/* Slovra V6 — PART 3
   Games center + game screens desktop adaptation.
   Keeps mobile compact, makes desktop feel intentionally desktop-sized,
   and preserves Slovra's colorful visual language in light/dark themes. */

:root{
  --p3-rail:1080px;
  --p3-card:#17191f;
  --p3-card-2:#20242c;
  --p3-line:rgba(255,255,255,.10);
  --p3-text:#f7f7fb;
  --p3-muted:#aeb4c0;
}
body.light-mode,body.light{
  --p3-card:rgba(255,255,255,.93);
  --p3-card-2:#f5f7fb;
  --p3-line:rgba(30,35,45,.10);
  --p3-text:#171820;
  --p3-muted:#68707e;
}

/* Home rail: Part 3 widens the main home blocks together, not just the hero. */
@media (min-width:960px){
  #screen-home.slovra-home-simple .hero-banner-container,
  #screen-home.slovra-home-simple .slovra-simple-home,
  #screen-home.slovra-home-simple .slovra-home-preview,
  #screen-home.slovra-home-simple #v21-feature-panel{
    width:min(calc(100% - 56px),var(--p3-rail))!important;
    max-width:var(--p3-rail)!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
}

/* ---------- shared game top bars ---------- */
#screen-games .game-header,
.solo-game-screen>.game-header,
#screen-live>.game-header{
  width:min(calc(100% - 28px),var(--p3-rail))!important;
  max-width:var(--p3-rail)!important;
  margin:10px auto 14px!important;
  min-height:58px!important;
  padding:9px 12px!important;
  border:1px solid var(--p3-line)!important;
  border-radius:20px!important;
  background:color-mix(in srgb,var(--p3-card) 92%,transparent)!important;
  box-shadow:0 12px 30px rgba(0,0,0,.10)!important;
  backdrop-filter:blur(16px)!important;
  display:grid!important;
  grid-template-columns:42px minmax(0,1fr) 42px!important;
  align-items:center!important;
  box-sizing:border-box!important;
}
#screen-games .game-header>div:first-child,
.solo-game-screen>.game-header>div:first-child,
#screen-live>.game-header>div:first-child{
  width:38px!important;height:38px!important;border-radius:13px!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  background:var(--p3-card-2)!important;border:1px solid var(--p3-line)!important;
  font-size:0!important;color:var(--p3-text)!important;
}
#screen-games .game-header>div:first-child::before,
.solo-game-screen>.game-header>div:first-child::before,
#screen-live>.game-header>div:first-child::before{content:'←';font:800 20px/1 Nunito,sans-serif!important}
#screen-games .game-header>div:nth-child(2),
.solo-game-screen>.game-header>div:nth-child(2),
#screen-live>.game-header>div:nth-child(2){
  font:900 18px/1.05 Nunito,sans-serif!important;
  color:var(--p3-text)!important;text-align:center!important;
}

/* ---------- Games hub ---------- */
#screen-games{padding-bottom:110px!important}
#screen-games .games-hero-banner,
#screen-games .p3-game-mode,
#screen-games .games-grid{
  width:min(calc(100% - 28px),var(--p3-rail))!important;
  max-width:var(--p3-rail)!important;
  margin-left:auto!important;margin-right:auto!important;box-sizing:border-box!important;
}
#screen-games .games-hero-banner{
  min-height:190px!important;padding:28px 30px!important;border-radius:30px!important;
  display:flex!important;align-items:center!important;justify-content:space-between!important;gap:28px!important;
  background:
    radial-gradient(260px 170px at 92% 12%,rgba(70,255,220,.25),transparent 72%),
    radial-gradient(240px 170px at 18% 100%,rgba(255,93,202,.22),transparent 72%),
    linear-gradient(120deg,#6f3cff 0%,#8d45ef 36%,#ff4e94 69%,#16bcd4 100%)!important;
  box-shadow:0 20px 52px rgba(88,55,198,.24)!important;
}
#screen-games .games-hero-copy{max-width:650px!important}
#screen-games .games-hero-kicker{font:900 11px/1 Nunito,sans-serif!important;letter-spacing:1.25px!important}
#screen-games .games-hero-banner h2{font:900 clamp(28px,3vw,42px)/1 Nunito,sans-serif!important;letter-spacing:-.9px!important}
#screen-games .games-hero-banner p{font:700 15px/1.45 Nunito,sans-serif!important;max-width:620px!important}
#screen-games .games-hero-chips{
  min-width:260px!important;display:grid!important;grid-template-columns:1fr!important;
  align-content:center!important;justify-items:stretch!important;margin:0!important;gap:8px!important;
}
#screen-games .games-hero-chips span{
  display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;
  min-height:42px!important;padding:0 13px!important;font:900 12px/1 Nunito,sans-serif!important;
  background:rgba(255,255,255,.14)!important;
}
#screen-games .games-hero-chips .slovra-icon{width:19px;height:19px;--icon-main:#fff;--icon-accent:#fff;--icon-soft:rgba(255,255,255,.12)}

