/* Giao diện chung cho mọi trang của website Blocked: Merge Puzzle.
   Màu "Neon đêm" lấy từ src/ui/theme.ts (nền xanh đêm, ô kính màu, ô chắn đá núi lửa nứt cam). Chỉ có nền tối, giống app.
   Ẩn/hiện ngôn ngữ do site.js làm (một quy tắc chèn vào), không nằm ở đây. */
:root {
  --bg: #0b1022; --bg-2: #151c38; --card: #111836; --line: rgba(150, 170, 255, 0.22);
  --text: #e8ecff; --muted: #9aa6d6; --accent: #7fe9ff; --accent-ink: #0b1022; --warm: #ff7a1f;
  --cta-from: #3fd6ff; --cta-to: #8b5cff; --cta-edge: #5b3fd0;
  --board: #0e1430; --board-edge: rgba(140, 160, 255, 0.3);
  --cell: rgba(140, 160, 255, 0.11); --cell-edge: rgba(160, 180, 255, 0.26);
  --block: #322e39; --block-edge: #8d8698; --mystery: #9ff6ff;
  --shadow: 0 20px 50px -20px rgba(111, 139, 255, 0.45);
  --radius: 16px;
  --font-display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --font: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; }
strong { font-weight: 600; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, .brand { font-family: var(--font-display); text-wrap: balance; }
.wrap { max-width: 64rem; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 44rem; }

/* ---- Thanh trên cùng ---- */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; min-width: 0; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.top nav a.link { padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.top nav a.link:hover { color: var(--text); background: var(--bg-2); }
@media (max-width: 640px) { .top nav a.link { display: none; } }
.lang { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg-2); flex: none; }
.lang button { font: inherit; font-size: 13px; font-weight: 600; min-width: 40px; min-height: 32px; padding: 0 10px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* ---- Nút ---- */
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; border-radius: 14px;
  padding: 12px 20px; min-height: 52px; font-size: 16px; line-height: 1.2; color: #fff;
  background: linear-gradient(180deg, var(--cta-from), var(--cta-to)); box-shadow: 0 4px 0 var(--cta-edge); }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--cta-edge); }
.btn small { display: block; font-size: 12px; font-weight: 500; opacity: 0.9; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
/* Link cửa hàng còn {{...}} trong config.js: nút thành nhãn "Sắp ra mắt". */
.btn:not([href]) { background: transparent; color: var(--muted); border: 1px dashed var(--line); box-shadow: none; cursor: default; }
.btn:not([href]):hover { filter: none; }
.btn:not([href]):active { transform: none; }
.btn[href] .soon, .btn:not([href]) .get { display: none; }

/* ---- Trang chủ: phần đầu ---- */
.hero { padding: 56px 0 48px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(36px, 7vw, 60px); line-height: 1.05; margin: 12px 0 16px; }
.hero p.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); max-width: 32rem; margin: 0 0 28px; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--bg-2); font-size: 14px; font-weight: 600; color: var(--accent); }
.facts { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 14px; }
.facts span::before { content: "✓ "; color: var(--accent); font-weight: 700; }
@media (max-width: 820px) {
  .hero { padding: 32px 0 40px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 32px; }
}

/* Bàn chơi minh hoạ */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 10px; background: var(--board);
  border: 1px solid var(--board-edge); border-radius: 18px; width: min(100%, 420px); margin-inline: auto; box-shadow: var(--shadow); }
