/* Font tự lưu trong thư mục fonts/ (giấy phép SIL OFL, xem fonts/OFL-*.txt) — không gọi Google Fonts */
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/barlow-condensed-vietnamese-600-normal.woff2) format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/barlow-condensed-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 800; font-display: swap; src: url(../fonts/barlow-condensed-vietnamese-800-normal.woff2) format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 800; font-display: swap; src: url(../fonts/barlow-condensed-latin-ext-800-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 800; font-display: swap; src: url(../fonts/barlow-condensed-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 800; font-display: swap; src: url(../fonts/montserrat-vietnamese-800-normal.woff2) format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 800; font-display: swap; src: url(../fonts/montserrat-latin-ext-800-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 800; font-display: swap; src: url(../fonts/montserrat-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* P4rkour4fun – giao diện. Màu lấy từ chính màn chơi:
   trời tím đêm, mái nhà + gờ mái sáng, đèn cửa sổ, biển hiệu san hô, vàng. */
:root {
  --night: #14122b;
  --ink: #1d1a3a;
  --dusk: #2b2060;
  --wall: #332a6b;
  --roof: #262248;
  --ledge: #7a72b8;
  --lamp: #ffd98a;
  --sun: #ffd166;
  --sun-d: #c9962e;
  --coral: #ff5d4a;
  --coral-d: #c23b2c;
  --mist: #ece8f7;
  --bg: var(--mist);
  --fg: var(--ink);
  --font: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) { :root { --bg: var(--night); --fg: #efeaff; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 600 18px/1.3 var(--font);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; }
.brand { margin: 0; width: min(100%, 900px); text-align: right; font: 800 clamp(18px, 4vw, 28px) Montserrat, "Segoe UI", system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.brand b { color: var(--coral); }
.hint { margin: 0; max-width: 900px; font-size: 17px; opacity: .75; text-align: center; }
.hint a { color: inherit; }

#wrap {
  --hud: #fff; --hud-sh: rgba(20, 18, 43, .5);
  position: relative; width: min(100%, 900px); aspect-ratio: 9 / 4;
  border-radius: 12px; overflow: hidden; background: var(--roof);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
#wrap:fullscreen { width: 100vw; height: 100vh; max-width: none; border-radius: 0; aspect-ratio: auto; }
#wrap:-webkit-full-screen { width: 100vw; height: 100vh; border-radius: 0; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; object-fit: contain; }
#cr { position: absolute; left: 50%; bottom: 6px; z-index: 1; transform: translateX(-50%); white-space: nowrap; font: 600 11px/1 var(--font); letter-spacing: .08em; color: #fff; opacity: .55; pointer-events: none; text-shadow: 0 1px 2px rgba(0, 0, 0, .65); }

/* Điện thoại xoay ngang: bỏ phần thừa, khung chơi cao hết cỡ màn */
@media (max-height: 540px) and (orientation: landscape) {
  body { padding: 4px max(8px, env(safe-area-inset-right)) 4px max(8px, env(safe-area-inset-left)); gap: 0; }
  .brand, .hint { display: none; }
  #wrap { width: min(100%, 900px, calc((100vh - 8px) * 2.25)); width: min(100%, 900px, calc((100dvh - 8px) * 2.25)); border-radius: 8px; }
}

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: .45em 1.2em .5em; border: 0; border-radius: 10px;
  background: var(--coral); color: #fff; font: 800 clamp(18px, 2.6vw, 23px)/1 var(--font);
  cursor: pointer; box-shadow: 0 4px 0 var(--coral-d); transition: transform .06s, box-shadow .06s; touch-action: manipulation;
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--coral-d); }
.btn-sun, .btn-buy { background: var(--sun); color: var(--dusk); box-shadow: 0 4px 0 var(--sun-d); }
.btn-sun:active:not(:disabled), .btn-buy:active:not(:disabled) { box-shadow: 0 1px 0 var(--sun-d); }
.btn-buy { background: linear-gradient(135deg, var(--sun), #ff9a3c); }
.btn-ghost { background: rgba(255, 255, 255, .13); box-shadow: 0 4px 0 rgba(10, 8, 30, .35); }
.btn-ghost:active:not(:disabled) { box-shadow: 0 1px 0 rgba(10, 8, 30, .35); }
.btn.sm { min-height: 38px; padding: .35em .8em .4em; font-size: clamp(16px, 2.2vw, 19px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.lnk { padding: 6px; border: 0; background: none; color: inherit; font: 600 clamp(16px, 2.3vw, 19px) var(--font); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.ib { width: clamp(34px, 5vw, 42px); height: clamp(34px, 5vw, 42px); padding: 0; border: 0; border-radius: 50%; background: rgba(20, 18, 43, .58); color: #fff; display: grid; place-items: center; cursor: pointer; touch-action: manipulation; }
.ib svg { width: 52%; height: 52%; }
.ic svg { display: block; width: 1.15em; height: 1.15em; }

/* ---------- Chip: xu, combo, vật phẩm ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: clamp(26px, 3.8vw, 32px); padding: 0 11px; border-radius: 99px; background: rgba(20, 18, 43, .62); color: #fff; font: 800 clamp(15px, 2.2vw, 19px)/1 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip.sm { height: 24px; padding: 0 8px; font-size: 15px; }
.chip.lg { height: 36px; padding: 0 14px; font-size: 20px; }
.coin { flex: none; width: .95em; height: .95em; border-radius: 50%; background: var(--sun); box-shadow: inset 0 0 0 2px #c98a1e; }
.tok { flex: none; width: .85em; height: .85em; border-radius: 50%; background: var(--coral); box-shadow: inset 0 0 0 2px #fff; }
.chip-combo { background: var(--coral); }
.chip-combo b { color: var(--sun); }
.chip-combo.pop { animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(1.25); } to { transform: scale(1); } }
.pw { --p: 1; position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 3px; height: clamp(21px, 3vw, 25px); padding: 0 7px 0 5px; border-radius: 99px; background: rgba(20, 18, 43, .5); color: #fff; font: 800 clamp(12px, 1.7vw, 15px)/1 var(--font); font-variant-numeric: tabular-nums; align-self: center; }
.pwi { flex: none; width: 1.2em; height: 1.2em; }
.pw .x2 { font-style: normal; color: var(--sun); }
.pw::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: calc(var(--p) * 100%); background: var(--sun); }
.pw.low { animation: blink .5s ease-in-out infinite alternate; }
@keyframes blink { to { opacity: .35; } }

/* ---------- HUD trong lúc chạy ---------- */
.hud { position: absolute; inset: 0 0 auto 0; z-index: 2; display: flex; align-items: flex-start; gap: clamp(8px, 1.6vw, 14px); padding: clamp(6px, 1.2vw, 10px) clamp(8px, 1.4vw, 12px); color: var(--hud); pointer-events: none; }
.hud-l { display: flex; flex-direction: column; gap: 2px; }
.h-dist { font: 800 clamp(24px, 4.4vw, 36px)/1 var(--font); font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 var(--hud-sh); }
.h-best { font: 600 clamp(13px, 1.9vw, 17px)/1.1 var(--font); opacity: .9; text-shadow: 0 1px 0 var(--hud-sh); }
.hud-m { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.hud .ib { margin-left: auto; pointer-events: auto; }

/* ---------- Menu (bắt đầu / tạm dừng / ngã) ---------- */
.menu { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; padding: calc(clamp(32px, 5vw, 40px) + 2 * clamp(8px, 1.5vw, 14px)) clamp(8px, 1.5vw, 14px) clamp(8px, 1.5vw, 14px); color: #fff; background: linear-gradient(180deg, rgba(43, 32, 96, .6), rgba(20, 18, 43, .86)); }
.bal .chip { height: clamp(32px, 5vw, 40px); background: var(--roof); box-shadow: inset 0 3px 0 var(--ledge); }
.menu-card { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(4px, 1.1vh, 10px); text-align: center; }
.menu-card h1 { margin: 0; font: 800 clamp(32px, 6.6vw, 62px)/.95 var(--font); text-shadow: 0 3px 0 rgba(20, 18, 43, .45); }
.menu-card p { margin: 0; max-width: 32em; font: 600 clamp(15px, 2.3vw, 20px)/1.3 var(--font); color: rgba(255, 255, 255, .88); }
.menu-card .m-best, .menu-card .tip { color: var(--lamp); }
.menu-card .tip { font-size: clamp(14px, 1.9vw, 17px); }
.result { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.r-m { font: 800 clamp(34px, 6vw, 56px)/1 var(--font); color: var(--sun); font-variant-numeric: tabular-nums; }
.badge { padding: 4px 10px; border-radius: 6px; background: var(--coral); font: 800 clamp(15px, 2.2vw, 19px)/1.1 var(--font); transform: rotate(-3deg); }
.m-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: clamp(2px, .8vh, 6px) 0 4px; }
.rot { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .1); font-size: 16px; }
.rot .ic svg { width: 26px; height: 26px; }
.rot .lnk { white-space: nowrap; }
.dot { position: absolute; top: -3px; right: -3px; width: 13px; height: 13px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px var(--dusk); }
body.compact .menu { position: fixed; z-index: 5; background: linear-gradient(180deg, var(--dusk), var(--night)); }

/* ---------- Thanh trên cùng (sảnh + menu): xu, tài khoản, nút menu chung ---------- */
.topbar { position: absolute; inset: 0 0 auto 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: clamp(8px, 1.5vw, 14px); pointer-events: none; }
.topbar > * { pointer-events: auto; }
.tb-r { display: flex; align-items: center; gap: 8px; }
.ib-lg { position: relative; width: clamp(36px, 5.2vw, 42px); height: clamp(36px, 5.2vw, 42px); background: var(--roof); box-shadow: inset 0 3px 0 var(--ledge), 0 3px 0 rgba(10, 8, 30, .45); border-radius: 10px; }
.ib-lg .ic svg { width: 22px; height: 22px; }
body.compact .topbar { position: fixed; z-index: 7; }

/* Chữ cái đầu của tên (hồ sơ) */
.ava { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--coral); color: #fff; font: 800 16px/1 var(--font); box-shadow: inset 0 -3px 0 var(--coral-d); }

/* ---------- Sảnh chính: giữa màn để trống cho nhân vật trên canvas ---------- */
.lobby { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: clamp(8px, 1.5vw, 14px); pointer-events: none; }
.lobby > * { pointer-events: auto; }
.lobby .rot { align-self: center; color: #fff; background: rgba(20, 18, 43, .7); }
.l-bot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.mappick { display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 12px; background: var(--roof); box-shadow: inset 0 4px 0 var(--ledge), 0 4px 0 rgba(10, 8, 30, .45); }
.mappick .ib { background: rgba(255, 255, 255, .1); }
.mp-txt { display: flex; flex-direction: column; align-items: center; min-width: clamp(100px, 14vw, 136px); padding: 2px 4px; color: #fff; text-align: center; }
.mp-txt b { font: 800 clamp(17px, 2.6vw, 22px)/1.05 var(--font); }
.mp-txt small { font: 600 clamp(13px, 1.8vw, 15px)/1.15 var(--font); color: var(--lamp); }
.btn-play { min-height: clamp(50px, 7.6vw, 64px); padding: 0 1.3em; border-radius: 12px; font-size: clamp(24px, 3.8vw, 34px); box-shadow: 0 5px 0 var(--coral-d); }
.btn-play .ic svg { width: .75em; height: .75em; }
body.compact .lobby { position: fixed; padding: 16px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }

/* ---------- Menu chung: tab Tủ đồ / Nhiệm vụ / Cài đặt ---------- */
.panel.tabbed #dlg-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: rgba(10, 8, 30, .45); }
.tabs button { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 9px; background: none; color: rgba(255, 255, 255, .8); font: 800 clamp(16px, 2.4vw, 21px) var(--font); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--sun); color: var(--dusk); }
.tabs .dot { top: 4px; right: 6px; }
body.compact .topbar:not([hidden]) ~ .toast { position: fixed; z-index: 8; }

/* ---------- Thông báo nhỏ ---------- */
.toast { position: absolute; left: 50%; bottom: 14px; z-index: 6; max-width: calc(100% - 24px); padding: 8px 16px; border-radius: 10px; background: var(--dusk); color: var(--sun); font: 800 clamp(15px, 2.2vw, 19px)/1.2 var(--font); text-align: center; box-shadow: inset 0 3px 0 var(--ledge), 0 4px 0 rgba(10, 8, 30, .4); transform: translate(-50%, 170%); opacity: 0; transition: transform .25s, opacity .25s; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
/* Khi đang ở menu: thông báo nằm giữa thanh trên cùng (giữa nút ngôn ngữ và nút tài khoản) */
.lobby:not([hidden]) ~ .toast { bottom: clamp(16px, 3vw, 26px); max-width: calc(100% - 2 * clamp(250px, 32vw, 290px)); }
body.compact .topbar:not([hidden]) ~ .toast { top: 70px; bottom: auto; max-width: calc(100% - 24px); transform: translate(-50%, -24px); }
body.compact .topbar:not([hidden]) ~ .toast.show { transform: translate(-50%, 0); }

/* ---------- Hộp thoại: khung như một mái nhà, gờ sáng ở trên ---------- */
.dlg { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(20, 18, 43, .8); }
.panel { position: relative; display: flex; flex-direction: column; gap: 12px; width: min(100%, 540px); max-height: 100%; overflow: auto; overscroll-behavior: contain; padding: 22px clamp(14px, 3vw, 24px) 18px; border-radius: 14px; background: var(--roof); color: #fff; box-shadow: inset 0 6px 0 var(--ledge), 0 10px 0 rgba(10, 8, 30, .55); }
.panel.wide { width: min(100%, 880px); }
.panel h2 { margin: 0; font: 800 clamp(28px, 4.6vw, 40px)/1 var(--font); }
.panel h3 { margin: 8px 0 0; font: 800 clamp(19px, 2.8vw, 23px)/1.1 var(--font); color: var(--lamp); }
.panel p { margin: 0; font-size: clamp(16px, 2.3vw, 19px); }
.panel .note { color: rgba(255, 255, 255, .72); font-size: clamp(15px, 2vw, 17px); }
.panel .wm { min-height: 1.3em; color: var(--sun); }
.panel .who b { color: var(--sun); }
.dlg-b { display: flex; flex-direction: column; gap: 12px; }
.done { align-self: center; min-width: 140px; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.row-l { font: 800 clamp(17px, 2.4vw, 20px) var(--font); }
.seg { display: inline-flex; gap: 3px; padding: 3px; border-radius: 10px; background: rgba(10, 8, 30, .45); }
.seg button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: none; color: rgba(255, 255, 255, .8); font: 800 clamp(15px, 2.2vw, 18px) var(--font); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--sun); color: var(--dusk); }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

/* Bản đồ */
.maps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.map { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 0 0 10px; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, .08); color: #fff; text-align: left; cursor: pointer; font: inherit; }
.map b { padding: 0 10px; font: 800 clamp(17px, 2.4vw, 20px)/1.1 var(--font); }
.map small { padding: 0 10px; font-size: 15px; color: rgba(255, 255, 255, .75); }
.map .map-best { color: var(--lamp); }
.map[aria-pressed="true"] { border-color: var(--sun); background: rgba(255, 209, 102, .16); }
.map-sw {
  align-self: stretch; height: 50px; margin-bottom: 6px;
  background:
    linear-gradient(180deg, transparent 64%, var(--tp) 64%, var(--tp) 71%, var(--pf) 71%),
    linear-gradient(90deg, transparent 6%, var(--nr) 6%, var(--nr) 22%, transparent 22%, transparent 31%, var(--nr) 31%, var(--nr) 50%, transparent 50%, transparent 66%, var(--fr) 66%, var(--fr) 86%, transparent 86%) bottom / 100% 72% no-repeat,
    linear-gradient(180deg, var(--sk0), var(--sk1));
}

/* Tủ đồ */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.cards.prem { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 8px 10px; border: 2px solid transparent; border-radius: 10px; background: rgba(255, 255, 255, .08); text-align: center; }
.card.on { border-color: var(--sun); background: rgba(255, 209, 102, .14); }
.card canvas { width: 64px; height: 80px; border-radius: 8px; }
.card.wide canvas { width: 120px; height: 80px; }
.card b { font: 800 clamp(16px, 2.3vw, 19px)/1.1 var(--font); }
.card > .btn { width: 100%; padding-left: .3em; padding-right: .3em; white-space: nowrap; }
.card.pr { padding: 0 0 10px; overflow: hidden; background: var(--night); border-color: rgba(255, 209, 102, .45); }
.card.pr.on { border-color: var(--sun); }
.card.pr canvas { width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 0; cursor: pointer; }
.card.pr small { margin-top: -4px; padding: 0 8px; font-size: 15px; opacity: .8; }
.card .rw { display: flex; gap: 6px; width: calc(100% - 16px); }
.card .rw .btn { flex: 1; }
.card .rw .try { flex: 0 0 44px; padding: 0; }
.card .rw .try svg { width: 22px; height: 22px; }

/* Nhiệm vụ & thành tựu */
.missions { display: flex; flex-direction: column; gap: 8px; }
.mission { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .08); }
.mission.done { background: rgba(255, 209, 102, .12); }
/* Thử thách hôm nay (đầu bảng Nhiệm vụ) */
.daily { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: linear-gradient(100deg, rgba(255, 93, 74, .28), rgba(255, 209, 102, .14)); box-shadow: inset 0 4px 0 var(--ledge); }
.daily .d-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.daily b { color: var(--sun); font: 800 clamp(19px, 2.8vw, 24px)/1.1 var(--font); }
.daily small { color: rgba(255, 255, 255, .82); font: 600 clamp(14px, 2vw, 16px)/1.3 var(--font); }
.daily .btn { flex: none; min-width: 6.5em; }
@media (max-width: 480px) { .daily { flex-direction: column; align-items: stretch; } }
.m-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.m-txt b { font: 800 clamp(16px, 2.3vw, 19px)/1.15 var(--font); }
.m-txt small { font-size: 14px; color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; }
.prog { height: 8px; border-radius: 99px; background: rgba(10, 8, 30, .5); overflow: hidden; }
.prog i { display: block; width: var(--p); height: 100%; border-radius: inherit; background: var(--sun); }
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ach { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, .06); opacity: .62; }
.ach.got { opacity: 1; background: var(--wall); box-shadow: inset 0 3px 0 var(--sun); }
.ach b { font: 800 17px/1.1 var(--font); }
.ach small { font-size: 14px; line-height: 1.2; color: rgba(255, 255, 255, .75); }
.ach .chip { margin-top: 4px; }

/* Tài khoản */
.form { display: flex; flex-direction: column; gap: 10px; }
.form input { min-height: 44px; padding: 8px 12px; border: 2px solid transparent; border-radius: 10px; background: rgba(255, 255, 255, .13); color: #fff; font: 600 clamp(18px, 2.6vw, 21px) var(--font); }
.form input::placeholder { color: rgba(255, 255, 255, .6); }
.form input:focus-visible { border-color: var(--sun); outline: none; }
.wallets { display: flex; flex-direction: column; gap: 8px; }

/* Hồ sơ người chơi */
.who2 { display: flex; align-items: center; gap: 12px; }
.who2 .ava { width: 58px; height: 58px; font-size: 30px; box-shadow: inset 0 -5px 0 var(--coral-d); }
.who2 .dn { display: block; font: 800 clamp(22px, 3.4vw, 28px)/1.05 var(--font); }
.devtag { display: inline-block; margin-left: 8px; padding: 2px 7px 3px; border-radius: 6px; vertical-align: 4px; background: var(--sun); color: var(--ink); font: 800 13px/1 var(--font); box-shadow: inset 0 -2px 0 var(--sun-d); }
.who2 small { display: block; font-size: 15px; color: rgba(255, 255, 255, .65); }
.who2 .lnk { padding: 2px 0; font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { display: flex; flex-direction: column; gap: 3px; padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, .07); }
.stat b { font: 800 clamp(20px, 3vw, 26px)/1 var(--font); color: var(--sun); font-variant-numeric: tabular-nums; }
.stat small { font-size: 14px; line-height: 1.15; color: rgba(255, 255, 255, .72); }
.bests { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bests div { display: flex; justify-content: space-between; gap: 6px; padding: 6px 10px; border-radius: 8px; background: rgba(255, 255, 255, .05); font-size: 15px; }
.bests b { color: var(--lamp); font-variant-numeric: tabular-nums; }
.secbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.acct-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lnk.danger, .panel .warn { color: #ffab9f; }
.btn-danger { background: transparent; color: #ffab9f; box-shadow: inset 0 0 0 2px #ffab9f; }
.btn-danger:active:not(:disabled) { box-shadow: inset 0 0 0 2px #ffab9f; }
.links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; }
.coderow { display: flex; gap: 8px; }
.code { flex: 1; min-width: 0; min-height: 50px; padding: 8px 12px; border: 2px dashed var(--sun); border-radius: 10px; background: rgba(10, 8, 30, .45); color: var(--sun); font: 800 clamp(22px, 3.6vw, 28px) var(--font); letter-spacing: .12em; text-align: center; }
@media (max-width: 600px) { .stats, .bests { grid-template-columns: repeat(2, 1fr); } }

/* Hướng dẫn khi mở file trực tiếp */
.boot { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; background: var(--roof); color: #fff; text-align: center; box-shadow: inset 0 6px 0 var(--ledge); }
.boot h2 { margin: 0; font: 800 clamp(24px, 4vw, 36px) var(--font); }
.boot p { margin: 0; }
.boot pre { margin: 0; padding: 6px 14px; border-radius: 8px; background: rgba(10, 8, 30, .55); color: var(--sun); font: 800 22px var(--font); }
.boot .en { font-size: 15px; opacity: .7; }

@media (max-width: 480px) { .maps { grid-template-columns: 1fr; } .tabs button .ic { display: none; } }
@media (prefers-reduced-motion: reduce) { .toast, .btn { transition: none; } .chip-combo.pop, .pw.low { animation: none; } }
