/* Стили страниц /games (генерируются tools/build-game-pages.mjs) */
* { box-sizing: border-box; }
*:focus { outline: none; }

body {
    margin: 0;
    padding: 24px;
    background: #050507;
    color: #cbd5e1;
    font-family: Consolas, monospace;
}
a { color: inherit; }
.wrap { max-width: 1152px; margin: 0 auto; }

/* Шапка (как на главной) */
.header-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 32px;
}
.nav-toggle {
    display: inline-flex;
    justify-self: start;
    background: #0f0f14;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    gap: 4px;
}
.nav-btn {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}
.nav-btn.active {
    background: rgba(37, 99, 235, 0.2);
    color: #fff;
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}
.nav-btn:hover:not(.active) { color: #fff; }
.logo-link { text-decoration: none; }
.logo-text {
    font-size: 36px;
    font-weight: 900;
    text-transform: uppercase;
    font-style: italic;
    letter-spacing: -0.05em;
    color: #fff;
}
.logo-text span {
    color: #3b82f6;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
}
.header-right { display: flex; justify-content: flex-end; }
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.25);
    white-space: nowrap;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #34d399;
    box-shadow: 0 0 8px #34d399;
}

/* Контент */
.breadcrumbs { font-size: 12px; color: #6b7280; margin-bottom: 20px; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: #fff; }
.intro { max-width: 820px; margin-bottom: 32px; }
.intro.center { margin: 0 auto 36px; text-align: center; }
.intro h1 {
    font-size: 32px;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
}
.intro p { font-size: 14px; line-height: 1.6; color: #9ca3af; margin: 0 0 8px; }
.intro .stats { color: #6b7280; font-size: 13px; }
.intro .stats b { color: #60a5fa; }

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.glass-card {
    background: #0b0d14;
    border: 1px solid #161922;
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    transition: all 0.25s ease;
}
.glass-card:hover {
    background: #0f121d;
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 10px 30px -10px rgba(59, 130, 246, 0.15);
}
.card-top { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.card-thumb-wrapper {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #121520;
    border: 1px solid #1e2230;
}
.card-thumb-wrapper img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-head { flex: 1; min-width: 0; }
.card-head h2, .card-head h3 {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-head p { font-size: 12px; color: #6b7280; margin: 6px 0 0; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid;
}
.badge-green { color: #4ade80; background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.2); }
.badge-yellow { color: #facc15; background: rgba(234, 179, 8, 0.1); border-color: rgba(234, 179, 8, 0.2); }
.badge-blue { color: #60a5fa; background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.2); }

.code {
    margin: 0;
    background: #07080d;
    border: 1px solid #161922;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 11px;
    color: #a5b4fc;
    max-height: 84px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
.card-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: #6b7280;
    margin-top: auto;
}
.card-meta a { color: #60a5fa; text-decoration: none; font-weight: 700; }
.card-meta a:hover { text-decoration: underline; }
.btn-copy {
    background: rgba(255, 255, 255, 0.03);
    color: #a1a1aa;
    font: inherit;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #1a1d28;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}
.btn-copy:hover {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.4);
}
.btn-copy.copied {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
}

.game-tile { flex-direction: row; align-items: center; text-decoration: none; }

/* Избранное */
.btn-fav {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #1a1d28;
    background: rgba(255, 255, 255, 0.03);
    color: #6b7280;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-fav:hover { color: #facc15; border-color: rgba(234, 179, 8, 0.4); }
.btn-fav.on { color: #facc15; border-color: rgba(234, 179, 8, 0.5); background: rgba(234, 179, 8, 0.1); }
.badge-gray { color: #9ca3af; background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.08); }
.empty-note { text-align: center; color: #6b7280; font-size: 14px; }
.empty-note a { color: #60a5fa; }

/* Переключатель языка */
.header-right { gap: 10px; align-items: center; flex-wrap: wrap; }
.lang-switch {
    display: inline-flex;
    gap: 2px;
    background: #0f0f14;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 3px;
}
.lang-switch a {
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    text-decoration: none;
    padding: 5px 8px;
    border-radius: 7px;
}
.lang-switch a.active, .lang-switch a:hover { color: #fff; background: rgba(37, 99, 235, 0.2); }

.related.top { margin-bottom: 28px; }
.related.top h2 { font-size: 14px; }
.related.center .chips { justify-content: center; }

.faq, .related { max-width: 820px; margin: 0 auto 40px; }
.faq h2, .related h2 { font-size: 20px; font-weight: 900; color: #fff; text-transform: uppercase; margin: 0 0 16px; }
.faq details {
    background: #0b0d14;
    border: 1px solid #161922;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 700; color: #e5e7eb; font-size: 14px; }
.faq details p { font-size: 13px; line-height: 1.6; color: #9ca3af; margin: 10px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    color: #cbd5e1;
    background: #0b0d14;
    border: 1px solid #161922;
    border-radius: 999px;
    padding: 8px 14px;
    transition: all 0.2s ease;
}
.chip:hover { color: #fff; border-color: rgba(59, 130, 246, 0.5); }

.site-footer { margin-top: 64px; padding: 32px 0; border-top: 1px solid #1f2937; text-align: center; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 24px; font-size: 14px; color: #6b7280; margin-bottom: 8px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: #fff; }
.site-footer p { font-size: 12px; color: #4b5563; margin: 0; }

@media (max-width: 900px) {
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    body { padding: 16px; }
    .header-nav { display: flex; flex-direction: column; gap: 16px; }
    .nav-toggle, .header-right { justify-self: center; justify-content: center; }
    .grid { grid-template-columns: 1fr; }
    .intro h1 { font-size: 24px; }
}

/* Хеллоуин: подгоняем элементы этих страниц под halloween.css */
html:has(link[href="/halloween.css"]) .intro h1 {
    font-family: 'Creepster', cursive;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: #ff7a1a;
    text-shadow: 0 3px 0 #b84a00, 0 0 22px rgba(255, 122, 26, 0.55);
}
html:has(link[href="/halloween.css"]) .intro .stats b,
html:has(link[href="/halloween.css"]) .card-meta a { color: #ff7a1a; }
html:has(link[href="/halloween.css"]) .faq details,
html:has(link[href="/halloween.css"]) .chip,
html:has(link[href="/halloween.css"]) .code {
    background: #170c22;
    border: 2px solid rgba(155, 92, 255, 0.22);
}
html:has(link[href="/halloween.css"]) .chip:hover { border-color: #ff7a1a; color: #fff3e6; }
html:has(link[href="/halloween.css"]) .badge-green { color: #9be22d; background: rgba(155, 226, 45, 0.1); border-color: rgba(155, 226, 45, 0.35); }
html:has(link[href="/halloween.css"]) .badge-yellow { color: #9b5cff; background: rgba(155, 92, 255, 0.12); border-color: rgba(155, 92, 255, 0.4); }
html:has(link[href="/halloween.css"]) .badge-blue { color: #ff7a1a; background: rgba(255, 122, 26, 0.12); border-color: rgba(255, 122, 26, 0.4); }
