@font-face{font-family:BeVietnam;src:url(font.ttf) format('truetype');font-display:swap;font-weight:100 900}
/* 21.331: trang chủ mẫu C «Màn chào trong game» — cùng phong cách menu «Tem đua» trong game (khối tối nghiêng −11°, viền màu, chữ kem/vàng, ca-rô).
   Khối nghiêng vẽ bằng ::before (.tem) nên chữ bên trong vẫn đứng thẳng và app.js đổi textContent của nút không làm mất kiểu. */
:root{color-scheme:dark;--navy:#12233a;--navy2:#0b1726;--bg:#0a1622;--cream:#fcf2cf;--gold:#f5c542;--red:#ea4436;--teal:#33e0c8;--blue:#4aa3ff;
--panel:linear-gradient(100deg,rgba(10,22,34,.95),rgba(14,32,46,.9));--glass:rgba(14,40,46,.84);--glass-line:rgba(51,224,200,.35);--soft:rgba(252,242,207,.78);
--bar:68px;--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px);
font-family:BeVietnam,system-ui,sans-serif;font-weight:600;color:var(--cream);background:var(--bg)}
*{box-sizing:border-box}html{width:100%;height:100%;overflow:hidden}body{margin:0;width:100%;height:100vh;height:var(--viewport-height,100dvh);display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden;background:var(--bg)}
button,a{-webkit-tap-highlight-color:transparent}
button{font:inherit;cursor:pointer;border:0;border-radius:0;padding:10px 16px;background:none;color:var(--cream);font-size:12px;font-weight:700;letter-spacing:.06em;line-height:1.5}
button:hover{filter:brightness(1.08)}button:focus-visible,a:focus-visible{outline:3px solid var(--teal);outline-offset:4px}button:disabled{cursor:wait;opacity:.8}
[hidden]{display:none!important}
.tem{position:relative;isolation:isolate}
.tem::before{content:"";position:absolute;inset:0;z-index:-1;transform:skewX(-11deg);background:var(--tb,var(--panel));border:var(--tbd,0 solid transparent);box-shadow:var(--ts,none)}
.ic{flex:none;vertical-align:-3px}

