:root {
  --orange: #ff8a00; --blue: #3fb6ff; --ink: #0d1530; --panel: rgba(10, 18, 45, 0.82);
  --text: #f4f7ff; --muted: #a8b6d8; --good: #6dff9c; --bad: #ff5a6a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1530; color: var(--text);
  font-family: "Trebuchet MS", system-ui, sans-serif; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; }
.labels { position: absolute; inset: 0; pointer-events: none; }
.nametag { background: rgba(0,0,0,.55); padding: 2px 8px; border-radius: 10px; font-size: 13px; font-weight: bold; white-space: nowrap; }
.nametag.host { background: var(--orange); color: #1b0d00; }

.hidden { display: none !important; }
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding: 24px 6vw; pointer-events: none; }
.screen > * { pointer-events: auto; }
.panel { background: var(--panel); border: 2px solid rgba(255,255,255,.12); border-radius: 18px; padding: 20px; width: min(400px, 100%); backdrop-filter: blur(6px); }
/* the title: a shonen manga logo. Comic lettering with a thick ink outline, a hot gradient fill, a hard drop
   shadow, a slight forward lean, and a red banner underneath. */
.logo { position: absolute; left: 4vw; top: 3vh; margin: 0; font-size: clamp(34px, 6vw, 74px); line-height: .9; pointer-events: none;
  font-family: 'Bangers', 'Impact', 'Trebuchet MS', sans-serif; font-weight: 400; letter-spacing: 2px; text-transform: uppercase;
  transform: rotate(-4deg) skewX(-6deg); transform-origin: left top; display: flex; flex-direction: column; align-items: flex-start; }
