/* Khung game cố định 540x960 (tỉ lệ 9:16), JS co giãn vừa cửa sổ, nền đen xung quanh. */
@font-face {
  font-family: "Baloo2";
  src: url("assets/fonts/Baloo2.ttf") format("truetype");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --ink: #1b2f57;
  --muted: #55688d;
  --gold: #ffd35a;
  --red: #e5534b;
  --green: #3fae6a;
  --navy: #0f2147;
  --font: "Baloo2", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  font-family: var(--font);
  color: var(--ink);
  user-select: none;
  touch-action: manipulation;
}

button, input { font-family: var(--font); }

#stage.land { width: 960px; height: 540px; }
#stage.land.rot { transform: translate(-50%, -50%) rotate(90deg) scale(var(--s, 1)); }
#stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 540px;
  height: 960px;
  transform: translate(-50%, -50%) scale(var(--s, 1));
  transform-origin: center center;
  overflow: hidden;
  background: #0a1838 url("assets/final/bg_pattern.webp") center / cover no-repeat;
}

.screen { position: absolute; inset: 0; display: none; flex-direction: column; padding: 14px 16px; z-index: 1; }
.screen.active { display: flex; }
.hidden { display: none !important; }

.logo-wrap { display: flex; flex-direction: column; align-items: center; margin-top: 30px; }
.logo-wrap.small { margin-top: 6px; }
/* logo PNG đã đổi nền đen thành trong suốt, giữ nguyên ánh sáng viền */
.logo-img {
  width: 520px;
  max-width: 100%;
  height: auto;
  animation: logoFloat 3.4s ease-in-out infinite;
}
.logo-wrap.small .logo-img { width: 520px; }
.logo {
  margin: -10px auto 0;
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 2px;
  color: var(--gold);
  -webkit-text-stroke: 8px #5a2a00;
  paint-order: stroke fill;
  text-shadow: 0 7px 0 #5a2a00, 0 14px 18px rgba(0,0,0,.45);
  text-align: center;
  animation: logoFloat 3s ease-in-out infinite;
}
.logo.small { margin-top: -6px; font-size: 44px; }
.contact {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  text-align: center;
  color: #cfe0ff;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  text-shadow: 0 2px 0 var(--navy);
  z-index: 3;
}
.contact:active { color: var(--gold); }
@keyframes logoFloat { 50% { transform: translateY(-6px); } }

.chip {
  display: flex;
  align-items: center;
  height: 44px;
  border: 0 solid transparent;
  border-width: 0 24px;
  border-image: url("assets/final/plate.webp") 0 66 fill / 0 24px stretch;
  color: #fff;
  padding: 0 4px 3px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 2px 0 var(--navy);
}
.top-row { display: flex; justify-content: space-between; align-items: center; }
.lang-btn {
  min-width: 64px;
  height: 52px;
  padding: 0 14px 4px;
  border: 4px solid #3c74c4;
  border-radius: 16px;
  background: linear-gradient(#2c68b4, #164a8a);
  box-shadow: 0 4px 0 #0f2147;
  color: #fff;
  font: 800 24px/1 var(--font);
  -webkit-text-stroke: 4px var(--navy);
  paint-order: stroke fill;
  cursor: pointer;
}
.lang-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #0f2147; }
.lang-btn.auth-lang { position: absolute; top: 16px; right: 16px; z-index: 5; }
.top-actions { align-items: center; }
.top-actions { display: flex; gap: 8px; }
.round-btn { width: 64px; height: 64px; padding: 0; border: 0; background: none; cursor: pointer; transition: transform .08s; }
.round-btn img { width: 100%; height: 100%; object-fit: contain; }
.round-btn.small { width: 56px; height: 56px; }
.round-btn:active { transform: scale(.9); }

/* Nút chữ nhật dùng border-image để góc đá không bị méo */
.wbtn {
  display: block;
  width: 100%;
  min-height: 92px;
  margin: 8px 0;
  padding: 0 10px;
  border: 30px solid transparent;
  border-image: url("assets/final/btn_orange.webp") 28 fill / 30px stretch;
  background: transparent;
  font: 800 30px/1 var(--font);
  color: #fff;
  -webkit-text-stroke: 5px var(--navy);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--navy);
  cursor: pointer;
  transition: transform .08s, filter .15s;
}
.wbtn:active { transform: scale(.96); filter: brightness(.9); }
.wbtn.orange { border-image-source: url("assets/final/btn_orange.webp"); }
.wbtn.blue   { border-image-source: url("assets/final/btn_blue.webp"); }
.wbtn.green  { border-image-source: url("assets/final/btn_green.webp"); }
.wbtn.grey   { border-image-source: url("assets/final/btn_grey.webp"); }
.wbtn.small  { min-height: 80px; font-size: 26px; }


