/* Tông màu theo banner Appreciation Day 2026 (New World Saigon Hotel): nền trắng, đỏ chủ đạo */
:root {
  --bg: #ffffff;
  --bg2: #fff4f5;
  --card: #f3f3f6;
  --card2: #e3e3ea;
  --text: #1c1c22;
  --muted: #6d6d78;
  --red: #c41230;
  --red-dark: #8c0b21;
  --accent: var(--red);
  --green: #2f8f4e;
  --gold: #ffcc33;
  --radius: 22px;
  --hand: "Segoe Print", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Segoe UI", cursive;
  --serif: Georgia, "Times New Roman", "Noto Serif", serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; overflow: hidden; }
#app { width: 100vw; height: 100vh; position: relative; }

.screen { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center;
  justify-content: center; gap: 22px; padding: 28px 40px;
  background: radial-gradient(1200px 700px at 30% 10%, var(--bg2), var(--bg) 70%); }
.screen.active { display: flex; }
.hidden { display: none !important; }

.h2 { font-size: clamp(30px, 4vw, 56px); margin: 0; font-weight: 900; letter-spacing: 0.5px; color: var(--red); font-family: var(--serif); }
.hint { color: var(--muted); font-size: clamp(16px, 1.6vw, 24px); margin: 0; text-align: center; }
.small { color: var(--muted); font-size: 16px; }
.row { display: flex; gap: 20px; align-items: center; justify-content: center; flex-wrap: wrap; }
.row.left { justify-content: flex-start; }
.hand { font-family: var(--hand); }

/* ---------- buttons ---------- */
.btn { border: 0; border-radius: var(--radius); cursor: pointer; font-weight: 800; color: #fff;
  background: var(--red); padding: 18px 34px; font-size: 24px; box-shadow: 0 8px 0 var(--red-dark);
  transition: transform .06s, box-shadow .06s; touch-action: manipulation; }
.btn:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--red-dark); }
.btn:disabled { opacity: .4; cursor: default; }
.btn-huge { font-size: clamp(32px, 4vw, 56px); padding: 30px 60px; animation: pulse 1.6s ease-in-out infinite; }
.btn-big { font-size: 30px; padding: 22px 44px; }
.btn-ghost { background: #fff; color: var(--text); border: 3px solid var(--card2); box-shadow: 0 8px 0 var(--card2); }
.btn-ghost:active { box-shadow: 0 2px 0 var(--card2); }
.btn-danger { background: var(--red-dark); box-shadow: 0 8px 0 #4f0612; }
.btn-danger:active { box-shadow: 0 2px 0 #4f0612; }
.btn-sm { font-size: 18px; padding: 12px 22px; box-shadow: 0 5px 0 var(--card2); }
.btn-sm:active { box-shadow: 0 1px 0 var(--card2); transform: translateY(4px); }
@keyframes pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.04);} }

