/* ==========================================================================
   Sparkfire big screen (js/screen-ui.js) and the phones as its controllers
   (js/pad-ui.js). Everything here is under .scr or .pad, plus the menu's
   pair of buttons.
   ========================================================================== */

.menu-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu-pair .btn { flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; padding: 8px 10px; }
.menu-pair .btn small { line-height: 1.15; text-align: center; }
.btn.scr-menu { display: flex; border-color: rgba(255, 154, 31, 0.6); box-shadow: 0 0 14px rgba(255, 154, 31, 0.24), inset 0 0 14px rgba(255, 154, 31, 0.1); }
.btn.scr-menu b { white-space: nowrap; font: 400 21px/1 var(--neon); letter-spacing: 0.05em; color: #fff0dc; text-shadow: 0 0 10px #ff9a1f; }
.btn.scr-menu small { font-weight: 600; font-size: 12px; color: var(--mute); text-transform: none; letter-spacing: 0.02em; }

/* ---------- the big screen ---------- */
.scr { position: fixed; inset: 0; z-index: 15; background: #04030b; overflow: hidden; touch-action: manipulation; }
.scr-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scr-screen { position: absolute; inset: 0; }
.scr-disc { width: 18px; height: 18px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 12px var(--pc); flex: none; }

.scr-lobby {
  display: grid; grid-template-columns: minmax(300px, 0.9fr) minmax(260px, 1.25fr) minmax(360px, 1fr); gap: 22px;
  padding: max(20px, var(--sat)) 24px max(20px, var(--sab));
}
.scr-col {
  min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 20px;
  border-radius: 24px; background: rgba(10, 8, 26, 0.84); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 0 40px rgba(120, 80, 255, 0.18);
}
.scr-joincol { align-items: center; justify-content: center; text-align: center; }
.scr-logo { margin: 0; font: 400 clamp(46px, 5.4vw, 92px)/0.9 var(--neon); letter-spacing: 0.02em; text-transform: uppercase; }
.scr-kicker { margin: 0; color: #ffd9ad; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; font-size: clamp(12px, 1.1vw, 18px); text-shadow: 0 0 10px rgba(255, 154, 31, 0.6); }
.scr-qrcard { padding: 12px; border-radius: 20px; background: #f4efff; box-shadow: 0 0 0 3px rgba(255, 154, 31, 0.8), 0 0 40px rgba(255, 154, 31, 0.45); line-height: 0; }
#scr-qr { width: clamp(150px, min(22vw, 34vh), 360px); height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.scr-code { display: flex; gap: 10px; }
.scr-code span {
  width: clamp(48px, 4.6vw, 84px); height: clamp(62px, 6vw, 108px); display: grid; place-items: center; border-radius: 14px;
  border: 2px solid rgba(255, 154, 31, 0.75); background: rgba(255, 154, 31, 0.1);
  font: 400 clamp(38px, 3.8vw, 72px)/1 var(--neon); color: #fff3e2; text-shadow: 0 0 12px #ff9a1f, 0 0 30px rgba(255, 154, 31, 0.6);
}
.scr-how { margin: 0; color: var(--mute); font-size: clamp(14px, 1.15vw, 20px); max-width: 30em; }
.scr-how b { color: var(--ink); }

.scr-preview { position: relative; min-height: 0; border-radius: 24px; border: 1px dashed rgba(160, 170, 255, 0.18); }
.scr-preview-label {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); margin: 0; white-space: nowrap;
  padding: 4px 14px; border-radius: 999px; background: rgba(8, 6, 20, 0.8); border: 1px solid var(--line);
  color: var(--mute); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px;
}

.scr-h { margin: 0; font: 400 26px/1 var(--neon); color: #fff; }
.scr-slots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.scr-slot {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line); background: rgba(20, 16, 44, 0.6); transition: box-shadow 0.2s, transform 0.2s;
}
.scr-slot .scr-disc { grid-row: span 2; width: 26px; height: 26px; }
.scr-slot b { font: 400 21px/1.1 var(--neon); color: var(--pc); }
.scr-slot span:last-child { font-size: 13px; font-weight: 600; color: var(--mute); }
.scr-slot.on { border-color: var(--pc); background: rgba(var(--pr), 0.12); box-shadow: 0 0 18px rgba(var(--pr), 0.35), inset 0 0 14px rgba(var(--pr), 0.12); }
.scr-slot.on span:last-child { color: #e6ebff; }
.scr-slot.poke { transform: scale(1.03); box-shadow: 0 0 30px rgba(var(--pr), 0.8), inset 0 0 22px rgba(var(--pr), 0.3); }
.scr-slot.cpu { opacity: 0.8; }
.scr-slot.cpu .scr-disc { background: transparent; border: 3px solid var(--pc); box-shadow: none; }
.scr-slot.open { border-style: dashed; opacity: 0.55; }
.scr-slot.open .scr-disc { background: transparent; border: 2px dashed var(--pc); box-shadow: none; }
.scr-slot.open b { color: #cfd6ff; }

.scr-set { display: flex; flex-direction: column; gap: 2px; }
.scr-picks { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; margin-bottom: 6px; }
.scr-pick { min-height: 54px; border-radius: 12px; border: 1px solid var(--line); background: rgba(20, 16, 44, 0.6); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 6px 30px 6px 14px; text-align: left; position: relative; }
.scr-pick::after { content: '›'; position: absolute; right: 12px; top: 50%; transform: translateY(-52%); font-size: 26px; color: var(--mute); }
.scr-pick small { color: var(--mute); font-weight: 600; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.scr-pick b { font: 400 19px/1.1 var(--neon); color: #fff; }
.scr-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.scr-row > span { display: flex; flex-direction: column; font-weight: 700; flex: 1; min-width: 0; }
.scr-row.stack { flex-direction: column; align-items: stretch; gap: 6px; }
.scr-row.stack .seg { justify-content: stretch; }
.scr-row.stack .seg button { flex: 1; }
.scr-row small { color: var(--mute); font-weight: 500; font-size: 12px; }
.scr-row .seg { flex-wrap: nowrap; justify-content: flex-end; flex: none; }
.scr-row .seg button { padding: 0 10px; min-height: 38px; min-width: 44px; font-size: 14px; }
.scr-set .toggle { padding: 8px 0; }
.scr-play { min-height: 82px; }
.scr-play b { font-size: 34px; }
.scr-play:disabled { opacity: 0.45; }
.scr-foot { display: flex; justify-content: space-between; gap: 8px; }

.scr-hud { pointer-events: none; }
.scr-side { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scr-pause {
  pointer-events: auto; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(10, 8, 24, 0.7); border: 1px solid var(--line); opacity: 0.75;
}
.scr-pause svg { width: 20px; height: 20px; fill: var(--ink); }
.scr-codepill {
  display: flex; flex-direction: column; align-items: center; padding: 6px 10px 7px; border-radius: 14px;
  background: rgba(8, 6, 20, 0.75); border: 1px solid rgba(255, 154, 31, 0.45); color: #ffd9ad;
}
.scr-codepill small { font-weight: 700; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); }
.scr-codepill b { font: 400 20px/1.1 var(--neon); letter-spacing: 0.08em; text-shadow: 0 0 8px #ff9a1f; }

.scr-msg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; background: radial-gradient(120% 80% at 50% 40%, rgba(40, 20, 70, 0.6), rgba(4, 3, 11, 0.98)); }
.scr-title { margin: 0; font: 400 clamp(40px, 5vw, 72px)/1 var(--neon); color: #fff0dc; text-shadow: 0 0 12px #ff9a1f, 0 0 32px rgba(255, 154, 31, 0.6); }
.scr-lede { margin: 0; color: var(--mute); font-size: clamp(16px, 1.4vw, 22px); max-width: 32em; }

.scr-sheet {
  position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(calc(100% - 40px), 560px); max-height: calc(100% - 40px); overflow: auto; padding: 26px 26px 22px; border-radius: 26px; text-align: center;
  background: rgba(14, 10, 30, 0.9); border: 1px solid var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 0 60px rgba(120, 80, 255, 0.3);
  animation: scr-pop 0.3s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes scr-pop { from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); } }
.scr-sheet h2 { margin: 0 0 14px; font: 400 clamp(36px, 4vw, 64px)/1.05 var(--neon); }
.scr-over-kicker { margin: 0 0 4px; color: var(--mute); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.scr-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.scr-btns.row { flex-direction: row; align-items: stretch; }
.scr-btns.row .btn { flex: 1; }
.scr-btns.row .btn.big { flex: 1.6; }
.scr-note { margin: 12px 0 0; color: #ffe27a; font-weight: 700; }
.scr-standings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.scr-standings li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(20, 16, 44, 0.6); }
.scr-standings li:first-child { border-color: var(--pc); box-shadow: 0 0 18px color-mix(in srgb, var(--pc) 45%, transparent); }
.scr-standings li b { color: var(--pc); flex: 1; font: 400 22px/1.1 var(--neon); }
.scr-standings li b small { font: 600 13px var(--ui); color: var(--mute); }
.scr-standings li span:last-child { color: var(--mute); font-weight: 600; }
.scr-place { width: 24px; font: 400 22px var(--neon); color: #fff; text-align: center; }
.scr-toast { z-index: 40; top: 18px; bottom: auto; max-width: calc(100% - 40px); text-align: center; font-size: clamp(15px, 1.2vw, 20px); }

/* A narrow or upright screen: the lobby stacks, and the preview plays behind it. */
@media (max-width: 1000px), (orientation: portrait) {
  .scr-lobby { grid-template-columns: 1fr; grid-auto-rows: min-content; overflow-y: auto; gap: 14px; padding: 16px; }
  .scr-preview { display: none; }
  .scr-col { overflow: visible; }
  .scr-col > * { width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; }
  .scr-joincol > .scr-code, .scr-joincol > .scr-qrcard { width: auto; }
}

/* ---------- a phone as a controller ---------- */
.pad { position: fixed; inset: 0; z-index: 15; background: #05040c; overflow: hidden; touch-action: none; --pc: #8a90b8; --pr: 138, 144, 184; }
.pad-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.pad-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: calc(var(--sat) + 10px) 12px 10px 16px; background: linear-gradient(rgba(5, 4, 12, 0.95), rgba(5, 4, 12, 0));
}
.pad-me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.pad-disc { width: 22px; height: 22px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 12px var(--pc); flex: none; }
.pad-me b { font: 400 26px/1.2 var(--neon); color: var(--pc); text-shadow: 0 0 10px var(--pc); white-space: nowrap; }
.pad-pill { padding: 3px 10px; border-radius: 999px; background: rgba(255, 210, 122, 0.14); border: 1px solid rgba(255, 210, 122, 0.6); color: #ffe2a8; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pad-leave { min-height: 36px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(10, 8, 24, 0.7); color: var(--mute); font-weight: 700; font-size: 14px; }
.pad-msg {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: calc(var(--sat) + 70px) 24px calc(var(--sab) + 24px); text-align: center;
  background: radial-gradient(120% 70% at 50% 40%, rgba(var(--pr), 0.16), rgba(5, 4, 12, 0.98) 70%);
}
.pad-msg h2 { margin: 0; font: 400 34px/1.05 var(--neon); color: #fff; }
.pad-msg p { margin: 0; color: var(--mute); max-width: 22em; }
.pad-tv { position: relative; width: 120px; height: 76px; border-radius: 12px; border: 3px solid #ff9a1f; box-shadow: 0 0 20px rgba(255, 154, 31, 0.6), inset 0 0 18px rgba(255, 154, 31, 0.3); margin-bottom: 18px; animation: pad-glow 2.2s ease-in-out infinite; }
.pad-tv::after { content: ''; position: absolute; left: 50%; bottom: -16px; width: 44px; height: 4px; transform: translateX(-50%); border-radius: 2px; background: #ff9a1f; box-shadow: 0 0 10px #ff9a1f; }
@keyframes pad-glow { 50% { box-shadow: 0 0 34px rgba(255, 154, 31, 0.9), inset 0 0 24px rgba(255, 154, 31, 0.45); } }
.pad-sheet {
  position: absolute; z-index: 2; left: 50%; top: calc(var(--sat) + 70px); transform: translateX(-50%);
  width: min(calc(100% - 24px), 420px); max-height: calc(100% - 100px); overflow: auto; padding: 18px 16px 16px; border-radius: 22px; text-align: center;
  background: rgba(14, 10, 30, 0.92); border: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 0 40px rgba(var(--pr), 0.3);
}
.pad-sheet h2 { margin: 0 0 12px; font: 400 36px/1.05 var(--neon); }
.pad-kicker { margin: 0 0 2px; color: var(--mute); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; font-size: 13px; }
.pad-note { margin: 12px 0 0; color: var(--mute); font-size: 14px; }
.pad-sheet .scr-standings li { padding: 7px 10px; }
.pad-sheet .scr-standings li b { font-size: 19px; }
