/*
 * public_html/assets/student/games/css/main.css
 *
 * Shared visual shell for the Games minisite. Used by the hub and every
 * individual game via layout_header.php / layout_footer.php.
 *
 * Design direction: warm arcade-corner-of-a-serious-portal, not navy
 * corporate SaaS. Dark base, ember accent, gold reserved for competitions.
 *
 * Game-specific CSS must NOT override these tokens — extend, don't fork.
 * See ADDING_A_GAME.md §6.
 */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Archivo+Black&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Surfaces — warm near-black, not navy */
    --bg:        #15110d;
    --bg-raised: #1f1812;
    --bg-card:   #261d15;
    --bg-card-hover: #2d2219;
    --line:      #3a2d1f;
    --line-soft: #2a2018;

    /* Text */
    --ink:       #f5ede0;
    --ink-dim:   #b8a890;
    --ink-faint: #7a6c58;

    /* Accents */
    --ember:      #ff6b35;  /* signature accent — casual games, primary actions */
    --ember-dim:  #c4502420;
    --gold:       #e8b339;  /* reserved for competitions / special status */
    --gold-dim:   #e8b33920;
    --warn:       #e8b339;
    --good:       #5fb87a;
    --bad:        #e0584f;

    /* Shape */
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 8px;

    /* Type */
    --font-display: 'Space Grotesk', sans-serif;
    --font-hero: 'Archivo Black', 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

body {
    background-image:
        radial-gradient(ellipse 900px 500px at 15% -10%, #ff6b3514, transparent 60%),
        radial-gradient(ellipse 700px 400px at 100% 0%, #e8b33910, transparent 55%);
    background-repeat: no-repeat;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------- Top bar ---------- */

.games-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(21, 17, 13, 0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-soft);
}

.games-back {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--line);
    color: var(--ink-dim);
    font-size: 18px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.games-back:hover {
    background: var(--bg-card-hover);
    color: var(--ink);
    border-color: var(--ember);
}

.games-topbar-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.01em;
}

.games-topbar-spacer { flex: 1; }

/* ---------- Main wrapper ---------- */

.games-main {
    max-width: 880px;
    margin: 0 auto;
    padding: 28px 18px 60px;
}

/* ---------- Hero ---------- */

.games-hero {
    position: relative;
    padding: 8px 2px 30px;
    overflow: hidden;
}

.games-hero::after {
    /* faint marquee scanline texture — signature element, used once */
    content: '';
    position: absolute;
    inset: -20px -20px auto -20px;
    height: 140px;
    background: repeating-linear-gradient(
        180deg,
        transparent 0px,
        transparent 3px,
        #ff6b3508 3px,
        #ff6b3508 4px
    );
    pointer-events: none;
}

.games-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ember);
    margin: 0 0 10px;
}

.games-hero-eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ember);
    box-shadow: 0 0 8px 1px #ff6b3590;
}

.games-hero-title {
    font-family: var(--font-hero);
    font-size: clamp(34px, 7vw, 52px);
    line-height: 1.02;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}

.games-hero-sub {
    font-size: 15px;
    color: var(--ink-dim);
    margin: 0;
    max-width: 46ch;
}

/* ---------- Section headers (casual vs competitions grouping) ---------- */

.games-section {
    margin: 8px 0 34px;
}

.games-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line-soft);
}

.games-section-title {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-dim);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.games-section-title .ti { font-size: 15px; }

.games-section-title.is-competition { color: var(--gold); }

/* 'server' category — the Minecraft board. Grass green, so the section reads
   as "somewhere else you play" rather than another arcade cabinet. */
.games-section-title.is-server { color: #7cb342; }

/* 'lobby' category — The Lobby. Ember, the hub's own signature colour, because
   this is not somewhere else you play: it is this place, before the playing. */
.games-section-title.is-lobby { color: var(--ember); }

.games-section-note {
    font-size: 12px;
    color: var(--ink-faint);
}

/* ---------- Hub grid + cards ---------- */

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.game-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 16px 16px 18px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-sm);
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.game-card::before {
    /* glowing accent edge — the "cabinet light" */
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent, var(--ember));
    box-shadow: 0 0 14px 0 var(--accent, var(--ember));
}

.game-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent, var(--ember));
    background: var(--bg-card-hover);
}

.game-card.is-competition {
    border-style: solid;
    background: linear-gradient(135deg, var(--bg-card) 60%, #e8b33912);
}

.game-card.is-server {
    border-style: solid;
    background: linear-gradient(135deg, var(--bg-card) 60%, #5b873118);
}

.game-card.is-lobby {
    border-style: solid;
    background: linear-gradient(135deg, var(--bg-card) 55%, #ff6b3520);
}

/* The ribbon is gold by default (Compete); the server card's says Join, and the
   Lobby's says Talk. */
.game-card.is-server .game-card-ribbon {
    background: #7cb342;
    color: #12200a;
}

.game-card.is-lobby .game-card-ribbon {
    background: var(--ember);
    color: #15110d;
}

.game-card-ribbon {
    position: absolute;
    top: 10px;
    right: -28px;
    transform: rotate(40deg);
    background: var(--gold);
    color: #1a1208;
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 32px;
}

.game-card-icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--accent, var(--ember)) 16%, var(--bg-raised));
    color: var(--accent, var(--ember));
    font-size: 22px;
}

.game-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.game-card-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 16px;
    color: var(--ink);
}

.game-card-desc {
    font-size: 13px;
    color: var(--ink-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-card-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--ink-faint);
    margin-top: 2px;
}

.game-card-arrow {
    flex-shrink: 0;
    color: var(--ink-faint);
    font-size: 18px;
    transition: transform 0.15s ease, color 0.15s ease;
}

.game-card:hover .game-card-arrow {
    transform: translateX(3px);
    color: var(--accent, var(--ember));
}

/* ---------- Empty state ---------- */

.games-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    padding: 70px 20px;
    color: var(--ink-dim);
}

.games-empty .ti {
    font-size: 40px;
    color: var(--ink-faint);
}

.games-empty p { margin: 0; max-width: 36ch; font-size: 14px; }

/* ---------- Shared game-page primitives ---------- */

.game-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding-top: 6px;
}

.game-status {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    color: var(--ink-dim);
    margin: 0;
    padding: 8px 18px;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--line);
}

.game-status.win  { color: var(--good); border-color: #5fb87a40; background: #5fb87a12; }
.game-status.lose { color: var(--bad);  border-color: #e0584f40; background: #e0584f12; }

.game-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.games-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--bg-card);
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.games-btn:hover { background: var(--bg-card-hover); border-color: var(--ink-faint); }
.games-btn:active { transform: scale(0.97); }

.games-btn-primary {
    background: var(--ember);
    border-color: var(--ember);
    color: #1a0f08;
}
.games-btn-primary:hover {
    background: #ff7e4d;
    border-color: #ff7e4d;
}

@media (max-width: 480px) {
    .games-hero-title { font-size: 32px; }
    .games-main { padding: 20px 14px 50px; }
}
