*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --teal:#00B4A0; --teal-dark:#007A6E; --teal-light:#E0F7F5;
  --yellow:#FFD600; --ink:#0A1628; --red:#E8002D; --orange:#FF6B00;
  --white:#fff; --gray:#f5f5f5; --r:14px;
}
body { font-family:'Inter',system-ui,sans-serif; background:#f0f0f0; min-height:100vh; display:flex; justify-content:center; align-items:flex-start; }
.app { width:100%; max-width:430px; min-height:100vh; background:var(--white); overflow-x:hidden; }
.screen { display:none; }
.screen.active { display:block; }

/* topbar */
.topbar { background:var(--teal); padding:1rem 1.25rem; display:flex; align-items:center; gap:10px; }
.topbar-icon { width:36px; height:36px; background:var(--yellow); border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.topbar-icon svg { width:20px; height:20px; }
.topbar-title { color:#fff; font-size:16px; font-weight:600; flex:1; }
.topbar-sub { color:rgba(255,255,255,0.75); font-size:11px; margin-top:1px; }
.topbar-right { margin-left:auto; display:flex; align-items:center; gap:8px; }
.user-avatar { width:30px; height:30px; border-radius:50%; object-fit:cover; border:2px solid var(--yellow); }
.user-avatar-placeholder { width:30px; height:30px; border-radius:50%; background:var(--yellow); color:var(--ink); display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:600; flex-shrink:0; }
.signout-btn { background:rgba(255,255,255,0.2); border:none; color:#fff; font-size:11px; padding:4px 8px; border-radius:20px; cursor:pointer; font-family:inherit; }

/* geo banner */
.geo { height:64px; background:var(--teal); display:flex; align-items:center; overflow:hidden; }
.geo-c { border-radius:50%; flex-shrink:0; }

/* pad */
.pad { padding:1.25rem; }
.lbl { font-size:10px; font-weight:600; letter-spacing:1.5px; text-transform:uppercase; color:var(--teal-dark); margin-bottom:6px; }

/* inputs */
input, select, textarea { width:100%; border:2px solid var(--teal); border-radius:var(--r); padding:11px 14px; font-size:15px; font-family:inherit; outline:none; color:var(--ink); background:var(--white); appearance:none; -webkit-appearance:none; }
input:focus, select:focus, textarea:focus { border-color:var(--teal-dark); }
select { background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2300B4A0' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 14px center; padding-right:36px; }

/* buttons */
.btn { display:flex; align-items:center; justify-content:center; gap:7px; width:100%; padding:13px; border-radius:var(--r); font-size:14px; font-weight:600; cursor:pointer; border:none; font-family:inherit; transition:opacity 0.15s,transform 0.1s; }
.btn:active { opacity:0.85; transform:scale(0.99); }
.btn:disabled { opacity:0.4; cursor:not-allowed; }
.btn-teal { background:var(--teal); color:#fff; }
.btn-yellow { background:var(--yellow); color:var(--ink); }
.btn-ghost { background:transparent; color:var(--teal); border:2px solid var(--teal); }
.btn-google { background:#fff; color:#3c4043; border:2px solid #dadce0; font-weight:500; }
.btn-google img { width:18px; height:18px; }

.sp { margin-top:10px; } .sp-12 { margin-top:12px; } .sp-16 { margin-top:16px; }
.sp-20 { margin-top:20px; } .sp-24 { margin-top:24px; }
.divider { height:1px; background:rgba(0,0,0,0.07); margin:0.75rem 0; }
.err { color:#A32D2D; font-size:12px; margin-top:6px; display:none; }

/* room code */
.code-box { background:var(--teal); border-radius:var(--r); padding:1.25rem; text-align:center; color:#fff; }
.code-big { font-size:44px; font-weight:600; letter-spacing:12px; color:var(--yellow); display:block; margin:4px 0; }
.code-hint { font-size:11px; opacity:0.85; }

/* chips */
.chip { display:flex; align-items:center; gap:10px; padding:9px 12px; background:var(--teal-light); border-radius:10px; margin-bottom:7px; }
.avatar { width:30px; height:30px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:600; color:#fff; flex-shrink:0; }
.chip-name { font-size:13px; font-weight:500; color:var(--ink); flex:1; }
.badge { padding:2px 8px; border-radius:20px; font-size:10px; font-weight:600; }
.badge-ready { background:#9FE1CB; color:#085041; }
.badge-waiting { background:#FAC775; color:#633806; }

/* match header */
.match-hdr { background:var(--ink); padding:1rem 1.25rem; display:flex; align-items:center; justify-content:space-between; }
.team-blk { text-align:center; flex:1; }
.team-flag { font-size:26px; display:block; }
.team-nm { font-size:10px; color:rgba(255,255,255,0.65); margin-top:3px; }
.vs-badge { background:var(--yellow); color:var(--ink); font-size:11px; font-weight:600; padding:3px 10px; border-radius:20px; }

/* steppers */
.score-pickers { display:flex; align-items:center; justify-content:center; gap:12px; margin:1.75rem 0; }
.score-col { display:flex; flex-direction:column; align-items:center; gap:6px; }
.score-flag { font-size:28px; }
.score-name { font-size:10px; color:var(--teal-dark); font-weight:600; text-align:center; max-width:70px; }
.stepper { display:flex; align-items:center; border:2px solid var(--teal); border-radius:10px; overflow:hidden; }
.step-btn { width:36px; height:46px; background:var(--teal-light); border:none; cursor:pointer; font-size:22px; color:var(--teal-dark); font-family:inherit; display:flex; align-items:center; justify-content:center; }
.step-btn:active { background:var(--teal); color:#fff; }
.step-val { width:46px; height:46px; display:flex; align-items:center; justify-content:center; font-size:26px; font-weight:600; color:var(--ink); background:#fff; }
.score-dash { font-size:30px; color:var(--teal); font-weight:600; margin:0 4px; padding-top:26px; }

/* stickers */
.sticker { border:3px solid var(--ink); border-radius:12px; overflow:hidden; margin-bottom:10px; }
.sticker-top { padding:11px 14px; display:flex; align-items:center; gap:10px; }
.sticker-num { font-size:22px; font-weight:600; color:#fff; min-width:28px; }
.sticker-info { flex:1; }
.sticker-player { font-size:13px; font-weight:600; color:#fff; }
.sticker-pred { font-size:11px; color:rgba(255,255,255,0.85); margin-top:2px; }
.sticker-bot { background:#fff; padding:8px 14px; display:flex; justify-content:space-between; align-items:center; }
.sticker-wc { font-size:9px; font-weight:600; color:var(--teal-dark); letter-spacing:1.5px; text-transform:uppercase; }
.diff-badge { padding:2px 8px; border-radius:20px; font-size:10px; font-weight:600; background:#E0F7F5; color:var(--teal-dark); }
.diff-badge.exact { background:var(--yellow); color:var(--ink); }
.diff-badge.close { background:#9FE1CB; color:#085041; }
.pts-badge { padding:2px 8px; border-radius:20px; font-size:11px; font-weight:600; background:var(--ink); color:var(--yellow); }

/* result inputs */
.result-row { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.result-row .rf { font-size:22px; }
.result-row .ri { width:54px; border:2px solid var(--teal); border-radius:8px; padding:8px; font-size:22px; font-weight:600; text-align:center; outline:none; font-family:inherit; color:var(--ink); }
.result-row .rd { font-size:22px; color:var(--teal); font-weight:600; }

/* winner */
.winner-card { background:var(--yellow); border-radius:var(--r); padding:1.25rem; text-align:center; margin-bottom:1rem; }
.winner-trophy { font-size:36px; display:block; margin-bottom:4px; }
.winner-name { font-size:22px; font-weight:600; color:var(--ink); }
.winner-sub { font-size:12px; color:#555; margin-top:3px; }

/* spinner */
.loading-wrap { display:flex; align-items:center; gap:8px; background:var(--teal-light); border-radius:20px; padding:8px 14px; margin-top:10px; }
.spin { width:14px; height:14px; border:2px solid var(--teal); border-top-color:transparent; border-radius:50%; animation:sp 0.7s linear infinite; flex-shrink:0; }
@keyframes sp { to { transform:rotate(360deg); } }
.spin-text { font-size:13px; color:var(--teal-dark); }

/* rt dot */
.rt-dot { width:8px; height:8px; border-radius:50%; background:#9FE1CB; display:inline-block; margin-right:4px; animation:pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.rank-icon { font-size:18px; min-width:26px; text-align:center; }

/* tabs */
.tabs { display:flex; border-bottom:2px solid var(--teal-light); }
.tab { flex:1; padding:12px; text-align:center; font-size:13px; font-weight:600; color:#888; cursor:pointer; border-bottom:3px solid transparent; margin-bottom:-2px; }
.tab.active { color:var(--teal-dark); border-bottom-color:var(--teal); }
.tab-content { display:none; }
.tab-content.active { display:block; }

/* leaderboard */
.lb-row { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px; margin-bottom:6px; background:var(--gray); }
.lb-row.me { background:var(--teal-light); }
.lb-rank { font-size:18px; min-width:28px; text-align:center; }
.lb-name { flex:1; font-size:13px; font-weight:500; color:var(--ink); }
.lb-pts { font-size:16px; font-weight:600; color:var(--teal-dark); }
.lb-sub { font-size:10px; color:#888; }

/* history match card */
.hist-card { border:2px solid var(--ink); border-radius:10px; overflow:hidden; margin-bottom:10px; }
.hist-hdr { background:var(--ink); padding:8px 12px; display:flex; align-items:center; justify-content:space-between; }
.hist-match { font-size:12px; font-weight:600; color:#fff; }
.hist-score { font-size:14px; font-weight:600; color:var(--yellow); }
.hist-body { padding:8px 12px; background:#fff; }
.hist-pred-row { display:flex; align-items:center; justify-content:space-between; padding:4px 0; border-bottom:1px solid #f0f0f0; font-size:12px; }
.hist-pred-row:last-child { border-bottom:none; }

/* my rooms */
.room-card { border:2px solid var(--teal-light); border-radius:var(--r); padding:12px 14px; margin-bottom:10px; display:flex; align-items:center; gap:12px; }
.room-card-flags { font-size:20px; line-height:1; }
.room-card-info { flex:1; }
.room-card-name { font-size:13px; font-weight:600; color:var(--ink); }
.room-card-sub { font-size:11px; color:#888; margin-top:2px; }
.status-pill { padding:2px 8px; border-radius:20px; font-size:10px; font-weight:600; }
.status-waiting { background:#FAC775; color:#633806; }
.status-active { background:#9FE1CB; color:#085041; }
.status-done { background:#E0F7F5; color:var(--teal-dark); }
.btn-sm { padding:7px 14px; border-radius:8px; font-size:12px; font-weight:600; cursor:pointer; border:none; font-family:inherit; background:var(--teal); color:#fff; white-space:nowrap; }

/* match list cards (NEW — for multi-match) */
.match-list-card { border:2px solid var(--teal-light); border-radius:var(--r); padding:14px; margin-bottom:10px; cursor:pointer; transition:border-color 0.15s; }
.match-list-card:active { border-color:var(--teal); }
.match-list-card.status-needpredict { border-color:var(--yellow); background:#FFFBEA; }
.match-list-card.status-predicted { border-color:var(--teal-light); }
.match-list-card.status-finished { border-color:#e0e0e0; background:#fafafa; }
.mlc-top { display:flex; align-items:center; justify-content:space-between; }
.mlc-teams { font-size:14px; font-weight:600; color:var(--ink); }
.mlc-flags { font-size:18px; }
.mlc-status { margin-top:6px; display:flex; align-items:center; gap:6px; }
.mlc-pill { font-size:10px; font-weight:600; padding:3px 9px; border-radius:20px; }
.mlc-pill.need { background:var(--yellow); color:var(--ink); }
.mlc-pill.done { background:#9FE1CB; color:#085041; }
.mlc-pill.over { background:#E0F7F5; color:var(--teal-dark); }
.mlc-sub { font-size:11px; color:#888; }
.empty-state { text-align:center; padding:2.5rem 0; }
.empty-state .es-icon { font-size:48px; margin-bottom:10px; }
.empty-state .es-text { font-size:14px; color:#666; }

@media (max-width:430px) { body { background:var(--white); } }
