:root {
  --blue: #2f7cf6;
  --blue-d: #1d5fd8;
  --blue-dd: #154bb5;
  --blue-l: #e8f0ff;
  --navy: #1846a3;
  --yellow: #ffe23d;
  --green: #22c27a;
  --green-d: #17a565;
  --red: #e5484d;
  --x: #2a6fe0;
  --o: #e2454f;
  --text: #1f2a3c;
  --muted: #6b7a90;
  --bg: #ffffff;
  --card: #f4f7fc;
  --line: #dfe5ee;
  --board: #e9ecf0;
  --grid: #cfd5dd;
  --shadow: 0 4px 0 #1b56c4;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #e8eef8; --muted: #9aa8bd; --bg: #10172a; --card: #1a2440; --line: #2a3658;
    --board: #1b2440; --grid: #33406a; --blue-l: #1d2b52;
  }
}
:root[data-theme="dark"] {
  --text: #e8eef8; --muted: #9aa8bd; --bg: #10172a; --card: #1a2440; --line: #2a3658;
  --board: #1b2440; --grid: #33406a; --blue-l: #1d2b52;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: #cfdcf3; color: var(--text); overscroll-behavior: none;
}
button { font-family: inherit; cursor: pointer; border: 0; }
input { font-family: inherit; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

#app {
  position: relative; max-width: 480px; margin: 0 auto; height: 100vh; height: 100dvh;
  background: var(--bg); overflow: hidden; box-shadow: 0 0 40px rgba(0,0,0,.15);
}
.screen { position: absolute; inset: 0; display: none; flex-direction: column; }
.screen.active { display: flex; }