.p3-game-mode{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;
  padding:8px!important;margin-top:18px!important;border-radius:22px!important;
  background:var(--p3-card)!important;border:1px solid var(--p3-line)!important;
  box-shadow:0 10px 26px rgba(0,0,0,.08)!important;
}
.p3-game-mode button{
  min-height:58px!important;border:0!important;border-radius:16px!important;padding:9px 14px!important;
  background:transparent!important;color:var(--p3-muted)!important;cursor:pointer!important;
  display:flex!important;align-items:center!important;justify-content:center!important;gap:10px!important;
  font:900 14px/1 Nunito,sans-serif!important;transition:.18s ease!important;
}
.p3-game-mode button .p3-mode-count{font-size:10px!important;padding:4px 7px!important;border-radius:999px!important;background:rgba(127,127,127,.13)!important}
.p3-game-mode button.is-active{
  color:#fff!important;background:linear-gradient(100deg,#754cff,#bd42dd)!important;
  box-shadow:0 8px 18px rgba(117,76,255,.22)!important;
}
.p3-game-mode button[data-mode="multi"].is-active{background:linear-gradient(100deg,#19a96a,#35c97d)!important}
.p3-game-mode .slovra-icon{width:20px;height:20px}

#screen-games .games-grid{
  padding:18px 0 0!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:14px!important;
}
#screen-games .game-card{
  min-height:176px!important;margin:0!important;padding:18px!important;border-radius:24px!important;
  display:grid!important;grid-template-columns:54px 1fr auto!important;grid-template-rows:auto 1fr!important;
  align-items:center!important;gap:10px 12px!important;
  background:linear-gradient(160deg,var(--p3-card-2),var(--p3-card))!important;
  border:1px solid var(--p3-line)!important;box-shadow:0 10px 24px rgba(0,0,0,.12)!important;
}
#screen-games .game-card[hidden]{display:none!important}
#screen-games .game-card .game-card-badge{grid-column:1/-1;justify-self:start;position:static!important;margin-bottom:2px!important}
#screen-games .game-icon-box{
  width:54px!important;height:54px!important;border-radius:18px!important;font-size:0!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
}
#screen-games .game-icon-box .slovra-icon{width:27px;height:27px}
#screen-games .game-info h3{font:900 17px/1.08 Nunito,sans-serif!important;color:var(--p3-text)!important}
#screen-games .game-info p{font:700 11.5px/1.35 Nunito,sans-serif!important;color:var(--p3-muted)!important;margin-top:6px!important}
#screen-games .game-arrow{font-size:0!important}
#screen-games .game-arrow .slovra-icon{width:20px;height:20px}
body.light-mode #screen-games .game-card,body.light #screen-games .game-card{background:linear-gradient(160deg,#fff,#f5f7fb)!important;border-color:rgba(30,35,45,.10)!important;box-shadow:0 9px 22px rgba(45,50,70,.08)!important}
body.light-mode #screen-games .game-info h3,body.light #screen-games .game-info h3{color:#171820!important}
body.light-mode #screen-games .game-info p,body.light #screen-games .game-info p{color:#69717e!important}
body.light-mode #screen-games .game-icon-box,body.light #screen-games .game-icon-box{background:color-mix(in srgb,currentColor 12%,#fff)!important}

