/* The mail terminal stays dark around the painted course and light race cards. */
body {
  background: radial-gradient(ellipse at 12% 10%, #315577 0, transparent 58%),
    repeating-linear-gradient(128deg, transparent 0 44px, #80b6d208 45px 46px),
    #142b46;
  min-height: 100svh;
  color: #1d3349;
}
header { background: #132a43; color: #fff7e3; border-bottom: 3px solid #416181; }
.navInner, main { max-width: 1420px; }
.brand i { background: #ffe076; color: #203550; box-shadow: 2px 3px #080f22; }
.brand small { color: #8fddde; }
nav button { color: #eef7ff; background: #27435e; border: 1px solid #526d83; }
#lobby .hero, .lobbyGrid .box, .arena, .panel {
  border: 3px solid #10243b;
  box-shadow: 0 5px 0 #091e33;
}
#lobby .hero { background-position: 60% 49%; }
.hero::before { background: linear-gradient(90deg, #102c43cd, #12384950 41%, transparent 72%); }
.heroCopy { padding: 22px 26px; }
.heroCopy p { color: #fff1ae; }
.heroCopy h1 { transform: skew(-6deg); text-shadow: 2px 4px #203953, 4px 6px #17354a; }
.lobbyGrid .box { background: #fff8e8; padding: 17px 20px; border-radius: 20px; }
.box h2, .raceHead h1 { font-weight: 900; }
.courseHead h2::before, .launch h2::before { content:""; display:inline-block; vertical-align: .02em; width: 9px; height: .75em; margin-right: 9px; background:#f69a4d; transform:skew(-14deg); box-shadow:4px 0 #ffd583; }
select, .levels span { background:#fffefa; border:1.5px solid #adb9bb; }
.levels :checked + span { background:#ffde7c; color:#402e1a; border-color:#946328; box-shadow:0 2px #946328; }
.levels i { font: bold 15px/1 monospace; color:#375369; }
.lobbyGrid .launch { background:#edf9f6; }
.launch .modes { background:#cedfdc; border-radius:14px; }
.modes [aria-pressed="true"] { background:#254663; color:white; box-shadow:0 2px 0 #112b43; }
.matchup {
  display:grid; grid-template-columns:1fr 1fr; position:relative; isolation:isolate;
  overflow:hidden; border:2px solid #253b51; border-radius:15px; margin:12px 0;
  background:linear-gradient(107deg,#ffdc97 0%,#f7a76b 50%,#75c7c1 50.3%,#b7e9dc 100%);
}
.matchup::before { content:""; position:absolute; inset:0; z-index:-1; background:repeating-linear-gradient(115deg,transparent 0 15px,#fff2 15px 18px,transparent 18px 27px); }
.pilot { display:grid; justify-items:center; align-content:end; min-width:0; padding:6px 4px 8px; }
.pilot img { width:100%; height:clamp(76px,12vh,130px); object-fit:contain; filter:drop-shadow(2px 4px 1px #26395345); animation:idle 2.6s ease-in-out infinite; }
.pilot:last-child img { animation-delay:-1.3s; }
.pilot b { max-width:95%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; background:#1e3953; color:#fff7df; border-radius:20px; padding:1px 12px; font-size:14px; }
.matchup > i { position:absolute; left:50%; top:42%; transform:translate(-50%,-50%) rotate(-8deg); color:#fff9df; font:italic 1000 32px/1 Arial,sans-serif; -webkit-text-stroke:1px #26354a; text-shadow:2px 3px #26354a; }
@keyframes idle { 50% {transform:translateY(-3px) rotate(2deg);} }
#soloPreview {grid-template-columns:1fr; gap:6px;}
.notebookActions button { flex:1; padding:5px; background:#fffcf3; }
.primary { background:linear-gradient(#ffe989,#ffd04f); border:2px solid #674d28; border-bottom-width:4px; color:#302d32; font-weight:900; }
#start { font-size:20px; letter-spacing:.08em; }
#start::after { content:" »"; }
button:active:enabled { transform:translateY(1px); }
.raceHead { color:#fff9e8; }
.raceHead p, #rotateHint {color:#c8dfeb;}
#raceMode {background:#234b64; color:#bdfff3; border:1px solid #59939a;}
.panel { border-top:6px solid #f3a055; background:#fff9eb; }
.panel:nth-child(2) {border-top-color:#62cbbd;}
.answers button {border:2px solid #afc3c8; border-bottom-width:4px; background:#fffefa; color:#19354b;}
.panelTop button {background:#264c66; color:white;}
.hud b {background:#1c344bec; border-bottom:3px solid #ffb263;}
.hud b:last-child {border-bottom-color:#74dfcd;}
dialog {border:3px solid #20364b; box-shadow:0 7px 0 #12283b;}
@media (min-width:800px) and (orientation:landscape) {
  #lobby { grid-template-columns:minmax(0,1.45fr) minmax(320px,1fr); grid-template-rows:minmax(230px,1fr) auto; grid-template-areas:"hero launch" "course launch"; gap:14px; }
  .lobbyGrid { display:contents; }
  #lobby .hero {grid-area:hero; height:auto; min-height:230px; align-items:center;}
  .lobbyGrid > .box:first-child {grid-area:course;}
  .lobbyGrid > .launch {grid-area:launch; display:flex; flex-direction:column;}
  #start {margin-top:auto;}
  .filters {grid-template-columns:minmax(68px,.82fr) minmax(68px,.82fr) minmax(100px,1.6fr);}
  .filters label:last-child {grid-column:auto;}
}
@media (max-width:799px), (orientation:portrait) {
  .lobbyGrid {grid-template-columns:1fr;}
  .heroCopy {padding:18px;}
  .matchup .pilot img {height:100px;}
}
@media (prefers-reduced-motion: reduce) { .pilot img {animation:none;} }

@media (min-width:800px) and (max-height:680px) and (orientation:landscape) {
  .navInner {height:48px;}
  main {padding-block:8px 12px;}
  .lobbyGrid .box {padding:10px 14px;}
  .launch h2 {margin-bottom:5px;}
  .matchup {margin:6px 0;}
  .pilot img {height:55px;}
  .pilot {padding-block:2px;}
  #soloPreview {margin:4px 0;}
  .launch .distanceChoice {margin-bottom:5px;}
}

.answers { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.audioStatus {display:block; color:#604614; font-weight:700; margin-bottom:6px;}

.gameShelf{grid-area:hero;background:#203d58;padding:12px 15px 16px;border:2px solid #496882;border-radius:18px;align-self:start}
.gameShelf h1{color:#fff5d8;font-size:clamp(22px,2.5vw,32px);margin:0 0 10px}
.games{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.games button{min-width:0;overflow:hidden;padding:0 0 9px;text-align:left;line-height:1.3;background:#2f506b;color:#fff9e8;border:2px solid #688398}
.games button[aria-pressed=true]{border-color:#ffce61;background:#fff0bd;color:#2d3b44;box-shadow:0 3px #b58034}
.games img{width:100%;height:clamp(65px,9vw,128px);display:block;object-fit:cover}
.games strong,.games span{display:block;margin:6px 7px 0}.games strong{font-size:clamp(15px,1.7vw,21px)}.games span{font-size:13px}
#activityLabel{color:#eff7e6;margin:2px 0 8px;font-size:15px}
#activityMount iframe{display:block;border:0;border-radius:14px;width:100%;height:calc(100svh - 98px);min-height:420px;background:#19353c}
@media(min-width:800px) and (orientation:landscape){#lobby{grid-template-rows:auto 1fr}.gameShelf{align-self:stretch;display:flex;flex-direction:column;justify-content:center}.lobbyGrid>.box:first-child{align-self:start}}

#soloGuide{border:2px solid #385863;border-radius:12px;overflow:hidden;background:#fff9e8}
#soloGuide img{width:100%;height:clamp(80px,15svh,148px);display:block;object-fit:cover}
#soloGuide p{margin:0;padding:7px 10px;font-size:15px;font-weight:650}

.studyEntry{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;margin:10px 0 1px;padding:10px 14px;background:#235662;color:white;border:2px solid #183d4d;border-radius:11px;text-align:left}
.studyEntry span{font-size:14px;color:#d5eee3}