/* ---------- avatar ---------- */
.avatar {
  --s: 44px; width: var(--s); height: var(--s); border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: calc(var(--s) * .55); line-height: 1;
  background: #ddd; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); user-select: none;
}
.avatar.md { --s: 40px; }
.avatar.lg { --s: 108px; border-width: 5px; }
.avatar.xl { --s: 96px; border-width: 4px; }
.avatar.ring { box-shadow: 0 0 0 3px rgba(255,255,255,.25), 0 6px 18px rgba(0,0,0,.2); }
.avatar.placeholder {
  background: #eceef1 radial-gradient(circle at 50% 38%, #fff 0 22%, transparent 23%) ;
  position: relative; overflow: hidden;
}
.avatar.placeholder::after {
  content: ''; position: absolute; width: 70%; height: 45%; bottom: -8%; left: 15%;
  background: #fff; border-radius: 50% 50% 0 0;
}
.avatar.searching { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

/* ---------- buttons ---------- */
.btn-pill {
  display: block; width: 100%; padding: 15px 18px; border-radius: 999px;
  background: linear-gradient(#4b8ff9, var(--blue)); color: #fff; font-weight: 800; font-size: 17px;
  letter-spacing: .5px; box-shadow: var(--shadow); transition: transform .08s, box-shadow .08s;
}
.btn-pill:active { transform: translateY(3px); box-shadow: 0 1px 0 #1b56c4; }
.btn-pill.big { padding: 22px 18px; font-size: 22px; }
.btn-pill.danger { background: linear-gradient(#f06a6e, var(--red)); box-shadow: 0 4px 0 #b9343a; margin: 22px 0 8px; }
.btn-pill:disabled { opacity: .6; }
.btn-ghost {
  background: rgba(255,255,255,.12); color: #e9f1ff; font-weight: 600; padding: 11px 32px;
  border-radius: 8px; font-size: 15px; margin-top: 10px;
}
.btn-link { background: none; color: var(--muted); margin-top: 12px; font-size: 14px; padding: 6px; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.18);
  color: #fff; font-size: 19px; display: grid; place-items: center;
}
.text-btn {
  min-width: 40px; height: 34px; padding: 0 12px; border-radius: 10px; background: rgba(255,255,255,.18);
  color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .3px;
}
.icon-btn.dark { background: var(--card); color: var(--text); font-size: 15px; width: 34px; height: 34px; }
.badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}

/* ---------- auth ---------- */
#screen-auth { background: linear-gradient(#3a8dff, #1559f0); overflow-y: auto; }
.auth-wrap { padding: 36px 24px; margin: auto 0; color: #fff; }
.auth-title { text-align: center; font-size: 24px; font-weight: 800; margin: 8px 0 22px; letter-spacing: 1px; }
.auth-tabs { display: flex; background: rgba(0,0,0,.15); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.auth-tab { flex: 1; padding: 10px; border-radius: 9px; background: none; color: #dbe8ff; font-weight: 700; font-size: 15px; }
.auth-tab.active { background: #fff; color: var(--blue-d); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { font-size: 13px; font-weight: 600; color: #e3edff; display: flex; flex-direction: column; gap: 5px; }
.auth-form input {
  padding: 13px 14px; border-radius: 10px; border: 2px solid transparent; font-size: 16px; outline: none;
  background: #fff; color: #1f2a3c;
}
.auth-form input:focus { border-color: var(--yellow); }
.auth-form .btn-pill { margin-top: 8px; background: linear-gradient(#ffe866, #ffcf1f); color: #173d8f; box-shadow: 0 4px 0 #d39b00; }
.auth-note { text-align: center; font-size: 13px; color: #dbe8ff; margin: 4px 0 0; }
.auth-error { color: #ffd0d0; background: rgba(160,0,0,.25); border-radius: 8px; padding: 0; text-align: center; font-size: 14px; margin: 14px 0 0; }
.auth-error:not(:empty) { padding: 9px 12px; }
.modal .auth-error { color: var(--red); background: #ffecec; }

/* ---------- logo ---------- */
.logo-shield { width: 190px; height: 205px; margin: 0 auto; }
.logo-shield.small { width: 120px; height: 130px; }
.logo-shield svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 10px rgba(21,75,181,.25)); }

/* ---------- home ---------- */
#screen-home { background: var(--bg); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; }
.me-mini { display: flex; align-items: center; gap: 8px; }
.me-info { min-width: 90px; }
.me-elo { font-size: 13px; color: var(--blue); font-weight: 700; }
.me-elo b { color: #f0a500; }
.elo-bar { height: 7px; border-radius: 4px; background: var(--blue-l); overflow: hidden; margin-top: 4px; }
.elo-bar span { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 4px; transition: width .5s; }
.coins { display: flex; align-items: center; gap: 6px; background: var(--card); border-radius: 999px; padding: 4px 4px 4px 10px; font-weight: 700; }
.coin-icon { color: #f6b500; font-size: 18px; text-shadow: 0 0 0 #c98d00; }
.coin-plus { width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 800; font-size: 18px; line-height: 1; }

.home-body { flex: 1; overflow-y: auto; padding: 0 22px 16px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.hero { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.hero-side { width: 64px; display: flex; justify-content: center; }
.hero-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 22px;
  color: var(--text); text-align: center;
}
.hero-chip b { font-size: 18px; }
.hero-chip small { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .5px; }
.dot-online { width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(34,194,122,.2); }
.me-name-line { text-align: center; font-weight: 700; margin: 6px 0 18px; color: var(--muted); }
.play-buttons { display: flex; flex-direction: column; gap: 16px; }

.pane-title { text-align: center; color: var(--blue); font-size: 20px; margin: 12px 0 2px; font-weight: 800; }
.pane-sub { text-align: center; color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.list li {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--card);
}
.list li.me { outline: 2px solid var(--blue); }
.lb-pos { width: 30px; text-align: center; font-weight: 800; color: var(--muted); font-size: 15px; }
.lb-main { flex: 1; min-width: 0; }
.lb-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-rank { font-size: 12px; font-weight: 600; }
.lb-elo { font-weight: 800; color: #e09b00; }
.h-res { width: 54px; text-align: center; font-weight: 800; font-size: 13px; border-radius: 8px; padding: 6px 0; color: #fff; flex: none; }
.h-res.win { background: var(--green); } .h-res.loss { background: var(--red); } .h-res.draw { background: #8d9aa8; }
.h-delta { font-weight: 800; } .h-delta.up { color: var(--green-d); } .h-delta.down { color: var(--red); }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }

.profile-card { text-align: center; padding: 14px 0 6px; }
.profile-card .avatar { margin: 0 auto; }
.profile-card h2 { margin: 10px 0 0; font-size: 21px; }
.profile-card p { margin: 2px 0 8px; }
.rank-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-weight: 800; color: #fff; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.stat { background: var(--card); border-radius: 12px; padding: 10px 6px; text-align: center; }
.stat b { display: block; font-size: 19px; color: var(--blue); }
.stat small { font-size: 11px; color: var(--muted); font-weight: 600; }
.section-title { font-size: 15px; margin: 18px 0 8px; color: var(--text); }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; justify-items: center; }
.avatar-grid button { background: none; padding: 0; border-radius: 50%; }
.avatar-grid button.sel .avatar { box-shadow: 0 0 0 3px var(--blue); }
.rank-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--card); border-radius: 10px; font-weight: 600; }
.rank-list li.cur { outline: 2px solid var(--blue); }
.rank-list .ri { font-size: 20px; width: 26px; text-align: center; }
.rank-list .rn { flex: 1; }
.rank-list .rm { color: var(--muted); font-size: 13px; }
.rules p { margin: 4px 0; font-size: 14px; color: var(--muted); line-height: 1.5; }

.bottom-nav { display: flex; border-top: 1px solid var(--line); background: var(--bg); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav button {
  flex: 1; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px;
  font-size: 10px; font-weight: 700; color: var(--muted);
}
.nav-ico { font-size: 22px; filter: grayscale(.9); opacity: .7; }
.bottom-nav button.active { color: var(--blue); background: var(--blue-l); }
.bottom-nav button.active .nav-ico { filter: none; opacity: 1; }

/* ---------- search ---------- */
.blue-screen { background: linear-gradient(#338cff, #1559f0); color: #fff; }
.search-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 16px; }
.search-title { font-size: 21px; font-weight: 600; margin: 0; letter-spacing: .3px; text-align: center; }
.search-count { font-size: 38px; color: var(--yellow); font-weight: 600; margin: 4px 0 70px; min-height: 48px; }
.versus { display: flex; align-items: center; justify-content: center; gap: 34px; width: 100%; }
.vs-player { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 120px; }
.vs-name { font-weight: 600; font-size: 15px; text-transform: uppercase; max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 8px; }
.vs-elo { color: var(--yellow); font-weight: 700; font-size: 15px; }
.vs-text { font-size: 30px; font-weight: 800; font-style: italic; margin-bottom: 40px; text-shadow: 0 3px 8px rgba(0,0,0,.25); }
.vs-text span { color: #7fd0ff; margin: 0 -2px; }
.search-hint { min-height: 22px; color: #d4e4ff; font-size: 14px; margin: 60px 0 10px; text-align: center; }
.found .vs-player:last-child .avatar { animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }

/* ---------- game ---------- */
#screen-game { background: var(--bg); }
.game-head {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 12px;
  background: linear-gradient(#3a8dff, var(--blue)); color: #fff;
}
.game-mode { font-weight: 800; letter-spacing: .5px; font-size: 15px; }
.players-row { display: flex; align-items: stretch; gap: 6px; padding: 10px 10px 4px; }
.pcard {
  position: relative; flex: 1; display: flex; align-items: center; gap: 7px; padding: 7px 8px 11px; border-radius: 14px;
  background: var(--card); border: 2px solid transparent; min-width: 0; transition: border-color .2s, background .2s;
}
.pcard.right { flex-direction: row-reverse; text-align: right; }
.pcard.turn { border-color: var(--blue); background: var(--blue-l); }
.pcard.offline { opacity: .55; }
.pinfo { min-width: 0; flex: 1; }
.pname { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pelo { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psym { font-weight: 900; font-size: 20px; width: 20px; text-align: center; }
.psym.X { color: var(--x); } .psym.O { color: var(--o); }
.ptimer { position: absolute; left: 10px; right: 10px; bottom: 4px; height: 4px; border-radius: 2px; background: rgba(0,0,0,.07); overflow: hidden; }
.ptimer span { display: block; height: 100%; width: 0; background: var(--green); }
.ptimer span.warn { background: var(--red); }
.score-mini { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 2px; }
.score-mini small { font-size: 9px; font-weight: 700; color: var(--muted); }
.score-mini b { font-size: 18px; white-space: nowrap; }
.bubble {
  position: absolute; top: calc(100% + 4px); left: 6px; z-index: 6; max-width: 190px; padding: 7px 11px; border-radius: 12px;
  background: #fff; color: #1f2a3c; font-size: 13px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.18);
  word-wrap: break-word; animation: pop .25s ease;
}
.pcard.right .bubble { left: auto; right: 6px; }
.turn-status { text-align: center; font-weight: 700; font-size: 14px; color: var(--blue); min-height: 22px; padding: 2px 8px; }
.turn-status.wait { color: var(--muted); }
.board-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 4px 6px 10px; min-height: 0; }
.board {
  --cell: 28px; display: grid; grid-template-columns: repeat(var(--n, 15), var(--cell));
  background: var(--board); border: 1px solid var(--grid); border-radius: 6px; overflow: hidden; touch-action: manipulation;
}
.cell {
  width: var(--cell); height: var(--cell); border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid);
  display: grid; place-items: center; font-weight: 900; font-size: calc(var(--cell) * .72); line-height: 1; user-select: none;
  position: relative;
}
.board.my-turn .cell:not(.X):not(.O):hover { background: rgba(47,124,246,.12); cursor: pointer; }
.cell.X::before {
  content: ''; width: 62%; height: 62%;
  background:
    linear-gradient(45deg, transparent 42%, var(--x) 42%, var(--x) 58%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, var(--x) 42%, var(--x) 58%, transparent 58%);
}
.cell.O::before { content: ''; width: 56%; height: 56%; border-radius: 50%; border: calc(var(--cell) * .1) solid var(--o); box-sizing: border-box; }
.cell.last { background: rgba(255,214,0,.35); }
.cell.win { background: var(--navy); }
.cell.win.X::before {
  background:
    linear-gradient(45deg, transparent 42%, #9ec5ff 42%, #9ec5ff 58%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, #9ec5ff 42%, #9ec5ff 58%, transparent 58%);
}
.cell.win.O::before { border-color: #ffb3b8; }
.cell.placed::before { animation: place .18s ease-out; }
@keyframes place { from { transform: scale(.3); opacity: .2; } }

/* ---------- result ---------- */
.result { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; pointer-events: none; }
.result > * { pointer-events: auto; }
.result-top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 16px 16px 14px;
  background: linear-gradient(#1c4fb0, #1846a3); color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.25); animation: slideDown .35s ease;
}
.result-top h2 { margin: 0; font-size: 27px; color: var(--yellow); font-weight: 800; letter-spacing: .5px; }
.result-top h2.lose { color: #ff9a9a; }
.result-top h2.draw { color: #d6e4ff; }
.result-top p { margin: 4px 0 0; font-size: 14px; color: #d4e2ff; }
.result-gain { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.chip { background: rgba(255,255,255,.15); border-radius: 999px; padding: 4px 10px; font-weight: 800; font-size: 13px; white-space: nowrap; }
.result-score {
  margin: auto auto 12px; display: flex; align-items: center; gap: 10px; background: #2d3a55; color: #fff;
  padding: 6px 8px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.3); animation: pop .4s ease;
}
.rs-mid { display: flex; flex-direction: column; align-items: center; padding: 0 10px; }
.rs-mid small { font-size: 10px; color: #b9c6dc; font-weight: 700; }
.rs-mid b { font-size: 24px; }
.result-bottom { background: var(--navy); padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); animation: slideUp .35s ease; }
.result-msg { color: #d4e2ff; text-align: center; margin: 0 0 10px; font-size: 14px; min-height: 0; }
.result-msg:empty { display: none; }
.btn-green {
  width: 100%; padding: 16px; border-radius: 10px; background: linear-gradient(#2fd38a, var(--green)); color: #fff;
  font-weight: 800; font-size: 18px; box-shadow: 0 4px 0 var(--green-d);
}
.btn-green:disabled { opacity: .7; }
.btn-green.pulse { animation: glow 1s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 4px 0 var(--green-d), 0 0 0 6px rgba(47,211,138,.35); } }
.row2 { display: flex; gap: 12px; margin-top: 12px; }
.btn-white { flex: 1; padding: 14px; border-radius: 10px; background: #fff; color: var(--blue-dd); font-weight: 800; font-size: 15px; }
@keyframes slideDown { from { transform: translateY(-100%); } }
@keyframes slideUp { from { transform: translateY(100%); } }
.btn-show-result {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 9; padding: 12px 22px; border-radius: 999px;
  background: var(--navy); color: #fff; font-weight: 800; box-shadow: 0 6px 18px rgba(0,0,0,.3);
}

/* ---------- chat ---------- */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; height: 62%; background: var(--bg);
  border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.25); display: flex; flex-direction: column;
  animation: slideUp .25s ease; padding-bottom: env(safe-area-inset-bottom);
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 78%; padding: 8px 12px; border-radius: 14px; background: var(--card); font-size: 14px; word-wrap: break-word; align-self: flex-start; }
.msg.mine { align-self: flex-end; background: var(--blue); color: #fff; }
.msg small { display: block; font-size: 10px; opacity: .7; font-weight: 700; margin-bottom: 1px; }
.quick-chat { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 0; scrollbar-width: none; }
.quick-chat button { flex: none; padding: 7px 11px; border-radius: 999px; background: var(--blue-l); color: var(--blue-d); font-weight: 600; font-size: 13px; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px 12px; }
.chat-form input { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 16px; outline: none; background: var(--card); color: var(--text); }
.chat-form button { padding: 0 18px; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 700; }

/* ---------- modal ---------- */
.modal { position: absolute; inset: 0; z-index: 50; background: rgba(10,25,60,.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { width: 100%; max-width: 360px; background: var(--bg); border-radius: 20px; padding: 22px 20px 14px; text-align: center; animation: pop .25s ease; }
.modal-box h3 { margin: 0 0 4px; color: var(--blue); font-size: 20px; font-weight: 800; }
.modal-box .btn-pill { margin-top: 14px; }
.level-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.level-grid button {
  padding: 12px 6px; border-radius: 14px; background: var(--card); color: var(--text); font-weight: 700; font-size: 15px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px solid transparent;
}
.level-grid button span { font-size: 26px; }
.level-grid button.active { border-color: var(--blue); background: var(--blue-l); color: var(--blue-d); }
.seg { display: flex; background: var(--card); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; padding: 9px 4px; border-radius: 9px; background: none; color: var(--muted); font-weight: 700; font-size: 13px; }
.seg button.active { background: var(--blue); color: #fff; }
.code-form { display: flex; gap: 8px; }
.code-form input { flex: 1; min-width: 0; padding: 12px; font-size: 22px; letter-spacing: 6px; text-align: center; border-radius: 12px; border: 2px solid var(--line); outline: none; background: var(--card); color: var(--text); font-weight: 800; }
.code-form .btn-pill { width: auto; margin: 0; padding: 0 20px; }
.room-code { font-size: 42px; font-weight: 800; letter-spacing: 8px; color: var(--blue); margin: 4px 0; user-select: all; }
.waiting-dots::after { content: ''; animation: dots 1.5s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

.toast {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 100; max-width: 90%;
  background: rgba(20,30,50,.92); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
  text-align: center; animation: pop .2s ease;
}

@media (max-height: 640px) {
  .logo-shield { width: 140px; height: 150px; }
  .btn-pill.big { padding: 17px; font-size: 20px; }
  .search-count { margin-bottom: 36px; }
  .search-hint { margin-top: 30px; }
}
