/* GHOST IN THE GRAVEYARD — host styles. © 2026 Andreas Trejo · IQ Bonkers.
   Galaxy-night: the game surface (#stage) fills the screen — 100dvh
   column, slim top bar, arena takes everything else; in fullscreen
   the bar hides and the surface is the full display. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: #05030C;
  color: #F6F0FF;
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#app { display: flex; flex-direction: column; height: 100dvh; }
#topbar {
  flex: 0 0 auto; height: 46px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  background: linear-gradient(180deg, rgba(24,8,44,.95), rgba(10,4,22,.95));
  border-bottom: 1px solid rgba(255,0,198,.35);
}
:fullscreen #topbar { display: none; }
.brand { font-weight: 900; letter-spacing: .08em; font-size: 14px; }
.brand-iq { color: #FF00C6; }
.brand-sub { color: #FFC44D; font-size: 9px; letter-spacing: .24em; margin-left: 6px; }
.top-btns { display: flex; gap: 8px; }
.top-btn {
  font: inherit; font-size: 10px; font-weight: 800; letter-spacing: .14em;
  color: #F6F0FF; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.3); border-radius: 9px;
  min-height: 32px; padding: 0 10px; cursor: pointer;
}
#stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: #060312; }
#arena { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* ---------- mode menu ---------- */
#menu {
  position: absolute; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  /* the living graveyard scene breathes through the menu — fog, moon,
     fireflies and the idle cast are all moving behind this veil */
  background:
    radial-gradient(90% 55% at 78% 4%, rgba(216,226,255,.10), rgba(216,226,255,0) 60%),
    radial-gradient(120% 90% at 50% 0%, rgba(40,8,64,.38), rgba(4,2,10,.74));
  padding: 16px; overflow-y: auto;
}
.menu-card {
  position: relative;
  width: min(94vw, 460px); text-align: center;
  background: linear-gradient(168deg, rgba(26,14,48,.88), rgba(11,6,24,.92) 55%, rgba(16,8,32,.9));
  border: 1px solid rgba(255,0,198,.5);
  border-radius: 20px; padding: 22px 18px 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.65), 0 0 34px rgba(255,0,198,.14),
    inset 0 1px 0 rgba(255,255,255,.09), inset 0 0 42px rgba(88,40,160,.14);
  -webkit-backdrop-filter: blur(3px) saturate(1.15); backdrop-filter: blur(3px) saturate(1.15);
  overflow: hidden;
}
.menu-card::before { /* moonlight pooling at the top of the card */
  content: ""; position: absolute; left: 50%; top: -70px; transform: translateX(-50%);
  width: 300px; height: 130px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(216,226,255,.17), rgba(216,226,255,0) 70%);
}
.menu-card::after { /* ground fog lapping the card's foot */
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -26px; height: 64px;
  pointer-events: none; border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(168,160,210,.13), rgba(168,160,210,0) 70%);
}
.menu-title { font-size: 30px; font-weight: 900; font-style: italic; letter-spacing: .02em; line-height: 1.08; text-shadow: 0 2px 22px rgba(0,0,0,.6); }
.menu-title span { color: #FF00C6; text-shadow: 0 0 18px rgba(255,0,198,.65), 0 0 46px rgba(255,0,198,.35); }
.menu-sub { margin-top: 8px; font-size: 13px; line-height: 1.45; color: #CDBEEF; }
.menu-group { margin-top: 18px; }
.menu-label { font-size: 10px; font-weight: 800; letter-spacing: .26em; color: #FFC44D; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0; }
.chip {
  font: inherit; font-size: 11px; font-weight: 800; letter-spacing: .1em;
  padding: 9px 11px; border-radius: 999px; cursor: pointer;
  color: #E9DFFC; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.28);
  min-height: 38px;
}
.chip.on { background: #FF00C6; border-color: #FF00C6; color: #fff; box-shadow: 0 0 14px rgba(255,0,198,.5); }
.menu-btn {
  display: block; width: 100%; min-height: 52px; margin-top: 8px;
  font: inherit; font-weight: 900; letter-spacing: .14em; font-size: 15px;
  color: #F6F0FF; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.3); border-radius: 14px; cursor: pointer;
}
.menu-btn.primary { background: #FF00C6; border-color: #FF00C6; color: #fff; box-shadow: 0 6px 22px rgba(255,0,198,.45); }
.menu-btn:active, .chip:active, .top-btn:active { transform: scale(.98); }
.menu-note { margin-top: 10px; font-size: 11.5px; line-height: 1.5; color: #B9A8D9; }
.menu-note.dim { color: #8d7bb5; }

/* ---------- host toast (round announcements) ---------- */
#toast {
  position: absolute; left: 50%; top: 64px; transform: translateX(-50%) translateY(-6px);
  z-index: 45; pointer-events: none;
  max-width: 92%; text-align: center;
  font-weight: 900; letter-spacing: .12em; font-size: 15px; color: #FFF;
  background: linear-gradient(180deg, rgba(24,10,46,.88), rgba(10,4,24,.86));
  border: 1px solid rgba(255,196,77,.55);
  padding: 9px 16px; border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0,0,0,.55), 0 0 22px rgba(255,0,198,.18);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
  text-shadow: 0 0 12px rgba(255,0,198,.55); white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast .t-sub { display: block; font-size: 10px; letter-spacing: .22em; color: #FFC44D; margin-top: 2px; }

/* ---------- final standings (host layer over the engine result) ---------- */
#standings {
  position: absolute; inset: 0; z-index: 65;
  display: none; align-items: center; justify-content: center;
  background:
    radial-gradient(90% 55% at 78% 4%, rgba(216,226,255,.09), rgba(216,226,255,0) 60%),
    radial-gradient(120% 90% at 50% 0%, rgba(40,8,64,.36), rgba(4,2,10,.72));
  padding: 16px;
}
#standings.show { display: flex; }
.stand-card {
  position: relative;
  width: min(94vw, 420px); text-align: center;
  background: linear-gradient(168deg, rgba(30,16,52,.9), rgba(12,7,26,.94) 55%, rgba(20,10,36,.92));
  border: 1px solid rgba(255,196,77,.6);
  border-radius: 20px; padding: 22px 18px 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,.7), 0 0 34px rgba(255,196,77,.13),
    inset 0 1px 0 rgba(255,255,255,.09), inset 0 0 42px rgba(120,70,180,.12);
  -webkit-backdrop-filter: blur(3px) saturate(1.15); backdrop-filter: blur(3px) saturate(1.15);
  overflow: hidden;
}
.stand-card::before {
  content: ""; position: absolute; left: 50%; top: -70px; transform: translateX(-50%);
  width: 300px; height: 130px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255,220,150,.15), rgba(255,220,150,0) 70%);
}
.stand-title { font-size: 11px; font-weight: 800; letter-spacing: .3em; color: #FFC44D; }
.stand-champ { font-size: 27px; font-weight: 900; font-style: italic; margin-top: 6px; }
.stand-champ span { color: #FF00C6; text-shadow: 0 0 16px rgba(255,0,198,.6); }
.stand-portrait { display: flex; justify-content: center; margin: 10px 0 2px; }
.stand-portrait canvas { border-radius: 16px; }
.stand-rows { margin: 12px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.stand-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; padding: 6px 10px;
}
.stand-row.champ { border-color: rgba(255,196,77,.75); background: rgba(255,196,77,.08); }
.stand-row canvas { border-radius: 8px; flex: 0 0 auto; }
.stand-name { font-weight: 800; letter-spacing: .06em; font-size: 14px; text-align: left; }
.stand-class { font-size: 10px; letter-spacing: .18em; color: #B9A8D9; text-align: left; }
.stand-stars { margin-left: auto; font-weight: 900; color: #FFC44D; font-size: 15px; letter-spacing: .04em; white-space: nowrap; }
.stand-note { font-size: 11px; color: #8d7bb5; margin-top: 8px; line-height: 1.45; }

/* ---------- control hosts ---------- */
.ctl-host { position: absolute; inset: 0; pointer-events: none; z-index: 30; display: none; }
.ctl-host.live { display: block; }
.vc-controls { position: absolute; inset: 0; }
.vc-band { position: absolute; inset: 0; pointer-events: none; }
.vc-band .joy-zone { pointer-events: auto; }
.vc-band .tc-actions { position: absolute; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); pointer-events: auto; }
.vc-band .joy-cluster { position: absolute; left: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.vc-band-right .joy-zone { left: auto; right: 0; }
.vc-band-right .joy-cluster { left: auto; right: 10px; }
.vc-band-right .tc-actions { right: auto; left: 10px; }
#ctlP2 .vc-band .joy-zone { width: 34%; }
#ctlP2 { z-index: 29; }