.cell { aspect-ratio: 1; border-radius: 10px; background: var(--cell); box-shadow: inset 0 0 0 1px var(--cell-edge);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: clamp(20px, 4.4vw, 34px);
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); position: relative; }
/* Ô số kiểu kính: nền màu trong mờ + viền sáng (TILE_COLORS trong src/ui/theme.ts). */
.v2 { background: #39f3fc6b; box-shadow: inset 0 0 0 2px #39f3fc; }
.v4 { background: #30c0f86b; box-shadow: inset 0 0 0 2px #30c0f8; }
.v8 { background: #685ef76b; box-shadow: inset 0 0 0 2px #685ef7; }
.v16 { background: #9460b76b; box-shadow: inset 0 0 0 2px #9460b7; }
.v32 { background: #eb8ccd6b; box-shadow: inset 0 0 0 2px #eb8ccd; }
.v64 { background: #ce64896b; box-shadow: inset 0 0 0 2px #ce6489; }
.v128 { background: #de1d3f6b; box-shadow: inset 0 0 0 2px #de1d3f; font-size: clamp(17px, 3.6vw, 28px); }
.v1024 { background: #4ce1b66b; box-shadow: inset 0 0 0 2px #4ce1b6; font-size: clamp(15px, 3.2vw, 24px); }
.blk { background: radial-gradient(circle at 35% 30%, #3e3946, var(--block) 60%, #1c1a21); box-shadow: inset 0 0 0 2px var(--block-edge), 0 0 14px -4px var(--warm);
  color: var(--mystery); text-shadow: 0 0 10px var(--mystery); overflow: hidden; }
.blk svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.blk.mystery { font-size: clamp(22px, 5vw, 38px); }
.hint { outline: 3px dashed var(--warm); outline-offset: -6px; }

/* ---- Các khối nội dung ---- */
section.block { padding: 56px 0; border-top: 1px solid var(--line); }
section.block h2 { font-size: clamp(24px, 4vw, 34px); line-height: 1.2; margin: 0 0 8px; }
section.block p.sub { color: var(--muted); margin: 0 0 28px; max-width: 40rem; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { font-size: 18px; margin: 12px 0 6px; }
.card p { color: var(--muted); margin: 0; font-size: 15px; }
.icon-tile { width: 44px; height: 44px; font-size: 22px; }
.sizes { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.sizes .card { flex: 1 1 160px; text-align: center; }
.sizes strong { font-family: var(--font-display); font-size: 28px; display: block; }
.note { color: var(--muted); margin: 16px 0 0; }

.shots { display: grid; grid-auto-flow: column; grid-auto-columns: min(240px, 62vw); gap: 16px; overflow-x: auto;
  scroll-snap-type: x mandatory; padding: 4px 4px 16px; margin: 0 -4px; scrollbar-width: thin; }
.shots img { width: 100%; aspect-ratio: 414 / 900; object-fit: cover; border-radius: 22px; scroll-snap-align: start; box-shadow: var(--shadow); background: var(--bg-2); }

.support { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 720px) { .support { grid-template-columns: 1fr; } }
.support ol, .support ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); display: grid; gap: 6px; }
.support .stack { display: grid; gap: 16px; }
details { border-top: 1px solid var(--line); padding: 12px 0; }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-weight: 700; }
details[open] summary::after { content: "–"; }
details p { margin: 8px 0 0; color: var(--muted); }

/* Game khác của studio (thẻ do ../more-games.js tạo) */
.more-games { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.mg-card { display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto 1fr; gap: 4px 14px; align-items: start; padding: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.mg-card:hover { border-color: var(--accent); }
.mg-icon { grid-row: 1 / 3; width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-size: 30px; background: var(--bg-2); object-fit: cover; }
.mg-text { color: var(--muted); font-weight: 400; font-size: 14px; line-height: 1.45; }

/* ---- Trang văn bản (quyền riêng tư, điều khoản) ---- */
.doc p { margin: 0 0 12px; }
.doc header.intro { padding: 40px 0 8px; }
.doc h1 { font-size: clamp(28px, 6vw, 40px); line-height: 1.15; margin: 0; }
.doc .meta { margin-top: 10px; color: var(--muted); font-size: 14px; }
.summary { margin: 28px 0; padding: 18px 20px; border-radius: 14px; background: var(--bg-2); }
.summary h2 { margin: 0 0 8px; font-family: var(--font); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.summary ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.doc section { padding: 18px 0; border-top: 1px solid var(--line); }
.doc section:first-of-type { border-top: 0; }
h2.sec { font-size: 20px; line-height: 1.3; margin: 0 0 8px; }
ul.list { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 6px; }
.table-wrap { overflow-x: auto; margin: 8px 0 12px; }
table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.doc article + article { margin-top: 24px; }

/* ---- Chân trang ---- */
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

[hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) {
  .lang button, .top nav a.link { transition: background 0.15s, color 0.15s; }
  .float { animation: float 4s ease-in-out infinite; }
  @keyframes float { 50% { transform: translateY(-6px); } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
