/* =============================================================
 * EdGame Play page — sign-in gate + game picker.
 *
 * Loaded after css/styles.css and reuses its tokens, .nav, .btn, .eyebrow,
 * .hi, .section-head and .hero-bg-orb. Only what the Play page adds lives
 * here. Mobile-first, same breakpoints as styles.css (640 · 1024).
 * ============================================================= */

/* ---------- Visibility ----------
   js/play.js switches views with the `hidden` attribute. Any author
   `display` rule (e.g. .play-gate's flex) beats the browser's own
   [hidden] { display: none }, which would leave a "hidden" view on screen. */
.play-page [hidden] { display: none !important; }

/* ---------- Page shell ---------- */
.play-page { min-height: 100vh; display: flex; flex-direction: column; }
.play {
    position: relative;
    flex: 1;
    overflow: hidden;
    background:
      radial-gradient(ellipse at 15% -10%, rgba(90, 200, 250, 0.14), transparent 55%),
      radial-gradient(ellipse at 90% 0%, rgba(255, 216, 77, 0.12), transparent 50%),
      var(--bg);
}
.play > section { position: relative; z-index: 1; }

/* ---------- Signed-in account (nav) ---------- */
.play-account {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.play-account[hidden] { display: none; }
.play-account-name {
    color: var(--text-mute);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.play-account-name strong { color: var(--gold); }
/* Usernames are stored lowercase; show them the way a name reads. */
.player-name { text-transform: capitalize; }
@media (max-width: 480px) {
    .play-account-name { display: none; }
}

/* ---------- Gate ---------- */
.play-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 160px);
}
.gate-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px 28px 28px;
    box-shadow: var(--shadow-hover);
}
.gate-card h1 { font-size: clamp(1.8rem, 5vw, 2.3rem); margin-bottom: 10px; }
.gate-lede { color: var(--text-mute); font-size: 15px; margin-bottom: 24px; }

.gate-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    margin-bottom: 22px;
}
.gate-tab {
    background: transparent;
    border: 0;
    border-radius: 999px;
    padding: 10px 12px;
    color: var(--text-mute);
    font-weight: 600;
    font-size: 14px;
    transition: background 160ms, color 160ms;
}
.gate-tab:hover { color: var(--text); }
.gate-tab[aria-selected="true"] {
    background: linear-gradient(135deg, var(--gold), var(--gold-2));
    color: #191320;
}

.gate-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.gate-input {
    width: 100%;
    font: inherit;
    font-size: 18px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius);
    padding: 14px 16px;
    transition: border-color 160ms, box-shadow 160ms;
}
.gate-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255, 216, 77, 0.2);
}
.gate-input[aria-invalid="true"] { border-color: var(--red); }
.gate-hint { color: var(--text-dim); font-size: 12px; margin: 8px 0 0; }
.gate-hint code {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    padding: 0 5px;
}
.gate-error {
    margin: 14px 0 0;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(245, 101, 101, 0.12);
    border: 1px solid rgba(245, 101, 101, 0.35);
    color: #ffb4b4;
    font-size: 14px;
}
.gate-submit {
    width: 100%;
    justify-content: center;
    margin-top: 22px;
}
.gate-submit[disabled] { opacity: 0.7; cursor: progress; transform: none; }

.gate-switch {
    text-align: center;
    color: var(--text-mute);
    font-size: 14px;
    margin: 18px 0 0;
}
.link-button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--gold);
    font-weight: 600;
}
.link-button:hover { color: var(--gold-2); text-decoration: underline; }
.gate-noscript { color: var(--text-mute); text-align: center; margin-top: 20px; }

/* ---------- Game picker ---------- */
.play-games .section-head h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 16px; }
.play-games .section-head h1:focus { outline: none; }

.games-grid {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
@media (min-width: 640px)  { .games-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .games-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; } }

.game-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    color: var(--text);
    text-decoration: none;
    transition: transform 200ms, border-color 200ms, box-shadow 200ms;
}
a.game-card:hover,
a.game-card:focus-visible {
    transform: translateY(-6px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-hover);
    color: var(--text);
}
.game-art {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--bg-2);
    overflow: hidden;
}
.game-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 400ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
a.game-card:hover .game-art img { transform: scale(1.04); }

.game-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 22px 22px;
    flex: 1;
}
.game-body h2 { font-size: 1.3rem; }
.game-body p { color: var(--text-mute); font-size: 14px; margin: 0; flex: 1; }
.game-tag {
    align-self: flex-start;
    padding: 3px 10px;
    background: rgba(90, 200, 250, 0.14);
    color: var(--cyan);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.3px;
}
.game-play {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--gold), var(--gold-2));
    color: #191320;
    font-weight: 700;
    font-size: 15px;
    box-shadow: var(--shadow-lift);
}

/* Coming soon: visible but clearly not playable. */
.soon-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(6, 11, 26, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}
.game-card.is-soon { cursor: default; }
.game-card.is-soon .game-art img { filter: grayscale(0.85) brightness(0.6); }
.game-card.is-soon .game-body h2,
.game-card.is-soon .game-body p { color: var(--text-dim); }
.game-card.is-soon .game-tag { background: rgba(255, 255, 255, 0.06); color: var(--text-dim); }

/* Undisclosed concepts: plain black boxes. */
.game-card.is-secret {
    min-height: 260px;
    align-items: center;
    justify-content: center;
    background: #000;
    border-color: rgba(255, 255, 255, 0.1);
}
.secret-mark {
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
    color: rgba(255, 255, 255, 0.14);
}
.game-card.is-secret .soon-badge {
    position: static;
    margin-top: 18px;
    background: transparent;
}

/* ---------- Footer ---------- */
.play-footer { padding: 24px; }
.play-footer .footer-copy { margin-top: 0; padding-top: 0; border-top: 0; }
@media (max-width: 900px) {
    /* No sticky mobile CTA on this page, so no room needs reserving for it. */
    .play-footer .footer-copy { padding-bottom: 0; }
}