.logo .l1, .logo .l2 { display: block; -webkit-text-stroke: 0.055em #0d1530; paint-order: stroke fill;
  -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0.06em 0.07em 0 #0d1530); }
.logo .l1 { background-image: linear-gradient(180deg, #fff6b0 0%, #ffe14a 45%, #ff9a1a 75%, #e2420d 100%); font-size: .82em; margin-left: .15em; }
.logo .l2 { background-image: linear-gradient(180deg, #ffffff 0%, #bfefff 45%, #4fb6ff 75%, #2457d6 100%); font-size: 1.12em; margin-top: -.08em;
  animation: logoGlow 2.6s ease-in-out infinite; }
@keyframes logoGlow { 0%, 100% { filter: drop-shadow(0.06em 0.07em 0 #0d1530) drop-shadow(0 0 0 rgba(120,200,255,0)); }
  50% { filter: drop-shadow(0.06em 0.07em 0 #0d1530) drop-shadow(0 0 .25em rgba(120,200,255,.75)); } }
.logo .beta { display: block; margin: .5em 0 0 .45em; font-family: system-ui, sans-serif; font-size: .17em; font-weight: bold; letter-spacing: .12em;
  text-transform: uppercase; color: #fff; opacity: .85; text-shadow: 0 1px 2px #0d1530, 0 0 6px rgba(13,21,48,.8); }
.askPanel { max-width: 380px; text-align: center; } .askPanel p { margin: 4px 0 14px; font-size: 16px; }
.askPanel .row { display: flex; gap: 10px; justify-content: center; }
.logo .tag { display: inline-block; margin: .28em 0 0 .3em; padding: .22em .7em .16em; font-size: .3em; letter-spacing: .22em;
  color: #fff; background: linear-gradient(90deg, #e2420d, #ff2a5a); border: .08em solid #0d1530; border-radius: .25em;
  box-shadow: .12em .14em 0 #0d1530; transform: skewX(-8deg); white-space: nowrap; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
input, select { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 2px solid #34406a; background: #0b1230; color: var(--text); margin-top: 4px; }
input:focus, select:focus { outline: none; border-color: var(--blue); }
button { font: inherit; font-weight: bold; font-size: 16px; padding: 11px 16px; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(#ffb12a, #ff7300); color: #1b0d00; box-shadow: 0 4px 0 #a34500; flex: 1; }
button:active { transform: translateY(2px); box-shadow: 0 2px 0 #a34500; }
button.alt { background: linear-gradient(#69c8ff, #2a83e6); color: #04122e; box-shadow: 0 4px 0 #154f99; }
button.ghost { background: transparent; color: var(--text); box-shadow: none; border: 2px dashed #34406a; width: 100%; margin: 6px 0 12px; }
.row { display: flex; gap: 10px; margin-top: 8px; }
.row input { margin: 0; text-transform: uppercase; letter-spacing: 6px; text-align: center; }
.error { color: var(--bad); min-height: 1em; margin: 8px 0 0; }
.muted { color: var(--muted); font-size: 14px; }

#custom .opt { display: grid; grid-template-columns: 82px 1fr; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; flex: none; box-shadow: none; }
.sw.on { border-color: #fff; transform: scale(1.12); }
.chip { font-size: 12px; padding: 4px 8px; border-radius: 8px; background: #1b2550; color: var(--text); box-shadow: none; flex: none; font-weight: normal; }
.chip.on { background: var(--orange); color: #1b0d00; }

.codebox { position: absolute; left: 4vw; top: 4vh; background: var(--panel); border-radius: 18px; padding: 14px 22px; color: var(--muted); font-size: 14px; }
.codebox strong { display: block; font-size: 54px; letter-spacing: 10px; color: #ffe14a; }
.codebox small { display: block; }
.lobbyPanel { max-height: calc(100vh - 48px); overflow-y: auto; }
.lobbyPanel h2 { margin: 0 0 12px; }
.lobbyPanel h3 { margin: 18px 0 6px; font-size: 15px; color: var(--muted); }
#crew { list-style: none; padding: 0; margin: 0; }
#crew li { padding: 6px 0; border-bottom: 1px solid #1f2a52; }
#crew li b { color: var(--orange); font-size: 12px; margin-left: 6px; }
#crew li b.bot { color: var(--blue); }
.hudCode { color: #ffe14a; letter-spacing: 3px; }
kbd { background: #1b2550; border: 1px solid #34406a; border-radius: 4px; padding: 0 5px; color: var(--text); }

#hud { position: fixed; inset: 0; pointer-events: none; }
.topbar { position: absolute; top: 14px; left: 16px; right: 16px; display: flex; gap: 14px; align-items: center; }
.stageTag, .timer { background: var(--panel); border-radius: 12px; padding: 8px 14px; font-size: 18px; white-space: nowrap; }
.timer { font-size: 26px; font-weight: bold; min-width: 76px; text-align: center; }
.timer.low { color: var(--bad); animation: pulse .5s infinite alternate; }
.meter { flex: 1; height: 30px; background: rgba(0,0,0,.5); border-radius: 15px; overflow: hidden; position: relative; border: 2px solid rgba(160,220,255,.5); }
#meterFill { height: 100%; width: 0; background: linear-gradient(90deg, #2a83e6, #9fe3ff, #fff); box-shadow: 0 0 20px #9fe3ff; transition: width .25s; }
#meterText { position: absolute; inset: 0; display: grid; place-items: center; font-weight: bold; text-shadow: 0 1px 3px #000; }
.banner { position: absolute; top: 28%; width: 100%; text-align: center; font-size: clamp(32px, 7vw, 80px); font-weight: 900; font-style: italic;
  color: #ffe14a; text-shadow: 4px 4px 0 #e2420d, 8px 8px 0 #0d1530; opacity: 0; transition: opacity .4s; }
.banner.show { opacity: 1; }
#feed { position: absolute; left: 16px; bottom: 130px; width: min(460px, 70vw); max-height: 34vh; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; }
#feed div { background: rgba(0,0,0,.5); padding: 5px 10px; border-radius: 10px; font-size: 14px; width: fit-content; max-width: 100%; animation: in .25s; }
#feed div.phrase { background: rgba(42,131,230,.55); }
#feed div.system { color: var(--muted); font-style: italic; }
#feed b { color: #ffe14a; margin-right: 6px; }
.typebar { position: absolute; bottom: 16px; left: 0; right: 0; margin: 0 auto; width: min(720px, 94vw); pointer-events: auto; text-align: center; }
.phrase { font-size: clamp(18px, 3vw, 30px); font-weight: bold; margin-bottom: 8px; text-shadow: 0 2px 4px #000; color: rgba(255,255,255,.55); }
.phrase .ok { color: var(--good); }
.phrase .bad { color: var(--bad); }
.typebar input { font-size: 20px; background: rgba(11,18,48,.85); }
.combo { position: absolute; right: 0; top: -30px; font-weight: bold; color: #ffe14a; text-shadow: 0 2px 3px #000; }
.resultPanel { text-align: center; margin: 0 auto; width: min(620px, 100%); padding: 12px 18px; }
.resultPanel h1 { font-size: 30px; margin: 0 0 2px; font-style: italic; }
.resultPanel p { margin: 0 0 6px; font-size: 14px; }
.resultPanel #resultGuest { display: flex; align-items: center; justify-content: center; gap: 12px; }
.resultPanel #resultGuest p { margin: 0; }
.resultPanel #resultGuest button { flex: none; }
#result { flex-direction: column; justify-content: space-between; align-items: center; padding: 14px 16px; }
.mvpBox { width: min(560px, 100%); text-align: center; padding: 14px 20px 10px; border-radius: 20px; backdrop-filter: blur(6px);
  background: linear-gradient(rgba(60, 40, 0, .78), rgba(10, 18, 45, .85)); border: 3px solid #ffe14a; box-shadow: 0 0 30px rgba(255, 225, 74, .35); }
.mvpLabel { font-size: 15px; letter-spacing: 4px; color: #ffe14a; font-weight: bold; }
.mvpName { font-size: clamp(30px, 6vw, 52px); font-weight: bold; font-style: italic; line-height: 1.1; color: #fff;
  text-shadow: 3px 3px 0 #e2420d, 5px 5px 0 #0d1530; overflow-wrap: anywhere; }
.mvpPower { font-size: 18px; color: #ffe14a; margin: 4px 0 6px; }
.mvpBox .resultBoard { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; list-style: none; padding: 0; margin: 4px 0 0; max-width: none; font-size: 14px; color: var(--muted); }
.mvpBox .resultBoard b { float: none; margin-left: 6px; }
@keyframes pulse { to { transform: scale(1.12); } }
@keyframes in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 700px) {
  .screen { justify-content: center; align-items: flex-end; padding: 12px; }
  .logo { font-size: 30px; }
  .codebox { top: 10px; left: 10px; padding: 8px 14px; }
  .codebox strong { font-size: 34px; }
  #feed { bottom: 140px; max-height: 24vh; }
}

/* ---------- stage polish ---------- */
.nametag.bot { opacity: .75; }
button.small { font-size: 13px; padding: 6px 10px; margin: 8px 0 0; }
.enemyInfo { color: #ff9aa8; font-weight: bold; margin: 4px 0 10px; }
#fullMark { position: absolute; top: 0; bottom: 0; left: 66.6%; width: 3px; background: #fff; box-shadow: 0 0 8px #fff; }
#meterFill.over { background: linear-gradient(90deg, #2a83e6, #9fe3ff, #fff3a0, #ffd000); box-shadow: 0 0 26px #ffd000; }
.meter.struggle { background: var(--enemy, #ff3b6b); border-color: rgba(255,255,255,.6); }
#teamSide { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; background: linear-gradient(90deg, #2a83e6, #bfefff); transition: width .2s; }
#clashMark { position: absolute; top: -4px; bottom: -4px; left: 50%; width: 8px; margin-left: -4px; background: #fff; border-radius: 4px; box-shadow: 0 0 14px #fff, 0 0 30px #ffe9a0; transition: left .2s; }
.meter.struggle span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: bold; text-shadow: 0 1px 3px #000; font-size: 13px; white-space: nowrap; overflow: hidden; }
.iconBtn { flex: none; width: 44px; padding: 8px 0; background: var(--panel); box-shadow: none; font-size: 18px; }
.sidebar { position: absolute; right: 16px; top: 70px; width: 210px; pointer-events: auto; }
.board { background: rgba(0,0,0,.45); border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.board:empty { display: none; }
.board h4 { margin: 0 0 4px; font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.board div { display: flex; justify-content: space-between; padding: 2px 0; }
.board div b { color: #ffe14a; }
.board div.me { color: var(--good); }
.callout { position: absolute; top: 44%; width: 100%; text-align: center; font-size: clamp(20px, 3.4vw, 36px); font-weight: 900; font-style: italic;
  color: #9fe3ff; text-shadow: 3px 3px 0 #0d1530; opacity: 0; transition: opacity .3s; }
.callout.show { opacity: 1; }
.sub { position: absolute; top: calc(28% + clamp(40px, 8vw, 90px)); width: 100%; text-align: center; font-size: clamp(18px, 3vw, 34px); font-weight: 900;
  color: #ff9aa8; text-shadow: 3px 3px 0 #0d1530; opacity: 0; transition: opacity .4s; }
.sub.show { opacity: 1; }
.context { font-size: 13px; font-weight: bold; letter-spacing: 3px; color: #9fe3ff; text-shadow: 0 1px 2px #000; margin-bottom: 2px; }
.context.urgent { color: #ff5a6a; animation: pulse .4s infinite alternate; }
.context.struggle { color: #ffe14a; }
#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 5; transition: opacity .6s; }
#flash.on { opacity: .85; transition: none; }
.resultBoard { text-align: left; margin: 6px auto 14px; max-width: 260px; padding-left: 22px; }
.resultBoard li { padding: 2px 0; }
.resultBoard b { color: #ffe14a; float: right; }
@media (max-width: 700px) { .sidebar { display: none; } }

/* exact typing + inactivity */
.phrase .bad { text-decoration: underline wavy; }
.phrase .extra { background: rgba(255,90,106,.25); border-radius: 3px; }
#say.shake { animation: shake .35s; border-color: var(--bad); }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
#feed div.miss { opacity: .75; text-decoration: line-through; text-decoration-color: var(--bad); }
.idleWarn { position: absolute; left: 50%; top: 38%; transform: translateX(-50%); padding: 14px 22px; border-radius: 14px;
  background: rgba(120,10,20,.85); border: 2px solid #ff5a6a; font-weight: 800; font-size: 20px; text-align: center; z-index: 5;
  animation: pulse 1s infinite alternate; }
@keyframes pulse { from { box-shadow: 0 0 0 rgba(255,90,106,.0); } to { box-shadow: 0 0 30px rgba(255,90,106,.8); } }

/* host controls, crowns, hall of fame */
button.danger { background: linear-gradient(#ff7a8a, #d8283f); color: #fff; box-shadow: 0 4px 0 #8a1023; }
.roomActions { position: absolute; right: 4vw; top: 3vh; display: flex; gap: 10px; }
.roomActions button { margin: 0; }
.sidebar button.danger { width: 100%; margin-top: 8px; }
#crew li { display: flex; align-items: center; gap: 4px; }
#crew li .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#crew li .crown { width: 20px; text-align: center; }
#crew li .given { color: var(--muted); font-size: 12px; }
#crew li .kick { width: auto; flex: none; margin: 0; background: transparent; color: #ff7a8a; box-shadow: none; padding: 2px 8px; font-size: 14px; border: 1px solid #5a2a3a; border-radius: 8px; }
#crew li .kick:hover { background: #5a2a3a; }
.hall { position: absolute; left: 4vw; bottom: 4vh; width: min(320px, 40vw); max-height: 42vh; overflow: auto; }
.hall h3 { margin: 10px 0 8px; font-size: 15px; color: var(--muted); }
.hallToggle { width: 100%; display: flex; justify-content: space-between; align-items: center; font-size: 16px; letter-spacing: 2px; }
.hallToggle .arrow { display: inline-block; transition: transform .2s; }
.hall.open .hallToggle .arrow { transform: rotate(90deg); }
.hall .hallBody { display: none; }
.hall.open .hallBody { display: block; }
.hall.open { width: min(520px, 60vw); max-height: 70vh; }
#say { text-align: center; }
#say::placeholder { text-align: center; }
.hall ol { margin: 0; padding-left: 26px; }
.hall li { padding: 3px 0; }
.hall li b { float: right; color: #ffe14a; }
.lockedTag { color: #ff7a8a; font-size: 13px; margin-left: 8px; }
.cornerBtns { position: absolute; right: 16px; bottom: 16px; display: flex; align-items: flex-end; gap: 10px; }
.donate { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.changesBtn { flex: none; font-size: 15px; padding: 9px 16px; background: linear-gradient(#69c8ff, #2a83e6); color: #04122e; box-shadow: 0 4px 0 #154f99; }
.modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 10, 30, .6); }
.changesPanel { width: min(560px, 100%); max-height: 80vh; display: flex; flex-direction: column; }
.changesPanel h2 { margin: 0 0 8px; }
.changesBody { overflow: auto; margin-bottom: 12px; }
.changesBody h3 { margin: 6px 0; color: #ffe14a; font-size: 15px; }
.changesBody ul { margin: 0; padding-left: 20px; }
.changesBody li { margin: 5px 0; font-size: 14px; line-height: 1.4; }
.typebar { transition: opacity .25s, transform .25s; }
.typebar.away { opacity: 0; transform: translateY(30px); pointer-events: none; }
.typebar.flashIn { animation: flashIn .9s ease-out; }
@keyframes flashIn { 0% { opacity: 0; transform: scale(1.25); filter: brightness(3); } 35% { opacity: 1; transform: scale(.97); filter: brightness(2); } 100% { transform: scale(1); filter: none; } }
.donateBtn { font-weight: bold; font-size: 15px; padding: 9px 16px; border-radius: 12px; text-decoration: none;
  background: linear-gradient(#ffe14a, #ffb12a); color: #1b0d00; box-shadow: 0 4px 0 #a34500; }
.donateBtn:active { transform: translateY(2px); box-shadow: 0 2px 0 #a34500; }
.donateBtn { border: 2px solid #ffe14a; }
.donateBtn .heart { display: inline-block; animation: heartbeat 1.2s ease-in-out infinite; }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1); } 45% { transform: scale(1.18); } 60% { transform: scale(1); } }
.feedbackBtn { background: linear-gradient(#9ef0b0, #2fb86a); color: #052611; box-shadow: 0 4px 0 #1d7a45; }
#fbMsg { width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; border-radius: 10px; border: 2px solid #34406a; background: #0b1230; color: var(--text); resize: vertical; margin: 6px 0 10px; }
.donateCard { display: none; background: var(--panel); border: 2px solid rgba(255,255,255,.12); border-radius: 14px; padding: 12px;
  width: 180px; text-align: center; backdrop-filter: blur(6px); }
.donate:hover .donateCard, .donate:focus-within .donateCard { display: block; }
.donateCard img { display: block; margin: 0 auto 8px; border-radius: 10px; background: #fff; }
.donateCard p { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.donateCard a { color: var(--blue); font-size: 13px; font-weight: bold; }

.crewHead { display: flex; align-items: center; gap: 8px; }
.crewHead #lockBtn { flex: none; margin: 0 0 0 auto; }
#rejoin .countdown { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 8px; background: rgba(4,18,46,.35); font-variant-numeric: tabular-nums; }

/* stats and unlocks */
.myStats:empty { display: none; }
.myStats { margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.12); }
.myTitle { font-weight: bold; color: #ffe14a; margin-bottom: 6px; }
.statGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.statGrid b { display: block; color: var(--text); font-size: 16px; }
.sw.locked, .chip.locked { opacity: .35; cursor: not-allowed; }
.nametag small { display: block; font-size: 10px; font-weight: normal; opacity: .85; text-align: center; }
.nametag.chat.twitch { background: #6441a5; }
.nametag.chat.youtube { background: #c4302b; }
.chatP { font-size: 10px; margin-left: 6px; padding: 1px 5px; border-radius: 5px; color: #fff; }
.chatP.twitch { background: #6441a5; } .chatP.youtube { background: #c4302b; }
.chatP.kick, .nametag.chat.kick { background: #2fbf2f; color: #001a00; } .chatP.rumble, .nametag.chat.rumble { background: #85c742; color: #0f2000; }
/* stream chat services */
.services { display: grid; gap: 6px; margin: 6px 0 8px; }
.svc { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin: 0; padding: 7px 10px; border-radius: 10px; background: #1b2550; cursor: pointer; color: var(--text); font-size: 14px; font-weight: bold; text-align: left; }
.svc input { width: 18px; height: 18px; margin: 0; accent-color: #6dff9c; }
.svcIcon { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-weight: 900; font-size: 13px; color: #fff; flex: none; }
.svcIcon.twitch { background: #9146ff; } .svcIcon.youtube { background: #ff0000; } .svcIcon.kick { background: #53fc18; color: #000; } .svcIcon.rumble { background: #85c742; color: #000; }
.svc:has(input:checked) { outline: 2px solid #6dff9c; }
.svcIn { margin: 0 0 4px; font-size: 14px; }
.streamBox .row button { margin-top: 0; }
p.small { font-size: 12px; }
/* host stream tools */
.streamBox { margin: 10px 0; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.05); }
.streamBox summary { cursor: pointer; font-weight: bold; }
.streamBox label { margin-top: 8px; }
.streamBox .st.connected { color: var(--good); } .streamBox .st.error { color: var(--bad); }
label.check { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
label.check input { width: auto; margin: 0; }
/* practice */
.practice { margin: 10px 0; padding: 10px; border-radius: 12px; border: 2px dashed #ffe14a; }
.practice .phrase { font-size: 20px; margin: 6px 0; }
.practice .ok { color: var(--good); } .practice .bad { color: var(--bad); text-decoration: underline; }
/* stream chat phrase on the HUD */
.chatBox { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); padding: 8px 16px; border-radius: 14px; font-size: 16px;
  background: rgba(100, 65, 165, .88); border: 2px solid #b9a3ff; box-shadow: 0 6px 20px rgba(0,0,0,.35); white-space: nowrap; }
.chatBox b { color: #ffe14a; font-size: 20px; }
.chatTag { font-weight: bold; margin-right: 6px; }
/* big moments */
.banner.huge { animation: huge 1.6s ease-out; }
@keyframes huge { 0% { transform: scale(2.4); filter: brightness(3); } 20% { transform: scale(.9) rotate(-2deg); }
  30% { transform: scale(1.15) rotate(2deg); } 100% { transform: scale(1); } }
/* lobby: room code and crew down the left, settings on the right */
#lobby .lobbyLeft { position: absolute; left: 2vw; top: 3vh; bottom: 3vh; width: min(330px, 30vw); display: flex; flex-direction: column; gap: 12px; pointer-events: auto; }
#lobby .lobbyLeft .codebox { position: static; }
#lobby .crewPanel { width: 100%; flex: 0 1 auto; min-height: 0; overflow-y: auto; padding: 12px 14px; } /* grows with the crew, scrolls past the bottom of the screen */
#lobby .crewPanel h3 { margin: 0 0 6px; }
#lobby.screen { padding-right: 2vw; }
.modePick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 2px 0 10px; }
.modeBtn { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; text-align: left; background: #1b2550; color: var(--text); box-shadow: none; border: 2px solid transparent; }
.modeBtn b { font-size: 15px; letter-spacing: 2px; } .modeBtn small { font-size: 11px; font-weight: normal; color: var(--muted); }
.modeBtn.on { background: linear-gradient(#ffb12a, #ff7300); color: #1b0d00; border-color: #ffe14a; } .modeBtn.on small { color: #3a1d00; }
.hallTabs { display: flex; gap: 6px; margin: 8px 0 2px; }
.hallTabs .chip { flex: 1; padding: 5px; }
body.portrait #lobby .lobbyLeft { position: static; width: 100%; flex-direction: row; gap: 8px; }
body.portrait #lobby .crewPanel { max-height: 22vh; }
/* OBS overlay (?watch=CODE): just the show */
body.watch #menu, body.watch .lobbyPanel, body.watch .roomActions, body.watch .typebar, body.watch .sidebar button, body.watch #mute,
body.watch #resultHost, body.watch #resultGuest, body.watch #copyInvite, body.watch #idleWarn { display: none !important; }
body.watch .banner { font-size: 72px; } body.watch .chatBox { font-size: 22px; } body.watch .chatBox b { font-size: 28px; }

/* customizer: dropdowns + color tabs */
.drops { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.dropRow { margin: 0; font-size: 12px; }
.dropRow select { font-size: 14px; padding: 7px 8px; }
.custTabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 4px 0 8px; }
.custTab { flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 5px; border-radius: 12px;
  background: #1b2550; box-shadow: none; color: var(--text); font-weight: normal; position: relative; }
.custTab .ico { font-size: 20px; line-height: 1; }
.custTab .dot { position: absolute; top: 4px; right: 6px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); }
.custTab small { font-size: 10px; color: var(--muted); }
.custTab.on { background: var(--orange); color: #1b0d00; } .custTab.on small { color: #1b0d00; }
.palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; justify-items: center; padding: 8px 4px; border-radius: 12px; background: rgba(255,255,255,.04); }
.palette .sw { width: 32px; height: 32px; }
.shirtToggle { display: flex; gap: 6px; margin-bottom: 6px; }
.shirtToggle .chip { flex: 1; padding: 6px; font-size: 13px; }
body.portrait .drops { grid-template-columns: 1fr 1fr 1fr; }
body.portrait .custTab small { display: none; }

@media (max-width: 700px) { .hall { display: none; } .roomActions { top: auto; bottom: 10px; right: 10px; } }

/* ---------- phones and tablets: the layout follows the screen's orientation ---------- */
/* portrait (taller than wide): the 3D scene on top, panels stacked at the bottom */
body.portrait .screen { justify-content: center; align-items: flex-end; padding: 10px; }
body.portrait .panel { width: 100%; }
body.portrait #menu > .panel:not(.hall), body.portrait .lobbyPanel { max-height: 54vh; overflow-y: auto; }
body.portrait .logo { left: 12px; top: 10px; font-size: 28px; }
body.portrait .hall { display: block; left: auto; right: 10px; top: 10px; bottom: auto; width: 46vw; padding: 8px; max-height: 40vh; }
body.portrait .hall.open { width: calc(100vw - 20px); max-height: 60vh; z-index: 5; }
body.portrait .hallToggle { font-size: 12px; letter-spacing: 1px; padding: 8px 10px; }
body.portrait .myStats { display: none; }
body.portrait .hall.open .myStats { display: block; }
body.portrait .cornerBtns { top: 64px; right: 10px; bottom: auto; flex-direction: column; align-items: flex-end; gap: 6px; }
body.portrait .changesBtn, body.portrait .donateBtn { font-size: 12px; padding: 6px 10px; }
body.portrait .donateCard { position: absolute; right: 0; top: 40px; }
body.portrait .codebox { left: 10px; top: 10px; padding: 8px 12px; font-size: 12px; }
body.portrait .codebox strong { font-size: 30px; letter-spacing: 6px; }
body.portrait .roomActions { right: 10px; top: 10px; bottom: auto; }
body.portrait .topbar { flex-wrap: wrap; gap: 6px; top: 8px; left: 8px; right: 8px; }
body.portrait .topbar .meter { order: 5; flex-basis: 100%; height: 26px; }
body.portrait .stageTag { font-size: 13px; padding: 6px 10px; }
body.portrait .timer { font-size: 20px; min-width: 56px; padding: 6px 10px; }
body.portrait .sidebar { display: none; }
body.portrait #feed { bottom: 150px; max-height: 18vh; width: calc(100vw - 20px); left: 10px; }
body.portrait #feed div { font-size: 12px; }
body.portrait .chatBox { top: 96px; white-space: normal; width: calc(100vw - 20px); text-align: center; font-size: 13px; }
body.portrait .chatBox b { font-size: 15px; }
body.portrait .banner { font-size: clamp(26px, 9vw, 48px); }
body.portrait .phrase { font-size: clamp(18px, 5.5vw, 26px); }
body.portrait .resultPanel h1 { font-size: 22px; }
body.portrait #resultHost, body.portrait #resultGuest { flex-wrap: wrap; }
body.portrait .mvpName { font-size: 32px; }

/* landscape but short (phones on their side): tighter panels that scroll, less clutter */
body.short .panel { padding: 12px; }
body.short #menu > .panel:not(.hall), body.short .lobbyPanel { max-height: calc(100vh - 20px); overflow-y: auto; }
body.short .logo { font-size: 26px; }
body.short .hall { bottom: 8px; }
body.short #feed { display: none; }
body.short .topbar { top: 6px; }
body.short .typebar { bottom: 6px; }
body.short .phrase { font-size: 18px; margin-bottom: 4px; }
body.short .typebar input { font-size: 16px; padding: 6px 10px; }
body.short .banner { font-size: 40px; }
body.short .mvpBox { padding: 6px 12px; } body.short .mvpName { font-size: 28px; }
body.portrait .sub, body.portrait .callout { font-size: 16px; padding: 0 14px; box-sizing: border-box; }

/* main menu (wide screens): title and stats hug the left edge, the customize panel the right edge */
body:not(.portrait) #menu.screen { padding-right: 2vw; }
body:not(.portrait) #menu .logo { left: 1.5vw; }
body:not(.portrait) #menu .hall { left: 1.5vw; }

/* centred text everywhere in the panels */
.panel, .panel h2, .panel h3, .panel p, .panel label, .codebox, .modeBtn, .practice, .streamBox, .changesBody h3 { text-align: center; }
.panel input, .panel select, .panel textarea { text-align: center; text-align-last: center; }
.crewHead { justify-content: center; position: relative; }
.crewHead #lockBtn { position: absolute; right: 0; }
#crew li { justify-content: center; position: relative; }
#crew li .who { flex: none; max-width: 70%; }
#crew li .crown { position: absolute; left: 0; }
#crew li .given { position: absolute; right: 34px; }
#crew li .kick { position: absolute; right: 0; }
.modeBtn { align-items: center; }
.statGrid, .myTitle { text-align: center; }
.dropRow, .custTabs, .palette { text-align: center; }
.hall li { text-align: left; }
.changesBody ul { text-align: left; display: inline-block; }
#custom .opt { justify-items: center; }

/* the "gathering…" dots: each one hops in turn, so it reads as loading */
.dots { display: inline-block; margin-left: 2px; }
.dots i { font-style: normal; display: inline-block; animation: dotHop 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dotHop { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-6px); opacity: 1; } }