/* ---------- thanh trên ---------- */
#toolbar{position:relative;min-height:calc(var(--bar) + var(--safe-top));display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;padding:calc(12px + var(--safe-top)) max(24px,var(--safe-right)) 12px max(24px,var(--safe-left));gap:10px 24px;background:linear-gradient(180deg,#0d1b2a,var(--bg));z-index:2}
#toolbar::after{content:"";position:absolute;left:0;right:0;bottom:0;height:4px;background:repeating-conic-gradient(var(--cream) 0 25%,var(--navy) 0 50%) 0 0/8px 8px;opacity:.55}
.wordmark{display:inline-flex;align-items:center;gap:12px;padding:7px 20px 7px 14px;text-decoration:none;color:var(--cream);white-space:nowrap;--tb:var(--panel)}
.brand-mark{display:grid;place-items:center;width:36px;height:36px;border-radius:10px;background:#da251d;border:2px solid var(--navy)}
.brand-text b{display:block;font-size:19px;line-height:1.05;letter-spacing:.02em;font-weight:700}
.brand-text small{display:block;font-size:9px;letter-spacing:.14em;color:var(--gold);margin-top:3px}
nav{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;max-width:100%}
nav button{display:inline-flex;align-items:center;gap:8px;height:42px;padding:0 16px;font-size:12.5px;text-transform:uppercase;--tb:rgba(10,22,34,.92)}
nav button::after{content:"";order:-1;width:18px;height:18px;background:currentColor;-webkit-mask:var(--ico) center/contain no-repeat;mask:var(--ico) center/contain no-repeat}
#install{color:var(--teal);--tbd:2px solid var(--teal);--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Crect x='3.5' y='3.5' width='17' height='17' rx='4'/%3E%3Cpath d='M12 8v8M8 12h8'/%3E%3C/svg%3E")}
/* 21.347: nút Cách chơi + Toàn màn hình đã bỏ; «Tải game» ghi chữ ở mọi cỡ màn hình */
#game{min-height:0;position:relative;overflow:hidden;background:var(--bg)}
#unity-canvas{position:absolute;inset:0;display:block;width:100%;height:100%;touch-action:none;outline:none}

/* ---------- màn đầu (giống màn chào trong game) ---------- */
#welcome{height:100%;position:relative;display:flex;flex-direction:column;overflow:auto;overscroll-behavior:contain;background:var(--bg);scrollbar-gutter:stable}
.hero{position:relative;flex:none;padding:0 0 26px}
.hero-bg{position:absolute;left:0;right:0;top:0;height:340px;background:url(poster-home-khien.jpg) 55% 50%/cover}
.hero-bg::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(6,14,22,.4),rgba(6,14,22,.1) 38%,var(--bg) 98%)}
.place{display:none}
.lab{font-size:11px;letter-spacing:.16em;color:var(--gold);font-weight:700}
.intro{position:relative;padding:160px max(16px,var(--safe-right)) 0 max(16px,var(--safe-left));max-width:820px}
.eyebrow{display:inline-flex;align-items:center;gap:8px;height:34px;margin:0 0 0 6px;padding:0 16px;font-size:12px;letter-spacing:.14em;color:var(--cream);--tb:var(--red)}
h1{margin:16px 0 0;font-weight:800;font-style:italic;letter-spacing:-.01em}
.t1{display:block;font-size:clamp(40px,12vw,58px);line-height:.98;white-space:nowrap}
.t2{display:inline-block;margin:8px 0 0 10px;padding:4px 18px 8px;font-size:clamp(40px,12vw,58px);line-height:1;color:var(--navy);white-space:nowrap;--tb:var(--gold);--ts:9px 9px 0 var(--red)}
.description{font-size:15px;line-height:1.6;color:var(--soft);margin:22px 0 0;max-width:34em;font-weight:500}
.play-panel{max-width:520px;min-width:0;margin-top:26px}
.cta{display:flex;align-items:center;gap:16px;padding-left:8px}
.primary{flex:1;display:flex;align-items:center;justify-content:center;gap:14px;min-height:64px;padding:0 20px;font-size:22px;letter-spacing:.08em;color:var(--cream);--tb:linear-gradient(180deg,#ff5a4a,#d42e22);--ts:7px 7px 0 var(--navy2)}
.primary::after{content:"";width:33px;height:22px;flex:none;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 24' fill='none' stroke='%23fcf2cf' stroke-width='4.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4l8 8-8 8M18 4l8 8-8 8'/%3E%3C/svg%3E") center/contain no-repeat}
.primary:disabled::after{display:none}
.gear{display:grid;place-items:center;width:64px;height:64px;padding:0;flex:none;--tb:rgba(10,22,34,.92);--tbd:3px solid var(--teal)}
#load-status{display:flex;align-items:center;gap:10px;font-size:12.5px;line-height:1.6;margin:14px 0 0 8px;color:var(--soft);font-weight:500;overflow-wrap:anywhere}
#load-status::before{content:"";flex:none;width:54px;height:8px;transform:skewX(-11deg);background:repeating-conic-gradient(var(--cream) 0 25%,var(--navy) 0 50%) 0 0/8px 8px}
progress{display:block;width:100%;height:10px;margin-top:12px;accent-color:var(--gold)}
#retry{margin-top:12px;padding:10px 18px;--tbd:2px solid var(--gold)}

/* ---------- thẻ kính: điều khiển + bản cập nhật ---------- */
.landing-main{width:100%;max-width:1480px;margin:0 auto;padding:0 max(16px,var(--safe-right)) 8px max(16px,var(--safe-left));flex:1 0 auto}
.board{display:grid;gap:18px}
.glass{background:var(--glass);border:2px solid var(--glass-line);border-radius:22px;box-shadow:0 18px 40px rgba(0,8,16,.4)}
.how{padding:16px 18px 18px}
.how h2{margin:0 0 12px}
.pads{display:flex;flex-wrap:wrap;gap:6px}
.pads img{width:38px;height:38px}
.touch-guide{font-size:12.5px;line-height:1.6;color:var(--soft);margin:10px 0 0;font-weight:500}
.controls{display:none;flex-wrap:wrap;gap:10px 18px;margin-top:14px;font-size:12px;letter-spacing:.06em}
.controls span{display:inline-flex;align-items:center;gap:6px}
kbd{display:inline-grid;place-items:center;min-width:28px;height:28px;padding:0 7px;border-radius:7px;background:var(--cream);color:var(--navy);border:2px solid var(--navy);box-shadow:0 3px 0 var(--navy);font:inherit;font-size:12px}
.release-notes{margin:0;font-size:13px;line-height:1.55;color:var(--soft);font-weight:500}
.release-notes summary{cursor:pointer;list-style:none;display:block;position:relative;padding:13px 48px 13px 18px;color:var(--cream);font-size:14.5px;line-height:1.7;font-weight:600;border-bottom:2px solid transparent}
.release-notes[open] summary{border-bottom-color:rgba(51,224,200,.22)}
.release-notes summary::-webkit-details-marker{display:none}
.release-notes summary::after{content:"";position:absolute;right:20px;top:50%;width:12px;height:12px;margin-top:-9px;border:solid var(--gold);border-width:0 3px 3px 0;transform:rotate(45deg);transition:transform .15s}
.release-notes[open] summary::after{transform:translateY(5px) rotate(-135deg)}
.release-notes b{color:var(--gold)}
.release-tag{display:inline-block;margin-right:8px;font-size:10.5px;font-weight:700;letter-spacing:.14em;color:var(--cream);background:var(--red);padding:3px 10px;transform:skewX(-11deg)}
.release-notes ul{list-style:none;margin:0;padding:10px 18px 16px}
.release-notes li{position:relative;padding-left:22px;margin-top:8px}
.release-notes li::before{content:"";position:absolute;left:0;top:6px;width:10px;height:10px;border-radius:3px;background:var(--teal)}
.release-check{margin:0;padding:0 18px 16px;color:#ff8a7e;font-weight:600}
.release-check button{margin-left:6px;padding:4px 12px;font-size:11px;background:var(--red)}

/* ---------- ảnh trong game ---------- */
.section-title{display:flex;align-items:center;gap:14px;margin:34px 0 18px;font-size:21px;font-style:italic;font-weight:800;letter-spacing:.04em}
.section-title>.tem{display:grid;place-items:center;width:48px;height:30px;--tb:var(--red)}
.section-title i{flex:1;height:10px;background:linear-gradient(var(--gold),var(--gold)) 0 0/100% 4px no-repeat,linear-gradient(rgba(245,197,66,.45),rgba(245,197,66,.45)) 0 100%/70% 3px no-repeat;transform:skewX(-11deg)}
.street-gallery{display:grid;grid-template-columns:minmax(0,1fr);gap:18px;min-width:0}
.street-preview{min-width:0;margin:0;border-radius:22px;overflow:hidden;border:2px solid var(--glass-line);background:var(--glass);display:flex;flex-direction:column}
.street-preview picture{display:block;width:100%;aspect-ratio:2778/1284;overflow:hidden;background:#13262f}
.street-preview img{display:block;width:100%;height:100%;object-fit:cover}
.preview-label{display:flex;align-items:center;gap:12px;padding:10px 14px;background:rgba(14,40,46,.95)}
.preview-no{display:grid;place-items:center;flex:none;min-width:42px;height:42px;border-radius:10px;background:var(--gold);color:var(--navy);font-size:17px;font-style:italic;font-weight:800}
.preview-label b{display:block;font-size:15px;line-height:1.35}
.preview-label small{display:block;font-size:11.5px;line-height:1.45;color:rgba(252,242,207,.62);margin-top:2px;font-weight:500}
.preview-tag{margin-left:auto;flex:none;font-size:11px;letter-spacing:.12em;padding:5px 10px;border:2px solid var(--teal);color:var(--teal)}
.preview-tag.new{border-color:var(--red);background:var(--red);color:var(--cream)}
footer{position:relative;flex:none;display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px 24px;margin-top:40px;padding:24px max(16px,var(--safe-right)) max(22px,var(--safe-bottom)) max(16px,var(--safe-left));background:var(--navy2);font-size:12px;line-height:1.6;color:rgba(252,242,207,.7);font-weight:500}
footer::before{content:"";position:absolute;left:0;right:0;top:0;height:8px;background:repeating-linear-gradient(-45deg,var(--gold) 0 18px,var(--navy) 18px 36px)}
.footer-title{font-weight:700;letter-spacing:.12em;color:var(--gold)}.footer-title>span{margin:0 7px}
.author{overflow-wrap:anywhere;font-weight:700;letter-spacing:.08em;color:var(--cream)}   /* 21.347: thay dòng trạng thái offline */

/* ---------- máy tính bảng / điện thoại ngang ---------- */
@media(min-width:760px){
.board{grid-template-columns:1.3fr 1fr;align-items:start}
.street-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}
.street-preview:first-child{grid-column:1/3}
}
@media(hover:hover) and (pointer:fine){.controls{display:flex}}
/* ---------- máy tính ---------- */
@media(min-width:1000px){
.hero{min-height:min(800px,calc(var(--viewport-height,100dvh) - var(--bar) + 60px));padding:0}
.hero-bg{height:auto;bottom:0;background-size:165% auto;background-position:52% 58%}
.hero-bg::after{background:linear-gradient(100deg,rgba(6,14,22,.9) 32%,rgba(6,14,22,.25) 62%,rgba(6,14,22,0) 80%),linear-gradient(180deg,rgba(6,14,22,0) 74%,var(--bg))}
.place{display:block;position:absolute;right:max(48px,var(--safe-right));top:40px;z-index:1;padding:10px 28px 10px 20px;--tb:rgba(10,22,34,.9)}
.place::before{border-right:7px solid var(--gold)}
.place b{display:block;font-size:24px;margin-top:2px;font-weight:700}
.intro{padding:64px 48px 140px max(48px,var(--safe-left))}
.t1,.t2{font-size:clamp(64px,6.4vw,92px)}
.description{font-size:18px}
.primary{min-height:76px;font-size:27px}.gear{width:76px;height:76px}
.landing-main{padding:0 max(48px,var(--safe-right)) 8px max(48px,var(--safe-left))}
.board{margin-top:-110px;position:relative}
.street-gallery{grid-template-columns:repeat(3,minmax(0,1fr))}
.street-preview:first-child{grid-column:auto}
footer{padding:26px max(48px,var(--safe-right)) max(28px,var(--safe-bottom)) max(48px,var(--safe-left))}
}
/* Màn ngang thấp (điện thoại xoay ngang, laptop nhỏ): màn đầu gọn lại, không che hết trang. */
@media(min-width:701px) and (max-height:620px){:root{--bar:54px}
#toolbar{padding-top:calc(8px + var(--safe-top));padding-bottom:8px}
.hero{min-height:0;padding-bottom:20px}
.intro{padding-top:40px;padding-bottom:30px}
.t1,.t2{font-size:44px}
.description{font-size:13px;margin-top:14px}
.play-panel{margin-top:16px}.primary{min-height:52px;font-size:19px}.gear{width:52px;height:52px}
.board{margin-top:0}
.place{top:16px}
}
/* ---------- điện thoại dọc ---------- */
@media(max-width:700px){:root{--bar:56px}
#toolbar{padding:calc(10px + var(--safe-top)) max(12px,var(--safe-right)) 10px max(12px,var(--safe-left));gap:8px 10px}
.wordmark{padding:6px 14px 6px 10px;gap:9px}
.brand-mark{width:32px;height:32px}.brand-mark svg{width:22px;height:22px}
.brand-text b{font-size:17px}.brand-text small{display:none}
nav{gap:6px}
nav button{height:38px;padding:0 10px;font-size:11.5px}
.pads{gap:4px}.pads img{width:34px;height:34px}
}

/* ---------- 21.334: điện thoại — cỡ chữ/nút như màn chào trong game ----------
   Người dùng: chữ, nút, menu trên trang chủ quá to so với màn chào trong game trên điện thoại. Màn chào trong game vẽ trên khung
   1947 × 900 điểm co về màn hình (iPhone Pro Max ngang 932 × 430 → ×0,48): tiêu đề 80 → ~38 px, nút LÊN XE THÔI 460 × 82 → ~220 × 40,
   chữ nút 32 → ~15, mô tả 22 → ~11, logo cao 66 → ~32. Hai khối dưới áp cùng tỉ lệ cho điện thoại ngang và dọc. */
@media(max-width:700px),(max-height:500px){:root{--bar:46px}
#toolbar{padding:calc(6px + var(--safe-top)) max(12px,var(--safe-right)) 6px max(12px,var(--safe-left));gap:6px 10px}
#toolbar::after{height:3px;background-size:6px 6px}
.wordmark{padding:4px 12px 4px 8px;gap:8px}
.brand-mark{width:26px;height:26px;border-radius:7px}.brand-mark svg{width:18px;height:18px}
.brand-text b{font-size:14px}.brand-text small{font-size:7px;letter-spacing:.12em;margin-top:2px}
nav{gap:6px}
nav button{height:32px;padding:0 10px;font-size:10.5px;gap:6px}
nav button::after{width:15px;height:15px}
.lab{font-size:9px}
.hero-bg{height:300px;background-size:auto 145%;background-position:50% 72%}
.eyebrow{height:22px;padding:0 11px;font-size:9.5px;gap:6px}.eyebrow .ic{width:12px;height:12px}
h1{margin-top:10px}
.t1,.t2{font-size:36px}
.t2{margin:5px 0 0 6px;padding:3px 13px 5px;--ts:6px 6px 0 var(--red)}
.description{font-size:11.5px;line-height:1.5;margin-top:12px;max-width:30em}
.play-panel{max-width:300px;margin-top:14px}
.cta{gap:10px;padding-left:5px}
.primary{min-height:40px;font-size:15px;gap:10px;padding:0 14px;--ts:5px 5px 0 var(--navy2)}
.primary::after{width:22px;height:15px}
.gear{width:40px;height:40px;--tbd:2px solid var(--teal)}.gear svg{width:22px;height:22px}
#load-status{font-size:10px;margin-top:9px;gap:8px}#load-status::before{width:40px;height:6px;background-size:6px 6px}
.how{padding:12px 14px 14px}.how h2{margin-bottom:8px}
.pads{gap:4px}.pads img{width:30px;height:30px}
.touch-guide{font-size:10.5px;margin-top:7px}
.controls{font-size:10px;gap:7px 12px;margin-top:10px}kbd{min-width:22px;height:22px;font-size:10px;padding:0 5px;border-radius:5px}
.glass{border-radius:16px}.board{gap:12px}
.release-notes{font-size:10.5px}.release-notes summary{font-size:11.5px;padding:9px 40px 9px 14px}.release-notes ul{padding:6px 14px 12px}
.release-notes li{padding-left:18px;margin-top:6px}.release-notes li::before{width:8px;height:8px;top:5px}
.release-tag{font-size:9px;padding:2px 8px}
.section-title{font-size:15px;margin:22px 0 12px;gap:10px}.section-title>.tem{width:36px;height:22px}
.street-gallery{gap:12px}.street-preview{border-radius:16px}
.preview-label{padding:7px 10px;gap:9px}.preview-no{min-width:30px;height:30px;font-size:12.5px;border-radius:7px}
.preview-label b{font-size:11.5px}.preview-label small{font-size:9px}.preview-tag{font-size:9px;padding:3px 7px}
footer{font-size:9.5px;margin-top:26px;padding-top:18px}
dialog{padding:18px;border-radius:16px}dialog h2{font-size:19px;margin:12px 0 14px}dialog h3{font-size:11px}dialog p{font-size:11.5px;line-height:1.65}.close{width:32px;height:32px;font-size:20px}
.rotate-card h2{font-size:19px}.rotate-card p{font-size:12px}
}
/* Điện thoại xoay ngang: màn đầu bố cục như màn chào trong game (chữ bên trái, ảnh phủ cả khung, thẻ «Địa điểm hôm nay» góc phải). */
@media(max-height:500px) and (orientation:landscape){
.hero{min-height:calc(var(--viewport-height,100dvh) - var(--bar) - var(--safe-top));padding:0}
.hero-bg{height:auto;bottom:0;background-size:170% auto;background-position:48% 56%}   /* phóng to để giấu HUD/nút trong ảnh chụp */
.hero-bg::after{background:linear-gradient(100deg,rgba(6,14,22,.86) 30%,rgba(6,14,22,.25) 60%,rgba(6,14,22,0) 78%),linear-gradient(180deg,rgba(6,14,22,0) 80%,var(--bg))}
.place{display:block;position:absolute;right:max(16px,var(--safe-right));top:12px;z-index:1;padding:5px 16px 5px 12px;--tb:rgba(10,22,34,.9)}
.place::before{border-right:4px solid var(--gold)}
.place .lab .ic{width:11px;height:11px}.place b{display:block;font-size:13px;margin-top:1px;font-weight:700}
.intro{padding:22px 24px 26px max(32px,var(--safe-left));max-width:520px}
.landing-main{padding-top:14px}
.board{grid-template-columns:1.3fr 1fr}
.street-gallery{grid-template-columns:repeat(3,minmax(0,1fr))}.street-preview:first-child{grid-column:auto}
}
@media(max-width:360px){.t1,.t2{font-size:32px}}
/* ---------- trong game ---------- */
.game-immersive,.immersive #game{background:#202020}
.immersive #game{min-height:100dvh}
#safe-area-probe{position:fixed;visibility:hidden;pointer-events:none;top:0;left:0;padding:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left)}
.immersive #game{position:fixed;left:0;top:0;width:var(--viewport-width,100vw);height:var(--viewport-height,100dvh);max-width:none;max-height:none;margin:0;padding:0}
.immersive #toolbar{position:fixed;z-index:40;top:calc(var(--safe-top) + 8px);left:calc(var(--safe-left) + 8px);right:calc(var(--safe-right) + 8px);min-height:var(--bar);padding:8px 12px;border-radius:14px;box-shadow:0 5px 24px #00000066;background:rgba(10,22,34,.95);border:2px solid var(--glass-line);justify-content:flex-end}
.immersive #toolbar::after{display:none}
.immersive #toolbar .wordmark{display:none}
#game-menu{position:fixed;z-index:35;right:calc(var(--safe-right) + 12px);top:calc(var(--safe-top) + 86px);width:40px;height:40px;padding:0;font-size:22px;line-height:40px;border-radius:10px;background:rgba(10,22,34,.9);border:2px solid var(--glass-line);color:var(--cream);box-shadow:0 2px 12px #00000055;opacity:.9}
@media(orientation:portrait){#game-menu{top:calc(var(--safe-top) + (var(--viewport-width,100vw) - var(--safe-left) - var(--safe-right)) * .1583333 + 12px)}}

/* ---------- hộp Cách chơi ---------- */
dialog{position:fixed;margin:auto;top:calc(var(--safe-top) + 12px);bottom:calc(var(--safe-bottom) + 12px);left:calc(var(--safe-left) + 12px);right:calc(var(--safe-right) + 12px);height:fit-content;max-width:600px;width:calc(100% - var(--safe-left) - var(--safe-right) - 24px);max-height:calc(var(--viewport-height,100dvh) - var(--safe-top) - var(--safe-bottom) - 24px);border:2px solid var(--glass-line);border-radius:22px;padding:26px;background:#0f2530;color:var(--cream);overflow:auto;box-shadow:0 24px 70px #000000aa}
dialog::backdrop{background:#050c14c4}
.guide-heading{display:flex;align-items:center;justify-content:space-between;gap:14px}
.guide-heading .eyebrow{margin:0 0 0 6px}
.close{display:grid;place-items:center;flex:none;width:40px;height:40px;padding:0;font-size:24px;line-height:1;--tb:var(--red)}
dialog h2{font-size:26px;line-height:1.3;margin:18px 0 22px;font-style:italic;font-weight:800}
.guide-section{border-top:2px solid rgba(51,224,200,.2);padding:16px 0 0;margin-top:16px}
dialog h3{font-size:13px;letter-spacing:.12em;text-transform:uppercase;margin:0 0 8px;color:var(--gold)}
dialog p{font-size:13px;line-height:1.75;margin:8px 0;color:var(--soft);font-weight:500}
dialog p b{color:var(--cream)}
#cache-help{font-size:12px}

@media(prefers-reduced-motion:no-preference){button{transition:filter .16s}button:active{filter:brightness(.9)}}

/* ---------- xoay ngang để chơi ---------- */
#rotate-game{position:fixed;inset:0;z-index:50;display:grid;place-items:center;padding:max(20px,var(--safe-top)) max(20px,var(--safe-right)) max(20px,var(--safe-bottom)) max(20px,var(--safe-left));background:var(--bg);color:var(--cream);overflow:auto}
#rotate-game[hidden]{display:none}
.rotate-card{width:min(100%,340px);padding:26px;text-align:center;border:2px solid var(--glass-line);border-radius:22px;background:var(--glass)}
.rotate-card svg{color:var(--teal)}
.rotate-card h2{margin:12px 0 8px;font-size:23px;font-style:italic;font-weight:800}
.rotate-card p{margin:0 0 22px;color:var(--soft);font-size:13px;line-height:1.65;font-weight:500}
.rotate-card button{min-height:46px;padding:8px 24px;font-size:14px;--tb:linear-gradient(180deg,#ff5a4a,#d42e22)}
/* 21.347: «PHỐ QUEN» nhỏ hơn ~15 % và đệm trên theo em để dấu sắc chồng trên Ô nằm trong khối vàng
   (trước đây dấu lòi lên trên khối, chữ xanh đen trên nền tối nên trông như «PHÔ QUEN»). */
h1 .t2{font-size:clamp(34px,10vw,49px);padding-top:.36em;padding-bottom:.14em;line-height:1}
@media(min-width:1000px){h1 .t2{font-size:clamp(54px,5.4vw,78px)}}
@media(min-width:701px) and (max-height:620px){h1 .t2{font-size:37px}}
@media(max-width:700px),(max-height:500px){h1 .t2{font-size:30px}}
@media(max-width:360px){h1 .t2{font-size:27px}}
/* 21.347: hộp «Tải game» chỉ có phần Cài game & chơi offline */
#install-guide .guide-heading{margin-bottom:6px}
#install-guide .guide-heading h3{margin:0 0 0 4px}
/* 21.349: ô logo trên thanh trên trong suốt → cùng màu nền thanh header (trước là khối --panel nghiêng khác màu). */
#toolbar .wordmark{--tb:transparent}
/* 21.349: tiêu đề mới dài hơn («VƯỢT QUA 2000M» / «NHẬN NGAY 200,000Đ») → chữ nhỏ hơn 21.347; đệm dưới .22em để dấu nặng
   của «Ậ» nằm trong khối vàng (chữ xanh đen, ra ngoài khối là mất dấu như «PHỐ» trước đây). */
h1 .t1{font-size:clamp(34px,10vw,50px)}
h1 .t2{font-size:clamp(28px,8.2vw,41px);padding-bottom:.22em}
@media(min-width:1000px){h1 .t1{font-size:clamp(56px,5.4vw,78px)}h1 .t2{font-size:clamp(46px,4.5vw,64px)}}
@media(min-width:701px) and (max-height:620px){h1 .t1{font-size:38px}h1 .t2{font-size:31px}}
@media(max-width:700px),(max-height:500px){h1 .t1{font-size:31px}h1 .t2{font-size:25px}}
@media(max-width:360px){h1 .t1{font-size:28px}h1 .t2{font-size:22px}}
/* 21.356: tài khoản + bảng xếp hạng (account.js) */
#account-open{color:var(--gold);--tbd:2px solid var(--gold);max-width:200px;--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c1.5-4 4.5-6 8-6s6.5 2 8 6'/%3E%3C/svg%3E")}
#account-open.signed{text-transform:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;line-height:42px}
#account-open.signed::after{display:none}
.side{display:grid;gap:18px;align-content:start;min-width:0}
.ranks{padding:14px 16px 12px}
.ranks-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.ranks-head h2{margin:0}
#rank-all{padding:4px 14px;font-size:11px;color:var(--navy);--tb:var(--gold)}
.rank-me{margin:8px 0 6px;font-size:12.5px;line-height:1.5;color:var(--cream);font-weight:600}
.rank-list{list-style:none;margin:0;padding:0;font-size:13px}
.rank-list li{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:8px;padding:5px 8px;border-radius:8px}
.rank-list li:nth-child(odd){background:rgba(252,242,207,.05)}
.rank-list li.me{background:rgba(245,197,66,.22);outline:1px solid var(--gold)}
.rank-list li.muted{display:block;color:var(--soft);font-weight:500;background:none}
.rank-list .no{font-weight:800;color:var(--gold);text-align:center}
.rank-list li:nth-child(1) .no{color:#ffd23f;font-size:15px}
.rank-list .nm{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rank-list .m{font-variant-numeric:tabular-nums;color:var(--teal);font-weight:700}
#ranks .rank-list{margin-top:4px}
.acct-tabs{display:flex;gap:6px;margin:16px 0 12px}
.acct-tabs button{flex:1;padding:10px;border-radius:10px;background:rgba(252,242,207,.06);color:var(--soft);font-size:13px}
.acct-tabs button.on{background:var(--gold);color:var(--navy)}
.acct-form{display:grid;gap:10px}
.acct-form label{display:grid;gap:5px;font-size:12px;color:var(--soft);font-weight:600}
.acct-form input{font:inherit;font-size:16px;font-weight:500;padding:10px 12px;border-radius:10px;border:2px solid var(--glass-line);background:#0a1a24;color:var(--cream);width:100%}
.acct-form input:focus{outline:none;border-color:var(--gold)}
.acct-form .primary{min-height:52px;font-size:17px;margin-top:6px}
.linkish{justify-self:start;padding:4px 2px;color:var(--teal);font-weight:600;text-decoration:underline;letter-spacing:0}
.acct-or{display:flex;align-items:center;gap:10px;margin:14px 0;color:var(--soft);font-size:12px}
.acct-or::before,.acct-or::after{content:"";flex:1;height:1px;background:rgba(51,224,200,.3)}
.google{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:48px;border-radius:10px;background:#fff;color:#1f1f1f;font-size:14px;letter-spacing:0}
#acct-in small{color:var(--soft);font-weight:500}
.rename{grid-template-columns:1fr auto;align-items:end}
.rename button,#acct-logout{padding:10px 18px;--tb:rgba(10,22,34,.92);--tbd:2px solid var(--teal)}
#acct-logout{margin-top:14px;--tbd:2px solid var(--red)}
.acct-msg{min-height:1.4em;margin:12px 0 0!important;color:#ff8a7a!important}
.acct-msg.ok{color:var(--teal)!important}
#run-toast{position:fixed;z-index:45;left:50%;transform:translateX(-50%);bottom:calc(var(--safe-bottom) + 14px);width:max-content;max-width:min(560px,calc(100vw - 32px));display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px 12px;padding:10px 14px;border-radius:14px;background:rgba(10,22,34,.94);border:2px solid var(--gold);box-shadow:0 8px 30px #000a;font-size:13px;line-height:1.45;text-align:center}
.toast-actions{display:inline-flex;gap:8px;align-items:center}
.toast-actions button{padding:5px 12px;font-size:11.5px}
#toast-ranks{--tb:rgba(51,224,200,.25);--tbd:1px solid var(--teal)}
#toast-close{padding:2px 8px;font-size:18px;color:var(--soft)}
@media(max-width:700px),(max-height:500px){
  #account-open{max-width:130px}#account-open.signed{line-height:32px}
  .ranks{padding:10px 12px 8px}.rank-list{font-size:11.5px}.rank-list li{grid-template-columns:26px minmax(0,1fr) auto;padding:4px 6px}
  .rank-me{font-size:11px}.side{gap:12px}
  #run-toast{font-size:11.5px;padding:7px 10px;bottom:calc(var(--safe-bottom) + 6px)}
}
/* 21.358: hộp «Tải game» — thẻ trình duyệt + các bước có ảnh */
.install-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:14px 0 12px}
.install-tabs button{flex:1 1 auto;padding:9px 10px;border-radius:10px;background:rgba(252,242,207,.06);color:var(--soft);font-size:12.5px;letter-spacing:.02em}
.install-tabs button.on{background:var(--teal);color:var(--navy)}
.install-lead{margin-top:0!important}
.install-lead b.red,.install-steps b.red{color:#ff6b5c}
.install-steps{list-style:none;margin:6px 0 0;padding:0;display:grid;gap:18px}
.install-steps li{border-top:2px solid rgba(51,224,200,.2);padding-top:14px}
.install-steps p{margin:0 0 10px}
.install-steps img{display:block;width:100%;max-width:300px;height:auto;margin:0 auto;border-radius:16px;border:2px solid rgba(252,242,207,.18);box-shadow:0 10px 28px #0008}
.install-done{margin-top:18px!important;padding:12px 14px;border-radius:12px;background:rgba(51,224,200,.12);border:1px solid rgba(51,224,200,.4)}
@media(max-width:700px),(max-height:500px){.install-tabs button{font-size:11px;padding:8px 6px}.install-steps img{max-width:240px}}
/* 21.359: mở hộp thoại thì tiêu điểm vào tiêu đề (autofocus, tabindex -1) thay vì nút × đầu tiên — iPhone vẽ viền xanh quanh nút ×
   như thể nó đang được chọn. Tiêu đề nhận tiêu điểm không có viền. */
dialog [autofocus]:focus{outline:none}
/* 21.364: nút đóng/menu dùng icon SVG thay chữ «×»/«☰» — chữ trong nút bị iPhone bôi chọn (hiện tay cầm xanh + menu Sao chép/Tra cứu)
   khi chạm giữ. Mọi nút không cho bôi chọn chữ, không hiện menu chạm giữ. */
button{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.close svg,#toast-close svg,#game-menu svg{display:block;pointer-events:none}
.close{color:var(--cream)}
#game-menu{display:grid;place-items:center}
#game-menu[hidden]{display:none}
@media(max-width:700px),(max-height:500px){.close .ico-x{width:16px;height:16px}}
