@import url('https://fonts.googleapis.com/css2?family=Titan+One&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --bg: #292929;
    --surface: #1e1e1e;
    --surface2: #333;
    --accent: #0066cc;
    --accent2: #00aaff;
    --text: #ffffff;
    --text-muted: #aaaaaa;
    --border: #444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Mono', monospace;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    background-color: var(--bg);
    color: var(--text);
}

/* ── Index page ── */

h1 {
    text-align: center;
    font-family: 'Titan One', sans-serif;
    font-size: clamp(2rem, 6vw, 3.5rem);
    background: linear-gradient(135deg, #ffffff 30%, var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

h3 {
    text-align: center;
    margin-bottom: 24px;
}

h3 a, .credits-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: color 0.2s;
}

h3 a:hover, .credits-link:hover {
    color: var(--accent2);
}

.search-box {
    display: block;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 40px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: 'Space Mono', monospace;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: border-color 0.2s;
}

.search-box::placeholder {
    color: var(--text-muted);
}

.search-box:focus {
    outline: none;
    border-color: var(--accent2);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.game-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px 20px;
    min-height: 64px;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    opacity: 0;
    transition: opacity 0.2s;
}

.game-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent2);
    box-shadow: 0 4px 16px rgba(0, 170, 255, 0.1);
}

.game-card:hover::before {
    opacity: 1;
}

.game-card a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 0.03em;
    transition: color 0.2s;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
}

.game-card:hover a {
    color: var(--text);
}

.game-thumb {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--surface2);
    display: none;
}

.game-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Player overlay ── */

body.player-page {
    max-width: 100%;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.player-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.player-header {
    background-color: var(--surface);
    color: var(--text);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    z-index: 10;
}

.player-header h2 {
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    letter-spacing: 0.05em;
    margin: 0;
    flex-grow: 1;
    color: var(--text-muted);
}

.player-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    background-color: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    text-decoration: none;
}

.control-btn:hover {
    background-color: var(--accent);
    border-color: var(--accent);
}

.control-btn:active {
    background-color: #0052a3;
}

.iframe-container {
    flex: 1;
    overflow: hidden;
}

#game-frame {
    width: 100%;
    height: 100%;
    border: none;
}

#game-frame:-webkit-full-screen { width: 100%; height: 100%; }
#game-frame:-moz-full-screen    { width: 100%; height: 100%; }
#game-frame:fullscreen          { width: 100%; height: 100%; }

/* ── Credits page ── */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 48px;
    transition: color 0.2s;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.back-link:hover { color: var(--accent2); }
.back-link::before { content: '←'; }

.page-title {
    font-family: 'Titan One', sans-serif;
    font-size: clamp(2rem, 6vw, 3.5rem);
    line-height: 1;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff 30%, var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 56px;
}

.section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 32px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.section-label {
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent2);
    margin-bottom: 12px;
}

.section h2 {
    font-family: 'Titan One', sans-serif;
    font-size: 1.4rem;
    margin-bottom: 16px;
    color: var(--text);
}

.section p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 16px;
}

.section p:last-child { margin-bottom: 0; }

.repo-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 20px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-family: 'Space Mono', monospace;
    transition: border-color 0.2s, background 0.2s;
    margin-top: 8px;
    word-break: break-all;
}

.repo-link:hover {
    border-color: var(--accent2);
    background: #2a2a3a;
    color: var(--accent2);
}

.repo-link .icon { font-size: 18px; flex-shrink: 0; }

.email-block {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px 20px;
    margin-top: 8px;
}

.email-block .icon { font-size: 20px; flex-shrink: 0; }

.email-block a {
    color: var(--accent2);
    text-decoration: none;
    font-size: 14px;
    word-break: break-all;
    transition: opacity 0.2s;
}

.email-block a:hover {
    opacity: 0.75;
    text-decoration: underline;
}

.note-box {
    background: rgba(0, 102, 204, 0.08);
    border: 1px solid rgba(0, 170, 255, 0.2);
    border-radius: 6px;
    padding: 16px 20px;
    margin-top: 16px;
}

.note-box p {
    color: #88ccff;
    font-size: 13px;
    margin: 0;
    line-height: 1.7;
}

footer {
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.05em;
}