/* ---------- solo games: real desktop layouts ---------- */
.solo-game-screen{padding-bottom:110px!important}
.solo-game-screen .solo-game-page{
  width:min(calc(100% - 28px),var(--p3-rail))!important;max-width:var(--p3-rail)!important;margin:0 auto!important;padding:0 0 34px!important;
}
.solo-game-screen .solo-game-hero,
.solo-game-screen .mini-game-title-card{
  border-radius:26px!important;border:1px solid var(--p3-line)!important;box-shadow:0 14px 34px rgba(0,0,0,.10)!important;
}
.solo-game-screen .solo-game-card{border:1px solid var(--p3-line)!important;box-shadow:0 10px 26px rgba(0,0,0,.09)!important}
.solo-game-screen .solo-game-select{font-family:Nunito,sans-serif!important}

@media (min-width:960px){
  .solo-game-screen .solo-game-page{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:16px!important;align-items:start!important}
  .solo-game-screen .solo-game-page>.solo-game-hero,
  .solo-game-screen .solo-game-page>.mini-game-title-card,
  .solo-game-screen .solo-game-page>[id$="-play"],
  .solo-game-screen .solo-game-page>.solo-result{grid-column:1/-1!important}
  .solo-game-screen .solo-game-page>.solo-game-hero,
  .solo-game-screen .solo-game-page>.mini-game-title-card{min-height:128px!important;margin:0!important;padding:22px 24px!important}
  .solo-game-screen .solo-game-page>.setup-card{grid-column:1/-1!important;width:min(100%,720px)!important;justify-self:center!important;margin:0!important;padding:22px 24px!important}
  .solo-game-screen .solo-game-page>[id$="-play"]{width:100%!important;margin:0!important}
  .solo-game-screen .solo-game-stats{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:12px!important;margin:0 0 16px!important}
  .solo-game-screen .solo-game-stats.three{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .solo-game-screen .solo-stat{min-height:68px!important;display:flex!important;flex-direction:column!important;justify-content:center!important}
  .solo-game-screen .solo-stat strong{font-size:20px!important}
  .solo-game-screen .play-card,
  .solo-game-screen .quiz-game-card,
  .solo-game-screen .listen-game-card,
  .solo-game-screen .spelling-card,
  .solo-game-screen .truefalse-card{padding:24px!important;border-radius:26px!important}
  .solo-game-screen .match-board-wrap{gap:16px!important;padding:12px!important}
  .solo-game-screen .match-column{padding:12px!important;gap:10px!important}
  .solo-game-screen .match-tile{min-height:64px!important;font-size:15px!important}
  .solo-game-screen .memory-board{grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:12px!important;max-width:930px!important;margin:0 auto!important}
  .solo-game-screen .memory-card{aspect-ratio:.92!important}
  .solo-game-screen .memory-card-front,.solo-game-screen .memory-card-back{font-size:13px!important}
  .solo-game-screen .memory-card-front{font-size:22px!important}
  .solo-game-screen .quiz-options-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important}
  .solo-game-screen .quiz-option-btn{min-height:66px!important;font-size:15px!important}
  .solo-game-screen .quiz-speak-word{font-size:34px!important}
  .solo-game-screen .listen-game-card{display:grid!important;grid-template-columns:220px 1fr!important;align-items:center!important;gap:26px!important;text-align:left!important}
  .solo-game-screen .listen-pulse-wrap{margin:0!important}
  .solo-game-screen .spelling-card{max-width:900px!important;margin-left:auto!important;margin-right:auto!important}
  .solo-game-screen .spelling-meaning{font-size:34px!important}
  .solo-game-screen .truefalse-card{max-width:940px!important;margin-left:auto!important;margin-right:auto!important}
  .solo-game-screen .tf-pair>div:not(.tf-link){min-height:128px!important}
  .solo-game-screen .tf-pair strong{font-size:24px!important}
  .solo-game-screen .solo-result{width:min(100%,760px)!important;justify-self:center!important}
}

