/* ================= Cá Lớn Nuốt Cá Bé — MonBlock (base copied from Đuổi Hình Bắt Chữ) ================= */
:root {
  --bg: #0d1117;
  --panel: #151c26;
  --panel-2: #1b2431;
  --line: #2b3646;
  --txt: #e8eef6;
  --muted: #93a3b8;
  --accent: #ffcf5a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--txt);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  padding: var(--sat) var(--sar) var(--sab) var(--sal);
}
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent); }
.wrap { max-width: 640px; margin: 0 auto; padding: 8px 14px 28px; }
.screen { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
h2 { font-size: 17px; margin: 18px 0 10px; }
.note { color: var(--muted); font-size: 13px; line-height: 1.5; }
body.touch .no-touch { display: none; }

/* ---------- trang chủ ---------- */


/* ---------- chọn độ khó ---------- */
.variants { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 6px; }
.variant { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-align: left; }
.variant.on { border-color: #335fff; box-shadow: inset 0 0 0 1px #335fff; }
.variant > i { font-size: 30px; font-style: normal; line-height: 1; }
.variant span { display: flex; flex-direction: column; gap: 3px; }
.variant b { font-size: 16px; }
.variant small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.variant em { color: #b87400; font-size: 12px; font-style: normal; font-weight: 800; }

/* ---------- cửa hàng ---------- */
.shop-top { display: flex; justify-content: flex-end; gap: 16px; margin: 4px 0; font-size: 17px; font-weight: 800; }
.gem-chip b { color: #7fd8ff; }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px 12px; border: 2px solid var(--line); border-radius: 16px; background: var(--panel); text-align: center; }
.item.locked { opacity: .55; }
.item b { font-size: 14px; }
.item .rar { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.item .act { padding: 2px 8px; border-radius: 6px; font-size: 13px; font-weight: 800; color: var(--muted); }
.gem { color: #7fd8ff; }
.buyprev { display: flex; justify-content: center; margin: 4px 0 8px; }

/* ---------- xếp hạng ---------- */
.tabs { display: flex; gap: 6px; margin: 6px 0 10px; }
.tabs button { flex: 1; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-weight: 800; font-size: 14px; }
.rank .row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.rank .no { width: 28px; color: var(--muted); font-weight: 800; text-align: center; }
.rank .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.rank .nm small { color: var(--muted); font-weight: 600; }
.rank .sc { font-weight: 900; color: #b87400; }

.help { line-height: 1.6; }
.help ul { padding-left: 20px; }

/* ---------- hộp thoại ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(5, 8, 12, .72); }
.dialog { width: min(420px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.dialog h3 { margin: 0 0 8px; font-size: 20px; }
.dialog p { line-height: 1.5; }
.dialog .score { margin: 4px 0; font-size: 40px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; }
.dialog .rw { padding-left: 18px; line-height: 1.8; font-weight: 700; }
.dlg-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.dlg-btns button { padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); font-weight: 800; }
.toast { position: fixed; left: 50%; bottom: calc(80px + var(--sab)); z-index: 90; transform: translateX(-50%); padding: 10px 16px; border-radius: 12px; background: #222c3a; font-weight: 700; }
.updatebar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.updatebar button { padding: 8px 12px; border: 0; border-radius: 10px; font-weight: 800; }

h2 { font-size: 16px; margin: 16px 0 8px; }
.item { position: relative; }
.item .pay { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; }
.item .pr { font-size: 13px; font-weight: 800; color: #191b1d; }
.item .pr.on { color: #00a862; }
.item .pr.g { color: #1a8fd8; }
.item .pr.gh { color: var(--muted); font-weight: 600; font-size: 11px; }
.item.poor .pay { opacity: .5; }
.item .lock { position: absolute; top: 6px; right: 6px; z-index: 2; padding: 1px 6px; border-radius: 8px; background: #191b1d; color: #fff; font-size: 11px; font-weight: 800; }
.item.active { border-color: #335fff; }
.item .own { font-size: 12px; font-weight: 800; color: #6b3f16; }


/* ---------- chọn màn ---------- */
.mapcard { margin: 0 0 14px; border-radius: 16px; overflow: hidden; background: #fff; border: 1px solid #e3e5e8; scroll-margin-top: 70px; }
.mapcard.locked { opacity: .6; }
.mhead { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: linear-gradient(90deg, #1f5f7c, #2f7f9c); color: #fff; }
.mhead .mini { display: flex; gap: 4px; flex: none; }
.mhead .mini .board { --tw: 15px; display: flex; gap: 3px; margin: 0; padding: 0; }
.mhead .mini .tube .glass { border-width: 2px; padding: 1px; box-shadow: 0 0 0 1px rgba(8, 22, 36, .5); }
.mhead .mini .tube .glass::after { display: none; }
.mhead span.mt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mhead b { font-size: 17px; }
.mhead small { font-size: 13px; font-weight: 700; opacity: .92; }
.mhead .mc { font-weight: 900; font-size: 15px; white-space: nowrap; }
.lvgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 12px; }
.lv { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 54px; justify-content: center; padding: 6px 2px; border: 2px solid #cfe3ee; border-radius: 14px; background: #f1f8fc; font-weight: 900; color: #245a75; }
.lv b { font-size: 17px; }
.lv small { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: #c9ced6; }
.lv small i { font-style: normal; color: #e0a020; }
.lv.done { background: #e0f0f8; border-color: #6fb0d2; }
.lv.clean { background: #fff3c9; border-color: #e0a83a; color: #7a4f08; }
.lv.cur { border-color: #335fff; box-shadow: 0 0 0 3px rgba(51, 95, 255, .22); }
.lv:disabled { opacity: .45; background: #f0f1f2; border-color: #e3e5e8; color: #9aa0a6; }

/* ---------- cửa hàng ---------- */
.shop .item { position: relative; }
.pv { position: relative; display: flex; justify-content: center; align-items: center; width: 100%; min-height: 96px; pointer-events: none; }
.pv .board { --tw: 26px; display: flex; gap: 7px; margin: 0; padding: 0; }
.pv .board .tube { width: var(--tw); }
.pv .board .tube .glass { border-width: 2px; padding: 2px; box-shadow: 0 0 0 1px rgba(8, 22, 36, .6), 0 4px 5px rgba(0, 0, 0, .25); }
.pv .board .tube .glass::after { width: 12%; }
.pv-bg .field { display: flex; justify-content: center; width: 124px; max-width: none; margin: 0; padding: 12px 8px 8px; border-radius: 12px; }
.pv-bg .board { --tw: 20px; }
.buyprev .pv .board { --tw: 40px; gap: 12px; }
.buyprev .pv-bg .field { width: 220px; padding: 18px 10px 12px; }
.buyprev .pv-bg .board { --tw: 32px; }
.boostpv { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 900; color: #6b3f16; }
.boostpv .mbi { width: 46px; height: 46px; }

/* ---------- hộp kết quả ---------- */
.dialog.win { text-align: center; }
.dialog.win .wm { display: block; width: 104px; height: 104px; margin: -4px auto 0; animation: cheer 1.4s ease-in-out infinite; }
@keyframes cheer { 50% { transform: translateY(-6px) rotate(3deg); } }
.dialog.win h3 { margin: 4px 0 2px; font-size: 26px; font-weight: 900; color: #2f8f1f; }
.dialog.win .ans { margin: 0 0 8px; font-size: 22px; font-weight: 900; color: #3b1f06; }
.wstars { display: flex; justify-content: center; gap: 6px; margin: 4px 0 6px; }
.wstars .mbi { width: 44px; height: 44px; opacity: .25; filter: grayscale(1); }
.wstars .mbi.on { opacity: 1; filter: none; animation: starIn .5s ease backwards; }
.wstars .mbi.on:nth-child(2) { animation-delay: .15s; } .wstars .mbi.on:nth-child(3) { animation-delay: .3s; }
@keyframes starIn { from { transform: scale(0) rotate(-40deg); } }
.wchips { display: flex; justify-content: center; gap: 8px; margin: 2px 0 6px; flex-wrap: wrap; }
.wc { display: flex; align-items: center; gap: 4px; padding: 5px 11px 5px 7px; border-radius: 999px; background: #fff; border: 2px solid #e2bb72; font-size: 17px; color: #3b1f06; }
.wc i { font-style: normal; font-size: 20px; line-height: 1; }
.wc i .mb-coin { width: 22px; height: 22px; vertical-align: -4px; }
.wc .mbi { width: 22px; height: 22px; }
.wc b { font-weight: 900; }
.wc small { font-size: 12px; font-weight: 800; color: #8a5a22; }
.wtags { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.wtags span { padding: 3px 10px; border-radius: 999px; background: #e9f7d9; color: #2f6f1a; font-size: 12px; font-weight: 800; }
.dialog .evtag, .item .evtag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: linear-gradient(90deg, #8fd0ff, #c9b8ff); color: #1d2a4a; }
.dialog.win .more { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 16px; padding: 14px; border: 0; border-radius: 999px;
  background: linear-gradient(#7ed957, #2f9e2a); color: #fff; font-size: 20px; font-weight: 900; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), 0 5px 0 #1d6b18; text-shadow: 0 2px 0 #1d6b18; }
.dialog.win .more:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .45), 0 2px 0 #1d6b18; }
.dialog.win .more .mbi { width: 30px; height: 30px; flex: none; }
.dialog.win .links { display: flex; justify-content: center; gap: 22px; margin-top: 12px; flex-wrap: wrap; }
.dialog.win .links button { display: flex; align-items: center; gap: 6px; padding: 8px 4px; border: 0; background: none; font-size: 16px; font-weight: 900; color: #6b4418; }
.dialog.win .links .mbi { width: 24px; height: 24px; }
.wbtns { display: flex; gap: 8px; margin-top: 14px; }
.dialog.win .wbtns .more { flex: 1; margin-top: 0; }
.wshare { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 76px; padding: 6px 4px; border: 0; border-radius: 18px;
  background: linear-gradient(#5aa8ff, #2f6fe0); color: #fff; font-size: 13px; font-weight: 900; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .4), 0 5px 0 #1a4aa8; }
.wshare:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .4), 0 2px 0 #1a4aa8; }
.wshare .mbi { width: 26px; height: 26px; }
.wshare .mbi * { stroke: #fff; }
.modal:has(.dialog.win) { place-items: safe center; overflow-y: auto; }
.dialog.win { background: #fffdf5; }
.dialog.win .wsub { margin: 0 0 6px; font-size: 14px; color: #6b4418; font-weight: 700; }
.dialog .buyprev { display: flex; justify-content: center; margin: 6px 0 10px; }
.dialog .buyprev .boostpv { width: 100px; height: 100px; }
.dialog .stuck-tip { margin: 6px 0; color: #6b4418; font-weight: 700; }
@media (max-width: 380px) { .ctl button { font-size: 11px; } }




/* ================= Làng Quê Đại Chiến — riêng của game (mẫu của chủ dự án 15/11/2026) ================= */
html body.mb-light { background: linear-gradient(180deg, #9bd96e 0%, #5aa843 45%, #2f7a2c 100%) fixed; color: #fff; }
html body.mb-light .wrap { max-width: 560px; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
html body.mb-light .note { color: rgba(255, 255, 255, .9); }
html body.mb-light .note a { color: #ffe27a; }
.shop-top { color: #fff; }
.help { background: rgba(255, 255, 255, .96); color: #234a1f; padding: 4px 16px 12px; border-radius: 16px; }
.help h2 { color: #2a6a22; }
html body.mb-light .shop .item b, html body.mb-light .dialog { color: #234a1f; }
html body.mb-light .item { background: #fffdf3; border-color: #e6d9a8; }
.pv { background: linear-gradient(180deg, #cfeeff, #9ad06a); border-radius: 12px; }

/* ---------- chọn màn ---------- */
html body.mb-light .mapcard { background: rgba(255, 255, 255, .95); color: #234a1f; }
.mhead { background: #2a6a22 center/cover no-repeat; min-height: 72px; text-shadow: 0 2px 4px rgba(0, 30, 0, .75); }
.mhead span.mt, .mhead .mc { text-shadow: 0 2px 4px rgba(0, 30, 0, .85); }
html body.mb-light .lv { color: #2a5a1f; background: #f1f9e8; border-color: #cfe5b8; }
.lv.done { background: #e2f1cf; border-color: #8fc45e; } .lv.clean { background: #fff3c9; border-color: #e0a83a; color: #7a4f08; }
.lv.cur { border-color: #2f9e2a; box-shadow: 0 0 0 3px rgba(47, 158, 42, .28); }
.lv .boss { position: absolute; top: 2px; right: 4px; font-size: 11px; }
.lv { position: relative; }

/* ---------- màn chơi ngang ---------- */
#scPlay { margin: 0 -14px; }
.stage { position: relative; margin: 0 auto; background: #2a5a20; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; --u: .5; }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.stage .hud { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform: scale(var(--u)); transform-origin: 0 0; pointer-events: none; font-family: "Segoe UI", Roboto, Arial, sans-serif; }
.hud .seedbar { position: absolute; left: 10px; top: 8px; display: flex; gap: 6px; padding: 6px; border-radius: 16px; background: linear-gradient(180deg, #c98a48, #8f5a28); border: 4px solid #5e3612; box-shadow: 0 5px 0 rgba(0, 0, 0, .28); pointer-events: auto; }
.hud .sunbox { width: 96px; height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; background: #f6e8bd; border: 3px solid #7a4a1c; }
.hud .sunbox img { width: 60px; height: 60px; object-fit: contain; }
.hud .sunbox b { font-size: 30px; line-height: 1; color: #6b3a12; font-variant-numeric: tabular-nums; }
.hud .sunbox.flash b { color: #e0301a; animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.hud .seed { position: relative; width: 84px; height: 104px; padding: 0; border-radius: 10px; border: 3px solid #7a4a1c; background: linear-gradient(180deg, #fff6d6, #f1d98f); overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; touch-action: manipulation; }
.hud .seed img { width: 70px; height: 70px; object-fit: contain; margin-top: 3px; }
.hud .seed .cost { position: absolute; bottom: 0; left: 0; right: 0; height: 26px; line-height: 26px; text-align: center; font-size: 20px; font-weight: 900; color: #5e2e0a; background: rgba(255, 231, 150, .9); }
.hud .seed .cdv { position: absolute; left: 0; right: 0; top: 0; background: rgba(40, 30, 10, .55); height: 0; transition: none; }
.hud .seed.poor img { filter: grayscale(.7) brightness(.8); }
.hud .seed.sel { border-color: #3bb630; box-shadow: 0 0 0 4px rgba(120, 255, 90, .8), 0 0 18px rgba(120, 255, 90, .9); transform: translateY(-4px); }
.hud .tools { position: absolute; right: 12px; top: 8px; display: flex; gap: 8px; align-items: flex-start; pointer-events: none; }
.hud .tools > * { pointer-events: auto; }
.hud .wave { width: 300px; height: 46px; border-radius: 14px; padding: 6px 10px; background: linear-gradient(180deg, #c98a48, #8f5a28); border: 4px solid #5e3612; box-shadow: 0 4px 0 rgba(0, 0, 0, .28); display: flex; flex-direction: column; justify-content: center; pointer-events: none; }
.hud .wave .wb { position: relative; height: 16px; border-radius: 9px; background: #3a2208; overflow: hidden; }
.hud .wave .wb i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8bec5a, #2fb43a); border-radius: 9px; }
.hud .wave small { font-size: 13px; line-height: 1; text-align: center; color: #ffeeb8; font-weight: 800; margin-bottom: 1px; }
.hud .tb { width: 66px; height: 66px; padding: 0; border-radius: 14px; border: 4px solid #5e3612; background: linear-gradient(180deg, #ffd36a, #f09a1c); display: grid; place-items: center; color: #5e3612; font-size: 24px; font-weight: 900; box-shadow: 0 4px 0 rgba(0, 0, 0, .28); touch-action: manipulation; }
.hud .tb .mbi { width: 40px; height: 40px; }
.hud .tb.on { background: linear-gradient(180deg, #9af072, #3bb630); box-shadow: 0 0 0 4px rgba(255, 255, 255, .85), 0 4px 0 rgba(0, 0, 0, .28); }
.hud .banner { position: absolute; left: 0; right: 0; top: 300px; text-align: center; font-size: 54px; font-weight: 900; color: #fff; text-shadow: 0 4px 0 #5e2a08, 0 0 14px rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; }
.hud .banner.show { animation: ban 2.4s ease forwards; }
.hud .banner.big { font-size: 78px; color: #ff6a4a; }
@keyframes ban { 0% { opacity: 0; transform: scale(.6); } 12% { opacity: 1; transform: scale(1.08); } 20% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.05); } }
.hud .tip { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 26px; font-weight: 800; color: #fff; text-shadow: 0 2px 4px rgba(0, 30, 0, .9); pointer-events: none; }
.rotate { display: none; position: fixed; inset: 0; z-index: 70; place-items: center; text-align: center; color: #fff; background: rgba(20, 60, 20, .94); }
.rotate.on { display: grid; }
.stage .modal { position: absolute; padding: 8px; }
.stage .dialog { max-height: calc(100% - 8px); }
#btnExit { display: none; pointer-events: auto; }
body.mb-play .wrap { padding: 0; max-width: none; }

/* ---------- chọn cây ---------- */
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; margin: 8px 0; }
.pk { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px 4px; border: 3px solid #d9c98a; border-radius: 12px; background: #fff9de; font-size: 12px; font-weight: 800; color: #5e3612; }
.pk img { width: 54px; height: 54px; object-fit: contain; }
.pk i { font-style: normal; color: #c07a10; }
.pk.on { border-color: #3bb630; background: #eaffd8; box-shadow: 0 0 0 2px rgba(59, 182, 48, .35); }
.pk.off { opacity: .45; }
.pk.lock { filter: grayscale(1); opacity: .5; }
.pickcount { font-weight: 800; color: #2a6a22; }
.boostrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.boostrow button { padding: 6px 10px; border: 2px solid #d9c98a; border-radius: 10px; background: #fff9de; font-weight: 800; font-size: 13px; color: #5e3612; }
.boostrow button.on { border-color: #3bb630; background: #eaffd8; }
.newplant { display: flex; align-items: center; gap: 10px; margin: 6px 0; padding: 8px 10px; border-radius: 12px; background: #fff3c9; border: 2px solid #e0a83a; text-align: left; color: #5e3612; }
.newplant img { width: 56px; height: 56px; object-fit: contain; }
.newplant b { display: block; font-size: 15px; }
.newplant small { font-size: 12px; }

/* ---------- cửa hàng ---------- */
.pv.cv canvas { width: 100%; max-width: 150px; height: auto; border-radius: 10px; display: block; }
.buyprev .pv.cv canvas { max-width: 240px; }
.pv.boostpv img { width: 56px; height: 56px; object-fit: contain; }

/* ---------- sổ tay ---------- */
.dex { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-bottom: 8px; }
.dcard { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px 10px; border-radius: 14px; background: rgba(255, 255, 255, .95); color: #234a1f; border: 1px solid #cfe5b8; text-align: center; }
.dcard .dpic { display: grid; place-items: center; width: 100%; height: 66px; border-radius: 10px; background: linear-gradient(180deg, #cfeeff, #9ad06a); }
.dcard img { max-width: 86%; max-height: 58px; object-fit: contain; }
.dcard.unk img { filter: brightness(0) opacity(.5); }
.dcard b { font-size: 13px; } .dcard small { font-size: 11px; color: #4d7a3a; line-height: 1.3; }
.dex-h { margin: 10px 2px 6px; font-size: 16px; color: #fff; text-shadow: 0 2px 3px rgba(0, 40, 0, .5); }
.wfish { display: grid; place-items: center; margin: 0 auto 4px; width: 120px; height: 80px; }
.wfish img { max-width: 100%; max-height: 100%; object-fit: contain; animation: bob 2.2s ease-in-out infinite; }
.wfish.sad img { filter: grayscale(.6); animation: none; }
.ans { font-size: 28px; font-weight: 900; text-align: center; margin: 4px 0; }
@media (max-height: 480px) { .wfish { height: 50px; width: 80px; margin-bottom: 0; } .dialog.win h3 { margin: 0 0 2px; } .dialog.win .wstars { margin: 0; } .dialog.win .wbtns { margin-top: 8px; } }
#scPlay.rot #btnExit { display: grid; }
html body.mb-light.mb-play .wrap { max-width: none; padding: 0; }
#scPlay { margin: 0; }

/* ================= Trang chủ kiểu tranh minh hoạ (mẫu của chủ dự án 15/11/2026) =================
   Cả màn hình là một bức tranh: thẻ người chơi trái trên, bảng logo tre giữa trên, nút PLAY giữa, ba nút icon dưới. Luôn ngang.
   Mọi cỡ tính theo khung tranh (cqw / cqh) nên cùng một bố cục vừa mọi cửa sổ ngang và điện thoại dọc được xoay (sdk/land.js).
   --sal / --sat / --sar / --sab = vùng an toàn (tai thỏ, thanh trạng thái) đúng chiều người chơi nhìn. */
#scHome { position: fixed; inset: 0; z-index: 5; overflow: hidden; background: #3d8a2e; animation: none; container-type: size; }
#scHome .hm-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
body:has(#scHome:not(.hidden)) .mb-nav, body:has(#scHome:not(.hidden)) .ls-back { display: none !important; }
#scHome button { -webkit-appearance: none; appearance: none; font-family: inherit; }

/* Thẻ người chơi: avatar | cấp + thanh XP + hai ô xu / kim cương */
.hm-me { position: absolute; left: max(10px, var(--sal)); top: max(8px, var(--sat)); display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; width: min(30cqw, 250px);
  border-radius: 16px; background: linear-gradient(#f9e9c1, #f0d79c); border: 3px solid #a8742f; box-shadow: 0 3px 8px rgba(0, 0, 0, .4); }
.hm-av { position: relative; flex: none; width: 15cqh; height: 15cqh; min-width: 40px; min-height: 40px; max-width: 54px; max-height: 54px; border-radius: 50%; border: 3px solid #a8742f; background: #8fd0ff; display: grid; place-items: center; overflow: hidden; }
.hm-av .me-num { font-size: 22px; line-height: 1; }
.hm-av .me-num .mbi { width: 70%; height: 70%; }
.hm-av .me-avemo { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; line-height: 1; }
.hm-av.has-av .me-num { display: none; }
.hm-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hm-lvrow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hm-lv { font: 900 12px/1.1 system-ui, sans-serif; color: #6b3f12; white-space: nowrap; }
.hm-lvrow .xpbar { height: 5px; background: rgba(90, 55, 20, .25); border-radius: 5px; overflow: hidden; }
.hm-lvrow .xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffe27a, #ffb020); }
.hm-chips { display: flex; flex-direction: column; gap: 3px; }
.hm-bar { display: flex; align-items: center; gap: 4px; min-width: 70px; height: 22px; padding: 0 8px 0 3px; border-radius: 11px; background: #5a3b1a; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .55); }
.hm-bar img { width: 20px; height: auto; flex: none; }
.hm-bar b { color: #fff !important; font: 900 14px/1 system-ui, sans-serif; }

/* Hai nút tròn góc phải trên: Xếp hạng, quay lại */
.hm-rank, .hm-back { position: absolute; top: max(8px, var(--sat)); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; padding: 0; box-shadow: 0 3px 6px rgba(0, 0, 0, .4); }
.hm-back { right: max(10px, var(--sar)); background: #fff; border: 3px solid #e3e5e8; color: #191b1d; font: 700 30px/1 system-ui; padding-bottom: 4px; }
.hm-rank { right: calc(max(10px, var(--sar)) + 54px); background: #fff8e0; border: 3px solid #d8a13a; color: #a8661a; }
.hm-rank svg { width: 26px; height: 26px; }

/* Bảng logo tre */
.hm-sign { position: absolute; left: 50%; top: max(1cqh, var(--sat)); transform: translateX(-50%); width: min(38cqw, 44cqh * 640 / 327); aspect-ratio: 640 / 327; filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .35)); pointer-events: none; }
.hm-sign img { width: 100%; height: 100%; display: block; }
.hm-title { position: absolute; left: 17%; right: 17%; top: 27%; text-align: center; font-weight: 900; font-family: "Arial Rounded MT Bold", system-ui, sans-serif; }
.hm-title b { display: block; font-size: clamp(14px, 8.6cqh, 38px); line-height: 1.04; color: #7be63a; -webkit-text-stroke: .11em #1d4a0c; paint-order: stroke fill; text-shadow: 0 .09em 0 #14340a; }
.hm-title span { display: block; font-size: clamp(12px, 7cqh, 32px); line-height: 1.06; color: #ffb02e; -webkit-text-stroke: .11em #6a2c05; paint-order: stroke fill; text-shadow: 0 .09em 0 #4a1e03; }
.hm-rib { position: absolute; left: 24%; right: 24%; top: 78%; text-align: center; font: 900 clamp(8px, 3.3cqh, 16px)/1 system-ui, sans-serif; color: #6a2c05; font-style: normal; letter-spacing: .3px; }

/* PLAY */
.hm-play { position: absolute; left: 50%; top: 46cqh; transform: translateX(-50%); width: min(24cqw, 56cqh); padding: 1.4cqh 1cqw 1.6cqh; border-radius: 999px; text-align: center; color: #fff;
  background: linear-gradient(#8aea5a, #2fae2a 60%, #238a22); border: 4px solid #d8a13a; box-shadow: 0 5px 0 #8a5a14, 0 9px 12px rgba(0, 0, 0, .45); }
.hm-play b { display: block; font: 900 clamp(20px, 9cqh, 40px)/1.05 "Arial Rounded MT Bold", system-ui, sans-serif; -webkit-text-stroke: .12em #1d6a1d; paint-order: stroke fill; letter-spacing: 1px; }
.hm-play small { display: block; font: 900 clamp(11px, 3.6cqh, 16px)/1.2 system-ui, sans-serif; -webkit-text-stroke: .2em #1d6a1d; paint-order: stroke fill; }
.hm-play:active { transform: translateX(-50%) scale(.96); }

/* Ba nút icon: hình ô vuông của tranh, nhãn nằm trong dải trống ở đáy ô */
.hm-row { position: absolute; left: 50%; bottom: max(3cqh, var(--sab)); transform: translateX(-50%); display: flex; gap: 2cqw; }
.hm-ic { position: relative; width: min(13cqw, 30cqh); padding: 0; background: none; border: 0; box-shadow: none; color: #fff; }
.hm-ic img { width: 100%; height: auto; display: block; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .4)); }
.hm-ic span { position: absolute; left: 0; right: 0; bottom: 6%; text-align: center; font: 900 clamp(8px, 2.7cqh, 11px)/1 system-ui, sans-serif; -webkit-text-stroke: .22em #1d3a5a; paint-order: stroke fill; white-space: nowrap; }
.hm-ic:active, .hm-rank:active, .hm-back:active { transform: scale(.94); }

/* Dòng link + ghi chú khách */
.hm-note { position: absolute; left: max(10px, var(--sal)); bottom: 6px; margin: 0; max-width: 34cqw; font-size: 11px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.hm-note a { color: #ffe27a; }
.hm-guest { left: auto; right: max(10px, var(--sar)); max-width: 26cqw; text-align: right; font-size: 12px; line-height: 1.25; opacity: .9; }
.hm-guest.hidden { display: none; }
.hm-dex { display: block; width: 100%; margin: 6px 0 4px; padding: 10px; border-radius: 12px; background: #2f9a2a; color: #fff; font-weight: 800; }
/* Turned phone while playing: the stage is centred in the whole screen (sdk/land.js) */
#scPlay.rot .stage { position: fixed; left: var(--ls-cx, 50%); top: 50%; margin: 0 !important; transform: translate(-50%, -50%); }
/* Level plank: same height as the tool buttons, readable text */
.hud .wave { height: 66px; box-sizing: border-box; padding: 6px 12px; gap: 5px; }
.hud .wave small { font-size: 22px; margin-bottom: 0; }
.hud .wave .wb { height: 18px; }
/* Menu tiles drawn like the key-art: label in a dark-blue pill on the bottom rim */
.hm-ic span { left: 14%; right: 14%; bottom: 9%; padding: 3% 0 2%; border-radius: 999px; background: linear-gradient(#2a5fae, #1b3f86); border: 2px solid #f6ecd0; -webkit-text-stroke: 0; font-size: clamp(8px, 2.8cqh, 12px); }
.hm-ic span { left: 4%; right: 4%; bottom: 8%; font-size: clamp(12px, 2.8cqh, 14px); letter-spacing: 0; padding: 3% 0; }

/* Dialogs: the page may be turned (html.ls), so the usable height is the page height, not the screen's long side */
.dialog { max-height: var(--dlg-max, calc(100dvh - 32px)); }
html.ls .dialog { --dlg-max: calc(var(--ls-h) - 24px); }
html.ls .modal { padding: 12px; }
/* Plant picker: a header, a scrolling list of cards, and the buttons always visible */
.dialog:has(.pickgrid) { width: min(720px, 100%); display: flex; flex-direction: column; overflow: hidden; padding: 14px 16px; }
.dialog:has(.pickgrid) h3 { margin: 0 0 4px; flex: none; }
.dialog:has(.pickgrid) .note { margin: 0 0 4px; flex: none; }
.dialog:has(.pickgrid) .pickgrid { flex: 1 1 auto; min-height: 0; overflow-y: auto; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; padding: 4px 2px; overscroll-behavior: contain; }
.dialog:has(.pickgrid) .boostrow, .dialog:has(.pickgrid) .dlg-btns { flex: none; }
.dialog:has(.pickgrid) .dlg-btns { margin-top: 8px; }
.dialog:has(.pickgrid) .dlg-btns button { min-height: 44px; min-width: 96px; }

/* HUD big enough for a thumb on a phone (owner 15/11/2026): the 1280-wide HUD is scaled down with the stage, so scale the pieces back up on small stages */
.stage { --hs: min(1.12, max(1, calc(0.6 / var(--u)))); }
.hud .seedbar { transform: scale(var(--hs)); transform-origin: 0 0; }
.hud .tools { transform: scale(var(--hs)); transform-origin: 100% 0; }
.hud .wave { width: 190px; }
.hud .wave small { white-space: nowrap; font-size: 19px; }
.hud .tb .mbic { width: 62% !important; height: 62% !important; }

/* Design system 17/11/2026: no small link line on the home — the guide links open from the book icon;
   the line stays in the page, visually hidden, for search engines. */
#scHome .hm-seo { position: absolute !important; width: 1px !important; height: 1px !important; margin: 0 !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }
.hm-book { position: absolute; top: calc(max(8px, var(--sat)) + 54px); right: max(10px, var(--sar)); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; padding: 0; background: #fff8e0; border: 3px solid #d8a13a; color: #a8661a; box-shadow: 0 3px 6px rgba(0, 0, 0, .35); }
.hm-book svg { width: 26px; height: 26px; display: block; }
.hm-book:active { transform: scale(.94); }

/* Book sheet list + painted-home guest rule (design system 17/11/2026) */
#scBook a.bk-link { display: flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--skin-card-line, #e3e5e8); border-radius: 12px; background: var(--skin-card, #f7f8f9); color: var(--skin-ink, #191b1d); font-size: 15px; font-weight: 700; text-decoration: none; }
#scBook .bk-list { display: flex; flex-direction: column; gap: 8px; }
#scHome #guestNote { display: none !important; }
#scHome .hm-av { cursor: pointer; }

/* Sheet skin "bamboo": small sheets take the colours of the painted home (owner 30/11/2026). */
body.mb-light { --skin-frame: #3f5d1f; --skin-head: linear-gradient(#5b7d26, #3f5d1f); --skin-head-ink: #f6f3d8; --skin-line: #d8c36a;
  --skin-paper: #f1ecd2; --skin-card: #fffdf2; --skin-card-line: #cfc795; --skin-ink: #26310f; --skin-muted: #59633f; --skin-hover: #f8f6e4; }
