:root {
    --bg: #070a12;
    --panel: #101827;
    --panel-2: #172033;
    --text: #f4f7fb;
    --muted: #aab4c4;
    --accent: #8fd3ff;
    --accent-2: #c7f464;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #19294a, var(--bg) 42%), var(--bg);
    color: var(--text);
    min-height: 100vh;
}

a {
    color: inherit;
}

.hero {
    min-height: 430px;
    padding: 28px;
    background:
        linear-gradient(120deg, rgba(143, 211, 255, 0.18), rgba(199, 244, 100, 0.08)),
        radial-gradient(circle at 80% 20%, rgba(143, 211, 255, 0.18), transparent 32%);
    border-bottom: 1px solid var(--border);
}

.topbar,
.play-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.brand {
    text-decoration: none;
    font-weight: 900;
    letter-spacing: 0.03em;
    font-size: 1.2rem;
}

.admin-link,
.back-link,
.button,
.small-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.08);
    padding: 10px 16px;
    text-decoration: none;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
}

.button {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #06101b;
    border: 0;
    width: 100%;
}

.danger-button {
    background: rgba(255, 99, 99, 0.18);
}

.hero-content {
    max-width: 850px;
    padding: 90px 0 45px;
}

.eyebrow {
    color: var(--accent-2);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.8rem;
}

h1 {
    font-size: clamp(2.3rem, 8vw, 5rem);
    line-height: 0.95;
    margin: 0 0 24px;
}

.hero p,
.section-heading p,
.game-card p,
.footer,
.instructions p {
    color: var(--muted);
}

.wrap {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    padding: 54px 0 22px;
}

.section-heading h2 {
    font-size: 2rem;
    margin: 0;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 22px;
    padding-bottom: 70px;
}

.game-card,
.empty-card,
.admin-panel,
.stat-card,
.instructions {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.game-art {
    height: 150px;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 30% 30%, rgba(199, 244, 100, 0.25), transparent 30%),
        linear-gradient(135deg, rgba(143, 211, 255, 0.26), rgba(255, 255, 255, 0.03));
}

.game-art span {
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    border-radius: 26px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    font-size: 2.6rem;
    font-weight: 900;
}

.game-card-body,
.empty-card,
.admin-panel,
.instructions {
    padding: 22px;
}

.game-card h3 {
    margin: 0 0 10px;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.9rem;
    margin: 18px 0;
}

.footer {
    padding: 35px 18px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.play-page {
    background: #05070c;
}

.play-header {
    padding: 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 10, 18, 0.92);
    position: sticky;
    top: 0;
    z-index: 5;
}

.play-header h1 {
    font-size: clamp(1.4rem, 4vw, 2.6rem);
    margin: 0 0 6px;
}

.play-header p {
    margin: 0;
    color: var(--muted);
}

.play-count {
    color: var(--accent-2);
    font-weight: 800;
    white-space: nowrap;
}

.game-shell {
    height: calc(100vh - 96px);
    padding: 14px;
}

.game-frame {
    width: 100%;
    height: 100%;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #000;
}

.admin-body {
    padding: 30px 0 80px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 22px;
    align-items: start;
}

label {
    display: block;
    font-weight: 800;
    margin: 14px 0 8px;
}

input,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
    font: inherit;
}

textarea {
    min-height: 220px;
    font-family: Consolas, Monaco, monospace;
}

.help-text {
    color: var(--muted);
    font-size: 0.92rem;
}

.notice {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(199, 244, 100, 0.12);
    border: 1px solid rgba(199, 244, 100, 0.25);
    margin: 0 0 18px;
}

.error {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 99, 99, 0.14);
    border: 1px solid rgba(255, 99, 99, 0.3);
    margin: 0 0 18px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    padding: 18px;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
}

.admin-game-list {
    display: grid;
    gap: 12px;
}

.admin-game-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.admin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 820px) {
    .admin-grid,
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .play-header {
        align-items: start;
        flex-direction: column;
    }

    .game-shell {
        height: 72vh;
    }
}
