/* ================= MonBlock — light flat skin for the game pages (Roblox-like, same look as the portal) =================
   Loaded by every game AFTER its own css/style.css, active with <body class="mb-light"> (also turns the shell bar light).
   Light grey page, flat white cards with a hairline border, dark grey text, blue = action / selection, green = play.
   Games keep their own layout (Caro template); this file only re-skins the shared classes. The play field itself (boards,
   canvases, touch controls drawn over the canvas) keeps the game's own colours. */
/* Game pages are apps, not documents: taps / long-presses never select text (Android Chrome would pop "Touch to Search"
   and the copy / search callout). Text fields (chat, names) stay editable. */
body.mb-light { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.mb-light :is(input, textarea, [contenteditable]) { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
body.mb-light {
  --bg: #f2f4f5;
  --panel: #ffffff;
  --panel-2: #f2f4f5;
  --line: #e3e5e8;
  --txt: #191b1d;
  --muted: #606368;
  --accent: #ffc93d;
  --pri: #335fff;
  --red: #e5374f;
  --ok: #00a862;
  --coin: #b87400;
  --gem: #0a8fd0;
  --radius: 12px;
  background: var(--bg);
  color: var(--txt);
  font-family: "Builder Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
/* Home painting behind every screen (owner 19/11/2026, design system "Tranh nền sau mọi màn"): a game opts in with
   --mb-scene: url(/<id>/img/home-bg.webp) and --mb-scene-on: ''. Fixed layer, so it never scrolls or repaints.
   Veil default = token --ds-scene-veil (game pages do not load tokens.css). */
body.mb-light::before { content: var(--mb-scene-on, none); position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--mb-scene-veil, rgba(242, 244, 245, .66)), var(--mb-scene-veil, rgba(242, 244, 245, .66))), var(--mb-scene, none) center / cover no-repeat; }
body.mb-light a { color: var(--pri); }
body.mb-light .gem-chip b, body.mb-light .gem, body.mb-light .item .act .gem { color: var(--gem); }
body.mb-light .coin-chip b { color: var(--coin); }

/* ---------- player card ---------- */
body.mb-light .me-card { border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: none; }
body.mb-light .me-chips > * { padding: 3px 10px; border-radius: 6px; background: var(--panel-2); }
body.mb-light .xpbar { background: #e3e5e8; }
body.mb-light .xpbar i { background: var(--ok); }

/* ---------- buttons: flat white, hairline border ---------- */
body.mb-light .big, body.mb-light .small, body.mb-light .seg button, body.mb-light .tabs button, body.mb-light .lv,
body.mb-light .tools button, body.mb-light .replay-ctl button, body.mb-light .rules button, body.mb-light .vgrid button,
body.mb-light .opt, body.mb-light .vcard, body.mb-light .cth {
  border: 1px solid var(--line); background: #fff; color: var(--txt); box-shadow: none; transition: background .12s, border-color .12s;
}
body.mb-light .small:hover, body.mb-light .seg button:hover, body.mb-light .tabs button:hover, body.mb-light .tools button:hover,
body.mb-light .lv:hover, body.mb-light .opt:hover { background: #f7f8f9; border-color: #c9ccd1; }
body.mb-light .big small, body.mb-light .lv small, body.mb-light .rules button small { color: var(--muted); font-weight: 500; }
body.mb-light .small { border-radius: 10px; font-weight: 600; }
/* Mode tiles: white card, a coloured bar on the left tells the kind of play. */
body.mb-light .big { position: relative; padding-left: 22px; border-radius: 12px; font-weight: 700; overflow: hidden; }
body.mb-light .big::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--bar, #c9ccd1); }
body.mb-light .big:hover { transform: none; border-color: #c9ccd1; background: #fafbfc; }
body.mb-light .big-online { --bar: #335fff; }
body.mb-light .big-ai { --bar: #e5374f; }
body.mb-light .big-local { --bar: #00a862; }
body.mb-light .big-resume, body.mb-light .big-daily, body.mb-light .big-shop { --bar: #ffb020; }
body.mb-light .big-bai, body.mb-light .big-cothe, body.mb-light .big-new { --bar: #8a5cff; }
body.mb-light .big-ladder { --bar: #ff7a1a; }
body.mb-light .big-spin { --bar: #b05cff; animation: none; }
body.mb-light .big-go, body.mb-light .big-claim { padding-left: 18px; border-color: var(--ok); background: var(--ok); color: #fff; box-shadow: none; }
body.mb-light .big-go::before, body.mb-light .big-claim::before { display: none; }
body.mb-light .big-go:hover, body.mb-light .big-claim:hover { background: #008f53; }
body.mb-light .big-coins { border: 1px solid var(--line); background: #fff; color: var(--coin); }
body.mb-light .sticky-go { box-shadow: 0 -10px 20px rgba(242, 244, 245, .95); }

/* Selected states: blue outline + pale blue fill. */
body.mb-light .seg button.active, body.mb-light .tabs button.on, body.mb-light .lv.active, body.mb-light .rules button.active,
body.mb-light .vgrid button.active, body.mb-light .vcard.active, body.mb-light .opt.on {
  border-color: var(--pri); background: #eef2ff; color: var(--pri); box-shadow: inset 0 0 0 1px var(--pri);
}
body.mb-light .rules button.active b { color: var(--pri); }
body.mb-light .cth.done { border-color: #a6dfc2; background: #f0faf5; }
body.mb-light .skill.on u { color: var(--ok); }
body.mb-light .skill.on { border-color: #a6dfc2; background: #f0faf5; }
body.mb-light .rtag, body.mb-light .vtag { border: 1px solid #c7d3ff; background: #eef2ff; color: var(--pri); }

/* ---------- texts that used the yellow accent as a colour ---------- */
body.mb-light .on-elo, body.mb-light .on-code, body.mb-light .rrow .sc, body.mb-light .hgo, body.mb-light .status.over,
body.mb-light .wheel-msg .win, body.mb-light .evt, body.mb-light .item .evt { color: var(--pri); }
body.mb-light .spinner { border-color: var(--line); border-top-color: var(--pri); }

/* ---------- during a game (side panel, clocks, statuses) ---------- */
body.mb-light .status { background: #fff; border: 1px solid var(--line); }
body.mb-light .status.check { background: #fdecee; color: #c41d3a; border-color: #f6b9c3; }
body.mb-light .status.over { background: #eef2ff; border-color: #c7d3ff; }
body.mb-light .clock { background: var(--panel-2); color: var(--txt); }
body.mb-light .clock.on, body.mb-light .clock.run { background: var(--txt); border-color: var(--txt); color: #fff; }
body.mb-light .clock.low, body.mb-light .clock.run.low { background: var(--red); border-color: var(--red); color: #fff; }
body.mb-light .mv.cur, body.mb-light .mv-row .cur { background: var(--pri); color: #fff; }
body.mb-light .mv-row .r, body.mb-light .chk, body.mb-light .net { color: #c41d3a; }
body.mb-light .replay-actions { background: linear-gradient(rgba(242, 244, 245, 0), var(--bg) 40%); }
body.mb-light .replay-actions .big { box-shadow: none; }

/* ---------- lists: history, ranking, quests, settings ---------- */
body.mb-light .hrow, body.mb-light .rrow, body.mb-light .q, body.mb-light .tg, body.mb-light .stats div, body.mb-light .on-wait,
body.mb-light .item, body.mb-light .day { border: 1px solid var(--line); background: #fff; box-shadow: none; }
body.mb-light .hrow, body.mb-light .q, body.mb-light .tg, body.mb-light .item { border-radius: 10px; }
body.mb-light .hres.win { background: #e6f6ee; color: var(--ok); }
body.mb-light .hres.loss { background: #fdecee; color: #c41d3a; }
body.mb-light .rrow.me, body.mb-light .rank .row.me { border-color: var(--pri); background: #eef2ff; }
body.mb-light .q button, body.mb-light .claim, body.mb-light .updatebar button, body.mb-light .bundle button { border-radius: 8px; background: var(--pri); color: #fff; box-shadow: none; animation: none; }
body.mb-light .on-join input { border: 1px solid #c9ccd1; border-radius: 8px; background: #fff; color: var(--txt); }
body.mb-light .day.today { border-color: var(--pri); background: #eef2ff; }

/* ---------- shop ---------- */
body.mb-light .item.active { border-color: var(--ok); background: #f0faf5; box-shadow: inset 0 0 0 1px var(--ok); }
body.mb-light .item.active .act { background: #e6f6ee; color: var(--ok); }
body.mb-light .item .act.buy { background: #fff6db; color: var(--coin); }
body.mb-light .item.r-rare { border-color: #9fc0ff; }
body.mb-light .item.r-epic { border-color: #c6a6ff; background: #fff; }
body.mb-light .item.r-legend { border-color: #ffcf6a; background: #fff; }
body.mb-light .bundle { border: 1px solid var(--line); background: #fff; box-shadow: none; }
/* Người Que portraits keep a dark backdrop: fighters are drawn in light colours. */
body.mb-light canvas.me-av, body.mb-light .shop-top canvas, body.mb-light .item .sw.facepv, body.mb-light .tryon canvas {
  background: radial-gradient(circle at 50% 70%, #3a3f4a, #1e2229);
}
body.mb-light .tryon figcaption { color: var(--muted); }

/* ---------- dialogs, toasts ---------- */
body.mb-light .modal { background: rgba(0, 0, 0, .45); }
body.mb-light .dialog { border: 0; border-radius: 12px; background: #fff; box-shadow: 0 16px 48px rgba(0, 0, 0, .25); }
body.mb-light .mbtns, body.mb-light .dialog .mbtns { background: #fff; }
body.mb-light .mbtns button, body.mb-light .dlg-btns button { border: 1px solid #c9ccd1; border-radius: 8px; background: #fff; color: var(--txt); box-shadow: none; font-weight: 700; }
body.mb-light .mbtns button.pri, body.mb-light .dlg-btns button.pri { border-color: var(--pri); background: var(--pri); color: #fff; }
body.mb-light .dialog li.coin { color: var(--coin); background: #fff6db; }
body.mb-light .dialog li.quest { color: var(--ok); background: #e6f6ee; }
body.mb-light .toast { border-radius: 10px; background: #191b1d; color: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .2); }
body.mb-light .updatebar { border: 1px solid var(--line); background: #fff; }

/* Link rows at the foot of a game home (kỳ phổ, cờ thế, hướng dẫn…): each link gets a finger-sized hit box (≥ 34 px tall) and the
   lines get room, so 6–7 links in a row are not glued together on a phone (game audit 09/11/2026). The guest note keeps plain links. */
body.mb-light #scHome .note:not(#guestNote) { line-height: 1.4; }
body.mb-light #scHome .note:not(#guestNote) a { display: inline-block; padding: 8px 3px; margin: 0 1px; line-height: 18px; text-underline-offset: 3px; }

/* The "new version" bar is retired (sdk/pwa.js applies updates silently) */
.updatebar { display: none !important; }

/* Phone held sideways (orient-check 19/11/2026): while playing, the page bottom padding (28–32 px, room for the old bottom
   nav) pushed the play screen past a 390 px screen — scroll to reach the last row / tools. */
@media (orientation: landscape) and (max-height: 500px) { body.mb-play main.wrap { padding-bottom: 4px; } }

/* Standard painted home, phone held sideways (low frame) — design system "Phần chung bổ sung" (19/11/2026):
   hero on the left, logo → CHƠI → shortcut strip in one column. One rule for every game whose .hm-stack holds a .hm-hero
   (games with their own home, like Gộp Trái Cây, have no .hm-hero and keep their layout). */
@container (orientation: landscape) and (max-height: 560px) {
  :is(.hm-stack:has(> .hm-hero)) { display: grid; grid-template-columns: auto auto; grid-template-areas: "hero logo" "hero play" "hero go"; align-content: center; justify-content: center; justify-items: center; align-items: center; column-gap: 4cqw; row-gap: 2.4cqh; }
  :is(.hm-stack:has(> .hm-hero)):has(> .hm-go > .hm-play) { grid-template-areas: "hero logo" "hero go"; }
  :is(.hm-stack:has(> .hm-hero)) > .hm-hero { grid-area: hero; width: auto; max-width: 30cqw; max-height: 50cqh; }
  :is(.hm-stack:has(> .hm-hero)) > .hm-logo { grid-area: logo; max-height: 17cqh; }
  :is(.hm-stack:has(> .hm-hero)) > .hm-play { grid-area: play; }
  :is(.hm-stack:has(> .hm-hero)) > :is(.hm-go, .hm-maps, .hm-tools) { grid-area: go; margin-top: 0; }
}

/* Hard level not cleared yet: its first clear pays 1 💎 (owner 29/11/2026). One badge for every level grid, inside the cell's top-left corner. */
:has(> .mb-hardgem) { position: relative; }
.mb-hardgem { position: absolute; top: 3px; left: 4px; font-size: 12px; font-style: normal; line-height: 1; pointer-events: none; }