/* ---------- Popup: khung đá viền xanh giống nút ---------- */
.panel {
  position: relative;
  border: 44px solid transparent;
  border-image: url("assets/final/panel.webp") 42 fill / 44px stretch;
  padding: 0 4px;
  color: var(--ink);
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .45));
}
.panel .big, .panel p, .panel h3 { margin: 0; }
.center { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.big { font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.muted { color: var(--muted); font-size: 20px; font-weight: 600; margin: 2px 0; line-height: 1.2; }
.row-btns { display: flex; gap: 8px; }
.row-btns .wbtn { flex: 1; }

/* Ribbon tiêu đề gắn trên mép popup */
.ribbon {
  position: relative;
  width: 400px;
  height: 120px;
  margin: -118px auto 6px;
  background: url("assets/final/ribbon.webp") center / 100% 100% no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  -webkit-text-stroke: 6px #7a3000;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 #7a3000;
  padding: 0 70px 6px;
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.35));
}
.ribbon span { display: block; text-align: center; }

input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  border: 4px solid #3c74c4;
  box-shadow: inset 0 3px 0 rgba(0,0,0,.12);
  font-size: 24px;
  font-weight: 700;
  background: #fff;
  color: var(--ink);
  user-select: text;
}
input::placeholder { color: #8fa3c8; font-weight: 600; }
.code-input { text-align: center; letter-spacing: 5px; text-transform: uppercase; }

.menu { margin-top: auto; padding-bottom: 44px; }
/* Màn đăng nhập: cụm nút nằm giữa màn hình, ngay dưới logo */
#screen-auth .menu { margin-top: 36px; padding-bottom: 0; }
.code-box {
  align-self: center;
  margin-top: 8px;
  background: rgba(8, 20, 48, .72);
  border: 3px solid #4a7fc7;
  color: #fff;
  border-radius: 18px;
  padding: 2px 22px 4px;
  font-size: 22px;
  font-weight: 700;
}
.code-box b { color: var(--gold); letter-spacing: 3px; }


.timer.low { border-image-source: url("assets/final/btn_grey.webp"); animation: pulse .5s infinite alternate; color: #ffe0dc; -webkit-text-stroke-color: #a01610; text-shadow: 0 3px 0 #a01610; }
@keyframes pulse { to { transform: scale(1.1); } }

/* ---------- Kết quả ---------- */
/* Màn kết quả: cột flex theo chiều cao khung. Popup thống kê co giãn vừa phần còn lại và cuộn nếu thiếu chỗ. */
#screen-result { align-items: stretch; padding: 0 16px 18px; }
.result-hero {
  position: relative;
  flex: 0 0 auto;
  height: 232px;
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* tia sáng quay phía sau tiêu đề */
.rays {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 760px;
  height: 760px;
  margin: -380px 0 0 -380px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 226, 120, .55) 0deg 9deg, rgba(255, 226, 120, 0) 9deg 22deg);
  -webkit-mask-image: radial-gradient(circle, #000 12%, transparent 66%);
  mask-image: radial-gradient(circle, #000 12%, transparent 66%);
  opacity: 0;
  pointer-events: none;
}
#screen-result.win .rays { opacity: 1; animation: raysSpin 14s linear infinite; }
@keyframes raysSpin { to { transform: rotate(360deg); } }

.result-banner {
  position: relative;
  width: 470px;
  height: 160px;
  margin-bottom: 26px;
  background: url("assets/final/ribbon.webp") center / 100% 100% no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 90px 10px;
  filter: drop-shadow(0 10px 12px rgba(0,0,0,.45));
  overflow: hidden;
}
.result-banner::after { /* vệt sáng lướt qua */
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 70px;
  left: -120px;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.65), transparent);
  transform: skewX(-18deg);
}
.result-title {
  font-size: 58px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  color: #fff;
  -webkit-text-stroke: 9px #7a3000;
  paint-order: stroke fill;
  text-shadow: 0 5px 0 #7a3000;
}
.result-sub {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 0;
  text-align: center;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  text-shadow: 0 2px 0 var(--navy), 0 0 8px rgba(0,0,0,.6);
}

#screen-result.win .result-hero { animation: heroDrop .8s cubic-bezier(.2, 1.5, .4, 1) both, floatY 3.2s ease-in-out .8s infinite; }
#screen-result.win .result-banner::after { animation: shine 2.8s ease-in-out 1s infinite; }
#screen-result.win .result-title { animation: titleGlow 1.6s ease-in-out 1s infinite; }
#screen-result.lose .result-hero { animation: heroSink .9s ease-out both, sway 4s ease-in-out .9s infinite; }
#screen-result.draw .result-hero { animation: heroDrop .7s ease-out both, floatY 4s ease-in-out .7s infinite; }
#screen-result.lose .result-banner { filter: grayscale(.85) brightness(.85) drop-shadow(0 10px 12px rgba(0,0,0,.45)); }
#screen-result.lose::after { content: ""; position: absolute; inset: 0; background: rgba(8, 14, 32, .4); pointer-events: none; z-index: 2; }

.stats-wrap {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0 0 10px;
}
#screen-result .stats-wrap { animation: panelRise .8s cubic-bezier(.2, 1.3, .4, 1) .35s both, floatY 3.6s ease-in-out 1.2s infinite; }
#screen-result.lose .stats-wrap { animation: panelRise .8s ease-out .5s both, sway 5s ease-in-out 1.3s infinite; }

@keyframes heroDrop { from { transform: translateY(-180px) scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes heroSink { from { transform: translateY(-120px) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes panelRise { from { transform: translateY(260px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes floatY { 50% { transform: translateY(-6px); } }
@keyframes sway { 50% { transform: translateY(3px) rotate(.8deg); } }
@keyframes shine { 0% { left: -120px; } 45%, 100% { left: 560px; } }
@keyframes titleGlow { 50% { transform: scale(1.06); filter: brightness(1.25) drop-shadow(0 0 10px #fff3a8); } }

/* Nội dung thống kê cuộn được khi màn hình thấp */
.stats-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 4px;
  scrollbar-width: thin;
  scrollbar-color: #3c74c4 transparent;
  user-select: none;
  -webkit-overflow-scrolling: touch;
}
.stats { width: 100%; border-collapse: collapse; font-size: 20px; font-weight: 600; }
.stats th, .stats td { padding: 1px 6px; border-bottom: 2px solid #d9c9a3; text-align: center; line-height: 1.25; }
.stats th { color: var(--muted); font-weight: 800; position: sticky; top: 0; background: #fbf1da; z-index: 1; }
.stats td:first-child, .stats th:first-child { text-align: left; }
/* Chỉ số hơn: xanh dương sáng và đậm. Chỉ số kém hơn hoặc bằng: đen và mảnh. */
.stats td { color: #111a2c; font-weight: 400; }
.stats td.hi { color: #0a7cff; font-weight: 800; text-shadow: 0 0 10px rgba(10, 124, 255, .25); }
.stats td:first-child { font-weight: 500; color: #111a2c; }

.result-menu { flex: 0 0 auto; z-index: 3; }
.result-menu .wbtn { margin: 0; }

/* ---------- Overlay, toast, spinner ---------- */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 12, 30, .68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
}
.overlay > .panel { width: 100%; animation: popupIn .35s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes popupIn { from { transform: scale(.7) translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.spinner {
  width: 64px;
  height: 64px;
  margin: 4px auto;
  border-radius: 50%;
  border: 8px solid #cfdcf3;
  border-top-color: #f08a1c;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: absolute;
  left: 50%;
  bottom: 70px;
  transform: translateX(-50%);
  max-width: 470px;
  background: rgba(8, 20, 48, .92);
  border: 3px solid #4a7fc7;
  color: #fff;
  padding: 6px 22px 8px;
  border-radius: 18px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  z-index: 30;
  text-align: center;
}

/* ---------- Popup hướng dẫn ---------- */
.guide-panel { display: flex; flex-direction: column; gap: 8px; }
.guide-body {
  max-height: 560px;
  overflow-y: auto;
  padding: 0 6px 0 2px;
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: #3c74c4 transparent;
  user-select: none;
  -webkit-overflow-scrolling: touch;
}
.guide-h {
  margin: 10px 0 6px;
  padding: 2px 12px 4px;
  border-radius: 12px;
  background: linear-gradient(#2c68b4, #164a8a);
  border: 3px solid #3c74c4;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  text-shadow: 0 2px 0 var(--navy);
}
.guide-h:first-child { margin-top: 0; }
.guide-card, .guide-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 4px;
  border-bottom: 2px solid #e2d3ad;
}
.guide-info { flex: 1; min-width: 0; }
.guide-name { font-size: 24px; font-weight: 800; color: #0a5fd0; line-height: 1.1; }
.guide-p { margin: 0; font-size: 18px; font-weight: 500; line-height: 1.25; color: #111a2c; }
.guide-skill { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.25; color: #111a2c; }
.guide-stat { margin: 2px 0 0; font-size: 17px; font-weight: 500; color: #4a5b7c; }
.guide-stat.strong { font-weight: 800; color: #0a7cff; }
.guide-note { margin: 6px 0 0; font-size: 16px; font-weight: 600; color: #7a5a1a; line-height: 1.25; }
.guide-badge {
  flex: 0 0 auto;
  min-width: 74px;
  text-align: center;
  padding: 1px 8px 3px;
  border-radius: 12px;
  background: linear-gradient(#ffb23a, #e8820c);
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  text-shadow: 0 2px 0 #7a3000;
}
.guide-num {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  line-height: 32px;
  text-align: center;
  border-radius: 50%;
  background: linear-gradient(#2c68b4, #164a8a);
  border: 3px solid #3c74c4;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
}
.mini-shape { flex: 0 0 auto; display: grid; gap: 3px; width: 100px; justify-content: center; align-content: center; }
.mini-shape i { width: 18px; height: 18px; border-radius: 5px; background: #cdd8ea; }
.mini-shape i.on { background: linear-gradient(#52b6ff, #1c7fe0); box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); }
.mini-shape.orb i.on { background: linear-gradient(#ffe27a, #f0a010); }
.guide-card .spr { flex: 0 0 auto; width: 64px; height: 64px; }


/* Bảng xếp hạng */
.top-body { text-align: left; min-width: 330px; font-weight: 700; color: var(--ink); }
.top-body h4 { margin: 8px 0 4px; font-size: 20px; }
.top-body .row { display: flex; justify-content: space-between; gap: 12px; font-size: 17px; }

/* ---------- Màn ván cờ: canvas phủ kín (nền + bàn + quân), HUD đè lên ở các góc trống ---------- */
#screen-game { padding: 0; }
.board { position: absolute; inset: 0; width: 540px; height: 960px; z-index: 0; }
/* thanh thông tin: lượt đi, hoặc tên + cách đi của quân vừa chạm */
.info { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); z-index: 3; width: 330px; min-height: 52px; display: flex; align-items: center; gap: 8px; padding: 4px 10px; background: rgba(8, 20, 48, .66); border: 3px solid #4a7fc7; border-radius: 14px; pointer-events: none; }
.info-icon { height: 44px; width: auto; max-width: 40px; object-fit: contain; image-rendering: pixelated; flex: 0 0 auto; }
.info-name { font-weight: 800; font-size: 22px; line-height: 1.05; color: #fff; }
.info-name.mine { color: #ffe066; }
.info-name.check { color: #ff6b5e; }
.info-desc { font-weight: 600; font-size: 14px; line-height: 1.15; color: #cfe0ff; }
.info-desc:empty { display: none; }
/* khung người chơi: avatar + tên + đồng hồ */
.player { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 108px; }
.player.opp { top: 66px; right: 6px; }
.player.me { bottom: 20px; right: 6px; }
.avatar { width: 96px; height: 120px; image-rendering: pixelated; filter: drop-shadow(0 3px 4px rgba(0,0,0,.55)); }
.pname { max-width: 108px; padding: 0 8px; font-weight: 800; font-size: 16px; color: #fff; background: rgba(8, 20, 48, .82); border-radius: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clock { min-width: 84px; text-align: center; font-weight: 800; font-size: 24px; color: #fff; background: rgba(8, 20, 48, .82); border: 3px solid #4a7fc7; border-radius: 12px; padding: 0 8px 2px; }
.clock.mine { border-color: #ffd35a; color: #ffe066; }
.hud-btns { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 10px; width: 108px; }
.hud-btns .wbtn { width: 108px; min-height: 60px; margin: 0; font-size: 18px; padding: 0 4px; border-width: 16px; border-image-width: 16px; }

/* Bố cục NGANG (laptop): khung 960x540, bàn nằm ngang, HUD ở các góc/mép trống */
#stage.land .board { width: 960px; height: 540px; }
#stage.land .info { top: 6px; width: 380px; }
#stage.land .player { width: 120px; }
#stage.land .player.me { top: 14px; bottom: auto; left: 10px; right: auto; }
#stage.land .player.opp { top: 14px; right: 10px; left: auto; }
#stage.land .avatar { width: 110px; height: 138px; }
#stage.land .pname { max-width: 120px; }
#stage.land .hud-btns { top: auto; bottom: 4px; left: 50%; right: auto; transform: translateX(-50%); flex-direction: row; width: auto; gap: 12px; }
#stage.land .hud-btns .wbtn { width: 150px; min-height: 48px; border-width: 12px; border-image-width: 12px; font-size: 18px; }
#stage.land .hud-btns .round-btn { width: 44px; height: 44px; }

/* Popup CHIẾU: chữ to bật lên giữa màn hình */
.check-pop { position: absolute; left: 0; right: 0; top: 38%; z-index: 6; text-align: center; pointer-events: none; font-weight: 800; font-size: 120px; line-height: 1; color: #ff4b3e; -webkit-text-stroke: 10px #5a0a05; paint-order: stroke fill; text-shadow: 0 8px 0 #5a0a05, 0 0 40px rgba(255, 90, 60, .8); }
.check-pop.show { animation: checkPop 1.5s ease-out both; }
@keyframes checkPop {
  0% { transform: scale(.2) rotate(-8deg); opacity: 0; }
  14% { transform: scale(1.35) rotate(3deg); opacity: 1; }
  24% { transform: scale(1) rotate(-2deg); }
  34% { transform: scale(1.06) rotate(2deg); }
  44%, 78% { transform: scale(1) rotate(0); opacity: 1; }
  100% { transform: scale(1.25); opacity: 0; }
}
#stage.land .check-pop { top: 30%; font-size: 130px; }

/* Biểu tượng kết quả (thắng/thua) đặt phía trên băng rôn */
#screen-result .result-hero { margin-top: 150px; }
.result-emblem { position: absolute; left: 50%; top: -165px; width: 190px; height: 190px; object-fit: contain; transform: translateX(-50%); z-index: 3; filter: drop-shadow(0 8px 10px rgba(0,0,0,.5)); }

.guide-body { white-space: pre-line; font-size: 18px; line-height: 1.3; font-weight: 600; color: #3b2a16; }

/* Mini map ở giữa phía dưới (đè lên bậc thang của khung môi trường); nút xin hòa/đầu hàng hai bên */
.minimap { position: absolute; left: 50%; bottom: 4px; width: 116px; height: 104px; transform: translateX(-50%); z-index: 3; pointer-events: none; filter: drop-shadow(0 3px 5px rgba(0,0,0,.6)); }
#stage.land .hud-btns { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: auto; height: 64px; display: block; pointer-events: none; }
#stage.land .hud-btns > * { position: absolute; bottom: 6px; pointer-events: auto; margin: 0; }
#stage.land .hud-btns .round-btn { left: 576px; width: 44px; height: 44px; }
#stage.land .hud-btns .wbtn.blue { left: 150px; width: 128px; min-height: 46px; }
#stage.land .hud-btns .wbtn.grey { left: 288px; width: 128px; min-height: 46px; }
#stage.land .hud-btns .wbtn { border-width: 12px; border-image-width: 12px; font-size: 17px; }

/* Bỏ khung chữ giữa phía trên; lượt đi hiện bằng đồng hồ của bên đang đi nhấp nháy vàng */
.info { display: none !important; }
.clock.active { border-color: #ffd35a; box-shadow: 0 0 14px 3px rgba(255, 211, 90, .75); animation: clockPulse 1s ease-in-out infinite alternate; }
@keyframes clockPulse { to { box-shadow: 0 0 6px 1px rgba(255, 211, 90, .4); } }
/* Mini map: mặc định dọc (phe mình ở dưới), bấm để xoay ngang */
.minimap { pointer-events: auto !important; cursor: pointer; }
.minimap.vert { width: 92px; height: 102px; }

/* Mini map ở góc phải dưới, có phóng to/thu nhỏ và bật/tắt; hai nút Xin hòa / Đầu hàng ở mép phải xếp trên dưới; nút loa ở giữa phía dưới */
.mini-wrap { position: absolute; right: 8px; bottom: 6px; z-index: 4; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; --mz: 1; }
.mini-tools { display: flex; gap: 4px; }
.mini-btn { width: 26px; height: 24px; padding: 0; font: 800 17px/1 var(--font); color: #fff; background: rgba(14, 22, 40, .88); border: 2px solid #c9a13a; border-radius: 6px; cursor: pointer; }
.mini-btn:active { transform: scale(.92); }
.mini-wrap .minimap { position: static; transform: none; width: calc(116px * var(--mz)); height: calc(104px * var(--mz)); }
.mini-wrap .minimap.vert { width: calc(92px * var(--mz)); height: calc(102px * var(--mz)); }
.mini-wrap.off .minimap { display: none; }
#stage.land .hud-btns { top: 0; bottom: 0; left: 0; right: 0; height: auto; }
#stage.land .hud-btns .round-btn { left: 50%; right: auto; bottom: 6px; transform: translateX(-50%); }
#stage.land .hud-btns .wbtn.blue, #stage.land .hud-btns .wbtn.grey { left: auto; right: 6px; bottom: auto; width: 96px; min-height: 40px; font-size: 15px; }
#stage.land .hud-btns .wbtn.blue { top: 214px; }
#stage.land .hud-btns .wbtn.grey { top: 262px; }

/* Phóng to mini map = toàn màn hình; hai nút Xin hòa / Đầu hàng ở góc dưới trái */
.mini-wrap.full { position: absolute; inset: 0; right: 0; bottom: 0; z-index: 40; align-items: center; justify-content: center; gap: 10px; background: rgba(6, 12, 30, .88); }
.mini-wrap.full .mini-btn { width: 44px; height: 40px; font-size: 26px; }
.mini-wrap.full .minimap { width: 536px; height: 480px; }
.mini-wrap.full .minimap.vert { width: 432px; height: 480px; }
#stage.land .hud-btns .wbtn.blue, #stage.land .hud-btns .wbtn.grey { right: auto; left: 8px; top: auto; }
#stage.land .hud-btns .wbtn.blue { bottom: 56px; }
#stage.land .hud-btns .wbtn.grey { bottom: 8px; }

.check-pop { left: 50%; right: auto; top: 22%; width: 560px; margin-left: -280px; font-size: 0; -webkit-text-stroke: 0; text-shadow: none; filter: drop-shadow(0 0 22px rgba(255,150,40,.85)); }
#stage.land .check-pop { top: 18%; }

.intro-gate { position: absolute; inset: 0; z-index: 900; background: radial-gradient(circle at 50% 40%, #243a5e, #0a1020); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; cursor: pointer; }
.intro-gate img { width: min(70%, 460px); filter: drop-shadow(0 8px 20px rgba(0,0,0,.6)); }
.intro-tap { font: 800 30px var(--font); color: #ffe066; animation: pulse 1s infinite alternate; }
#intro-bar { position: absolute; right: 12px; top: 10px; z-index: 950; }
#intro-skip { font: 800 20px var(--font); color: #fff; background: rgba(8,20,48,.8); border: 3px solid #c9a13a; border-radius: 14px; padding: 4px 18px 6px; cursor: pointer; }
#screen-game.intro-mode .player, #screen-game.intro-mode .hud-btns, #screen-game.intro-mode .mini-wrap, #screen-game.intro-mode .info { display: none !important; }
.board { will-change: transform; }

.mini-wrap .minimap { width: calc(150px * var(--mz)); height: calc(134px * var(--mz)); }
.mini-wrap .minimap.vert { width: calc(128px * var(--mz)); height: calc(142px * var(--mz)); }
.mini-wrap.full .minimap { width: 536px; height: 480px; }
.mini-wrap.full .minimap.vert { width: 432px; height: 480px; }
