/* ZOLO web lobby: the app lobby's look (near-white blue pages, white cards, navy text, flat blue pills), Be Vietnam Pro. */
@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-display: swap; src: url("fonts/BeVietnamPro-400.woff2") format("woff2"); }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 500; font-display: swap; src: url("fonts/BeVietnamPro-500.woff2") format("woff2"); }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 700; font-display: swap; src: url("fonts/BeVietnamPro-700.woff2") format("woff2"); }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 800; font-display: swap; src: url("fonts/BeVietnamPro-800.woff2") format("woff2"); }

:root {
  --bg: #f4f8fe;
  --card: #ffffff;
  --navy: #10133f;
  --ink: #1d2247;
  --ink-2: #5d6788;
  --ink-3: #8a93ad;
  --line: #e8edf6;
  --chip: #ecf2fc;
  --chip-ink: #4b5680;
  --input: #edf3fc;
  --input-line: #e1eaf7;
  --blue: #1a82fb;
  --blue-dark: #0b6cf0;
  --blue-grad: linear-gradient(180deg, #2a9cff 0%, #0f78f7 100%);
  --blue-soft: #e1eefe;
  /* every Play button: one warm colour (it calls for the tap), whatever the game */
  --play-grad: linear-gradient(180deg, #ffb340 0%, #ff8a1a 55%, #f26c00 100%);
  --play-shadow: 0 6px 16px rgba(242, 108, 0, .32);
  --play-ink-shadow: 0 1px 1px rgba(150, 60, 0, .45);
  --gold: #ffc21f;
  --green: #2fc76a;
  --red: #ff4f5e;
  --shadow: 0 6px 20px rgba(26, 58, 140, .07);
  --shadow-up: 0 12px 28px rgba(26, 58, 140, .14);
  --radius: 24px;
  --top: 68px;
  --side: 252px;
  font-family: "Be Vietnam Pro", "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; background: radial-gradient(1200px 500px at 70% -120px, #e1eefe 0%, rgba(225, 238, 254, 0) 70%), var(--bg); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
svg.i { width: 22px; height: 22px; flex: none; fill: currentColor; }
html[data-lang="vi"] [data-l="en"], html[data-lang="en"] [data-l="vi"] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; width: 44px; height: 44px; border-radius: 14px; align-items: center; justify-content: center; color: var(--ink); }
.menu-btn:hover { background: var(--chip); }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img { height: 36px; width: auto; }
.search { flex: 1; max-width: 520px; margin: 0 auto; position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 16px; color: var(--ink-3); pointer-events: none; }
.search input {
  width: 100%; height: 44px; padding: 0 18px 0 48px; border-radius: 22px;
  border: 1.5px solid var(--input-line); background: var(--input); color: var(--ink);
  font: 500 15px/1 inherit; font-family: inherit; outline: none; transition: border-color .15s, background .15s;
}
.search input:focus { border-color: var(--input-line); background: var(--input); }
.search input::placeholder { color: var(--ink-3); }
.lang {
  flex: none; display: flex; height: 44px; padding: 4px; border-radius: 22px; background: var(--chip); gap: 2px;
}
.lang button { height: 36px; min-width: 44px; padding: 0 12px; border-radius: 18px; font-weight: 700; font-size: 14px; color: var(--chip-ink); }
.lang button[aria-pressed="true"] { background: var(--blue-grad); color: #fff; box-shadow: 0 3px 8px rgba(15, 120, 247, .3); }

/* ---------- side bar ---------- */
.side {
  position: fixed; z-index: 20; top: var(--top); bottom: 0; left: 0; width: var(--side);
  padding: 18px 14px 24px; overflow-y: auto; background: var(--card); border-right: 1px solid var(--line);
}
.side h3 { margin: 18px 12px 8px; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-3); }
.nav { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; border-radius: 14px; font-weight: 700; font-size: 15px; color: var(--ink-2); }
.nav:hover { background: var(--bg); color: var(--ink); }
.nav.on { background: var(--blue-soft); color: var(--blue); }
.nav .n { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-3); background: var(--bg); border-radius: 10px; padding: 2px 8px; }
.nav.on .n { background: #fff; color: var(--blue); }
.shade { display: none; }

/* ---------- main ---------- */
main { margin-left: var(--side); padding: calc(var(--top) + 24px) 28px 32px; min-height: 100vh; }
.wrap { max-width: 1320px; margin: 0 auto; }
h1, h2 { margin: 0; font-weight: 800; letter-spacing: -.3px; }
.sec { margin-top: 34px; }
.sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sec-head h2 { font-size: 22px; }
.sec-head .count { color: var(--ink-3); font-weight: 700; }

/* hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: stretch;
  border-radius: 28px; overflow: hidden; background: linear-gradient(135deg, #ffffff 0%, #eaf1ff 100%);
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.hero-art { position: relative; display: block; min-height: 300px; overflow: hidden; }
.hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.hero:hover .hero-art img { transform: scale(1.03); }
.hero-body { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 34px 38px; }
.badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; background: #fff3d6; color: #b5650b; font-size: 13px; font-weight: 800; }
.badge svg { width: 16px; height: 16px; }
.hero h1 { font-size: 40px; line-height: 1.1; }
.hero p { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.55; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 15px; background: var(--chip); color: var(--chip-ink); font-size: 13px; font-weight: 700; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 30px; border-radius: 26px;
  background: var(--blue-grad); color: #fff; font-size: 17px; font-weight: 800; white-space: nowrap; box-shadow: 0 6px 16px rgba(31, 102, 240, .3);
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(31, 102, 240, .36); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 22px; height: 22px; }
.hero .btn { align-self: flex-start; margin-top: 6px; }
.btn.play { background: var(--play-grad); box-shadow: var(--play-shadow); text-shadow: var(--play-ink-shadow); }
.btn.play:hover { box-shadow: 0 9px 20px rgba(242, 108, 0, .4); }
.btn.play svg { filter: drop-shadow(var(--play-ink-shadow)); }

/* category tabs */
.tabs { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; height: 44px; padding: 0 22px; border-radius: 22px; background: var(--chip); color: var(--chip-ink); font-weight: 700; font-size: 15px; }
.tab:hover { background: #dde6fb; }
.tab.on { background: var(--blue-grad); color: #fff; box-shadow: 0 4px 10px rgba(31, 102, 240, .28); }

/* game cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--card);
  box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-up); }
.card-art { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--chip); }
.card-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-art img { transform: scale(1.05); }
.card-new { position: absolute; top: 10px; left: 10px; height: 26px; padding: 0 10px; border-radius: 13px; background: #ff5a5f; color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.card-body .card-meta:last-of-type { margin-bottom: 8px; }
.card-title { font-size: 18px; font-weight: 800; }
.card-meta { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.card-meta svg { width: 16px; height: 16px; color: var(--ink-3); }
.card-play { margin-top: auto; height: 42px; border-radius: 21px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 15px; background: var(--play-grad); box-shadow: var(--play-shadow); text-shadow: var(--play-ink-shadow); transition: filter .15s; }
.card:hover .card-play { filter: brightness(1.06); }
.empty { display: none; padding: 48px 20px; text-align: center; color: var(--ink-2); font-weight: 500; background: var(--card); border-radius: var(--radius); border: 1px dashed var(--input-line); }
.empty.show { display: block; }

/* ---------- game page ---------- */
.stage {
  position: relative; border-radius: 26px; overflow: hidden; background: #101a3d; box-shadow: var(--shadow);
  height: clamp(300px, calc(100vh - var(--top) - 130px), 920px);
}
.stage-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(28px) saturate(1.1) brightness(.72); transform: scale(1.05); }
.frame { position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); height: 100%; aspect-ratio: var(--aspect, 750 / 1334); }
.stage[data-view="playing"] .frame { background: #fff; }
.frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.landscape .frame { left: 0; right: 0; width: 100%; transform: none; aspect-ratio: auto; }
.cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; color: #fff; }
.cover img { width: 124px; height: 124px; border-radius: 30px; box-shadow: 0 10px 28px rgba(0, 0, 0, .35); border: 4px solid rgba(255, 255, 255, .9); }
.cover h1 { font-size: 34px; text-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.cover p { margin: 0; font-weight: 500; color: rgba(255, 255, 255, .88); }
.cover .btn { height: 58px; padding: 0 40px; font-size: 19px; }
.stage.playing .cover { display: none; }
.back { display: none; position: absolute; z-index: 3; top: 50%; left: 0; width: 34px; height: 60px; transform: translateY(-50%); border-radius: 0 18px 18px 0; background: rgba(14, 20, 52, .5); color: #fff; align-items: center; justify-content: center; }
.back svg { width: 20px; height: 20px; }
/* phones: the game takes the whole screen once it starts (the page stays behind it) */
.stage.full { position: fixed; inset: 0; z-index: 100; height: auto; border-radius: 0; }
.stage.full .frame { aspect-ratio: auto; left: 0; right: 0; width: 100%; transform: none; }
@media (min-aspect-ratio: 3/4) { .stage.full:not(.landscape) .frame { left: 50%; right: auto; width: auto; aspect-ratio: var(--aspect, 750 / 1334); transform: translateX(-50%); } }
.stage.full .back { display: flex; }

.bar { margin-top: 14px; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.bar img { width: 48px; height: 48px; border-radius: 14px; }
.bar .t { min-width: 0; }
.bar .t b { display: block; font-size: 18px; font-weight: 800; }
.bar .t > span { display: block; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.bar .tools { margin-left: auto; display: flex; gap: 8px; }
.tool { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 22px; background: var(--chip); color: var(--chip-ink); font-weight: 700; font-size: 14px; }
.tool:hover { background: #dde6fb; }
.tool svg { width: 20px; height: 20px; }

.about { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 26px; }
.panel h2 { font-size: 20px; margin-bottom: 12px; }
.panel h3 { margin: 22px 0 10px; font-size: 16px; font-weight: 800; }
.panel p { margin: 0; color: var(--ink-2); line-height: 1.65; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); line-height: 1.55; }
.steps li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 14px; background: var(--blue-soft); color: var(--blue); font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.facts { margin: 0; display: grid; gap: 12px; }
.facts div { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 30px; }
.facts dt { color: var(--ink-3); font-weight: 500; font-size: 14px; }
.facts dd { margin: 0; font-weight: 700; font-size: 14px; text-align: right; }
.panel .chips { margin-top: 16px; }

/* ---------- footer ---------- */
footer { margin-top: 48px; padding: 22px 4px 4px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; color: var(--ink-3); font-size: 14px; font-weight: 500; }
footer a:hover { color: var(--blue); }
footer .sp { margin-left: auto; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 200; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 20px; border-radius: 22px; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 404 */
.lost { text-align: center; padding: 60px 20px; }
.lost h1 { font-size: 64px; color: var(--blue); }
.lost p { color: var(--ink-2); margin: 12px 0 26px; }

/* ---------- ZOLO lobby: shared pieces ---------- */
.btn.sm { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 22px; box-shadow: 0 4px 10px rgba(15, 120, 247, .24); }
.btn.xs { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 17px; box-shadow: none; }
.btn.ghost { background: var(--chip); color: var(--chip-ink); box-shadow: none; }
.btn.ghost:hover { background: #dfe8f8; box-shadow: none; }
.btn.danger { background: linear-gradient(180deg, #ff6b78 0%, #f23d4e 100%); box-shadow: 0 6px 16px rgba(242, 61, 78, .28); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.icon-btn { width: 48px; height: 48px; flex: none; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; background: var(--chip); color: var(--chip-ink); }
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 12px; }
.icon-btn.sm svg { width: 18px; height: 18px; }
.icon-btn:hover { background: #dfe8f8; }
.muted { color: var(--ink-3); font-size: 14px; line-height: 1.5; margin: 0; }
.center { display: flex; align-items: center; justify-content: center; }
.pad { padding: 40px 0; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--blue-soft); border-top-color: var(--blue); animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
img.coin { width: 22px; height: 22px; flex: none; }

/* avatar + frame (the frame is drawn at diameter / 0.7 like the app) */
.ava { position: relative; display: inline-flex; flex: none; width: var(--s); height: var(--s); }
.ava-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--blue-soft); }
.ava-frame { position: absolute; left: 50%; top: 50%; width: calc(var(--s) / .7); height: calc(var(--s) / .7); max-width: none; transform: translate(-50%, -50%); pointer-events: none; }
.ava.q { border-radius: 50%; background: rgba(255, 255, 255, .18); border: 3px dashed rgba(255, 255, 255, .7); align-items: center; justify-content: center; color: #fff; font-size: 34px; font-weight: 800; }
.lv { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 800; white-space: nowrap; }
.lv.ghost { background: rgba(255, 255, 255, .2); color: #fff; }

/* account corner of the top bar: every item 44 px high */
.acct { flex: none; display: flex; align-items: center; gap: 10px; }
.coins { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px 0 10px; border-radius: 22px; background: #fff6da; color: #9a5d00; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.me { display: inline-flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px 0 5px; border-radius: 22px; background: var(--chip); }
.me .ava { margin-left: 0; }
.me-t { display: flex; flex-direction: column; line-height: 1.15; }
.me-t b { font-size: 14px; font-weight: 800; color: var(--ink); max-width: 160px; overflow-wrap: anywhere; }
.me-t .lv { height: 18px; padding: 0 7px; font-size: 11px; align-self: flex-start; margin-top: 2px; }
.me:hover, .coins:hover { filter: brightness(.97); }

/* popups */
.modal-wrap { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(16, 19, 63, .45); opacity: 0; transition: opacity .18s; }
.modal-wrap.show { opacity: 1; }
.modal { position: relative; width: min(420px, 100%); max-height: calc(100% - 20px); overflow-y: auto; background: #fff; border-radius: 28px; padding: 26px 24px 22px; text-align: center; box-shadow: 0 24px 60px rgba(16, 19, 63, .28); transform: translateY(12px) scale(.98); transition: transform .18s; color: var(--ink); }
.modal-wrap.show .modal { transform: none; }
.modal .x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center; color: var(--ink-3); }
.modal .x:hover { background: var(--chip); }
.modal .x svg { width: 20px; height: 20px; fill: currentColor; }
.modal-art { width: 112px; height: 112px; margin: -4px auto 6px; object-fit: contain; }
.modal h2 { font-size: 22px; color: var(--navy); margin-bottom: 8px; }
.modal-body p { margin: 0 0 16px; color: var(--ink-2); line-height: 1.55; font-size: 15px; }
.modal-body .fine { margin: 14px 0 0; font-size: 12.5px; color: var(--ink-3); }
.modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.modal-actions .btn { flex: 1; padding: 0 16px; }
.gbtn { min-height: 44px; display: flex; justify-content: center; }
/* a sign-in button beside Google's (40 px tall, pill, 15 px text): the same size */
.btn.auth { height: 40px; padding: 0 20px; border-radius: 20px; font-size: 15px; box-shadow: none; }
.login .gbtn { min-height: 40px; }
.acct-row .gbtn { min-width: 220px; }
.gbtn-wait { height: 44px; display: flex; align-items: center; }
.gbtn-off { color: var(--ink-3); font-size: 13px; padding: 12px 0; }
.or { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.field-row { display: flex; gap: 10px; align-items: stretch; }
.field { flex: 1; min-width: 0; height: 48px; padding: 0 16px; border-radius: 16px; border: 1.5px solid var(--input-line); background: var(--input); color: var(--ink); font: 600 16px/1 inherit; font-family: inherit; outline: none; }
.field:focus { border-color: var(--input-line); background: var(--input); }
.field-err { min-height: 20px; margin: 8px 2px 10px; color: var(--red); font-size: 13px; font-weight: 600; text-align: left; }
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 12px; }
.apick { border-radius: 50%; padding: 3px; border: 3px solid transparent; }
.apick img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 50%; }
.apick.on { border-color: var(--blue); }
.apick:hover { border-color: var(--blue-soft); }

/* ---------- game page: mode picker + matching inside the stage ---------- */
.panel-host { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 20px; pointer-events: none; }
.panel-host:empty { display: none; }
.sheet { pointer-events: auto; width: min(440px, 100%); max-height: 100%; overflow-y: auto; background: #fff; border-radius: 28px; padding: 24px 22px; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); color: var(--ink); }
.sheet { position: relative; }
.sheet-x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center; color: var(--ink-3); }
.sheet-x:hover { background: var(--chip); }
.sheet-x svg { width: 20px; height: 20px; fill: currentColor; }
.tool[hidden] { display: none; }
.sheet.center { width: auto; padding: 22px; border-radius: 22px; display: flex; }
.sheet h2 { font-size: 22px; color: var(--navy); text-align: center; }
.balance { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 8px 0 18px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.balance b { color: #9a5d00; font-weight: 800; }
.modes { display: grid; gap: 10px; }
.mode { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 10px 14px 10px 18px; border-radius: 20px; background: var(--bg); border: 2px solid var(--line); text-align: left; transition: border-color .15s, background .15s; }
.mode:hover { border-color: #b9d6fd; background: #f8fbff; }
.mode.last { border-color: var(--blue); background: #f5f9ff; }
.mode.short { opacity: .62; }
.mode-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mode-t b { font-size: 17px; font-weight: 800; color: var(--navy); }
.mode-t small { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.stake { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 14px; border-radius: 18px; background: #fff6da; color: #9a5d00; font-weight: 800; font-size: 15px; }
.sheet.match { background: linear-gradient(180deg, #2a9cff 0%, #0b6cf0 100%); color: #fff; text-align: center; padding: 26px 20px 22px; }
.match-mode { display: inline-flex; height: 30px; align-items: center; padding: 0 14px; border-radius: 15px; background: rgba(255, 255, 255, .2); font-weight: 800; font-size: 14px; }
.vs-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 6px; margin: 26px 0 20px; }
.vs { width: auto; height: 56px; margin-top: 18px; }
.seat { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.seat .ava { margin: 12px 0 6px; }
.seat b { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; line-height: 1.25; }
.seat.pending .ava.q { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.93); opacity: .7; } }
.match-status { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 30px; margin-bottom: 18px; font-weight: 700; }
.match-status .spin { width: 20px; height: 20px; border-width: 3px; border-color: rgba(255, 255, 255, .3); border-top-color: #fff; }
.match-status .clock { font-variant-numeric: tabular-nums; opacity: .85; }
.match-status .found { font-size: 18px; font-weight: 800; color: #fff6c2; }
.sheet.match .btn.ghost { background: rgba(255, 255, 255, .2); color: #fff; min-width: 140px; }
.stage[data-view="modes"] .back, .stage[data-view="matching"] .back { display: none; }
.stage.full[data-view="modes"] .back, .stage.full[data-view="matching"] .back { display: flex; }
.toast { z-index: 400; }

/* ---------- profile ---------- */
.profile { display: grid; gap: 20px; }
.wall { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 40px 24px; }
.wall img { width: 150px; height: 150px; }
.wall h1 { font-size: 28px; color: var(--navy); }
.wall p { max-width: 460px; }
.pcard { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 30px; padding: 30px 34px; background: linear-gradient(135deg, #ffffff 0%, #eaf3ff 100%); }
.pcard-ava { position: relative; padding: 22px; }
.pcard-edit { position: absolute; right: 14px; bottom: 14px; width: 34px; height: 34px; border-radius: 17px; background: var(--blue-grad); display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(15, 120, 247, .35); border: 2px solid #fff; }
.pcard-edit svg { width: 16px; height: 16px; fill: #fff; }
.pcard-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pcard-name { display: flex; align-items: center; gap: 10px; }
.pcard-name h1 { font-size: 28px; color: var(--navy); overflow-wrap: anywhere; line-height: 1.2; }
.pcard-id { color: var(--ink-3); font-weight: 600; font-size: 14px; }
.xp { display: flex; align-items: center; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
.xp .lv { height: 26px; font-size: 13px; padding: 0 11px; border-radius: 13px; }
.xp-bar { width: 220px; max-width: 100%; height: 8px; border-radius: 4px; background: var(--blue-soft); overflow: hidden; }
.xp-bar i { display: block; height: 100%; background: var(--blue-grad); border-radius: 4px; }
.xp > span { font-size: 13px; color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.pcard-stats { display: flex; gap: 12px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 104px; padding: 14px 12px; border-radius: 20px; background: #fff; border: 1px solid var(--line); }
.stat img { width: 34px; height: 34px; }
.stat b { font-size: 20px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.pcols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.pcols > div { display: grid; gap: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.panel-head h2 { margin: 0; }
.panel > .muted { margin-bottom: 14px; }
.lvl-list { display: grid; gap: 8px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.lvl { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 12px 8px 8px; border-radius: 18px; background: var(--bg); border: 1.5px solid transparent; }
.lvl.now { border-color: var(--blue); background: #f5f9ff; }
.lvl.locked { opacity: .55; }
.lvl-n { width: 40px; height: 40px; flex: none; border-radius: 14px; background: var(--blue-grad); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.lvl.locked .lvl-n { background: #c8d2e6; }
.lvl-r { flex: 1; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.rw { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 15px; color: var(--navy); }
.rw .coin { width: 22px; height: 22px; }
.rw-frame { width: 30px; height: 30px; }
.lvl-s { font-size: 13px; font-weight: 700; color: var(--ink-3); min-width: 72px; text-align: right; }
.lvl.done .lvl-s { color: var(--green); }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; }
.ftile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 8px 12px; border-radius: 20px; background: var(--bg); border: 2px solid transparent; text-align: center; }
.ftile:hover:not(:disabled) { border-color: #b9d6fd; }
.ftile:disabled { cursor: default; }
.ftile.on { border-color: var(--blue); background: #f5f9ff; }
.ftile.locked .ftile-art { filter: grayscale(.85); opacity: .55; }
.ftile-art { height: 92px; display: flex; align-items: center; justify-content: center; }
.ftile b { font-size: 13px; font-weight: 800; color: var(--rar, var(--navy)); line-height: 1.25; }
.ftile-note { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.ftile.on .ftile-note { color: var(--blue); }
.acct-panel { display: grid; gap: 4px; }
.acct-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.acct-panel h2 + .acct-row { border-top: 0; }
.acct-t { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 3px; }
.acct-t b { font-size: 15px; font-weight: 800; }
.acct-t span { font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.ok-pill { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 17px; background: #e3f8eb; color: #1c9a50; font-weight: 800; font-size: 13px; }

/* ---------- rankings ---------- */
.rank .sec-head h1 { font-size: 28px; color: var(--navy); }
.rank .tabs { margin-bottom: 12px; }
.periods { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.chip-btn { height: 36px; padding: 0 16px; border-radius: 18px; background: #fff; border: 1.5px solid var(--line); font-weight: 700; font-size: 14px; color: var(--chip-ink); }
.chip-btn.on { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.rpanel { padding: 10px; }
.rlist { display: grid; gap: 4px; }
.rrow { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 8px 16px 8px 10px; border-radius: 18px; }
.rrow:nth-child(odd) { background: var(--bg); }
.rrow.mine { background: var(--blue-soft); }
.rrow .ava { margin: 0 6px; }
.rn { width: 36px; flex: none; text-align: center; font-weight: 800; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.medal { display: inline-flex; width: 32px; height: 32px; border-radius: 16px; align-items: center; justify-content: center; color: #fff; font-size: 15px; }
.top1 .medal { background: linear-gradient(180deg, #ffd83a, #ffab12); }
.top2 .medal { background: linear-gradient(180deg, #d6dde9, #9aa7bd); }
.top3 .medal { background: linear-gradient(180deg, #ffb27a, #e07b3c); }
.rname { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rname b { font-size: 15px; font-weight: 800; color: var(--navy); overflow-wrap: anywhere; }
.rv { flex: none; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.rme { position: sticky; bottom: 0; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); background: #fff; }
.rme-t { display: block; font-size: 13px; font-weight: 700; color: var(--ink-3); margin: 0 0 6px 12px; }

/* short screens (phones / tablets held sideways): the cover fits without scrolling */
@media (max-height: 620px) {
  .cover { gap: 10px; }
  .cover img { width: 76px; height: 76px; border-radius: 20px; border-width: 3px; }
  .cover h1 { font-size: 26px; }
  .cover p { font-size: 14px; }
  .cover .btn { height: 50px; font-size: 17px; }
}

/* ---------- narrow screens ---------- */
@media (max-width: 1023px) {
  :root { --side: 0px; }
  .menu-btn { display: inline-flex; }
  .side { width: 264px; transform: translateX(-100%); transition: transform .22s; box-shadow: var(--shadow-up); }
  body.menu .side { transform: none; }
  body.menu .shade { display: block; position: fixed; inset: var(--top) 0 0 0; z-index: 15; background: rgba(19, 32, 74, .28); }
  .about { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --top: 60px; }
  .top { gap: 10px; padding: 0 12px; }
  .brand b { display: none; }
  .brand img { height: 30px; }
  .lang button { min-width: 38px; padding: 0 8px; }
  main { padding: calc(var(--top) + 16px) 14px 24px; }
  .hero { grid-template-columns: 1fr; border-radius: 24px; }
  .hero-art { min-height: 0; aspect-ratio: 3 / 2; }
  .hero-body { padding: 20px 20px 22px; gap: 12px; }
  .hero h1 { font-size: 30px; }
  .hero .btn { align-self: stretch; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card { border-radius: 18px; }
  .card-body { padding: 10px 12px 12px; }
  .card-title { font-size: 16px; }
  .card-meta { font-size: 12px; }
  .card-play { height: 38px; font-size: 14px; }
  .stage { height: auto; aspect-ratio: 4 / 5; border-radius: 22px; }
  .stage .frame { display: none; }
  .stage.full .frame { display: block; }
  .cover img { width: 104px; height: 104px; border-radius: 26px; }
  .cover h1 { font-size: 28px; }
  .bar .tool span { display: none; }
  .bar .tool { width: 44px; padding: 0; justify-content: center; }
  .panel { padding: 20px; }
}

/* ---------- lobby pieces on narrow screens ---------- */
@media (max-width: 1023px) {
  .pcols { grid-template-columns: 1fr; }
  .pcard { grid-template-columns: auto minmax(0, 1fr); }
  .pcard-stats { grid-column: 1 / -1; }
  .stat { flex: 1; }
}
@media (max-width: 720px) {
  .acct { gap: 6px; }
  .coins { padding: 0 10px 0 7px; font-size: 14px; }
  .me { padding: 0 5px; }
  .me-t { display: none; }
  .search { min-width: 0; }
  .pcard { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 10px; padding: 22px 18px; }
  .pcard-main { align-items: center; }
  .pcard-name h1 { font-size: 24px; }
  .xp { justify-content: center; }
  .rrow { gap: 10px; padding: 8px 10px 8px 6px; }
  .rrow .ava { margin: 0 2px; }
  .sheet { padding: 20px 16px; border-radius: 24px; }
}
@media (max-width: 420px) {
  .search { display: none; }
}