/* ---------- idle (bố cục theo banner) ---------- */
#screen-idle { justify-content: flex-start; gap: 10px; padding: clamp(40px, 6vh, 66px) clamp(50px, 5vw, 90px) clamp(28px, 4vh, 46px); }
.frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.frame path { fill: none; stroke: var(--red); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.wordmark { text-align: center; font-family: var(--serif); color: var(--text); line-height: 1.1; flex: none; }
.wm-1 { font-size: clamp(18px, 1.6vw, 30px); letter-spacing: .28em; }
.wm-2 { font-size: clamp(9px, .75vw, 14px); letter-spacing: .4em; margin-top: 2px; }
.idle-body { flex: 1; min-height: 0; width: 100%; display: flex; gap: 40px; align-items: stretch; }
.idle-left { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; gap: 6px; }
.invite { text-align: center; }
.invite-pre { font-size: clamp(16px, 1.6vw, 30px); letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
.title { font-family: var(--serif); font-size: clamp(34px, 3.9vw, 82px); line-height: 1.05; margin: 4px 0; font-weight: 900;
  color: var(--red); white-space: nowrap; letter-spacing: -.01em; }
.invite-when { font-size: clamp(15px, 1.4vw, 26px); letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.cam-status { font-size: 16px; color: var(--muted); padding: 6px 14px; border-radius: 12px; background: rgba(0,0,0,.05); }
.cam-status.ok { color: var(--green); }
.cam-status.err { color: var(--red); }

/* demo tự chơi */
.demo-wrap { display: flex; align-items: stretch; gap: 14px; width: min(100%, 105vh); }
.demo-cam { width: clamp(120px, 10vw, 180px); flex: none; background: #000; border-radius: 18px; border: 4px solid var(--card2); position: relative;
  display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.demo-cam-label { position: absolute; top: 8px; left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 700; color: #ff6b6b; letter-spacing: 1px; }
.demo-cam-label::before { content: '● '; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.demo-cam-text { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-size: 15px; font-weight: 700; color: #fff; }
/* nhân vật 8-bit: canvas 16×20 phóng to, giữ nét pixel */
.person { width: clamp(56px, 8.5vh, 88px); height: auto; margin-bottom: 26px; image-rendering: pixelated; image-rendering: crisp-edges;
  animation: bob 2.4s ease-in-out infinite; }
.person.air { animation: jumper-arc .65s ease-out; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes jumper-arc { 0% { transform: translateY(0); } 45% { transform: translateY(-50px); } 100% { transform: translateY(0); } }
/* bụi khi tiếp đất */
.dust { position: absolute; bottom: 28px; left: 50%; width: 0; height: 0; pointer-events: none; }
.dust::before, .dust::after { content: ''; position: absolute; bottom: 0; width: 8px; height: 8px; border-radius: 50%; background: #fff; opacity: 0; }
.dust.go::before { animation: dust-l .35s ease-out; }
.dust.go::after { animation: dust-r .35s ease-out; }
@keyframes dust-l { 0% { transform: translate(-18px, 0) scale(1); opacity: .9; } 100% { transform: translate(-44px, -10px) scale(.3); opacity: 0; } }
@keyframes dust-r { 0% { transform: translate(10px, 0) scale(1); opacity: .9; } 100% { transform: translate(36px, -10px) scale(.3); opacity: 0; } }
.demo-arrow { align-self: center; font-size: 44px; color: var(--red); animation: nudge 1s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(8px); } }
.demo-game { flex: 1; min-width: 0; position: relative; }
#demo-game { width: 100%; aspect-ratio: 1200 / 320; display: block; border-radius: 18px; background: #f7f7f7;
  border: 3px solid var(--card2); box-shadow: 0 12px 30px rgba(0,0,0,.12); }
#demo-game.night { background: #202124; }
.demo-badge { position: absolute; top: 12px; left: 16px; font-size: 13px; font-weight: 800; letter-spacing: 1px; color: #fff;
  background: var(--red); padding: 4px 10px; border-radius: 8px; }

.howto { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; }
.game-name { font-weight: 900; font-size: clamp(18px, 1.8vw, 28px); color: var(--red); padding: 6px 14px; border: 3px solid var(--red); border-radius: 14px; }
.step { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 16px; padding: 8px 16px 8px 8px;
  font-size: clamp(15px, 1.4vw, 21px); font-weight: 700; }
.step .n { width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 900; }

.cta-row { display: flex; align-items: center; justify-content: center; gap: clamp(20px, 3vw, 60px); width: 100%; }
.cta-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.subtitle { font-family: var(--hand); font-size: clamp(18px, 1.8vw, 28px); color: var(--red); margin: 0; font-weight: 700; }
.cheers { width: clamp(70px, 6.5vw, 120px); height: auto; flex: none; }
.note-card { background: #fff; border: 3px solid var(--green); color: var(--green); border-radius: 8px; padding: 10px 18px; flex: none;
  font-size: clamp(18px, 1.8vw, 30px); line-height: 1.15; transform: rotate(-6deg); text-align: center; box-shadow: 0 8px 20px rgba(0,0,0,.08); }

/* bảng xếp hạng */
.board { width: min(32vw, 560px); flex: none; background: var(--card); border-radius: 30px; padding: 22px 26px;
  display: flex; flex-direction: column; box-shadow: 0 16px 40px rgba(0,0,0,.10); }
.board h2 { margin: 0 0 14px; font-size: clamp(22px, 2.4vw, 36px); text-align: center; }
.board-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; overflow: hidden; flex: 1; }
.board-list li { display: grid; grid-template-columns: 48px 64px 1fr auto; align-items: center; gap: 14px;
  background: #fff; border-radius: 16px; padding: 6px 14px 6px 8px; font-size: clamp(18px, 1.9vw, 28px); }
.board-list li:nth-child(1) { background: linear-gradient(90deg, rgba(255,204,51,.45), rgba(255,204,51,.12)); font-size: clamp(22px, 2.3vw, 34px); }
.board-list li:nth-child(2) { background: linear-gradient(90deg, rgba(190,190,205,.5), rgba(190,190,205,.12)); }
.board-list li:nth-child(3) { background: linear-gradient(90deg, rgba(205,127,50,.4), rgba(205,127,50,.1)); }
.board-list .rank { font-weight: 900; text-align: center; color: var(--red); }
.board-list img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; background: #ddd; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.board-list .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list .score { font-variant-numeric: tabular-nums; font-weight: 900; }
.board-empty { color: var(--muted); text-align: center; margin-top: 40px; font-size: 22px; }
.round-tag { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 4px 12px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: .5em; font-weight: 900; letter-spacing: 1px; }
.board-foot { display: flex; justify-content: center; padding-top: 14px; }

/* ---------- banner gốc (assets/banner.png) chiếu xen kẽ ---------- */
#screen-banner { padding: 0; background: #fff; }
#banner-img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* nút đặt vào khoảng trắng giữa ly champagne (trái) và bó hoa (phải) của banner, không đè lên hình */
.banner-cta { position: absolute; bottom: 11vh; left: 0; right: 0; display: flex; justify-content: center; }
.banner-cta .btn { font-size: clamp(26px, 2.6vw, 44px); padding: 20px 46px; }

/* ---------- hộp thoại xác nhận ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 26px; padding: 34px 44px; max-width: 760px; text-align: center;
  display: flex; flex-direction: column; gap: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.modal-title { font-size: clamp(28px, 3vw, 44px); font-weight: 900; color: var(--red); font-family: var(--serif); }
.modal-text { font-size: clamp(18px, 1.8vw, 26px); color: var(--text); line-height: 1.4; }

/* ---------- name (gọn theo chiều cao màn hình, không bao giờ cắt chữ) ---------- */
#screen-name { --key-h: clamp(36px, 7.6vh, 80px); justify-content: flex-start; overflow-y: auto; padding: 14px 30px; gap: 0; }
.name-wrap { margin: auto 0; width: 100%; display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 1.6vh, 20px); }
#screen-name .h2 { font-size: clamp(22px, min(4vw, 5vh), 48px); }
.name-box input { width: min(80vw, 900px); font-size: clamp(26px, min(5vw, 6vh), 64px); text-align: center; padding: .15em .4em;
  border-radius: var(--radius); border: 4px solid var(--card2); background: #fff; color: #111; font-weight: 800;
  text-transform: uppercase; letter-spacing: 2px; outline: none; }
.name-box input:focus { border-color: var(--red); }
.kbd { display: flex; flex-direction: column; gap: clamp(5px, 1vh, 10px); align-items: center; }
.kbd-row { display: flex; gap: clamp(4px, .8vw, 10px); align-items: center; }
.key { min-width: clamp(34px, min(5.4vw, 7.6vh), 84px); height: var(--key-h); padding: 0 4px; font-size: clamp(16px, min(2.6vw, 3.8vh), 34px); font-weight: 700;
  border-radius: 14px; border: 0; background: var(--card); color: var(--text); cursor: pointer; box-shadow: 0 5px 0 var(--card2); }
.key:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--card2); }
.key.wide { min-width: clamp(110px, min(16vw, 22vh), 240px); }
.key.space { min-width: clamp(200px, min(30vw, 48vh), 520px); }
.key.accent { background: var(--red); color: #fff; box-shadow: 0 5px 0 var(--red-dark); }
/* nút Quay lại / Tiếp tục nằm cùng hàng phím cách */
.kbd-row .btn { height: var(--key-h); padding: 0 clamp(12px, 1.8vw, 28px); font-size: clamp(15px, min(1.8vw, 3.2vh), 26px);
  border-radius: 14px; white-space: nowrap; box-shadow: 0 5px 0 var(--red-dark); }
.kbd-row .btn-ghost { box-shadow: 0 5px 0 var(--card2); }
.kbd-row .btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--red-dark); }
.kbd-row .btn-ghost:active { box-shadow: 0 1px 0 var(--card2); }

/* ---------- avatar ---------- */
.avatar-stage { position: relative; flex: none; height: 100%; aspect-ratio: 16/9; border-radius: 26px; overflow: hidden;
  background: #000; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.cam-note { position: absolute; left: 14px; bottom: 12px; padding: 6px 14px; border-radius: 10px; background: rgba(0,0,0,.55);
  color: #fff; font-weight: 700; font-size: 18px; pointer-events: none; }
.cam-note.ok { color: #4ade80; }
.cam-note.bad { color: #ffb4b4; }
.cam-note:empty { display: none; }
#avatar-cam { width: 100%; height: 100%; display: block; }
.countdown { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 220px;
  font-weight: 900; color: #fff; text-shadow: 0 10px 40px rgba(0,0,0,.7); pointer-events: none; }
.shutter { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.shutter.go { animation: shutter .45s ease-out; }
@keyframes shutter { 0% { opacity: 1; } 100% { opacity: 0; } }

/* photo booth: camera live (trái) + bảng chọn phụ kiện (phải) */
.booth { display: flex; gap: 24px; align-items: stretch; width: min(96vw, 1700px); height: min(56vh, 560px); }
.booth-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; background: var(--card); border-radius: 26px; padding: 16px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { padding: 10px 18px; border-radius: 14px; background: #fff; border: 3px solid var(--card2); font-weight: 800;
  font-size: clamp(16px, 1.4vw, 22px); cursor: pointer; color: var(--text); }
.tab.active { background: var(--red); color: #fff; border-color: var(--red); }
.tiles { display: flex; gap: 12px; flex-wrap: wrap; overflow-y: auto; align-content: flex-start; flex: 1; min-height: 0; }
.tile { width: 108px; display: flex; flex-direction: column; align-items: center; gap: 3px; background: #fff; border: 3px solid var(--card2);
  border-radius: 16px; padding: 5px; cursor: pointer; }
.tile.active { border-color: var(--red); background: #fff0f2; }
.tile canvas { width: 84px; height: 84px; display: block; }
.tile span { font-size: 13px; font-weight: 700; text-align: center; }

/* ---------- play ---------- */
/* màn hình chơi: cột trái = tên + tỉ số + vùng game (co theo cả rộng lẫn cao), cột phải = camera + độ nhạy */
#screen-play { flex-direction: row; align-items: stretch; justify-content: center; gap: 20px; padding: 14px 24px; }
.play-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.play-top { width: 100%; display: flex; align-items: center; gap: 20px; }
.player-chip { display: flex; align-items: center; gap: 14px; font-size: clamp(20px, min(2.4vw, 3.6vh), 36px); font-weight: 800; white-space: nowrap; }
.player-chip img { width: clamp(44px, 7vh, 70px); height: clamp(44px, 7vh, 70px); border-radius: 50%; object-fit: cover; border: 4px solid var(--red); background: #ddd; }
.play-hint { flex: 1; font-size: clamp(16px, min(2vw, 3vh), 30px); color: var(--red); text-align: center; font-weight: 700; min-height: 1.4em; }
.pip-col { flex: none; align-self: flex-start; display: flex; flex-direction: column; gap: 6px; width: 200px; }
.pip-col .tracker-pip canvas { width: 200px; height: 267px; }
/* thanh trượt độ nhạy 5 mức dưới khung camera */
.sens-ctl { background: var(--card); border-radius: 12px; padding: 6px 8px 5px; }
.sens-title { font-size: 12px; font-weight: 800; color: var(--red); text-align: center; letter-spacing: .3px; }
.sens-range { width: 100%; height: 30px; margin: 0; accent-color: var(--red); cursor: pointer; }
.sens-ticks { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--muted); padding: 0 6px; margin-top: -4px; }
.sens-name { font-size: 12px; font-weight: 700; text-align: center; white-space: nowrap; }
.mini-meter { position: relative; height: 8px; border-radius: 4px; background: #fff; border: 1px solid var(--card2); overflow: hidden; margin-top: 4px; }
.mini-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--green); }
.mini-thr { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--red); left: 33%; }
.admin-col .sens-range { height: 40px; }
.admin-col .sens-name { font-size: 18px; color: var(--red); }
.tracker-pip { position: relative; }
.tracker-pip canvas { width: 150px; height: 200px; border-radius: 14px; background: #000; border: 3px solid var(--card2); display: block; }
.pip-label { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 14px; padding: 4px; color: #fff;
  background: rgba(0,0,0,.6); border-radius: 0 0 12px 12px; }
.pip-label.ok { color: #4ade80; }
.pip-label.bad { color: #f87171; }

/* vùng game 1200:320 — rộng tối đa theo cột, nhưng không cao quá phần màn hình còn lại (chừa ~210px cho tên/tỉ số/lề) */
.game-wrap { position: relative; width: min(100%, calc((100vh - 210px) * 3.75)); }
#game { width: 100%; aspect-ratio: 1200 / 320; display: block; border-radius: 22px; background: #f7f7f7; border: 3px solid var(--card2);
  box-shadow: 0 16px 40px rgba(0,0,0,.12); touch-action: manipulation; }
#game.night { background: #202124; }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.overlay-card { pointer-events: auto; background: rgba(20,20,28,.88); color: #fff; border-radius: 26px; text-align: center;
  padding: clamp(12px, 2.4vh, 26px) clamp(20px, 3vw, 46px); display: flex; flex-direction: column; gap: clamp(5px, 1.1vh, 12px);
  align-items: center; backdrop-filter: blur(6px); box-shadow: 0 20px 60px rgba(0,0,0,.5); max-width: 96%; }
.overlay-card .big { font-size: clamp(26px, min(4.4vw, 6vh), 64px); font-weight: 900; color: var(--gold); line-height: 1.1; }
.overlay-card .mid { font-size: clamp(17px, min(2.4vw, 3.2vh), 34px); font-weight: 700; }
.overlay-card .mid.ok { color: #4ade80; }
.overlay-card .small { color: #c9c9d4; font-size: clamp(12px, 1.8vh, 16px); }
.overlay-card .btn { font-size: clamp(17px, min(2.2vw, 3vh), 30px); padding: clamp(10px, 1.6vh, 22px) clamp(18px, 2.4vw, 44px); }
.overlay-card .row { gap: clamp(10px, 1.5vw, 20px); }
.score-line { font-size: clamp(20px, min(3vw, 4.4vh), 44px); }
.score-line b { color: var(--gold); font-size: 1.4em; }

/* ---------- admin ---------- */
#screen-admin { justify-content: flex-start; overflow: auto; }
.admin-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; width: min(96vw, 1500px); }
.admin-col { display: flex; flex-direction: column; gap: 18px; }
.admin-col label { display: flex; flex-direction: column; gap: 6px; font-size: 20px; font-weight: 600; }
.admin-col label small { color: var(--muted); font-weight: 400; font-size: 15px; }
.admin-col select, .admin-col input[type=text] { font-size: 20px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--card2); background: #fff; color: #111; }
.admin-col input[type=range] { width: 100%; height: 40px; }
.admin-col input[type=checkbox] { width: 26px; height: 26px; }
#roi-editor { width: 100%; border-radius: 14px; background: #000; cursor: crosshair; touch-action: none; }
.pip-inline canvas { width: 180px; height: 240px; border-radius: 12px; background: #000; border: 2px solid var(--card2); display: block; }
.jump-test { font-size: 22px; background: var(--card); border-radius: 16px; padding: 18px 26px; text-align: center; transition: background .1s; }
.jump-test.flash { background: var(--green); color: #fff; }
.jump-test b { font-size: 44px; }
/* thanh đo độ vọt (tinh chỉnh độ nhạy) */
.meter-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.meter { position: relative; width: 46px; height: 240px; border-radius: 12px; background: #fff; border: 2px solid var(--card2); overflow: hidden; }
.meter-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(180deg, #9be0ae, var(--green)); }
.meter-thr { position: absolute; left: 0; right: 0; height: 4px; background: var(--red); bottom: 33%; }
.meter-peak { position: absolute; left: 0; right: 0; height: 4px; background: var(--gold); bottom: 0; opacity: 0; transition: opacity .3s; }
.btn.calibrating { background: var(--gold); color: #111; box-shadow: 0 5px 0 #b98d12; animation: pulse 1s ease-in-out infinite; }
.hint.left { text-align: left; font-size: 15px; }
.gifts-line { font-size: clamp(18px, 2vw, 28px); color: var(--gold); font-weight: 700; }
#ready-sub:empty { display: none; }

/* ---------- chơi theo đội ---------- */
.btn-team { font-size: clamp(15px, 1.4vw, 22px); padding: 10px 22px; }
.team-inputs { display: flex; gap: clamp(14px, 2vw, 30px); flex-wrap: wrap; justify-content: center; align-items: flex-end; }
.team-field { display: flex; flex-direction: column; gap: 6px; align-items: center; font-weight: 900; font-size: clamp(16px, 2.2vh, 24px); }
.team-field.t1 { color: #c41230; }
.team-field.t2 { color: #2f80ed; }
.team-input { width: min(34vw, 420px); font-size: clamp(22px, min(3.2vw, 4.6vh), 44px); text-align: center; padding: .15em .4em;
  border-radius: var(--radius); border: 4px solid var(--card2); background: #fff; color: #111; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px; outline: none; }
.team-input.active, .team-input:focus { border-color: currentColor; box-shadow: 0 0 0 4px rgba(0,0,0,.06); }
.team-size { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.team-size-label { font-weight: 800; font-size: clamp(14px, 1.8vh, 20px); color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper b { font-size: clamp(30px, min(3.4vw, 5vh), 52px); min-width: 1.4em; text-align: center; font-variant-numeric: tabular-nums; }
.stepper .step { width: clamp(46px, 6vh, 64px); height: clamp(46px, 6vh, 64px); padding: 0; font-size: clamp(24px, 3.4vh, 36px); border-radius: 50%; }
.team-bar { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 2vw, 30px); width: 100%;
  background: var(--card); border-radius: 16px; padding: 6px 20px; font-size: clamp(18px, 2vw, 30px); font-weight: 900; }
.team-bar .tb { padding: 4px 16px; border-radius: 12px; white-space: nowrap; }
.team-bar .tb.t1 { color: #c41230; }
.team-bar .tb.t2 { color: #2f80ed; }
.team-bar .tb.turn { background: #fff; box-shadow: inset 0 0 0 3px currentColor; }
.team-bar .tb-mid { color: var(--muted); font-size: .7em; white-space: nowrap; }
#screen-team-result { justify-content: center; }
.result-card { display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 2vh, 20px); width: min(96vw, 1200px); }
.result-title { font-family: var(--serif); font-size: clamp(36px, min(6vw, 9vh), 96px); font-weight: 900; color: var(--red); text-align: center; line-height: 1.05; }
.result-totals { display: flex; gap: clamp(14px, 2.5vw, 30px); align-items: stretch; width: 100%; justify-content: center; }
.rt { flex: 1; max-width: 460px; background: var(--card); border-radius: 26px; padding: clamp(12px, 2vh, 20px) 26px; text-align: center; }
.rt.t1 .rt-name { color: #c41230; }
.rt.t2 .rt-name { color: #2f80ed; }
.rt-name { font-size: clamp(20px, 2.4vw, 36px); font-weight: 900; }
.rt-score { font-size: clamp(40px, min(6vw, 9vh), 96px); font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
.rt.winner { background: linear-gradient(180deg, rgba(255,204,51,.5), rgba(255,204,51,.12)); box-shadow: 0 0 0 5px var(--gold); }
.rt ol { list-style: none; margin: 8px 0 0; padding: 0; font-size: clamp(14px, 1.5vw, 22px); font-weight: 700;
  display: flex; flex-direction: column; gap: 3px; }
.rt-vs { align-self: center; font-size: clamp(24px, 3vw, 48px); font-weight: 900; color: var(--muted); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: var(--text); color: #fff;
  padding: 16px 28px; border-radius: 16px; font-size: 22px; box-shadow: 0 10px 40px rgba(0,0,0,.3); z-index: 99; }