/* Light mode coverage for every in-game dark surface that used hard-coded colors. */
body.light-mode .solo-game-screen .solo-game-hero,
body.light .solo-game-screen .solo-game-hero,
body.light-mode .solo-game-screen .solo-game-card,
body.light .solo-game-screen .solo-game-card,
body.light-mode .solo-game-screen .mini-game-title-card,
body.light .solo-game-screen .mini-game-title-card{
  background:rgba(255,255,255,.94)!important;color:#171820!important;border-color:rgba(30,35,45,.10)!important;box-shadow:0 10px 24px rgba(45,50,70,.08)!important;
}
body.light-mode .solo-game-screen .solo-stat,body.light .solo-game-screen .solo-stat{background:#f7f8fb!important;border-color:#e2e5eb!important;box-shadow:none!important}
body.light-mode .solo-game-screen .solo-stat span,body.light .solo-game-screen .solo-stat span{color:#707887!important}
body.light-mode .solo-game-screen .solo-stat strong,body.light .solo-game-screen .solo-stat strong{color:#171820!important}
body.light-mode .solo-game-screen .match-board-wrap,body.light .solo-game-screen .match-board-wrap,
body.light-mode .solo-game-screen .match-column,body.light .solo-game-screen .match-column{background:#f6f8fb!important;border-color:#e1e5eb!important}
body.light-mode .solo-game-screen .match-tile,body.light .solo-game-screen .match-tile,
body.light-mode .solo-game-screen .quiz-option-btn,body.light .solo-game-screen .quiz-option-btn,
body.light-mode .solo-game-screen .tf-pair>div:not(.tf-link),body.light .solo-game-screen .tf-pair>div:not(.tf-link),
body.light-mode .solo-game-screen .spelling-input-wrap input,body.light .solo-game-screen .spelling-input-wrap input,
body.light-mode .solo-game-screen .spelling-actions button,body.light .solo-game-screen .spelling-actions button{
  background:#f7f9fb!important;color:#1d222a!important;border-color:#dce2e8!important;box-shadow:none!important;
}
body.light-mode .solo-game-screen .solo-game-select,body.light .solo-game-screen .solo-game-select{background:#f6f8fb!important;color:#1d222a!important;border-color:#dce2e8!important}
body.light-mode .solo-game-screen .match-column-title,body.light .solo-game-screen .match-column-title{color:#586170!important}
body.light-mode .solo-game-screen .quiz-game-label,body.light .solo-game-screen .quiz-game-label{color:#6d7583!important}
body.light-mode .solo-game-screen .solo-game-mini-title,body.light .solo-game-screen .solo-game-mini-title{color:#68717e!important}
body.light-mode .solo-game-screen .bomb-rules span,body.light .solo-game-screen .bomb-rules span{background:#f5f7fa!important;border-color:#e1e5eb!important;color:#4f5866!important}

/* ---------- live multiplayer ---------- */
#screen-live{padding-bottom:100px!important}
#screen-live #live-lobby-ui,
#screen-live #live-waiting-ui,
#screen-live #live-game-ui,
#screen-live #live-leaderboard-ui,
#screen-live #live-finished-ui{
  width:min(calc(100% - 28px),var(--p3-rail))!important;max-width:var(--p3-rail)!important;margin-left:auto!important;margin-right:auto!important;box-sizing:border-box!important;
}
#screen-live #live-lobby-ui{padding:0 0 30px!important;text-align:left!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:16px!important;align-items:start!important}
#screen-live #teacher-controls{
  grid-column:1/-1!important;width:100%!important;max-width:none!important;margin:0!important;padding:24px!important;border-radius:26px!important;
  background:var(--p3-card)!important;border:1px solid var(--p3-line)!important;box-shadow:0 14px 34px rgba(0,0,0,.10)!important;
}
#screen-live .live-join-box,#screen-live .live-info-box{
  margin:0!important;padding:24px!important;border-radius:26px!important;background:var(--p3-card)!important;border:1px solid var(--p3-line)!important;box-shadow:0 14px 34px rgba(0,0,0,.08)!important;
}
#screen-live .live-join-box{text-align:center!important;min-height:260px!important;display:flex!important;flex-direction:column!important;justify-content:center!important}
#screen-live .live-join-box h1{font:900 30px/1 Nunito,sans-serif!important;color:var(--p3-text)!important}
#screen-live #live-pin-input{max-width:360px!important;margin-left:auto!important;margin-right:auto!important}
#screen-live .live-info-box{min-height:260px!important}
#screen-live #live-waiting-ui{padding:26px!important;border-radius:28px!important;background:var(--p3-card)!important;border:1px solid var(--p3-line)!important}
#screen-live #live-game-ui{min-height:0!important;padding:0 0 40px!important}
#screen-live #live-q-text-container{min-height:180px!important;padding:24px!important;margin:14px 0!important;border-radius:26px!important;background:var(--p3-card)!important;border:1px solid var(--p3-line)!important}
#screen-live #live-q-text{font:900 clamp(24px,3vw,38px)/1.18 Nunito,sans-serif!important;color:var(--p3-text)!important}
#screen-live #live-options-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important;padding:0!important}
#screen-live .live-header-bar{border-radius:20px!important;background:var(--p3-card)!important;border:1px solid var(--p3-line)!important;margin-top:12px!important}
#screen-live #live-player-status-area{border-radius:20px!important;background:var(--p3-card)!important;border:1px solid var(--p3-line)!important;margin-top:16px!important;padding:14px!important}
#screen-live #live-leaderboard-ui,#screen-live #live-finished-ui{padding:28px!important;border-radius:28px!important;background:var(--p3-card)!important;border:1px solid var(--p3-line)!important}
body.light-mode #screen-live #teacher-controls,body.light #screen-live #teacher-controls,
body.light-mode #screen-live .live-join-box,body.light #screen-live .live-join-box,
body.light-mode #screen-live .live-info-box,body.light #screen-live .live-info-box,
body.light-mode #screen-live #live-waiting-ui,body.light #screen-live #live-waiting-ui,
body.light-mode #screen-live #live-q-text-container,body.light #screen-live #live-q-text-container,
body.light-mode #screen-live .live-header-bar,body.light #screen-live .live-header-bar,
body.light-mode #screen-live #live-player-status-area,body.light #screen-live #live-player-status-area,
body.light-mode #screen-live #live-leaderboard-ui,body.light #screen-live #live-leaderboard-ui,
body.light-mode #screen-live #live-finished-ui,body.light #screen-live #live-finished-ui{background:#fff!important;border-color:#e2e5eb!important;color:#171820!important;box-shadow:0 10px 24px rgba(45,50,70,.08)!important}
body.light-mode #screen-live #live-q-text,body.light #screen-live #live-q-text{color:#171820!important}
body.light-mode #screen-live #teacher-category-select,body.light #screen-live #teacher-category-select,
body.light-mode #screen-live #teacher-test-select,body.light #screen-live #teacher-test-select,
body.light-mode #screen-live #teacher-class-select,body.light #screen-live #teacher-class-select,
body.light-mode #screen-live #teacher-duration-select,body.light #screen-live #teacher-duration-select,
body.light-mode #screen-live #teacher-question-count,body.light #screen-live #teacher-question-count{background:#f6f8fb!important;color:#1d222a!important;border-color:#dce2e8!important}

/* ---------- mobile ---------- */
@media (max-width:959px){
  #screen-games .games-hero-banner,
  #screen-games .p3-game-mode,
  #screen-games .games-grid,
  .solo-game-screen .solo-game-page,
  #screen-live #live-lobby-ui,
  #screen-live #live-waiting-ui,
  #screen-live #live-game-ui,
  #screen-live #live-leaderboard-ui,
  #screen-live #live-finished-ui{width:calc(100% - 24px)!important;max-width:none!important}
  #screen-games .games-hero-banner{
    min-height:0!important;padding:20px 18px!important;border-radius:24px!important;display:block!important;
  }
  #screen-games .games-hero-banner h2{font-size:28px!important}
  #screen-games .games-hero-banner p{font-size:12.5px!important;max-width:none!important}
  #screen-games .games-hero-chips{
    min-width:0!important;margin-top:14px!important;display:flex!important;justify-content:center!important;gap:7px!important;
  }
  #screen-games .games-hero-chips span{min-height:34px!important;padding:0 9px!important;font-size:10px!important;justify-content:center!important}
  #screen-games .games-hero-chips .slovra-icon{width:15px;height:15px}
  .p3-game-mode{margin-top:12px!important;gap:6px!important;padding:6px!important;border-radius:18px!important}
  .p3-game-mode button{min-height:48px!important;font-size:11.5px!important;padding:8px!important}
  #screen-games .games-grid{grid-template-columns:1fr!important;gap:10px!important;padding-top:12px!important}
  #screen-games .game-card{min-height:112px!important;grid-template-columns:48px 1fr auto!important;padding:14px!important;border-radius:20px!important}
  #screen-games .game-icon-box{width:48px!important;height:48px!important;border-radius:15px!important}
  #screen-games .game-icon-box .slovra-icon{width:23px;height:23px}
  #screen-games .game-info h3{font-size:15px!important}
  #screen-games .game-info p{font-size:10.5px!important}

  .solo-game-screen .solo-game-page{display:block!important;padding-bottom:24px!important}
  .solo-game-screen .solo-game-hero,.solo-game-screen .mini-game-title-card{margin-top:0!important}
  .solo-game-screen .memory-board{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  #screen-live #live-lobby-ui{display:block!important;padding-bottom:24px!important}
  #screen-live #teacher-controls,#screen-live .live-join-box,#screen-live .live-info-box{margin-bottom:12px!important;padding:18px!important;border-radius:22px!important;min-height:0!important}
  #screen-live #live-options-grid{grid-template-columns:1fr!important}
  #screen-live #live-q-text-container{min-height:140px!important;padding:18px!important}
}

@media (max-width:430px){
  #screen-games .game-header,.solo-game-screen>.game-header,#screen-live>.game-header{width:calc(100% - 20px)!important;margin-top:8px!important}
  #screen-games .games-hero-banner,.p3-game-mode,#screen-games .games-grid,.solo-game-screen .solo-game-page,#screen-live #live-lobby-ui,#screen-live #live-waiting-ui,#screen-live #live-game-ui,#screen-live #live-leaderboard-ui,#screen-live #live-finished-ui{width:calc(100% - 20px)!important}
  #screen-games .games-hero-banner{padding:18px 15px!important}
  #screen-games .games-hero-chips{flex-wrap:wrap!important}
  .p3-game-mode button{font-size:10.5px!important;gap:6px!important}
  .p3-game-mode button .p3-mode-count{display:none!important}
}

@media (prefers-reduced-motion:reduce){
  #screen-games .game-card,.p3-game-mode button{transition:none!important}
}

/* SVG details added by Part 3 JS */
.solo-game-screen .solo-result-emoji .slovra-icon{width:52px!important;height:52px!important;--icon-main:#8c63ff;--icon-accent:#22c6df;--icon-soft:rgba(140,99,255,.12)}
.solo-game-screen .solo-game-best{display:flex!important;align-items:center!important;justify-content:center!important;gap:7px!important}
.solo-game-screen .solo-game-best .slovra-icon{width:16px;height:16px;--icon-main:#ffc800;--icon-accent:#ff9f2f;--icon-soft:rgba(255,200,0,.12)}
.solo-game-screen .match-speak .slovra-icon{width:14px;height:14px}
.solo-game-screen .quiz-speak-word .slovra-icon{width:22px;height:22px;vertical-align:-3px;margin-left:6px}
.solo-game-screen .solo-hero-chips span{display:inline-flex!important;align-items:center!important;gap:6px!important}
.solo-game-screen .solo-hero-chips .slovra-icon{width:14px;height:14px}
.solo-game-screen .mini-game-title-icon{font-size:0!important}
.solo-game-screen .mini-game-title-icon .slovra-icon{width:24px;height:24px}
