html[data-theme] .landing .guest-stage,
html[data-theme] .landing .putrajaya-photo {
  background: linear-gradient(180deg, #14243b44, #16243b8a), #27506d url('../models/home/putrajaya.jpg') center / cover;
}
.guest-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 3% 4%;
  overflow: hidden;
}
.guest-actor {
  flex: 0 1 18.7%;
  min-width: 0;
  max-width: 135px;
  aspect-ratio: 7 / 11;
  background-image: var(--sprite);
  background-repeat: no-repeat;
  background-size: 1200% 300%;
  filter: brightness(1.1) drop-shadow(0 2px 2px #101d2dc7);
  background-position: 0 calc(var(--initial-motion) * 50%);
  animation: guest-motion 1.8s steps(11, end) infinite;
}
.guest-actor:nth-child(1) { --sprite: url('../models/home/guest-1.webp'); }
.guest-actor:nth-child(2) { --sprite: url('../models/home/guest-2.webp'); }
.guest-actor:nth-child(3) { --sprite: url('../models/home/guest-3.webp'); }
.guest-actor:nth-child(4) { --sprite: url('../models/home/guest-4.webp'); }
.guest-actor:nth-child(5) { --sprite: url('../models/home/guest-5.webp'); }
.guest-actor:nth-child(3) { z-index: 1; transform: scale(1.12); transform-origin: bottom; }
.guest-actor:is(:first-child, :last-child) { transform: scale(.92); transform-origin: bottom; }
@keyframes guest-motion {
  from { background-position-x: 0%; }
  to { background-position-x: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .guest-actor { animation: none; }
}
.mandat-world {
  background: linear-gradient(180deg, #13293d50, #15243985), #274c68 url('../models/home/putrajaya.jpg') center / cover;
}
.mandat-world canvas { filter: drop-shadow(0 2px 4px #102136ae); }
.mandat-hero-copy {
  background: linear-gradient(to right, #d9f6e9 70%, transparent);
}
.board-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.board-summary article { padding: 11px 13px; }
.board-summary article :is(span, small) { display: block; color: var(--app-text); font-size: 12px; }
.board-summary strong { display: block; margin-block: 3px; font-size: clamp(15px, 2.4vw, 23px); }

.board-panel, .board-territory { padding: 15px; margin-block: 12px; }
:is(.board-panel,.board-territory) h3 { font-size: 17px; margin-bottom: 6px; }
:is(.board-panel,.board-territory) p { color: var(--app-text); font-size: 13px; margin-block: 5px 10px; }
.board-territory-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
:is(.board-panel,.board-territory) select {
  display: block;
  width: 100%;
  min-height: 42px;
  margin-block: 4px 10px;
  padding: 6px 7px;
  background: var(--app-bg);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  color: var(--app-text);
}
:is(.board-panel,.board-territory) label { display: block; font-size: 13px; font-weight: 700; }
.board-panel progress { width: 100%; height: 11px; accent-color: var(--app-accent); }
.board-items { display: grid; gap: 6px; list-style: none; padding: 0; margin-block: 11px; }
.board-items li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--app-line); border-radius: 9px; font-size: 13px; }
@media (max-width: 620px) {
  .board-territory-fields { grid-template-columns: 1fr; gap: 0; }
  .guest-stage { padding-bottom: 7%; }
}

.mandat-game {
  color-scheme: light;
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  --app-ink: #243447;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  color: #3d2a1d;
  background: #f5dfce;
  --app-bg: #fffcf5;
  --app-card: #fffaf0;
  --app-soft: #f5ecdc;
  --app-line: #decbb2;
  --app-text: #4c3728;
  --app-accent: #3eb53a;
  --app-accent-hover: #4bd147;
  --app-accent-ink: #ffffff;
  --app-lilac: #7b4fc9;
  --app-lilac-ink: #ffffff;
}
.mandat-game::backdrop { background: #e8cdb8; }
.mandat-game #mandat-board {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow: hidden;
  background: linear-gradient(180deg, #fce2d2 0%, #f5d8c8 45%, #e8eff7 100%);
  font-family: 'Segoe UI', Inter, system-ui, sans-serif;
}

/* TOP HUD BAR (Monopoly GO! Cream Pill Bar) */
.game-hud {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  padding: 7px clamp(8px, 2vw, 20px);
  background: linear-gradient(180deg, #fffdf7 0%, #f4ebd9 100%);
  border-bottom: 3px solid #d5c1a5;
  box-shadow: 0 4px 12px rgba(90, 56, 30, 0.14);
  position: relative;
  z-index: 6;
}
.mandat-game .mandat-btn {
  color: #4a3520;
  border: 2px solid #d2be9f;
  border-bottom-width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f1e6d2 100%);
  font-weight: 800;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}
.mandat-game .mandat-btn.primary {
  color: #ffffff;
  border-color: #268c22;
  background: linear-gradient(180deg, #56d94f 0%, #2ca727 100%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.mandat-game .mandat-btn:disabled { opacity: .48; }

.game-meters {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
}
.game-meters b {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px 4px 8px;
  border: 2px solid #d8c6ab;
  border-bottom-width: 3px;
  border-radius: 999px;
  background: #ffffff;
  color: #362517;
  font-size: clamp(12px, 2.6vw, 15px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(100, 70, 35, 0.08);
}
.game-meters .mgo-meter-level {
  background: linear-gradient(180deg, #5d6d7e 0%, #34495e 100%);
  color: #ffffff;
  border-color: #2c3e50;
}
.game-meters .mgo-meter-cash {
  background: linear-gradient(180deg, #ffffff 0%, #f5f9f2 100%);
  color: #22551c;
  border-color: #a9d19e;
  font-size: clamp(13px, 2.8vw, 16px);
}
.game-meters .mgo-meter-hp {
  background: linear-gradient(180deg, #fff5eb 0%, #fde6ce 100%);
  color: #9e4512;
  border-color: #f0b984;
}
.game-meters .mgo-meter-sp {
  background: linear-gradient(180deg, #eef9ff 0%, #d8f1ff 100%);
  color: #0e5a8a;
  border-color: #8fd0f7;
}
.mgo-meter-icon {
  font-size: 14px;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.18));
}
.game-meters small {
  display: none;
}
@media (min-width: 680px) {
  .game-meters small {
    display: inline;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    opacity: 0.72;
  }
}
.mandat-game .game-fullscreen { flex: none; font-size: 17px; padding: 4px 11px; }

.game-body, .game-board-screen, .game-stage { flex: 1; min-height: 0; }
.game-body { display: flex; flex-direction: column; position: relative; }
.game-details, .game-setup { overflow: auto; scrollbar-gutter: stable; }
.game-details, .game-setup {
  width: min(100%, 680px);
  padding: 12px clamp(10px, 3vw, 28px);
  align-self: center;
}
.game-details .mandat-card, .game-setup .mandat-card {
  background: #fffdf8;
  border: 2px solid #dfcbb0;
  border-bottom-width: 5px;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(95, 62, 32, 0.12);
}
.game-setup { margin: auto; }
.game-board-screen { display: flex; flex-direction: column; position: relative; }

/* 3D ISOMETRIC DIORAMA STAGE */
.game-stage {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  background-color: #f4d8c8;
  background-image:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.55) 0%, rgba(188, 224, 245, 0.45) 38%, rgba(246, 211, 197, 0.85) 75%, #e8c3b0 100%);
}
.game-stage::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 25%, #d6ecfa 0 120px, transparent 122px),
    radial-gradient(circle at 82% 76%, #d6ecfa 0 140px, transparent 142px),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.14) 0 14px, transparent 14px 28px);
  pointer-events: none;
}

/* WORLD DECORATIONS (Trees & Clouds around the 3D board) */
.mgo-world-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.mgo-tree {
  position: absolute;
  width: clamp(36px, 6vw, 60px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #9be564 0%, #52b736 62%, #2f7d1c 100%);
  box-shadow: 0 8px 0 #265c18, 0 14px 18px rgba(45, 30, 15, 0.22);
}
.mgo-tree.t1 { top: 14%; left: 14%; }
.mgo-tree.t2 { top: 16%; right: 15%; width: clamp(28px, 5vw, 48px); }
.mgo-tree.t3 { bottom: 22%; left: 12%; width: clamp(32px, 5.5vw, 52px); }
.mgo-tree.t4 { bottom: 20%; right: 13%; }

/* TOP EVENT TOURNAMENT BANNER ("KEY TO THE CITY" STYLE) */
.mgo-top-event {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: min(370px, calc(100% - 110px));
  pointer-events: none;
}
.mgo-event-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: linear-gradient(180deg, #fef9ff 0%, #f3d5f7 45%, #d68ce8 100%);
  border: 3px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 5px 0 #8a4399, 0 8px 18px rgba(55, 20, 70, 0.28);
}
.mgo-event-key {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b829c9, #771491);
  border: 2px solid #fff3b8;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  font-size: 18px;
}
.mgo-event-body {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.mgo-event-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(12px, 2.8vw, 15px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #4699ff;
  text-shadow:
    -1px -1px 0 #1e1342,
     1px -1px 0 #1e1342,
    -1px  1px 0 #1e1342,
     1px  1px 0 #1e1342,
     0    2px 0 #1e1342;
}
.mgo-event-bar {
  position: relative;
  height: 17px;
  margin-top: 2px;
  border-radius: 999px;
  background: #3d1d47;
  border: 1.5px solid #6b3b7a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mgo-event-bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #ff9933, #ffcc33);
  border-radius: inherit;
}
.mgo-event-bar > b {
  position: relative;
  z-index: 1;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  text-shadow: 0 1px 2px #1c0824;
  white-space: nowrap;
}
.mgo-event-reward {
  flex: none;
  display: grid;
  justify-items: center;
  padding: 3px 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff6cc 0%, #ffd54f 100%);
  border: 2px solid #ffffff;
  color: #4f2c06;
  line-height: 1.05;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.mgo-event-reward small { font-size: 8px; font-weight: 800; text-transform: uppercase; }
.mgo-event-reward b { font-size: 12px; font-weight: 900; }

/* LEFT & RIGHT FLOATING CIRCULAR BADGES */
.mgo-side-left,
.mgo-side-right {
  position: absolute;
  top: 66px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mgo-side-left { left: 10px; }
.mgo-side-right { right: 10px; }

.mgo-float-badge {
  display: grid;
  justify-items: center;
  align-content: center;
  width: clamp(54px, 11vw, 66px);
  height: clamp(54px, 11vw, 66px);
  padding: 4px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  background: linear-gradient(180deg, #fffdf9 0%, #f0e4ce 100%);
  box-shadow: 0 4px 0 #b89f7d, 0 6px 14px rgba(50, 30, 10, 0.25);
  color: #3b2614;
  cursor: pointer;
  transition: transform 0.14s ease;
}
.mgo-float-badge:hover:not(:disabled) { transform: translateY(-2px) scale(1.04); }
.mgo-float-badge:active:not(:disabled) { transform: translateY(1px); }
.mgo-float-badge:disabled { opacity: 0.48; cursor: not-allowed; }
.mgo-badge-shop { background: linear-gradient(180deg, #ff9966 0%, #e04f16 100%); color: #fff; box-shadow: 0 4px 0 #942d06, 0 6px 14px rgba(0,0,0,0.25); }
.mgo-badge-stats { background: linear-gradient(180deg, #74b9ff 0%, #2980b9 100%); color: #fff; box-shadow: 0 4px 0 #17517a, 0 6px 14px rgba(0,0,0,0.25); }
.mgo-badge-party { background: linear-gradient(180deg, #a29bfe 0%, #6c5ce7 100%); color: #fff; box-shadow: 0 4px 0 #4834d4, 0 6px 14px rgba(0,0,0,0.25); }
.mgo-badge-map { background: linear-gradient(180deg, #81ecec 0%, #00cec9 100%); color: #0c3b3a; box-shadow: 0 4px 0 #008f8c, 0 6px 14px rgba(0,0,0,0.25); }
.mgo-badge-rest { background: linear-gradient(180deg, #ffeaa7 0%, #fdcb6e 100%); color: #523405; box-shadow: 0 4px 0 #b88323, 0 6px 14px rgba(0,0,0,0.25); }

.mgo-badge-icon { font-size: clamp(19px, 3.8vw, 24px); line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2)); }
.mgo-float-badge small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #362212;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.15;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}

.game-map-inspection {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: fit-content;
  max-width: calc(100% - 140px);
  z-index: 6;
  border-radius: 999px;
  padding: 6px 14px;
  background: #fffdf7;
  color: #362417;
  border: 2px solid #d4bc98;
  box-shadow: 0 4px 12px rgba(60, 40, 20, 0.22);
  font-size: 12px;
  font-weight: 800;
}
.game-stage:not([data-phase="idle"]) .game-map-inspection { display: none; }

/* 3D ISOMETRIC TILTED BOARD GRID */
.board-grid {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-columns: repeat(var(--grid, 11), minmax(0, 1fr));
  grid-template-rows: repeat(var(--grid, 11), minmax(0, 1fr));
  width: var(--map-size, 340px);
  height: var(--map-size, 340px);
  margin: 0;
  padding: 5px;
  list-style: none;
  isolation: isolate;
  border-radius: 16px;
  background: #cdd9cf;
  border: 4px solid #f7f4ea;
  box-shadow:
    12px 12px 0 #8a9e91,
    20px 24px 36px rgba(45, 30, 18, 0.36);
  transform:
    translate3d(calc(-50% + var(--camera-x, 0px)), calc(-50% + var(--camera-y, 0px)), 0)
    scale(var(--zoom, 0.92))
    rotateX(50deg)
    rotateZ(45deg);
  transform-style: preserve-3d;
  /* Camera and pawn are driven frame by frame from board-motion.js; a CSS transition here would fight it. */
}

/* CLASSIC MONOPOLY TILES WITH 3D EXTRUSION & COLOR STRIPS */
.board-tile {
  position: relative;
  grid-row: var(--row);
  grid-column: var(--col);
  min-width: 0;
  min-height: 0;
  margin: 1.5px;
  border-radius: 5px;
  background: #f6faef;
  color: #1f2e28;
  box-shadow:
    3px 3px 0 #9db0a4,
    inset 0 0 0 1px #d6e2d8;
}
.board-tile.tile-corner {
  background: #eef6e8;
  box-shadow:
    3px 3px 0 #8aa395,
    inset 0 0 0 1.5px #bdd1c4;
}
.board-tile button {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  overflow: hidden;
  gap: 1px;
  width: 100%;
  height: 100%;
  padding: 6px 2px 3px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
}
.board-tile button:hover { box-shadow: inset 0 0 0 2px #ffae00; }

/* Property Color Header Strip */
.tile-band {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 26%;
  background: var(--band-color, #69c35f);
  border-bottom: 1.5px solid rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.38);
}
.board-tile.tile-corner .tile-band { display: none; }
.band-brown { --band-color: #935338; }
.band-sky { --band-color: #54bce8; }
.band-pink { --band-color: #e64998; }
.band-orange { --band-color: #f79221; }
.band-red { --band-color: #e8352e; }
.band-yellow { --band-color: #f4d025; }
.band-green { --band-color: #32b44a; }
.band-navy { --band-color: #2959b8; }
.band-chance { --band-color: #ff77aa; }
.band-tax { --band-color: #e2b842; }
.band-shop { --band-color: #23b5a8; }
.band-project { --band-color: #8252d9; }
.band-rest { --band-color: #58c264; }

.board-tile small {
  position: absolute;
  top: 2px;
  right: 3px;
  font: 800 clamp(5px, 1vw, 8px)/1 Inter, sans-serif;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 1px rgba(0,0,0,0.45);
}
.board-tile.tile-corner small { color: #546e60; text-shadow: none; }
.board-tile b {
  font-size: clamp(11px, 2.4vw, 20px);
  font-weight: 900;
  line-height: 1;
}
.board-tile.tile-start b {
  color: #d62b1f;
  font-size: clamp(12px, 2.7vw, 22px);
  letter-spacing: -0.04em;
}
.board-tile.tile-chance b {
  color: #d91b77;
  font-size: clamp(14px, 3vw, 24px);
}
.board-tile span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(5.5px, 1.25vw, 9px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.board-tile[aria-current] {
  background: #fff48f;
  color: #3d2408;
  outline: 3px solid #ffae00;
  box-shadow: 0 0 14px #ffdd47, 3px 3px 0 #c98612;
  z-index: 2;
}

/* CENTER PARK DIORAMA ("MONOPOLY" CENTER COURT) */
.board-centre {
  position: relative;
  overflow: hidden;
  grid-area: 2 / 2 / var(--grid, 11) / var(--grid, 11);
  margin: 4px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 5px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 50%, #fdf2e6 0 44%, #82c8e8 45% 56%, #7fd158 57% 100%);
  text-align: center;
  color: #3a2312;
  box-shadow:
    inset 0 0 0 4px #e8f5e1,
    inset 0 0 24px rgba(0, 0, 0, 0.14);
}
.board-centre strong, .board-centre small { position: relative; z-index: 2; max-width: 90%; }
.board-centre strong {
  font-size: clamp(14px, 3.6vw, 26px);
  font-weight: 900;
  color: #2f1a0c;
  background: rgba(255, 252, 242, 0.88);
  padding: 2px 12px;
  border-radius: 999px;
  border: 2px solid #dec6a4;
  box-shadow: 0 3px 6px rgba(0,0,0,0.12);
}
.board-centre small {
  font-size: clamp(8px, 1.7vw, 12px);
  font-weight: 800;
  color: #ffffff;
  background: #2f7d32;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Red & Gold Center Banner */
.mgo-center-banner {
  position: relative;
  z-index: 2;
  padding: 4px 18px;
  border-radius: 8px;
  background: linear-gradient(180deg, #ee3b2b 0%, #c11f12 100%);
  border: 3px solid #f6d155;
  box-shadow: 0 5px 0 #7a140b, 0 8px 16px rgba(0,0,0,0.25);
  color: #ffffff;
  font-size: clamp(14px, 3.8vw, 28px);
  font-weight: 950;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 0 #6e1008;
}

/* 3D Card Decks in Center Park (Chance & Community Chest) */
.mgo-chest-deck {
  position: absolute;
  z-index: 2;
  width: 24%;
  height: 15%;
  border-radius: 7px;
  display: grid;
  place-items: center;
  border: 2.5px solid #ffffff;
  font-weight: 900;
  font-size: clamp(14px, 3vw, 24px);
  color: #ffffff;
}
.mgo-deck-orange {
  bottom: 14%;
  left: 12%;
  background: linear-gradient(135deg, #ffa726, #f57c00);
  box-shadow: 4px 5px 0 #b25600, 0 7px 14px rgba(0,0,0,0.25);
}
.mgo-deck-blue {
  top: 14%;
  right: 12%;
  background: linear-gradient(135deg, #29b6f6, #0288d1);
  box-shadow: 4px 5px 0 #01579b, 0 7px 14px rgba(0,0,0,0.25);
}

.game-landmark {
  display: grid;
  width: clamp(38px, 11vw, 66px);
  aspect-ratio: 1;
  place-items: center;
  z-index: 2;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 5px #b8862d, 0 7px 14px rgba(0,0,0,0.22);
  background: linear-gradient(180deg, #fff1a8 0%, #f5c542 100%);
  color: #6b4c14;
  text-shadow: none;
  font-size: clamp(20px, 6vw, 34px);
}
.game-park { position: absolute; inset: 6%; border: 2px dashed rgba(255, 255, 255, 0.65); border-radius: 16px; pointer-events: none; }
.game-park i {
  position: absolute;
  border-radius: 50%;
  width: 11%;
  aspect-ratio: 1;
  left: var(--x);
  top: var(--y);
  box-shadow: 3px 4px 0 #266b1d, inset -3px -3px #39962c;
  background: #67d44c;
}
.game-park i:nth-child(1) { --x: 10%; --y: 12%; }
.game-park i:nth-child(2) { --x: 78%; --y: 74%; }
.game-park i:nth-child(3) { --x: 68%; --y: 12%; width: 8%; }
.game-park i:nth-child(4) { --x: 12%; --y: 74%; width: 8%; }
.game-park i:nth-child(5) { --x: 82%; --y: 44%; width: 7%; }

/* 3D CHARACTER TOKEN ON BOARD */
.board-avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(104px * var(--avatar-boost, 1));
  height: calc(152px * var(--avatar-boost, 1));
  z-index: 3;
  transform: translate3d(calc(-50% + var(--pawn-x, 0px)), calc(-78% + var(--pawn-y, 0px)), 0);
  transition: opacity .19s ease;
  will-change: transform;
  pointer-events: none;
}
.board-avatar-model, .board-avatar-marker { position: absolute; inset: 0; }
.board-avatar-model { transform: scale(calc((.58 + .46 * var(--focus, 0)) * var(--grow, 1) / var(--avatar-boost, 1))); transform-origin: center 78%; translate: 0 calc(var(--hop, 0px) * -1); }
.board-avatar-model canvas { display: block; width: 100%; height: 100%; filter: drop-shadow(0 6px 6px rgba(45, 25, 10, 0.45)); }
.board-avatar-model .graphics-fallback { display: none; }
.board-avatar:has(canvas[data-model]:not([data-error])) .board-avatar-marker { display: none; }
.board-avatar-marker { display: grid; place-items: end center; padding-bottom: 17px; color: #ffae00; font-size: 36px; text-shadow: 0 3px 4px rgba(0,0,0,0.45); }
.game-stage[data-phase="transfer"] .board-avatar { opacity: 0; }

/* GLOSSY WHITE 3D DICE (LIKE MONOPOLY GO!) */
.game-dice {
  position: absolute;
  z-index: 4;
  width: min(220px, 72vw);
  height: 110px;
  top: 44%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  perspective: 400px;
  filter: drop-shadow(0 14px 16px rgba(45, 25, 10, 0.38));
  pointer-events: none;
}
.game-dice[hidden] { display: none; }
.dice-cube {
  position: relative;
  display: block;
  width: 68px;
  height: 68px;
  transform-style: preserve-3d;
  transition: transform .22s ease-out;
}
.cube-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  place-items: center;
  padding: 9px;
  border-radius: 13px;
  background: linear-gradient(145deg, #ffffff 0%, #f0f2f5 100%);
  box-shadow: inset 0 0 0 2px #d8dde6, inset 0 -3px 6px rgba(0,0,0,0.08);
  backface-visibility: hidden;
}
.cube-face i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1b1e24;
  box-shadow: inset 0 2px #000000;
}
.cube-face.face-1 { transform: translateZ(34px); }
.cube-face.face-2 { transform: rotateY(90deg) translateZ(34px); }
.cube-face.face-3 { transform: rotateX(90deg) translateZ(34px); }
.cube-face.face-4 { transform: rotateX(-90deg) translateZ(34px); }
.cube-face.face-5 { transform: rotateY(-90deg) translateZ(34px); }
.cube-face.face-6 { transform: rotateY(180deg) translateZ(34px); }
.dice-cube[data-face="2"] { transform: rotateY(-90deg); }
.dice-cube[data-face="3"] { transform: rotateX(-90deg); }
.dice-cube[data-face="4"] { transform: rotateX(90deg); }
.dice-cube[data-face="5"] { transform: rotateY(90deg); }
.dice-cube[data-face="6"] { transform: rotateY(180deg); }
.game-dice[data-rolling="true"] .dice-cube { animation: game-tumble .52s linear infinite; }
.game-dice[data-rolling="true"] .dice-cube + .dice-cube { animation-direction: reverse; }
@keyframes game-tumble {
  from { transform: translateY(14px) rotateX(0turn) rotateY(0turn) rotateZ(0turn); }
  50% { transform: translateY(-28px) rotateX(.5turn) rotateY(.5turn) rotateZ(.5turn); }
  to { transform: translateY(14px) rotateX(1turn) rotateY(1turn) rotateZ(1turn); }
}

/* BOTTOM MONOPOLY GO! DOCK & GIANT GREEN DIAMOND ROLL BUTTON */
.game-turn {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px clamp(10px, 3vw, 24px) 8px;
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.85) 0%, #f6ebd8 45%, #efe0c6 100%);
  border-top: 3px solid #ffffff;
  box-shadow: 0 -6px 18px rgba(80, 50, 20, 0.12);
}
.game-result {
  min-width: 0;
  max-width: 560px;
  text-align: center;
  color: #4f3824;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.86);
  padding: 4px 14px;
  border-radius: 999px;
  border: 1.5px solid #dfd0b8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.game-result > div { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.game-result b { font-size: 13px; font-weight: 900; color: #2b1a0c; }
.game-result p { margin: 2px 0 0; font-weight: 700; color: #2b6e22; }
.game-last-dice { color: #d96b12; font: 19px/1 'Segoe UI Symbol', sans-serif; white-space: nowrap; }
.game-last-dice { display:inline-flex;gap:4px;vertical-align:middle; }
.result-die { display:inline-grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);place-items:center;width:21px;height:21px;padding:3px;border:1px solid #d1dce2;border-radius:5px;background:#fff; }
.result-die i { width:3px;height:3px;border-radius:50%;background:#172e3a; }

.mgo-action-popup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 16px;
  background: #fff9e6;
  border: 2px solid #f0c05a;
  font-size: 12px;
}

.game-roll-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.mgo-go-dock {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

/* Giant Green Diamond "GO" Button */
.mandat-game .mgo-go-diamond {
  position: relative;
  width: clamp(86px, 18vw, 106px);
  height: clamp(86px, 18vw, 106px);
  min-height: 0;
  padding: 0;
  margin-top: -28px;
  border-radius: 26px;
  border: 5px solid #fff7e2;
  background: linear-gradient(145deg, #6cf05b 0%, #2fb624 55%, #1d8a15 100%);
  box-shadow:
    0 7px 0 #145e0e,
    0 12px 22px rgba(20, 75, 15, 0.42),
    inset 0 3px 6px rgba(255, 255, 255, 0.55);
  color: #ffffff;
  transform: rotate(45deg);
  cursor: pointer;
  transition: transform 0.14s ease, filter 0.14s ease;
}
.mandat-game .mgo-go-diamond:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: rotate(45deg) scale(1.04);
}
.mandat-game .mgo-go-diamond:active:not(:disabled) {
  transform: rotate(45deg) translate(2px, 2px);
}
.mandat-game .mgo-go-diamond:disabled {
  filter: grayscale(0.55);
  opacity: 0.65;
}
.mgo-go-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transform: rotate(-45deg);
  padding: 6px;
  text-align: center;
}
.mgo-dice-icon {
  font-size: clamp(24px, 5vw, 32px);
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}
.mgo-go-inner strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(10px, 2.2vw, 12px);
  font-weight: 950;
  text-transform: uppercase;
  line-height: 1.05;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* Purple Multiplier Badge on top-right of GO button */
.mgo-mult-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  border: 2.5px solid #fff3c4;
  background: linear-gradient(180deg, #e066ff 0%, #9b26b6 100%);
  box-shadow: 0 3px 0 #5e1170, 0 5px 10px rgba(0,0,0,0.22);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.mandat-game .mgo-rest-pill {
  padding: 6px 13px;
  font-size: 12px;
  background: linear-gradient(180deg, #fff3c4 0%, #f7c852 100%);
  border-color: #c99318;
  color: #4a2f04;
}

/* Blue Energy / Dice Bar ("4086/80" style) */
.mgo-energy-pill {
  position: relative;
  width: min(260px, 78vw);
  height: 24px;
  border-radius: 999px;
  background: #234761;
  border: 2.5px solid #ffffff;
  box-shadow: 0 3px 0 #8fa8be, 0 5px 10px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mgo-energy-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #24b6ff 0%, #4dd2ff 100%);
  border-radius: inherit;
  transition: width 0.28s ease;
}
.mgo-energy-pill b {
  position: relative;
  z-index: 1;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

/* BOTTOM NAVIGATION TABS (WINS / BUILD / ALBUM / FRIENDS STYLE) */
.game-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex: none;
  border-top: 2px solid #e0cdb0;
  padding: 6px 10px;
  background: #f5ebd9;
}
.game-tabs button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  flex: 0 1 118px;
  min-height: 50px;
  min-width: 0;
  padding: 4px 6px;
  color: #6e553b;
  background: linear-gradient(180deg, #fffdf8 0%, #ede0c9 100%);
  border: 2px solid #d5c09e;
  border-bottom-width: 4px;
  border-radius: 14px;
  font: 850 11px/1.1 'Segoe UI', Inter, sans-serif;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(80, 50, 20, 0.08);
}
.game-tabs button span {
  font-size: 19px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}
.game-tabs button[aria-pressed="true"] {
  background: linear-gradient(180deg, #fff8d6 0%, #ffd55e 100%);
  color: #4a2c04;
  border-color: #d49617;
  transform: translateY(-2px);
}
.board-message { background: #c0392b; color: #ffffff; padding: 6px 14px; font-weight: 700; text-align: center; }

@media (max-width: 640px) {
  .game-stage[data-zoomed="false"] .board-tile button span { display: none; }
  .mgo-top-event { width: min(300px, calc(100% - 20px)); top: 6px; }
  .mgo-side-left, .mgo-side-right { top: 68px; gap: 8px; }
}
@media (max-width: 420px) {
  .game-hud { gap: 4px; padding-inline: 6px; }
  .game-hud .mandat-btn { padding-inline: 8px; font-size: 11px; }
  .game-meters { gap: 4px; }
  .game-meters b { padding: 3px 7px; font-size: 11px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .game-turn { flex-direction: row; justify-content: space-between; padding-block: 4px; }
  .game-roll-controls { width: auto; flex-direction: row; }
  .mandat-game .mgo-go-diamond { width: 68px; height: 68px; margin-top: -10px; border-radius: 18px; }
  .game-hud { padding-block: 4px; }
  .game-tabs { padding-block: 3px; }
  .game-tabs button { min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .game-stage *, .game-stage *::before { transition: none !important; animation: none !important; }
}


/* =============================================================================================
   v11: motion, effects layer, election panel, extra widgets
   ============================================================================================= */
.hud-back-text { display: none; }
@media (min-width: 480px) { .hud-back-text { display: inline; } }

.game-meters .mgo-meter-level { position: relative; overflow: hidden; }
.game-meters .mgo-meter-level::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  height: 3px;
  width: var(--xp, 0%);
  background: linear-gradient(90deg, #ffd23f, #ff9f1c);
  transition: width .6s ease;
}
.game-meters .mgo-meter-cash.pulse { animation: hud-pulse .5s ease-out; }
@keyframes hud-pulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); box-shadow: 0 0 0 4px #ffe58a, 0 0 18px #ffd23f; }
  100% { transform: scale(1); }
}

/* Banner / side badge layout adjustments */
.mgo-side-left, .mgo-side-right { top: 82px; }
.mgo-event-sub {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: -1px;
  color: #5a2a6b;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}
.mgo-event-key { animation: key-wiggle 4.2s ease-in-out infinite; }
@keyframes key-wiggle {
  0%, 82%, 100% { rotate: 0deg; }
  88% { rotate: -14deg; }
  94% { rotate: 12deg; }
}
.mgo-event-banner { position: relative; overflow: hidden; }
.mgo-event-banner::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -40%;
  width: 30%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-18deg);
  animation: shine 5s ease-in-out infinite;
}
@keyframes shine { 0%, 70% { left: -40%; } 100% { left: 140%; } }

.mgo-float-badge { animation: badge-bob 3.4s ease-in-out infinite; }
.mgo-side-left .mgo-float-badge:nth-child(2n) { animation-delay: -1.1s; }
.mgo-side-right .mgo-float-badge:nth-child(2n) { animation-delay: -1.7s; }
.mgo-side-right .mgo-float-badge:nth-child(3n) { animation-delay: -.6s; }
@keyframes badge-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
.mgo-badge-daily { background: linear-gradient(180deg, #ffe58a 0%, #ffb52e 100%); color: #4d2c00; box-shadow: 0 4px 0 #b4741a, 0 6px 14px rgba(0,0,0,.25); position: relative; }
.mgo-badge-daily:not(.is-ready) { filter: saturate(.55); }
.mgo-badge-daily.is-ready { animation: badge-ring 1.3s ease-in-out infinite; }
.mgo-badge-daily.is-ready::after {
  content: '!';
  position: absolute;
  top: -4px; right: -4px;
  display: grid; place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #ff3b4e;
  border: 2px solid #fff;
  color: #fff;
  font: 900 12px/1 'Segoe UI', sans-serif;
}
@keyframes badge-ring {
  0%, 100% { rotate: 0deg; scale: 1; }
  15% { rotate: -9deg; scale: 1.06; }
  30% { rotate: 8deg; scale: 1.06; }
  45% { rotate: -5deg; }
  60% { rotate: 0deg; scale: 1; }
}
.mgo-badge-election { background: linear-gradient(180deg, #ff8fa3 0%, #e0314f 100%); color: #fff; box-shadow: 0 4px 0 #8f1129, 0 6px 14px rgba(0,0,0,.25); }
.mgo-badge-audio { background: linear-gradient(180deg, #d6f0ff 0%, #82c8f5 100%); color: #0d3b5c; box-shadow: 0 4px 0 #3c85b3, 0 6px 14px rgba(0,0,0,.25); }
.mgo-badge-audio.is-off { filter: grayscale(.85) brightness(.95); }

/* Living background */
.mgo-cloud {
  position: absolute;
  width: 170px; height: 54px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  filter: blur(1.5px);
  box-shadow: 46px -18px 0 -4px rgba(255,255,255,.78), -38px -10px 0 -10px rgba(255,255,255,.78);
  animation: cloud-drift 60s linear infinite;
}
.mgo-cloud.c1 { top: 11%; left: -220px; }
.mgo-cloud.c2 { top: 66%; left: -220px; width: 130px; height: 42px; animation-duration: 82s; animation-delay: -30s; opacity: .85; }
.mgo-cloud.c3 { top: 34%; left: -220px; width: 100px; height: 34px; animation-duration: 95s; animation-delay: -62s; opacity: .7; }
@keyframes cloud-drift { to { transform: translateX(calc(100vw + 480px)); } }
.mgo-tree { transform-origin: 50% 100%; animation: tree-sway 3.6s ease-in-out infinite alternate; }
.mgo-tree.t2 { animation-delay: -1.2s; }
.mgo-tree.t3 { animation-delay: -2.1s; }
.mgo-tree.t4 { animation-delay: -.7s; }
@keyframes tree-sway { from { rotate: -3deg; } to { rotate: 3deg; } }
.mgo-bird { position: absolute; top: 24%; left: -40px; font-style: normal; font-size: 16px; animation: bird-fly 24s linear infinite; }
.mgo-bird::before { content: '🕊️'; }
.mgo-bird.b2 { top: 52%; animation-duration: 32s; animation-delay: -14s; font-size: 12px; }
@keyframes bird-fly {
  0% { transform: translate(0, 0); }
  50% { transform: translate(55vw, -26px); }
  100% { transform: translate(115vw, 10px); }
}

/* Pawn and tiles */
.board-avatar::after {
  content: '';
  position: absolute;
  left: 50%; top: 78%;
  width: calc((46px + 32px * var(--focus, 0)) * var(--grow, 1)); height: calc((15px + 9px * var(--focus, 0)) * var(--grow, 1));
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(30,15,5,.42), transparent 70%);
  z-index: -1;
}
.board-tile.tile-hit { animation: tile-hit .42s ease-out; z-index: 3; }
@keyframes tile-hit {
  0% { transform: translateZ(0) scale(1); }
  40% { transform: translateZ(16px) scale(1.12); }
  100% { transform: translateZ(0) scale(1); }
}
.board-tile.tile-landed { animation: tile-landed .9s ease-out; }
@keyframes tile-landed {
  0% { box-shadow: 0 0 0 0 rgba(255,214,64,.95), 3px 3px 0 #c98612; }
  100% { box-shadow: 0 0 0 26px rgba(255,214,64,0), 3px 3px 0 #c98612; }
}
.board-tile[aria-current] { animation: tile-current 1.5s ease-in-out infinite; }
@keyframes tile-current {
  0%, 100% { box-shadow: 0 0 10px #ffdd47, 3px 3px 0 #c98612; }
  50% { box-shadow: 0 0 22px #ffc400, 3px 3px 0 #c98612; }
}
.board-intro .board-grid { animation: board-pop .8s cubic-bezier(.2,1.2,.4,1) both; }
.board-intro .game-turn { animation: dock-rise .6s cubic-bezier(.2,1.1,.4,1) both; }
@keyframes board-pop { from { scale: .55; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes dock-rise { from { translate: 0 80px; opacity: 0; } to { translate: 0 0; opacity: 1; } }

/* GO button and energy */
.mandat-game .mgo-go-diamond.is-ready { animation: none; }
@keyframes go-pulse {
  0%, 100% { scale: 1; filter: drop-shadow(0 0 0 rgba(120,255,90,0)); }
  50% { scale: 1.07; filter: drop-shadow(0 0 14px rgba(120,255,90,.85)); }
}
.mgo-dice-icon { display: inline-block; }
.mandat-game .mgo-go-diamond:hover:not(:disabled) .mgo-dice-icon { animation: dice-wiggle .5s ease-in-out; }
@keyframes dice-wiggle { 0%, 100% { rotate: 0deg; } 25% { rotate: -25deg; } 75% { rotate: 25deg; } }
.mgo-regen {
  display: block;
  margin-top: -2px;
  color: #6a4f33;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.mgo-energy-fill { background-image: linear-gradient(90deg, #24b6ff, #4dd2ff 60%, #9be8ff); background-size: 200% 100%; animation: energy-flow 3s linear infinite; }
@keyframes energy-flow { to { background-position: -200% 0; } }

/* Election and ladder panel */
.election-panel .election-note { padding: 8px 12px; border-radius: 12px; background: #fff3c9; border: 1.5px solid #f0c05a; font-weight: 700; }
.ladder { display: grid; gap: 8px; list-style: none; padding: 0; margin: 12px 0; }
.ladder-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid #decbb2;
  border-bottom-width: 4px;
  border-radius: 16px;
  background: #fffaf0;
}
.ladder-step small { display: block; color: #6e553b; font-size: 11px; }
.ladder-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #f1e6d2; font-size: 22px; }
.ladder-state { font-size: 11px; font-weight: 900; text-transform: uppercase; color: #6e553b; white-space: nowrap; }
.ladder-step.held { background: linear-gradient(180deg, #eaffdd, #cdf4b6); border-color: #7fcf5a; }
.ladder-step.held .ladder-icon { background: #98e06f; }
.ladder-step.next { background: linear-gradient(180deg, #fff9d8, #ffeaa0); border-color: #f0b52c; animation: next-glow 1.6s ease-in-out infinite; }
.ladder-step.next .ladder-icon { background: #ffd23f; }
.ladder-step.locked { opacity: .62; }
@keyframes next-glow { 50% { box-shadow: 0 0 0 4px rgba(255,200,40,.45); } }
.election-next h3 { margin: 4px 0 8px; }
.requirements { display: grid; gap: 5px; list-style: none; padding: 0; margin: 0 0 12px; }
.requirements li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; font-weight: 700; }
.requirements .met { color: #1f7a2a; }
.requirements .unmet { color: #b3321f; }
.odds { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-bottom: 12px; font-weight: 800; font-size: 13px; }
.odds-bar { height: 16px; border-radius: 999px; background: #e9dcc6; border: 2px solid #d6c3a1; overflow: hidden; }
.odds-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff6b6b, #ffd23f 50%, #4cd964); border-radius: inherit; transition: width .6s ease; }
.mandat-game .election-go { width: 100%; min-height: 48px; font-size: 15px; }
.election-record { text-align: center; font-weight: 800; color: #6e553b; margin-top: 12px; }

/* =============================================================================================
   Effects layer
   ============================================================================================= */
.fx-root { position: absolute; inset: 0; z-index: 60; pointer-events: none; }
.fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fx-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.fx-float {
  position: absolute;
  opacity: 0;
  white-space: nowrap;
  font: 900 clamp(16px, 4vw, 22px)/1 'Segoe UI', Inter, sans-serif;
  color: #fff;
  -webkit-text-stroke: 3px var(--stroke, #5b3600);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--stroke, #5b3600);
  animation: fx-rise 1.8s cubic-bezier(.2,.8,.3,1) both;
}
.fx-float.big { font-size: clamp(22px, 6vw, 32px); }
.fx-float[data-tone="gold"] { color: #ffe27a; --stroke: #6a3d00; }
.fx-float[data-tone="red"] { color: #ff8a80; --stroke: #5c0f0a; }
.fx-float[data-tone="green"] { color: #a8ff9a; --stroke: #0f4d12; }
.fx-float[data-tone="blue"] { color: #9fdcff; --stroke: #0b3a66; }
@keyframes fx-rise {
  0% { opacity: 0; transform: translate(-50%, 14px) scale(.5); }
  14% { opacity: 1; transform: translate(-50%, -6px) scale(1.18); }
  28% { transform: translate(-50%, -12px) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), -96px) scale(1); }
}

.fx-banner {
  position: absolute;
  top: 82px; left: 50%;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(92vw, 460px);
  padding: 10px 22px 10px 14px;
  border-radius: 999px;
  border: 3px solid #fff;
  background: linear-gradient(180deg, #fff3b0 0%, #ffc531 100%);
  color: #4d2b00;
  box-shadow: 0 6px 0 #a56a12, 0 12px 26px rgba(40,20,0,.38);
  transform: translateX(-50%);
  animation: banner-in .45s cubic-bezier(.2,1.5,.4,1) both;
}
.fx-banner strong { display: block; font-size: clamp(14px, 3.6vw, 18px); font-weight: 900; line-height: 1.1; }
.fx-banner small { display: block; font-size: 12px; font-weight: 800; opacity: .8; }
.fx-banner-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.7); font-size: 24px; flex: none; }
.fx-banner[data-tone="purple"] { background: linear-gradient(180deg, #f1d9ff, #b778f0); color: #2c0a4d; box-shadow: 0 6px 0 #6a2fa3, 0 12px 26px rgba(30,0,60,.4); }
.fx-banner[data-tone="red"] { background: linear-gradient(180deg, #ffd0c9, #ff7a68); color: #4a0b05; box-shadow: 0 6px 0 #a3281a, 0 12px 26px rgba(60,0,0,.4); }
.fx-banner[data-tone="teal"] { background: linear-gradient(180deg, #c4fff4, #38d6c2); color: #02403a; box-shadow: 0 6px 0 #138a7c, 0 12px 26px rgba(0,40,36,.4); }
.fx-banner[data-tone="grey"] { background: linear-gradient(180deg, #eef1f5, #aab4c2); color: #1d2733; box-shadow: 0 6px 0 #6b7686, 0 12px 26px rgba(0,0,0,.35); }
.fx-banner.leaving { animation: banner-out .3s ease-in both; }
@keyframes banner-in { from { opacity: 0; transform: translate(-50%, -40px) scale(.6); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes banner-out { to { opacity: 0; transform: translate(-50%, -30px) scale(.9); } }

.fx-flash { position: absolute; inset: 0; animation: flash .7s ease-out both; }
.fx-flash[data-tone="gold"] { background: radial-gradient(circle, rgba(255,240,150,.85), rgba(255,200,40,0) 70%); }
.fx-flash[data-tone="red"] { background: radial-gradient(circle, rgba(255,60,50,.55), rgba(255,60,50,0) 75%); }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

.fx-shake { animation: shake .45s cubic-bezier(.36,.07,.19,.97); }
.fx-shake-strong { animation: shake-strong .6s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake {
  10%, 90% { transform: translate(-2px, 0); }
  20%, 80% { transform: translate(4px, 1px); }
  30%, 50%, 70% { transform: translate(-6px, -1px); }
  40%, 60% { transform: translate(6px, 1px); }
}
@keyframes shake-strong {
  10%, 90% { transform: translate(-4px, 2px) rotate(-.3deg); }
  20%, 80% { transform: translate(8px, -2px) rotate(.4deg); }
  30%, 50%, 70% { transform: translate(-12px, 3px) rotate(-.5deg); }
  40%, 60% { transform: translate(12px, -3px) rotate(.5deg); }
}

/* Modal cards */
.fx-modal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(circle at 50% 45%, rgba(40,20,60,.5), rgba(12,6,24,.78));
  pointer-events: auto;
  opacity: 0;
  transition: opacity .25s ease;
}
.fx-modal.open { opacity: 1; }
.fx-modal.leaving { opacity: 0; }
.fx-card {
  width: min(310px, 84vw);
  height: min(400px, 62vh);
  perspective: 1000px;
  scale: .5;
  transition: scale .5s cubic-bezier(.2,1.4,.4,1);
}
.fx-modal.open .fx-card { scale: 1; }
.fx-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .75s cubic-bezier(.3,1.25,.4,1); }
.fx-modal.flipped .fx-card-inner { transform: rotateY(180deg); }
.fx-card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 18px;
  border-radius: 24px;
  border: 5px solid #fff;
  text-align: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 10px 0 rgba(0,0,0,.28), 0 24px 44px rgba(0,0,0,.5);
}
.fx-card-front {
  background: radial-gradient(circle at 30% 25%, #ffd1f0, #ff5fa8 55%, #c21f78);
}
.fx-card-front b { font-size: 120px; line-height: 1; color: #fff; text-shadow: 0 6px 0 #8f0f57, 0 0 30px rgba(255,255,255,.6); animation: card-wobble 1s ease-in-out infinite; }
@keyframes card-wobble { 50% { rotate: 6deg; scale: 1.06; } }
.fx-card-back { transform: rotateY(180deg); background: linear-gradient(180deg, #fffdf2, #fbefc8); color: #3b2610; }
.fx-card-back small { font-weight: 900; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; color: #a1631d; }
.fx-card-back h3 { margin: 0; font-size: clamp(20px, 5.4vw, 25px); line-height: 1.15; font-weight: 900; }
.fx-card-back p { margin: 0; font-size: 14px; font-weight: 700; color: #5c4630; }
.fx-card-amount { display: block; margin-top: 4px; font-size: 38px; font-weight: 950; letter-spacing: -.02em; }
.fx-modal[data-tone="good"] .fx-card-back { background: linear-gradient(180deg, #f4ffe9, #c8f2a3); }
.fx-modal[data-tone="good"] .fx-card-amount { color: #1d8a2a; text-shadow: 0 3px 0 #bff0b2; }
.fx-modal[data-tone="bad"] .fx-card-back { background: linear-gradient(180deg, #fff1ee, #ffc4b8); }
.fx-modal[data-tone="bad"] .fx-card-amount { color: #c22a1a; text-shadow: 0 3px 0 #ffd6cf; }
.fx-card-ok {
  margin-top: 8px;
  padding: 10px 26px;
  border: 3px solid #fff;
  border-bottom-width: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #5fe054, #2ba726);
  color: #fff;
  font: 900 15px/1 'Segoe UI', Inter, sans-serif;
  text-shadow: 0 2px 2px rgba(0,0,0,.35);
  cursor: pointer;
}
.fx-card-ok:hover { filter: brightness(1.08); }

/* Election night */
.fx-ballot {
  width: min(380px, 92vw);
  padding: 24px 20px 22px;
  border-radius: 28px;
  border: 5px solid #fff;
  background: linear-gradient(180deg, #2b2a6b, #14134a);
  color: #fff;
  text-align: center;
  box-shadow: 0 10px 0 rgba(0,0,0,.35), 0 26px 50px rgba(0,0,0,.55);
  scale: .6;
  transition: scale .5s cubic-bezier(.2,1.4,.4,1);
}
.fx-modal.open .fx-ballot { scale: 1; }
.fx-ballot small { display: block; font-weight: 900; text-transform: uppercase; letter-spacing: .16em; font-size: 11px; color: #ffd23f; }
.fx-ballot h3 { margin: 4px 0 18px; font-size: clamp(22px, 6vw, 28px); font-weight: 950; }
.fx-tally { display: grid; gap: 14px; }
.fx-side { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; text-align: left; }
.fx-side span { font-weight: 800; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-side b { font-size: 22px; font-weight: 950; font-variant-numeric: tabular-nums; }
.fx-bar { grid-column: 1 / -1; order: 3; height: 22px; border-radius: 999px; background: rgba(255,255,255,.14); overflow: hidden; }
.fx-bar i { display: block; height: 100%; width: 0; border-radius: inherit; }
.fx-side.you i { background: linear-gradient(90deg, #2aa8ff, #6fe3ff); }
.fx-side.rival i { background: linear-gradient(90deg, #ff6b6b, #ffa07a); }
.fx-stamp {
  margin: 22px auto 6px;
  width: fit-content;
  padding: 6px 22px;
  border: 5px solid currentColor;
  border-radius: 12px;
  font-size: clamp(30px, 9vw, 42px);
  font-weight: 950;
  letter-spacing: .05em;
  opacity: 0;
  transform: scale(2.6) rotate(-14deg);
}
.fx-election[data-tone="good"] .fx-stamp { color: #5dff7b; text-shadow: 0 0 22px rgba(93,255,123,.8); }
.fx-election[data-tone="bad"] .fx-stamp { color: #ff6b6b; text-shadow: 0 0 22px rgba(255,107,107,.7); }
.fx-election.revealed .fx-stamp { animation: stamp-in .55s cubic-bezier(.2,1.6,.4,1) forwards; }
@keyframes stamp-in { to { opacity: 1; transform: scale(1) rotate(-6deg); } }

@media (max-height: 560px) {
  .mgo-side-left, .mgo-side-right { top: 70px; gap: 6px; }
  .mgo-float-badge { width: 44px; height: 44px; border-width: 2px; }
  .mgo-float-badge small { display: none; }
  .fx-card { height: min(330px, 80vh); }
}
@media (prefers-reduced-motion: reduce) {
  .mgo-float-badge, .mgo-cloud, .mgo-tree, .mgo-bird, .mgo-event-banner::after, .mgo-event-key,
  .board-tile[aria-current], .mandat-game .mgo-go-diamond.is-ready, .mgo-energy-fill, .ladder-step.next { animation: none !important; }
  .fx-float, .fx-banner { animation-duration: .01s !important; }
}

/* Legible text and controls across light and dark surfaces. */
.mandat-game .game-details { color: #243447; }
.mandat-game .board-panel { background: #fffaf0; color: #243447; }
.mandat-game .board-panel :is(p,label,li,small) { color: #405366; text-shadow: none; }
.mandat-game .board-panel :is(input,select,textarea) { background: #ffffff; color: #243447; border: 1px solid #8d9eac; }
.mandat-game .board-panel :is(h2,h3,b,strong) { color: #243447; text-shadow: none; }
.game-result { background: #102832; color: #effaff; }
.game-result :is(p,b) { color: #effaff; text-shadow: none; }
.game-map-inspection { color: #fff; background: #102832; line-height: 1.5; font-size: 13px; }
.board-tile button { color: inherit; text-shadow: none; }
.board-tile button small { opacity: 1; font-weight: 800; }
.mandat-game button:focus-visible { outline: 3px solid #ffe36b; outline-offset: 3px; }
#board-content-editor { color: var(--app-ink); }
#board-content-editor details { border: 1px solid var(--app-line); border-radius: 10px; padding: 12px; margin: 9px 0; }
#board-content-editor summary { cursor: pointer; font-weight: 700; min-height: 30px; }
#board-content-editor form { display: grid; gap: 12px; padding-top: 12px; }
#board-content-editor label { display: grid; gap: 5px; font-size: 14px; }
#board-content-editor :is(input:not([type=checkbox]),textarea) { width: 100%; background: var(--app-bg); color: var(--app-ink); border: 1px solid var(--app-line); padding: 10px; border-radius: 7px; }
#board-content-editor textarea { min-height: 75px; resize: vertical; }
.content-effects { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
#board-content-editor [role=status] { color: var(--app-ink); }

.game-details.equipment-details { width: min(1100px,100%); }
.equipment-wardrobe { display:grid; grid-template-columns:minmax(240px,.9fr) minmax(300px,1.2fr); gap:20px; padding:12px; color:#172d3e; }
.equipment-preview-panel { background:radial-gradient(ellipse at 50% 30%,#fff,#cee7e9); border:1px solid #aac4cd; border-radius:22px; padding:18px; text-align:center; }
.equipment-preview { height:410px; width:100%; }
.equipment-preview canvas { display:block; width:100%;height:100%; }
.equipment-inventory > p { margin:8px 0 18px; line-height:1.5; }
.equipment-cards { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px; }
.equipment-card { display:flex;flex-direction:column;align-items:center;gap:9px;background:#fffaf0;border:2px solid #c8b995;border-radius:16px;padding:15px;text-align:center;color:#263648; }
.equipment-card[data-equipped=true] { border-color:#38866b; background:#e8f7ee; }
.equipment-picture { background:#edf0f5;border-radius:14px;padding:6px;width:100%; }
.equipment-picture img { display:block;width:100%;height:auto;max-height:160px;object-fit:contain; }
.equipment-card h4 { font-size:16px;margin:0; }
.equipment-card p { font-size:13px;margin:0; }
.equipment-card small { margin:0; }
.equipment-card .mandat-btn { width:100%; margin-top:auto; }
.gear-filters { display:grid;gap:10px;margin:14px 0; }
.gear-views,.gear-categories { display:flex;flex-wrap:wrap;gap:6px; }
.gear-filters button { border:1px solid #90a5b3;border-radius:10px;min-height:38px;padding:7px 12px;background:#fffaf0;color:#243447;font-weight:700;cursor:pointer; }
.gear-filters button[aria-pressed=true] { background:#215b49;color:#fff;border-color:#215b49; }
.gear-filters small,.equipment-card small { color:#4b5a68; }
.gear-empty { grid-column:1 / -1;padding:24px;border:1px dashed #8197a4;border-radius:12px;text-align:center; }
@media(max-width:650px) {
 .equipment-wardrobe { grid-template-columns:1fr;padding:2px; }
 .equipment-preview { height:280px; }
 .equipment-card { padding:10px;gap:7px; }
 .equipment-picture img { height:110px; }
}

/* Keep text contrast tied to the surface, including locked progression cards. */
.mandat-game .board-summary article { background:#fffaf0; color:#243447; }
.mandat-game .board-summary article :is(strong,span,small) { color:#243447; text-shadow:none; opacity:1; }
.mandat-game .board-panel .ladder-step { opacity:1; color:#243447; }
.mandat-game .board-panel .ladder-step :is(b,small,span) { color:#243447; text-shadow:none; }
.mandat-game .board-panel .ladder-step.locked { background:#e3e8ec; border-color:#a6b3bf; }
.mandat-game .game-turn { display:flex; flex-direction:column; gap:10px; padding:10px 12px; }
.mandat-game .game-result { flex:none; max-width:min(780px,100%); border-radius:12px; line-height:1.4; overflow-wrap:anywhere; }
.mandat-game .mgo-go-diamond { margin:0; width:150px; height:58px; transform:none; border-radius:18px; animation:none; }
.mandat-game .mgo-go-diamond:is(:hover,:active):not(:disabled) { transform:none; }
.mandat-game .mgo-go-inner { transform:none; flex-direction:row; gap:8px; }
.mandat-game .mgo-go-inner strong { font-size:13px; }
.mgo-go-dock { flex-wrap:wrap; gap:12px; }
.game-body { min-width:0; }
.game-details { overflow-x:hidden; }
.game-map-inspection { max-height:30%;overflow:auto; }
.party-search { display:block;width:100%;padding:12px;margin:12px 0;border:1px solid #94a9b8;border-radius:10px; }
.party-options { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;max-height:48vh;overflow:auto;padding:3px; }
.party-option { display:flex!important;align-items:center;gap:10px;padding:10px;border:2px solid #8fa5b5;border-radius:12px;cursor:pointer;background:#f7fafc;color:#203549!important; }
.party-option:has(input:checked) { border-color:#ffd45e;background:#fff2c4; }
.party-option img { width:55px;height:55px;object-fit:contain;background:white;border-radius:8px; }
.party-option span { font-size:12px;line-height:1.4;overflow-wrap:anywhere;min-width:0; }
.party-option strong,.party-option small { display:block; }
.mandat-game .board-panel .party-option :is(strong,small) { color:#203549; }
.party-independent { width:55px;height:55px;flex:none;display:grid;place-items:center;background:#e4eaf0;color:#52687c;border-radius:8px;font-size:30px!important; }
.party-option input { flex:none; }
.party-option[hidden] { display:none!important; }
.party-picker > button { margin-top:14px;width:100%;min-height:44px; }
@media(max-width:600px) {
 .party-options { grid-template-columns:1fr; }
 .game-tabs button { font-size:10px;overflow-wrap:anywhere; }
 .mgo-go-dock { gap:7px; }
 .mandat-game .mgo-go-diamond { width:125px; }
 .mgo-side-left,.mgo-side-right { gap:5px; }
 .game-result b { font-size:12px; }
}
@media(max-height:500px) {
 .mandat-game .game-turn { gap:4px;padding:4px 8px; }
 .game-roll-controls { flex-direction:row;flex-wrap:wrap;justify-content:center; }
 .mandat-game .mgo-go-diamond { height:42px; }
 .mgo-energy-pill { max-width:170px; }
}

.mandat-game .mandat-btn.primary { background:#226b3e; border-color:#174b2d; color:#fff; text-shadow:none; }
.mandat-game .mandat-btn:disabled { opacity:1; background:#e1e6e9; border-color:#b0bbc4; color:#596570; text-shadow:none; box-shadow:none; }
.mandat-game .mgo-go-diamond { background:#23753c; border-color:#c5e0ae; }
.mandat-game .mgo-go-diamond:disabled { opacity:1; filter:none; }
.game-result { max-height:100px;overflow:auto; }
.equipment-preview-panel { align-self:start;position:sticky;top:0; }
.equipment-preview { touch-action:pan-y; }
.party-options { border:0;margin:0;min-width:0; }
.party-option input { width:18px;height:18px;accent-color:#246b48; }
.party-option:focus-within { outline:3px solid #d69215;outline-offset:1px; }
.visually-hidden { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
@media(max-width:650px) {
 .equipment-preview-panel { position:static; }
 .game-hud { display:grid;grid-template-columns:1fr auto;gap:5px;padding:5px 8px; }
 .game-meters { grid-column:1 / -1;grid-row:2;display:grid;grid-template-columns:auto 1fr auto auto;gap:4px;min-width:0; }
 .game-meters b { justify-content:center;gap:3px;padding:3px 5px;font-size:12px; }
 .game-meters small { display:inline;font-size:9px;opacity:1; }
 .game-meters .mgo-meter-icon { display:none; }
 .game-hud .mgo-hud-back { width:fit-content;min-width:38px;min-height:32px;padding:4px 10px; }
 .game-hud .game-fullscreen { grid-column:2;grid-row:1;min-height:32px; }
 .game-tabs { gap:4px;padding-inline:4px; }
 .game-tabs button { padding:4px 2px;line-height:1.2; }
 .mgo-go-dock { display:grid;grid-template-columns:1fr 1.25fr auto;width:min(100%,400px);gap:6px; }
 .mandat-game .mgo-go-diamond { width:100%;height:54px; }
 .mandat-game .mgo-rest-pill { padding:6px;font-size:11px;white-space:normal; }
 .mgo-mult-badge { padding:5px 7px;font-size:10px; }
 .mgo-float-badge { width:56px;height:56px;border-width:2px; }
 .mgo-float-badge small { font-size:9px; }
 .mgo-top-event { width:calc(100% - 16px); }
 .mgo-event-key { display:none; }
}
@media(max-width:390px) {
 .game-meters b { gap:3px;padding:4px 5px; }
 .game-meters small { font-size:9px; }
 .game-tabs button { font-size:9px;letter-spacing:-.15px;overflow-wrap:normal; }
}
@media(max-height:500px) {
 .game-result { max-height:58px;font-size:11px; }
}
@media(max-width:650px), (max-height:500px) {
 .mgo-side-left { top:auto;bottom:12px;left:8px; }
 .mgo-side-right { top:auto;bottom:12px;right:8px;flex-direction:row;gap:6px; }
 .mgo-side-left :is(.mgo-badge-election,.mgo-badge-stats,.mgo-badge-shop) { display:none; }
 .mgo-float-badge small { white-space:normal;overflow:visible;text-overflow:clip;padding:1px 2px; }
}
@media(max-width:650px) and (max-height:650px), (max-height:500px) {
 .mgo-event-sub,.mgo-event-bar,.mgo-event-key,.mgo-event-reward small { display:none; }
 .mgo-event-banner { padding:4px 8px;border-width:2px; }
 .mgo-float-badge { width:48px;height:48px;border-width:2px; }
 .mgo-badge-icon { font-size:19px; }
 .mandat-game .game-turn { gap:6px;padding:6px 8px; }
}
@media(max-height:500px) and (min-width:651px) {
 .mandat-game .game-turn { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);align-items:center; }
 .game-roll-controls { width:100%; }
 .game-roll-controls :is(.mgo-energy-pill,.mgo-regen) { display:none; }
}

/* LIVE CROWD: other players in this constituency and AI residents */
.board-crowd { position: absolute; inset: 0; pointer-events: none; }
.board-npc { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-origin: 0 0; pointer-events: none; will-change: transform; }
.board-npc.leaving { opacity: 0; transition: opacity .4s ease; }
.npc-shadow { position: absolute; left: -18px; top: -6px; width: 36px; height: 12px; border-radius: 50%; background: radial-gradient(ellipse, rgba(30, 15, 5, .42), transparent 70%); }
.npc-body { position: absolute; left: -22px; bottom: 0; display: block; width: 44px; height: 62px; transform-origin: 50% 100%; }
.board-npc.entering .npc-body { animation: npc-in .55s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes npc-in { from { opacity: 0; scale: .4; } to { opacity: 1; scale: 1; } }
.npc-fig { position: absolute; inset: 0; display: block; transform-origin: 50% 100%; animation: npc-bob 1.7s ease-in-out infinite alternate; }
.board-npc:nth-child(2n) .npc-fig { animation-delay: -.6s; }
.board-npc:nth-child(3n) .npc-fig { animation-delay: -1.1s; }
@keyframes npc-bob { from { transform: scaleY(1); } to { transform: scaleY(.965); } }
.npc-fig > i { position: absolute; display: block; }
.npc-legs { z-index: 1; left: 12px; top: 46px; width: 20px; height: 16px; border-radius: 0 0 5px 5px;
  background: linear-gradient(90deg, #2a2e44 0 45%, transparent 45% 55%, #2a2e44 55%); }
.npc-torso { z-index: 2; left: 9px; top: 26px; width: 26px; height: 24px; border-radius: 11px 11px 5px 5px; background: var(--top, #3b5ba5); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .13); }
.npc-torso::before, .npc-torso::after { content: ''; position: absolute; top: 3px; width: 6px; height: 19px; border-radius: 4px;
  background: linear-gradient(var(--top, #3b5ba5) 0 74%, var(--skin, #b98260) 74%); }
.npc-torso::before { left: -5px; }
.npc-torso::after { right: -5px; }
.npc-head { z-index: 3; left: 12px; top: 6px; width: 20px; height: 22px; border-radius: 50% 50% 46% 46%; background: var(--skin, #b98260); box-shadow: 0 2px 0 rgba(0, 0, 0, .08); }
.npc-head::before { content: ''; position: absolute; left: 5px; top: 10px; width: 3px; height: 4px; border-radius: 50%; background: #2b1d14; box-shadow: 7px 0 0 #2b1d14; }
.npc-head::after { content: ''; position: absolute; left: 8px; top: 16px; width: 4px; height: 2px; border-bottom: 2px solid rgba(120, 40, 40, .7); border-radius: 0 0 4px 4px; }
.npc-hair::before, .npc-hair::after { content: ''; position: absolute; display: block; }
.board-npc[data-gender="male"] .npc-hair::after { z-index: 5; left: 11px; top: 3px; width: 22px; height: 13px; border-radius: 12px 12px 3px 3px; background: var(--hair, #1d1612); }
.board-npc[data-gender="female"] .npc-hair::before { z-index: 0; left: 9px; top: 4px; width: 26px; height: 34px; border-radius: 13px 13px 9px 9px; background: var(--hair, #1d1612); }
.board-npc[data-gender="female"] .npc-hair::after { z-index: 5; left: 11px; top: 4px; width: 22px; height: 9px; border-radius: 11px 11px 2px 2px; background: var(--hair, #1d1612); }
.board-npc[data-covered="true"] .npc-hair::before { z-index: 0; left: 8px; top: 2px; width: 28px; height: 32px; border-radius: 50% 50% 40% 40%; background: var(--hijab, #2a7f8f); }
.board-npc[data-covered="true"] .npc-hair::after { z-index: 5; left: 8px; top: 4px; width: 28px; height: 36px; border-radius: 14px 14px 12px 12px; background: var(--hijab, #2a7f8f); }
.board-npc[data-covered="true"] .npc-hair::after { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 70%, 12% 70%, 12% 38%, 26% 20%, 74% 20%, 88% 38%, 88% 70%, 0 70%); }
.npc-tag { position: absolute; left: 50%; bottom: calc(100% + 3px); translate: -50% 0; display: flex; align-items: center; gap: 3px; max-width: 120px; padding: 1px 6px 1px 4px;
  border-radius: 999px; background: rgba(255, 255, 255, .94); color: #2b1b0e; font-size: 9px; line-height: 1.35; white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
  opacity: clamp(0, calc((var(--focus, 0) - .3) * 3), 1); }
.npc-tag b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 800; }
.npc-tag small { padding: 0 4px; border-radius: 6px; background: #e8eef7; color: #44546f; font-size: 8px; font-weight: 900; }
.board-npc[data-kind="player"] .npc-tag small { background: #dff6e6; color: #1d7a43; }
.npc-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 0 2px rgba(46, 204, 113, .3); }
.board-npc[data-kind="bot"] .npc-dot { background: #8aa4d6; box-shadow: none; }
.board-live-pill { position: absolute; left: 50%; top: 72px; translate: -50% 0; z-index: 5; max-width: calc(100% - 150px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 3px 11px; border-radius: 999px; background: rgba(32, 22, 52, .8); color: #fff; font-size: 11px; font-weight: 800; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); pointer-events: none; }
.board-live-pill[hidden] { display: none; }
.game-stage:has(.game-map-inspection:not([hidden])) .board-live-pill { opacity: 0; }
/* Other players and AI rolling on their own turn: a dice bubble pops above them, legs swing while they walk. */
.npc-roll { position: absolute; left: 50%; bottom: calc(100% + 18px); translate: -50% 0; padding: 1px 7px; border-radius: 999px;
  background: #ffd84a; color: #3a2405; font-size: 10px; font-weight: 900; white-space: nowrap; box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
  opacity: 0; scale: .5; pointer-events: none; }
.board-npc.rolling .npc-roll { animation: npc-roll 1.9s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes npc-roll {
  0% { opacity: 0; scale: .5; translate: -50% 6px; }
  14% { opacity: 1; scale: 1.08; translate: -50% 0; }
  22% { scale: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; translate: -50% -8px; }
}
.board-npc.walking .npc-legs { animation: npc-stride .32s ease-in-out infinite alternate; transform-origin: 50% 0; }
@keyframes npc-stride { from { transform: skewX(9deg); } to { transform: skewX(-9deg); } }
@media (prefers-reduced-motion: reduce) {
  .board-npc.rolling .npc-roll { animation: none; opacity: 1; scale: 1; }
  .board-npc.walking .npc-legs { animation: none; }
}

/* Residents and other players as 3D characters. The 2D figure stays only until the model has drawn. */
.board-npc .npc-body { appearance: none; margin: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent; }
.board-npc .npc-body:focus-visible { outline: 3px solid #ffd84a; outline-offset: 2px; border-radius: 8px; }
.npc-model { position: absolute; left: 50%; bottom: calc(var(--model-h, 82px) * -.22); width: var(--model-w, 56px); height: var(--model-h, 82px);
  translate: -50% 0; opacity: 0; transition: opacity .35s ease; pointer-events: none; filter: drop-shadow(0 4px 4px rgba(45, 25, 10, .4)); }
.board-npc[data-model="ready"] .npc-model { opacity: 1; }
.board-npc[data-model="ready"] .npc-fig { opacity: 0; animation: none; }
.npc-fig { transition: opacity .35s ease; }
.board-npc[data-model="ready"] .npc-tag { bottom: calc(var(--model-h, 82px) * .78 - 8px); }
.board-npc[data-model="ready"] .npc-roll { bottom: calc(var(--model-h, 82px) * .78 + 8px); }
.board-npc .npc-dot, .board-npc[data-kind] .npc-dot { background: #2ecc71; box-shadow: 0 0 0 2px rgba(46, 204, 113, .3); }
.board-npc .npc-tag small { background: #fff1c7; color: #7a4b00; }
@media (hover: hover) { .board-npc .npc-body:hover .npc-tag { opacity: 1; } }

/* Ranking badge on the left rail */
.mgo-badge-ranking { background: linear-gradient(180deg, #ffe17a 0%, #f2a900 100%); color: #4a2c00; box-shadow: 0 4px 0 #a86f00, 0 6px 14px rgba(0,0,0,.25); }

/* Sheet over the board: popularity ranking and player profiles */
.board-sheet { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  background: rgba(24, 14, 6, .42); backdrop-filter: blur(3px); animation: sheet-fade .2s ease both; }
@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }
.board-sheet-card { display: flex; flex-direction: column; width: min(460px, 100%); max-height: min(640px, 100%); overflow: hidden; border: 3px solid #fff; border-radius: 22px;
  background: linear-gradient(180deg, #fffaf0 0%, #fbeedb 100%); color: #3b2614; box-shadow: 0 6px 0 #c8a87c, 0 18px 40px rgba(40, 20, 5, .35);
  animation: sheet-rise .28s cubic-bezier(.2, 1.2, .4, 1) both; }
@keyframes sheet-rise { from { translate: 0 24px; scale: .96; } to { translate: 0 0; scale: 1; } }
.board-sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 18px; border-bottom: 2px dashed #ecd7b6; }
.board-sheet-head > div { flex: 1; min-width: 0; }
.board-sheet-head h3 { margin: 0; font-size: 18px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-sheet-head p { margin: 2px 0 0; font-size: 12px; color: #8a6a4a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-sheet-close, .board-sheet-back { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid #fff; border-radius: 50%;
  background: #f2e2c8; color: #5a3a1a; font-size: 16px; font-weight: 900; cursor: pointer; box-shadow: 0 3px 0 #c9a77b; }
.board-sheet-close:active, .board-sheet-back:active { translate: 0 2px; box-shadow: 0 1px 0 #c9a77b; }
.board-sheet-status { padding: 24px 18px; text-align: center; color: #8a6a4a; }
.rank-mine { margin: 10px 14px 0; padding: 8px 12px; border-radius: 12px; background: #fff3c4; color: #6b4300; font-size: 13px; font-weight: 800; text-align: center; }
.rank-list { flex: 1; min-height: 0; margin: 0; padding: 10px 10px 4px; overflow-y: auto; list-style: none; overscroll-behavior: contain; }
.rank-list-me { flex: none; padding-top: 0; border-top: 2px dashed #ecd7b6; }
.rank-row + .rank-row { margin-top: 6px; }
.rank-row button { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 6px 12px 6px 6px;
  border: 2px solid #f1dfc3; border-radius: 14px; background: #fff; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rank-row button:hover { border-color: #f2a900; }
.rank-row.is-me button { border-color: #2ecc71; background: #eafcf1; }
.rank-row.is-top button { background: linear-gradient(90deg, #fff7d6, #fff 60%); }
.rank-row.is-me.is-top button { background: linear-gradient(90deg, #fff7d6, #eafcf1 60%); }
.rank-place { display: grid; place-items: center; height: 40px; border-radius: 12px; background: #f6ead6; font-size: 15px; font-weight: 900; color: #7a5a3a; }
.rank-row.is-top .rank-place { background: transparent; font-size: 26px; }
.rank-name { min-width: 0; }
.rank-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.rank-name em { padding: 1px 6px; border-radius: 6px; background: #2ecc71; color: #fff; font-size: 10px; font-style: normal; vertical-align: 2px; }
.rank-name small { display: flex; align-items: center; gap: 5px; color: #8a6a4a; font-size: 12px; }
.rank-live { width: 7px; height: 7px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 0 2px rgba(46, 204, 113, .25); }
.rank-score { text-align: right; }
.rank-score b { display: block; font-size: 17px; font-weight: 900; color: #c47a00; }
.rank-score small { font-size: 10px; color: #8a6a4a; text-transform: uppercase; letter-spacing: .04em; }
.rank-note { margin: 0; padding: 8px 16px 14px; color: #9a7b5a; font-size: 11px; text-align: center; }
.profile-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 0; padding: 14px; }
.profile-facts div { padding: 10px 12px; border-radius: 14px; background: #fff; border: 2px solid #f1dfc3; }
.profile-facts dt { font-size: 11px; color: #8a6a4a; }
.profile-facts dd { margin: 2px 0 0; font-size: 18px; font-weight: 900; }
.profile-facts div:first-child { grid-column: 1 / -1; background: linear-gradient(90deg, #fff3c4, #fff); }
.profile-facts div:first-child dd { color: #c47a00; font-size: 24px; }
.profile-heading { margin: 0; padding: 0 18px; font-size: 14px; }
.profile-stats { display: grid; gap: 8px; margin: 0; padding: 10px 18px 18px; list-style: none; overflow-y: auto; }
.profile-stats li { display: grid; grid-template-columns: 96px minmax(0, 1fr) 30px; align-items: center; gap: 10px; font-size: 13px; }
.profile-stats b { text-align: right; }
.profile-bar { height: 10px; border-radius: 6px; background: #f1e3cc; overflow: hidden; }
.profile-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f2a900, #ff7a3d); }
:root[data-theme="dark"] .board-sheet-card { background: linear-gradient(180deg, #2b2620 0%, #221d18 100%); color: #f6ead6; border-color: #4a3f33; box-shadow: 0 6px 0 #14100c, 0 18px 40px rgba(0,0,0,.5); }
:root[data-theme="dark"] :is(.rank-row button, .profile-facts div) { background: #312a22; border-color: #4a3f33; }
:root[data-theme="dark"] .rank-row.is-me button { background: #1f3a2a; }
@media (prefers-reduced-motion: reduce) { .board-sheet, .board-sheet-card { animation: none; } }

/* ---------------------------------------------------------------------------------------------
   Fullscreen display for the game's other screens (Stats, Election, Equipment, Party): on wide screens
   they use the whole width instead of a narrow centred column.
   --------------------------------------------------------------------------------------------- */
@media (min-width: 900px) {
  .game-details { width: min(100%, 1400px); padding: 16px clamp(16px, 2.4vw, 36px) 24px; }
  /* Stats: overview tiles beside the stats card */
  .game-details:has(> .board-summary) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 18px; align-content: start; align-items: start; }
  .game-details > .board-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
  .game-details > .board-summary + .mandat-card { margin: 0; }
  /* Election: requirements beside the list of seats */
  .election-panel { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); column-gap: 24px; align-items: start; }
  .election-panel > :not(.election-general, .seat-list) { grid-column: 1 / -1; }
  .election-panel > .election-general { position: sticky; top: 0; }
  .cabinet-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  /* Party: more parties per row and a taller list */
  .party-options { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); max-height: max(320px, calc(100dvh - 360px)); }
  /* Equipment: tall preview on the left, the catalogue filling the rest */
  .game-details.equipment-details { width: min(100%, 1400px); }
  .equipment-wardrobe { grid-template-columns: minmax(280px, 32%) minmax(0, 1fr); gap: clamp(16px, 2vw, 28px); align-items: start; }
  .equipment-preview-panel { position: sticky; top: 0; }
  .equipment-preview { height: clamp(360px, calc(100dvh - 300px), 680px); }
  .equipment-cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

/* Seats with one holder each: who holds it, the player's chance and the button to run or challenge */
.election-general { margin: 12px 0; padding: 12px 14px; border: 2px solid #ecd7b6; border-radius: 14px; background: #fffdf6; }
.election-general h4 { margin: 0 0 8px; font-size: 14px; }
.election-general .requirements { margin: 0; }
.election-power { margin: 10px 0 0; font-size: 13px; }
.seat-list { display: grid; gap: 10px; margin: 12px 0; padding: 0; list-style: none; }
.seat-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 2px solid #e2cfae; border-radius: 16px; background: #fff; }
.seat-card.is-mine { border-color: #7fcf5a; background: linear-gradient(180deg, #f2ffe9, #ddf6cc); }
.seat-card.is-locked { background: #f1eee8; }
.seat-body { display: grid; gap: 2px; min-width: 0; }
.seat-body > b { font-size: 15px; }
.seat-body small { color: #6e553b; font-size: 11px; }
.seat-holder { font-size: 13px; color: #243447; overflow-wrap: anywhere; }
.seat-holder.is-vacant { color: #1f7a2a; font-weight: 800; }
.seat-holder.is-me { color: #1f7a2a; font-weight: 900; }
.mandat-game .board-panel .seat-why { color: #b3321f; font-weight: 700; }
.seat-act { display: grid; gap: 5px; justify-items: end; min-width: 120px; }
.seat-act .mandat-btn { min-height: 38px; padding: 6px 14px; white-space: nowrap; }
.seat-act .mandat-btn:disabled { opacity: .5; }
.mandat-game .seat-challenge { background: linear-gradient(180deg, #ff8f6b, #e0472c); color: #fff; border-color: #a92c16; }
.seat-odds { position: relative; display: block; width: 100%; height: 18px; border-radius: 999px; background: #efe2cb; overflow: hidden; }
.seat-odds i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ff6b6b, #ffd23f 50%, #4cd964); }
.seat-odds b { position: relative; display: block; text-align: center; font-size: 11px; line-height: 18px; color: #3b2614; }
.seat-badge { padding: 6px 12px; border-radius: 999px; background: #2ecc71; color: #fff; font-size: 12px; font-weight: 900; white-space: nowrap; }
.seat-group { grid-template-columns: 44px minmax(0, 1fr); }
.cabinet-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.cabinet-seat { display: grid; gap: 4px; align-content: start; padding: 10px; border: 2px solid #ecd7b6; border-radius: 12px; background: #fffaf0; }
.cabinet-seat.is-vacant { border-style: dashed; }
.cabinet-seat.is-mine { border-color: #7fcf5a; background: #eafbe0; }
.cabinet-seat b { font-size: 13px; }
.cabinet-seat small { color: #6e553b; font-size: 11px; overflow-wrap: anywhere; }
.cabinet-seat .seat-act { justify-items: stretch; min-width: 0; }
.cabinet-seat .seat-act .mandat-btn { min-height: 32px; padding: 4px 8px; font-size: 12px; }
.office-list li.is-mine { border-color: #7fcf5a; background: #eafbe0; }
@media (max-width: 560px) {
  .seat-card { grid-template-columns: 38px minmax(0, 1fr); }
  .seat-card > .seat-act { grid-column: 1 / -1; justify-items: stretch; }
  .seat-card .ladder-icon { width: 38px; height: 38px; font-size: 19px; }
}
@media (max-width: 560px) {
  .cabinet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .cabinet-seat { padding: 8px; }
}

/* Ragnarok-style stat window: hexagon radar beside the stat list */
.stats-layout { display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: 18px; align-items: center; margin: 12px 0; }
.stat-radar { width: 100%; height: auto; overflow: visible; }
.stat-radar .radar-ring { fill: #dcecf2; stroke: #b5cfdb; stroke-width: 1.2; }
.stat-radar .radar-ring.outer { fill: #e8f3f7; }
.stat-radar .radar-ring:not(.outer) { fill: rgba(190, 216, 228, .35); }
.stat-radar .radar-spoke { stroke: #c4d9e2; stroke-width: 1; }
.stat-radar .radar-shape { fill: rgba(141, 120, 230, .62); stroke: #7a62e0; stroke-width: 2; stroke-linejoin: round; transition: all .4s ease; }
.stat-radar text { fill: #3d4a5a; font-size: 15px; font-weight: 800; letter-spacing: .04em; }
.stat-radar .radar-scale { fill: #8193a3; font-size: 10px; font-weight: 600; letter-spacing: 0; }
.stat-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.stat-list li { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 2px solid #ecd7b6; border-radius: 14px; background: #fffdf6; }
.stat-abbr { display: grid; place-items: center; height: 38px; border-radius: 10px; background: #ece6ff; color: #5b45c9; font-size: 12px; font-weight: 900; letter-spacing: .04em; }
.stat-info { display: grid; gap: 3px; min-width: 0; }
.stat-info b { font-size: 14px; }
.stat-info em { margin-left: 4px; font-style: normal; color: #5b45c9; }
.stat-info em i { margin-left: 3px; font-style: normal; color: #1f7a2a; font-size: 12px; }
.mandat-game .board-panel .stat-info small { font-size: 11px; line-height: 1.35; color: #6e553b; }
.stat-bar { height: 6px; border-radius: 4px; background: #efe5d2; overflow: hidden; }
.stat-bar i { display: block; height: 100%; background: linear-gradient(90deg, #9a86ff, #6a52e0); }
.stat-add { display: flex; gap: 4px; }
.stat-add .mandat-btn { min-width: 40px; min-height: 34px; padding: 4px 8px; }
.stat-points { color: #5b45c9; }
@media (max-width: 700px) {
  .stats-layout { grid-template-columns: 1fr; }
  .stat-radar { max-width: 260px; justify-self: center; }
}

/* SPRM bail button, Ah Long debt badge and the bribe option */
.mandat-game .mgo-go-diamond.mgo-bail { background: linear-gradient(180deg, #ff8a7a, #d63a2a); border-color: #8f1d12; color: #fff; }
.mgo-badge-debt { background: linear-gradient(180deg, #ff9f9f 0%, #c62828 100%); color: #fff; box-shadow: 0 4px 0 #7a1010, 0 6px 14px rgba(0,0,0,.25); }
.mgo-badge-debt small { font-size: 9px; }
.mandat-game .mgo-bribe { background: linear-gradient(180deg, #4a4a4a, #1f1f1f); color: #ffd84a; border-color: #000; }
.project-hint { display: block; max-width: 340px; margin-top: 4px; font-size: 11px; line-height: 1.4; opacity: .9; }
.election-risk { margin: 8px 0 0; padding: 6px 8px; border-radius: 8px; background: #fff0e6; color: #a2410c; font-size: 12px; font-weight: 700; }
.mandat-game .board-panel .election-risk { color: #a2410c; }
.board-tile.tile-pdm span { white-space: normal; font-size: clamp(5px, 1.05vw, 8px); line-height: 1.05; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }

/* Finance: bank, Ah Long and the bankruptcy meter */
.mgo-badge-finance { background: linear-gradient(180deg, #b8e8d2 0%, #3fae7f 100%); color: #fff; box-shadow: 0 4px 0 #23704f, 0 6px 14px rgba(0,0,0,.25); }
.mgo-badge-finance.is-owing { background: linear-gradient(180deg, #ffd08a 0%, #e8901c 100%); box-shadow: 0 4px 0 #9a5a08, 0 6px 14px rgba(0,0,0,.25); }
.mgo-badge-finance.is-danger { background: linear-gradient(180deg, #ff9f9f 0%, #c62828 100%); box-shadow: 0 4px 0 #7a1010, 0 6px 14px rgba(0,0,0,.25); animation: finance-pulse 1.4s ease-in-out infinite; }
@keyframes finance-pulse { 50% { filter: drop-shadow(0 0 10px rgba(255, 60, 60, .9)); } }
.mgo-badge-finance small { font-size: 9px; }
.finance-body { display: grid; gap: 12px; padding: 14px; overflow-y: auto; }
.finance-muflis { padding: 10px 12px; border-radius: 12px; background: #3a1a1a; color: #ffd9d9; }
.finance-muflis p { margin: 4px 0 0; font-size: 12px; }
.finance-meter { padding: 10px 12px; border-radius: 14px; background: #fff; border: 2px solid #ecd7b6; }
.finance-meter-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.finance-bar { position: relative; height: 14px; margin: 6px 0; border-radius: 8px; background: #efe5d2; overflow: hidden; }
.finance-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4cd964, #ffd23f); transition: width .5s ease; }
.finance-meter.is-warn .finance-bar i { background: linear-gradient(90deg, #ffd23f, #ff9a3d); }
.finance-meter.is-danger, .finance-meter.is-bankrupt { border-color: #e04a3a; background: #fff1ef; }
.finance-meter.is-danger .finance-bar i, .finance-meter.is-bankrupt .finance-bar i { background: linear-gradient(90deg, #ff7a3d, #d62b1f); }
.finance-warn { position: absolute; top: 0; bottom: 0; width: 2px; background: #b3321f; }
.finance-meter small { color: #6e553b; font-size: 11px; line-height: 1.4; }
.finance-card { padding: 12px; border-radius: 14px; border: 2px solid #e2cfae; background: #fff; }
.finance-card.ahlong { border-color: #3a3a3a; background: #fbf7ef; }
.finance-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.finance-card header span { font-size: 12px; font-weight: 800; color: #6e553b; }
.finance-card dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 6px; margin: 8px 0; }
.finance-card dt { font-size: 10px; color: #8a6a4a; }
.finance-card dd { margin: 0; font-size: 15px; font-weight: 900; }
.finance-note { margin: 0 0 8px; font-size: 11px; line-height: 1.45; color: #6e553b; }
.finance-refusal { margin: 0 0 8px; font-size: 12px; font-weight: 800; color: #b3321f; }
.finance-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.finance-actions .mandat-btn { min-height: 34px; padding: 4px 10px; font-size: 12px; }
.finance-card > .mandat-btn.primary { width: 100%; min-height: 36px; }
.hardcore-choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; padding: 10px 12px; border: 2px dashed #e0a4a4; border-radius: 14px; background: #fff6f4; }
.hardcore-choice.is-on { border-style: solid; border-color: #d62b1f; background: #ffe9e5; }
.hardcore-choice p { margin: 4px 0 0; font-size: 12px; line-height: 1.4; }
.hardcore-choice small { display: block; margin-top: 4px; font-weight: 800; color: #b3321f; }
.hardcore-choice .mandat-btn { flex: none; }
:root[data-theme="dark"] :is(.finance-card, .finance-meter) { background: #312a22; border-color: #4a3f33; }
@media (prefers-reduced-motion: reduce) { .mgo-badge-finance.is-danger { animation: none; } }

/* Ground game: a flag on each visited polling district, coloured by local support */
.board-tile.tile-pdm button { position: relative; }
.tile-flag { position: absolute; bottom: 3px; right: 3px; display: none; width: clamp(9px, 1.7vw, 15px); height: clamp(9px, 1.7vw, 15px);
  border-radius: 50%; background: var(--flag, #ccc); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.board-tile[data-local="low"] .tile-flag, .board-tile[data-local="mid"] .tile-flag, .board-tile[data-local="high"] .tile-flag { display: block; }
.board-tile[data-local="low"] { --flag: #ffb43c; }
.board-tile[data-local="mid"] { --flag: #9ad13b; }
.board-tile[data-local="high"] { --flag: #1fa14a; }
.board-tile.tile-pdm[data-local="none"] button { filter: saturate(.75); }
.votes-card { margin-top: 18px; }
.votes-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.votes-summary div { padding: 10px 12px; border-radius: 14px; background: #f4efff; border: 2px solid #ded3ff; }
.votes-summary small { display: block; font-size: 11px; color: #5b45c9; }
.votes-summary b { font-size: 24px; color: #3d2aa8; }
.pdm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.pdm-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px 40px; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 10px; background: #fffdf6; border: 1px solid #ecd7b6; }
.pdm-row[data-local="none"] { background: #f3f0ea; opacity: .8; }
.pdm-name { display: grid; min-width: 0; }
.pdm-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.mandat-game .board-panel .pdm-name small { font-size: 10px; }
.pdm-bar { height: 8px; border-radius: 5px; background: #efe5d2; overflow: hidden; }
.pdm-bar i { display: block; height: 100%; background: var(--flag, #ccc); }
.pdm-row[data-local="low"] { --flag: #ffb43c; }
.pdm-row[data-local="mid"] { --flag: #9ad13b; }
.pdm-row[data-local="high"] { --flag: #1fa14a; }
.pdm-value { text-align: right; font-size: 13px; }
.election-votes { margin: 8px 0 0; padding: 6px 8px; border-radius: 8px; background: #f4efff; font-size: 12px; font-weight: 700; }
.mandat-game .board-panel .election-votes { color: #3d2aa8; }
.game-details > .votes-card { grid-column: 1 / -1; margin-top: 0; }

/* DUN boards of one parliamentary seat: switcher under the banner, visiting state, per-DUN popularity table. */
.dun-switch { pointer-events: auto; display: flex; align-items: center; justify-content: center; gap: 6px; margin: 8px auto 0; width: max-content; max-width: 100%;
  padding: 3px 6px; border-radius: 999px; background: rgba(255, 255, 255, .92); border: 2px solid #fff; box-shadow: 0 3px 0 #8a4399, 0 6px 14px rgba(55, 20, 70, .2); }
.dun-step { width: 30px; height: 30px; border-radius: 50%; border: 0; background: linear-gradient(180deg, #b829c9, #771491); color: #fff; font: 900 20px/1 system-ui, sans-serif; cursor: pointer; display: grid; place-items: center; padding: 0 0 2px; }
.dun-step:hover { filter: brightness(1.1); }
.dun-dots { display: inline-flex; gap: 4px; }
.dun-dot { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: #d8c8de; cursor: pointer; }
.dun-dot.is-home { box-shadow: 0 0 0 2px #fff, 0 0 0 3px #1fa14a; }
.dun-dot.is-on { background: #771491; transform: scale(1.25); }
.dun-switch-name { font-size: 12px; color: #4c1d5c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.game-stage.is-visiting .board-avatar { display: none; }
.game-stage.is-visiting .board-grid { filter: saturate(.85); }
.game-stage.is-visiting::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 4px rgba(119, 20, 145, .35); border-radius: inherit; }
.dun-visit { flex-direction: column; gap: 4px; text-align: center; }
.dun-visit b { font-size: 13px; }
.dun-visit small { color: #6b5232; }
.dun-visit-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.territory-duns { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: #f4efff; color: #3d2aa8; font-size: 13px; }
.votes-summary:has(> div:nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.votes-card h4 { margin: 14px 0 6px; font-size: 14px; }
.dun-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.dun-row { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 90px 44px 64px; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px;
  background: #fffdf6; border: 2px solid #ecd7b6; text-align: left; cursor: pointer; font: inherit; color: inherit; --flag: #7d5cf0; }
.dun-row.is-picked { border-color: #7d5cf0; background: #f6f2ff; }
.dun-name { display: grid; min-width: 0; }
.dun-name b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dun-name small, .dun-covered { font-size: 11px; color: #6b5f52; }
.dun-mark { margin-left: 4px; font-size: 12px; }
@media (max-width: 560px) {
  .dun-row { grid-template-columns: minmax(0, 1fr) 60px 40px; }
  .dun-covered { display: none; }
  .votes-summary:has(> div:nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .votes-summary b { font-size: 18px; }
  .dun-switch-name { max-width: 110px; }
}
.dun-title { display: flex; align-items: center; gap: 2px; min-width: 0; }
.mgo-top-event .board-live-pill { position: static; translate: none; display: block; width: max-content; max-width: 100%; margin: 6px auto 0; }
.mgo-top-event .board-live-pill[hidden] { display: none; }

/* Coalition badges and grouped party picker */
.coalition-chip { display: inline-block; padding: 1px 6px; border-radius: 6px; background: var(--bloc, #555); color: #fff; font-size: 10px; font-weight: 900; letter-spacing: .03em; vertical-align: middle; box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); }
.party-current { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.party-current img { border-radius: 8px; background: #fff; }
.party-coalition-note { margin-top: -4px; font-size: 13px; color: #5b4a35; }
.party-group { display: contents; }
.party-group-title { grid-column: 1 / -1; margin: 10px 0 2px; font-size: 13px; color: #4c1d5c; display: flex; align-items: center; gap: 6px; }
.party-options:has(.party-option[hidden]) .party-group-title { display: none; }
.seat-majority { color: #a5401b; }
.seat-majority.is-ok { color: #1c7a3a; }
.votes-area { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.votes-area .mandat-btn { min-height: 34px; padding: 4px 12px; font-size: 13px; }
.territory-move-warning { padding: 8px 10px; border-radius: 10px; background: #fff1e0; color: #8a3b07; font-size: 13px; }

/* Election-night rally */
.fx-rally { place-items: center; overflow-y: auto; }
.rally-box { width: min(760px, 96vw); padding: 16px 14px 14px; border-radius: 24px; text-align: center; color: #fff;
  background: linear-gradient(180deg, #3a1a5c 0%, #1f0f38 70%); border: 4px solid #fff; box-shadow: 0 20px 50px rgba(0,0,0,.5);
  scale: .8; transition: scale .45s cubic-bezier(.2,1.4,.4,1); }
.fx-rally.open .rally-box { scale: 1; }
.rally-kicker { display: block; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #ffd84a; }
.rally-box h3 { margin: 2px 0 4px; font-size: 22px; }
.rally-phase { margin: 0 0 6px; font-size: 13px; font-weight: 800; color: #e6d6ff; min-height: 18px; }
.rally-stage { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; margin: 0; padding: 26px 0 0; list-style: none; }
.rally-candidate { position: relative; display: grid; justify-items: center; gap: 4px; padding: 6px 6px 8px; border-radius: 16px;
  background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.12); transition: transform .25s, border-color .25s, background .25s; }
.rally-candidate.is-me { border-color: rgba(255,216,74,.55); }
.rally-candidate.is-speaking { transform: translateY(-4px); border-color: #ffd84a; background: rgba(255,216,74,.14); }
.rally-candidate.is-winner { border-color: #5dff7b; background: rgba(93,255,123,.16); }
.rally-speech { position: absolute; left: 50%; bottom: calc(100% - 22px); translate: -50% 0; z-index: 2; width: max-content; max-width: 170px;
  padding: 6px 9px; border-radius: 12px; background: #fff; color: #2a1640; font-size: 12px; font-weight: 800; line-height: 1.25;
  box-shadow: 0 4px 12px rgba(0,0,0,.3); animation: rally-pop .3s cubic-bezier(.2,1.6,.4,1); }
.rally-speech::after { content: ''; position: absolute; left: 50%; top: 100%; translate: -50% 0; border: 7px solid transparent; border-top-color: #fff; }
@keyframes rally-pop { from { scale: .4; opacity: 0; } }
.rally-figure { position: relative; width: 112px; height: 150px; display: grid; place-items: end center;
  background: radial-gradient(ellipse 60% 14% at 50% 94%, rgba(0,0,0,.35), transparent 70%); }
.rally-figure canvas { width: 112px; height: 164px; position: absolute; bottom: 0; left: 0; opacity: 0; transition: opacity .3s; }
.rally-candidate.has-model canvas { opacity: 1; }
.rally-fallback { width: 64px; height: 64px; margin-bottom: 30px; border-radius: 50%; display: grid; place-items: center; background: #6b3fa0; font-size: 28px; font-weight: 900; }
.rally-candidate.has-model .rally-fallback { display: none; }
.rally-podium { display: grid; justify-items: center; gap: 3px; width: 100%; }
.rally-podium b { font-size: 13px; line-height: 1.2; }
.rally-podium em { font-style: normal; font-size: 10px; padding: 0 5px; border-radius: 6px; background: #ffd84a; color: #3a2405; }
.rally-podium em.is-holder { background: #b9a6ff; }
.rally-party { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; }
.rally-party img { border-radius: 5px; background: #fff; }
.rally-party i { font-style: normal; padding: 0 5px; border-radius: 5px; background: var(--bloc); font-weight: 900; font-size: 10px; }
.rally-bar { width: 100%; height: 10px; border-radius: 6px; background: rgba(255,255,255,.15); overflow: hidden; }
.rally-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffd84a, #ff9e2c); border-radius: inherit; }
.rally-candidate.is-me .rally-bar i { background: linear-gradient(90deg, #7df0a0, #2fbf62); }
.rally-votes { font-size: 16px; font-weight: 900; }
.rally-tag { font-size: 11px; font-weight: 900; padding: 1px 8px; border-radius: 8px; background: #2fbf62; }
.rally-tag.is-forfeit { background: #c4383a; }
.rally-result { margin-top: 10px; }
.rally-result p { margin: 4px 0 0; font-size: 13px; color: #f3e9ff; }
.fx-rally[data-tone="good"] .fx-stamp { color: #5dff7b; text-shadow: 0 0 22px rgba(93,255,123,.8); }
.fx-rally[data-tone="bad"] .fx-stamp { color: #ff6b6b; text-shadow: 0 0 22px rgba(255,107,107,.7); }
.fx-rally.revealed .fx-stamp { animation: stamp-in .55s cubic-bezier(.2,1.6,.4,1) forwards; }
@media (max-width: 560px) {
  .rally-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rally-figure { width: 92px; height: 124px; }
  .rally-figure canvas { width: 92px; height: 135px; }
  .rally-box h3 { font-size: 18px; }
}
.rally-result .fx-stamp { margin: 4px auto 2px; font-size: clamp(26px, 7vw, 36px); }

/* Phase 2: negative balance, PDM stories, black ops */
.mgo-meter-cash.is-negative { background: #ffe1e1; border-color: #e0443e; color: #b3201a; animation: neg-pulse 1.4s ease-in-out infinite; }
@keyframes neg-pulse { 50% { box-shadow: 0 0 0 4px rgba(224,68,62,.25); } }
.money-negative { flex-direction: column; gap: 4px; text-align: center; border-color: #e0443e !important; background: #fff1f0 !important; }
.money-negative b { color: #b3201a; }
.money-negative small { color: #6b3b2b; font-size: 12px; }
.pdm-story { flex-direction: column; align-items: stretch; gap: 6px; max-width: 520px; margin-inline: auto; text-align: left; }
.pdm-story-head { display: flex; align-items: center; gap: 10px; }
.pdm-story-icon { font-size: 30px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: #fff3d6; flex: none; }
.pdm-story-head span:last-child { display: grid; }
.pdm-story-head small { font-size: 11px; color: #7a6248; text-transform: uppercase; letter-spacing: .04em; font-weight: 800; }
.pdm-story-head b { font-size: 15px; }
.pdm-story-text { margin: 0; font-size: 14px; line-height: 1.4; color: #3a2a1a; }
.pdm-story-ask { margin: 0; font-weight: 800; color: #8a4b05; }
.pdm-story-greed { margin: 0; padding: 6px 10px; border-radius: 10px; background: #fff0e0; border: 2px dashed #e0a050; color: #8a3b05; font-weight: 700; font-size: 13px; }
.pdm-story-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.pdm-story-actions .mandat-btn { min-height: 40px; font-size: 13px; padding: 6px 8px; }
.blackops-box { margin-top: 14px; padding: 12px; border-radius: 14px; background: #1f1630; color: #efe6ff; }
.blackops-box h4 { margin: 0 0 4px; }
.blackops-box p { margin: 0 0 8px; font-size: 13px; color: #cfc2e8; }
.blackops-confirm { display: grid; gap: 8px; }
.blackops-confirm b { color: #ffd84a; font-size: 14px; }
.blackops-box .seat-why { color: #ffb4b4; }

/* Stats tab: unspent stat points */
.game-tabs button { position: relative; }
.tab-dot { position: absolute; top: 2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center;
  background: #e0443e; color: #fff; font: 900 11px/1 system-ui, sans-serif; font-style: normal; box-shadow: 0 0 0 2px #fff; animation: dot-bounce 1.6s ease-in-out infinite; }
@keyframes dot-bounce { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(-3px); } 90% { transform: translateY(1px); } }
@media (prefers-reduced-motion: reduce) { .tab-dot { animation: none; } }

/* Residents and other players appear only once their 3D figure is ready (or as a stand-in if it cannot load). */
.board-npc .npc-body, .board-npc .npc-shadow { transition: opacity .35s ease; }
.board-npc:not([data-model]) .npc-body, .board-npc:not([data-model]) .npc-shadow { opacity: 0; pointer-events: none; }
/* The pop-in plays once, on a class that is removed afterwards: figures are re-appended to keep them in depth
   order, and an animation tied to a lasting attribute would restart (and blink) on every re-append. */
.board-npc.appearing .npc-body { animation: npc-in .55s cubic-bezier(.2, 1.3, .4, 1) both; }
@media (prefers-reduced-motion: reduce) { .board-npc.appearing .npc-body { animation: none; } }

/* Wardrobe: swatches, tiers, materials, upgrades */
.equipment-swatch { display: grid; place-items: center; background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.55), transparent 55%), var(--swatch); }
.equipment-swatch span { font-size: 54px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
.tier-badge { display: inline-block; padding: 1px 7px; border-radius: 8px; font-size: 11px; font-weight: 900; vertical-align: middle; background: #d9dee5; color: #3b4652; }
.tier-badge.tier-1 { background: #cfeedd; color: #17643a; }
.tier-badge.tier-2 { background: #cfe2ff; color: #1d4fa0; }
.tier-badge.tier-3 { background: linear-gradient(90deg, #b689ff, #7d4dff); color: #fff; }
.tier-badge.tier-4 { background: linear-gradient(90deg, #ffd84a, #ff9e2c); color: #4a2a00; box-shadow: 0 0 10px rgba(255,190,60,.7); }
.equipment-card.tier-3 { box-shadow: 0 0 0 2px #9b6bff, 0 6px 18px rgba(125,77,255,.25); }
.equipment-card.tier-4 { box-shadow: 0 0 0 2px #ffb52e, 0 6px 22px rgba(255,170,40,.45); }
.material-bar { margin: 10px 0; padding: 10px 12px; border-radius: 14px; background: #fff8ea; border: 2px solid #f0dcb5; }
.material-bar h4 { margin: 0 0 2px; }
.material-bar p { margin: 0 0 8px; font-size: 12px; color: #6b5a40; }
.material-bar ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.material-bar li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: #fff; }
.material-icon { font-size: 24px; }
.material-bar li > span:nth-child(2) { display: grid; flex: 1; min-width: 0; }
.material-bar li small { font-size: 11px; color: #6b5a40; }
.material-buy { display: flex; gap: 4px; }
.material-buy .mandat-btn { min-height: 30px; padding: 2px 8px; font-size: 12px; }
.upgrade-toggle { margin-top: 6px; width: 100%; min-height: 34px; font-size: 13px; }
.upgrade-box { margin-top: 6px; padding: 8px; border-radius: 10px; background: #f6f2ff; text-align: left; }
.upgrade-box ul { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 6px; padding: 0; list-style: none; }
.upgrade-box li { padding: 2px 7px; border-radius: 8px; background: #fff; font-size: 12px; font-weight: 700; }
.upgrade-box li.is-short { background: #ffe1e1; color: #b3201a; }
.upgrade-box p { margin: 0 0 4px; font-size: 12px; font-weight: 700; }
.upgrade-box small { display: block; margin-bottom: 6px; font-size: 11px; color: #6b5f52; }
.upgrade-box .mandat-btn { width: 100%; }
.upgrade-max { margin: 6px 0 0; font-size: 12px; font-weight: 800; color: #a06a00; }

/* First-visit download screen for the 3D characters */
.board-preload { position: absolute; top: calc(56px + env(safe-area-inset-top)); left: 50%; translate: -50% 0; z-index: 40; display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: rgba(40, 22, 58, .82); color: #fff; font-size: 12px; pointer-events: none; transition: opacity .3s; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); white-space: nowrap; }
.board-preload.leaving { opacity: 0; }
.board-preload b { font-weight: 700; }
.board-preload-bar { width: 70px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.board-preload-bar i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #ffd166, #ff8fab); transition: width .3s; }
.board-preload-figure { min-width: 32px; text-align: right; font-variant-numeric: tabular-nums; }
/* Lighter look on phones: no idle bobbing for stand-ins, no blur behind overlays. */
[data-lite] .npc-fig { animation: none; }
[data-lite] .board-preload { backdrop-filter: none; }

/* ---------------------------------------------------------------------------------------------
   RESPONSIVE: phones of every size.
   Landscape phones: the turn controls move to a column on the right, so the board keeps the full height.
   Short portrait phones: the corner buttons sit in two low rows and shrink, so they never cover the area card.
   --------------------------------------------------------------------------------------------- */
@media (max-height: 500px) and (orientation: landscape) {
  .mandat-game .game-board-screen { flex-direction: row; }
  .mandat-game .game-board-screen > .game-stage { flex: 1 1 auto; min-width: 0; }
  .mandat-game .game-turn {
    display: flex; flex-direction: column; justify-content: center; align-items: stretch;
    width: clamp(220px, 32vw, 300px); flex: 0 0 auto; gap: 6px; padding: 6px 10px;
    border-top: 0; border-left: 3px solid #fff; box-shadow: -6px 0 18px rgba(80, 50, 20, .12); overflow-y: auto;
  }
  .mandat-game .game-roll-controls { display: grid; grid-template-columns: 1fr auto; gap: 6px; width: 100%; }
  .mandat-game .game-roll-controls > :first-child { grid-column: 1 / -1; }
  .mandat-game .game-roll-controls :is(.mgo-energy-pill, .mgo-regen) { display: none; }
  .mandat-game .mgo-go-diamond { width: auto; height: 54px; margin: 0; border-radius: 16px; }
  .mandat-game .mgo-go-dock { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; width: 100%; }
  .mandat-game .mgo-go-dock .mgo-go-diamond { flex: 1 1 100%; order: -1; }
  .mandat-game .game-result { max-height: 72px; }
  .mandat-game .game-tabs { padding: 3px 8px; gap: 6px; }
  .mandat-game .game-tabs button { min-height: 32px; grid-auto-flow: column; gap: 5px; font-size: 11px; }
  .mandat-game .mgo-top-event { top: 4px; }
  .mandat-game .mgo-side-left, .mandat-game .mgo-side-right { bottom: 8px; }
}
@media (max-width: 430px) and (max-height: 700px) and (orientation: portrait) {
  .mandat-game .mgo-side-left { flex-direction: row; gap: 5px; }
  .mandat-game .mgo-side-right { gap: 5px; }
  .mandat-game .mgo-float-badge { width: 42px; height: 42px; }
  .mandat-game .mgo-badge-icon { font-size: 16px; }
  .mandat-game .mgo-float-badge small { display: none; }
  .mandat-game .game-tabs button { min-height: 42px; }
  .mandat-game .game-turn { gap: 4px; padding: 5px 8px; }
}
@media (max-width: 340px) {
  .mandat-game .game-meters b { padding: 3px 4px; font-size: 10px; }
  .mandat-game .game-tabs { gap: 4px; padding: 4px; }
  .mandat-game .game-tabs button { padding: 3px 2px; font-size: 8.5px; }
  .mandat-game .mgo-top-event { width: calc(100% - 12px); }
}
/* Notched phones: keep controls clear of the rounded corners and home bar. */
.mandat-game .game-tabs { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.mandat-game .game-hud { padding-top: max(6px, env(safe-area-inset-top)); padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
@media (max-height: 500px) and (orientation: landscape) {
  .mandat-game .board-live-pill { display: none; }
}
@media (max-height: 600px) and (orientation: portrait) {
  .mandat-game .board-live-pill { display: none; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .mandat-game .game-tabs button { position: relative; }
  .mandat-game .game-tabs .tab-dot { position: absolute; top: -7px; right: -5px; }
}
.rally-candidate.is-loser { filter: saturate(.55); }
.rally-candidate.is-loser canvas { filter: grayscale(.25) brightness(.92); }


/* =============================================================================================
   ADMIN PANEL — tabs, overview, settings, cards and tiles. Uses the app theme (light and dark).
   ============================================================================================= */
.adm-tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 8px; margin-bottom: 12px;
  background: var(--app-card); border: 1px solid var(--app-line); border-radius: 16px; box-shadow: var(--app-shadow); scrollbar-width: none; }
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tabs button { flex: 0 0 auto; padding: 9px 14px; border: 0; border-radius: 11px; background: transparent; color: var(--app-text); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.adm-tabs button[aria-selected="true"] { background: var(--app-accent); color: var(--app-accent-ink); }
.adm-tabs button b, .adm-chips button b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin-left: 4px; border-radius: 99px; background: #e5484d; color: #fff; font-size: 11px; }
.adm-head h2 { margin: 0 0 4px; }
.adm-head p { margin: 0 0 12px; color: var(--app-text); opacity: .8; line-height: 1.5; }
.adm-head-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.adm-note { margin: 6px 0; padding: 8px 12px; border-radius: 10px; background: var(--app-soft); font-size: 13px; line-height: 1.5; }
.adm-empty { padding: 18px; text-align: center; border: 2px dashed var(--app-line); border-radius: 14px; opacity: .75; }
.adm-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 99px; background: var(--app-soft); font-size: 13px; }
.mandat-btn.danger { color: #c4320a; border-color: #f3c7b8; }
.mandat-btn.danger:hover:not(:disabled) { background: #fff1ec; }
.mandat-btn.primary.danger-soft { background: #d9480f; border-color: #d9480f; color: #fff; }

/* Overview */
.adm-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 16px; }
.adm-stat { display: grid; gap: 2px; padding: 14px; text-align: left; border: 1px solid var(--app-line); border-radius: 14px; background: var(--app-soft); color: var(--app-text); font: inherit; cursor: pointer; }
.adm-stat strong { font-size: 28px; line-height: 1; color: var(--app-ink); }
.adm-stat span { font-size: 13px; opacity: .8; }
.adm-stat:hover, .adm-job:hover { border-color: var(--app-accent); }
.adm-jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.adm-job { display: flex; align-items: center; gap: 12px; padding: 16px; text-align: left; border: 1px solid var(--app-line); border-radius: 14px; background: var(--app-card); color: var(--app-text); font: inherit; font-weight: 700; cursor: pointer; }
.adm-job span { font-size: 26px; }
.adm-job b { margin-left: auto; font-size: 22px; opacity: .5; }

/* Settings */
.set-search { width: 100%; margin-bottom: 10px; padding: 11px 14px; border: 1px solid var(--app-line); border-radius: 12px; background: var(--app-soft); color: var(--app-text); font: inherit; }
.adm-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: thin; }
.adm-chips button { flex: 0 0 auto; padding: 8px 13px; border: 1px solid var(--app-line); border-radius: 99px; background: var(--app-card); color: var(--app-text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.adm-chips button[aria-selected="true"] { background: var(--app-ink); border-color: var(--app-ink); color: var(--app-card); }
.set-list { display: grid; gap: 8px; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--app-line); border-radius: 14px; background: var(--app-card); }
.set-row.is-custom { border-left: 4px solid #e8a33d; }
.set-row.is-dirty { background: color-mix(in srgb, var(--app-accent) 7%, var(--app-card)); border-color: var(--app-accent); }
.set-text strong { font-size: 15px; }
.set-text p { margin: 3px 0 0; font-size: 13px; line-height: 1.45; opacity: .78; }
.set-text .set-example { opacity: 1; color: var(--app-mint-ink, #0b7a55); font-weight: 600; }
.set-badge { padding: 1px 7px; border-radius: 99px; background: #fdf0d8; color: #8a4b05; font-size: 11px; font-weight: 800; vertical-align: 1px; }
.set-control { display: grid; justify-items: end; gap: 4px; }
.set-control small { font-size: 12px; opacity: .75; }
.set-stepper { display: flex; align-items: stretch; border: 1px solid var(--app-line); border-radius: 12px; overflow: hidden; background: var(--app-soft); }
.set-stepper > button { width: 40px; border: 0; background: transparent; color: var(--app-text); font-size: 20px; font-weight: 700; cursor: pointer; }
.set-stepper > button:hover { background: var(--app-line); }
.set-field { display: flex; align-items: center; gap: 4px; padding: 0 8px; border-left: 1px solid var(--app-line); border-right: 1px solid var(--app-line); background: var(--app-card); }
.set-field span { font-size: 13px; font-weight: 700; opacity: .7; }
.set-field input { width: 96px; padding: 10px 2px; border: 0; background: transparent; color: var(--app-ink); font: inherit; font-size: 16px; font-weight: 800; text-align: right; -moz-appearance: textfield; }
.set-field input::-webkit-inner-spin-button, .set-field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.set-link { padding: 0; border: 0; background: none; color: var(--app-accent); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.set-restore-all { margin-top: 10px; font-size: 13px; }
.set-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px -4px -4px; padding: 10px 12px; border-radius: 14px; font-weight: 700; }
.set-bar.is-open { background: var(--app-ink); color: var(--app-card); box-shadow: 0 -6px 20px rgba(0, 0, 0, .18); }
.set-bar span { flex: 1 1 200px; }
.set-bar.is-open .mandat-btn:not(.primary) { background: transparent; color: inherit; border-color: currentColor; }

/* Cards */
.adm-deck { margin-top: 14px; }
.adm-deck h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.adm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.adm-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--app-line); border-radius: 16px; background: var(--app-card); border-top: 5px solid #2f9e44; }
.adm-card.deck-fine { border-top-color: #e8590c; }
.adm-card.is-off { opacity: .55; }
.adm-card h4 { margin: 0; font-size: 16px; }
.adm-card p { margin: 0; font-size: 13px; opacity: .8; }
.adm-card-top { display: flex; justify-content: space-between; align-items: center; }
.adm-card-icon { font-size: 22px; }
.adm-card-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }
.adm-card-actions .mandat-btn { flex: 1; }
.eff-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.eff-chip { padding: 3px 9px; border-radius: 99px; background: var(--app-soft); font-size: 12px; font-weight: 800; }
.eff-chip.up { background: #d3f9d8; color: #1b6e2c; }
.eff-chip.down { background: #ffe3d6; color: #b4370a; }
.adm-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; cursor: pointer; }
.adm-switch input { position: absolute; opacity: 0; pointer-events: none; }
.adm-switch span { position: relative; width: 36px; height: 20px; border-radius: 99px; background: #c9ccd4; transition: background .2s; }
.adm-switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.adm-switch input:checked + span { background: #2f9e44; }
.adm-switch input:checked + span::after { transform: translateX(16px); }
.adm-switch input:focus-visible + span { outline: 2px solid var(--app-accent); outline-offset: 2px; }
.adm-editor { margin: 10px 0 14px; padding: 14px; border: 2px solid var(--app-accent); border-radius: 18px; background: var(--app-soft); }
.adm-editor h3 { margin: 0 0 10px; }
.adm-form { display: grid; gap: 12px; }
.adm-field { display: grid; gap: 5px; }
.adm-field > span { font-weight: 800; font-size: 14px; }
.adm-field > small { opacity: .75; font-size: 12px; }
.adm-field input:not([type=radio]), .adm-field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--app-line); border-radius: 10px; background: var(--app-card); color: var(--app-ink); font: inherit; }
.adm-seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.adm-seg label { cursor: pointer; }
.adm-seg input { position: absolute; opacity: 0; }
.adm-seg span { display: inline-block; padding: 8px 16px; border: 1px solid var(--app-line); border-radius: 99px; background: var(--app-card); font-weight: 700; }
.adm-seg input:checked + span { background: var(--app-ink); color: var(--app-card); border-color: var(--app-ink); }
.adm-seg input:focus-visible + span { outline: 2px solid var(--app-accent); outline-offset: 2px; }
.adm-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-preset { padding: 6px 12px; border: 1px dashed var(--app-accent); border-radius: 99px; background: transparent; color: var(--app-accent); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.adm-preset:hover { background: color-mix(in srgb, var(--app-accent) 10%, transparent); }
.eff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.eff-grid label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; }
.adm-check { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.adm-check input { width: 20px; height: 20px; }
.adm-preview { display: grid; justify-items: center; gap: 4px; max-width: 320px; padding: 16px; text-align: center; border-radius: 18px; background: linear-gradient(160deg, #e6fcf5, #d3f9d8); color: #12372a; box-shadow: 0 8px 22px rgba(0, 0, 0, .12); }
.adm-preview.deck-fine { background: linear-gradient(160deg, #fff4e6, #ffe3d6); color: #4a1d06; }
.adm-preview.deck-tile { background: linear-gradient(160deg, #edf2ff, #e5dbff); color: #22184a; }
.adm-preview-icon { font-size: 34px; }
.adm-preview small { text-transform: uppercase; letter-spacing: .08em; font-weight: 800; font-size: 11px; opacity: .7; }
.adm-preview strong { font-size: 18px; }
.adm-preview p { margin: 0; font-size: 13px; }
.adm-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Tiles */
.adm-board-wrap { display: grid; grid-template-columns: minmax(280px, 520px) minmax(0, 1fr); gap: 16px; align-items: start; }
.adm-board { position: relative; display: grid; grid-template-columns: repeat(11, 1fr); grid-template-rows: repeat(11, 1fr); gap: 3px; aspect-ratio: 1; padding: 6px; border-radius: 18px; background: #cfe8c2; }
.adm-tile { position: relative; display: grid; place-items: center; padding: 0; border: 1px solid rgba(0, 0, 0, .08); border-radius: 6px; background: #fffaf0; color: #3b2a14; font: inherit; cursor: pointer; overflow: hidden; }
.adm-tile span { font-size: clamp(10px, 2.4vw, 18px); line-height: 1; }
.adm-tile small { position: absolute; bottom: 1px; right: 3px; font-size: 9px; font-weight: 800; opacity: .6; }
.adm-tile i { position: absolute; top: 0; left: 3px; color: #e8590c; font-style: normal; font-size: 12px; }
.adm-tile.kind-pdm { background: #f8f3ff; }
.adm-tile.has-effect { background: #fff0d9; border-color: #e8a33d; }
.adm-tile.is-picked { outline: 3px solid var(--app-accent); outline-offset: 1px; z-index: 1; }
.adm-board-centre { grid-column: 2 / 11; grid-row: 2 / 11; display: grid; place-items: center; padding: 12px; text-align: center; font-weight: 800; color: #2d4a20; }
.adm-tile-editor h3 { margin-top: 0; }
@media (max-width: 820px) {
  .adm-board-wrap { grid-template-columns: 1fr; }
  .set-row { grid-template-columns: 1fr; gap: 8px; }
  .set-control { justify-items: stretch; }
  .set-stepper { justify-content: space-between; }
  .set-field { flex: 1; }
  .set-field input { width: 100%; }
  .set-stepper > button { width: 48px; }
}
[data-theme="dark"] .adm-board { background: #2b3a26; }
[data-theme="dark"] .adm-tile { background: #2a2620; color: #f0e6d6; }
[data-theme="dark"] .adm-tile.kind-pdm { background: #2b2538; }
[data-theme="dark"] .adm-tile.has-effect { background: #4a3417; }
[data-theme="dark"] .adm-board-centre { color: #cfe8c2; }
.mandat-panel [hidden], #mandat-panel-content [hidden] { display: none !important; }
.set-field span { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 520px) { .adm-tile small { display: none; } .adm-tile span { font-size: 13px; } }
.adm-switch, .adm-seg label { position: relative; } .adm-switch input, .adm-seg input { left: 0; top: 0; width: 1px; height: 1px; }

/* Ranking categories and shared percentages */
.rank-tabs { flex-shrink: 0; display: flex; gap: 6px; margin: 10px 14px 0; padding: 4px; border-radius: 14px; background: #f6ead5; overflow-x: auto; scrollbar-width: none; }
.rank-tabs button { flex: 1 0 auto; min-height: 36px; padding: 6px 12px; border: 0; border-radius: 10px; background: transparent; color: #7a5a3a; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.rank-tabs button[aria-pressed="true"] { background: #fff; color: #c47a00; box-shadow: 0 2px 6px rgba(120, 80, 20, .18); }
.rank-tabs button:disabled { opacity: .45; cursor: not-allowed; }
.rank-score { min-width: 74px; }
.rank-bar { display: block; height: 4px; margin-top: 4px; border-radius: 4px; background: linear-gradient(90deg, #f2a900 var(--share), #f1dfc3 var(--share)); }

/* Office holders page */
.posts-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 14px 16px; }
.posts-state { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; font-size: 13px; font-weight: 800; color: #6b4300; }
.posts-state select { flex: 1; min-height: 38px; padding: 4px 10px; border: 2px solid #f1dfc3; border-radius: 10px; background: #fff; font: inherit; }
.posts-block { margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: #fff; border: 2px solid #f1dfc3; }
.posts-block h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 14px; }
.posts-block h4 small { color: #9a7b5a; font-weight: 700; }
.posts-block h4 .mandat-btn { margin-left: auto; min-height: 30px; padding: 2px 10px; font-size: 12px; }
.posts-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.posts-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 4px; border-top: 1px dashed #f1dfc3; font-size: 13px; }
.posts-list li:first-child { border-top: 0; }
.posts-list li > span:first-child small { display: block; color: #9a7b5a; font-size: 11px; }
.post-holder { text-align: right; }
.post-holder em { padding: 1px 6px; border-radius: 6px; background: #eef2f5; color: #5a6470; font-size: 10px; font-style: normal; font-weight: 800; }
.post-holder.is-vacant { color: #b0905f; font-style: italic; }
.posts-level-centre { border-color: #f2a900; background: #fffaf0; }

/* General election and party election */
.pru-banner { display: grid; gap: 4px; margin: 10px 0; padding: 10px 14px; border-radius: 14px; background: #eef4ff; border: 2px solid #b8cdf5; }
.pru-banner.is-open { background: #e9fbef; border-color: #6fd49a; animation: pruGlow 2.4s ease-in-out infinite; }
.pru-banner b { font-size: 16px; }
.pru-banner small { color: #50607a; }
.pru-machinery { color: #6b4300 !important; font-weight: 700; }
@keyframes pruGlow { 50% { box-shadow: 0 0 0 4px rgba(46, 204, 113, .18); } }
.seat-badge.is-filed { background: #e9fbef; color: #1d7a45; }
.seat-consent { display: block; margin-top: 2px; color: #7a4f00; }
.party-election-line { padding: 8px 12px; border-radius: 12px; background: #eef4ff; border: 1.5px solid #b8cdf5; font-weight: 800; }
.party-election-line.is-open { background: #e9fbef; border-color: #6fd49a; }
.office-level { margin-top: 8px; border-radius: 14px; background: #fffaf0; border: 2px solid #f1dfc3; }
.office-level summary { padding: 10px 12px; cursor: pointer; font-size: 14px; }
.office-level summary small { color: #9a7b5a; }
.office-level .office-list { margin: 0; padding: 0 8px 8px; }
.office-list li.is-locked { opacity: .62; }
.office-candidates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.office-vote { min-height: 30px; padding: 2px 10px; font-size: 12px; }
.office-vote.is-voted { background: #2ecc71; border-color: #1d9a52; color: #fff; }
.machinery-card { margin: 10px 0; padding: 10px 14px; border-radius: 14px; background: #fff3d6; border: 2px solid #f2c45a; }
.machinery-card h4 { margin: 0 0 4px; }
.machinery-card p { margin: 0 0 6px; font-size: 13px; }
.machinery-card small { display: block; margin-bottom: 6px; }
@media (prefers-reduced-motion: reduce) { .pru-banner.is-open { animation: none; } }

/* Phones with a short visible area (browser bars take room): a slimmer area card and controls so the board and
   the character keep the most space. */
@media (max-width: 650px) and (max-height: 780px) and (orientation: portrait) {
  .mandat-game .mgo-event-sub, .mandat-game .mgo-event-key, .mandat-game .mgo-event-reward small { display: none; }
  .mandat-game .mgo-event-banner { padding: 4px 10px; border-width: 2px; }
  .mandat-game .mgo-event-bar { height: 14px; font-size: 9px; }
  .mandat-game .dun-switch { margin-top: 4px; padding: 2px 4px; }
  .mandat-game .dun-step { width: 28px; height: 28px; font-size: 16px; }
  .mandat-game .dun-switch-name { font-size: 12px; }
  .mandat-game .board-live-pill { display: none; }
  .mandat-game .mgo-float-badge { width: 44px; height: 44px; border-width: 2px; }
  .mandat-game .mgo-badge-icon { font-size: 18px; }
  .mandat-game .mgo-float-badge small { display: none; }
  .mandat-game .game-result { max-height: 48px; font-size: 12px; padding: 4px 10px; }
  .mandat-game .game-turn { gap: 4px; padding: 5px 8px; }
  .mandat-game .game-tabs button { min-height: 44px; }
}
