/* DATA POP Kawaii V3 — generated release bundle. Edit source layers, not this file. */

/* UI layer 1: game-tycoon.css */
/* Data Pop Tycoon — bright, rounded simulation-game presentation layer. */
:root {
  --tycoon-ink: #17324d;
  --tycoon-muted: #62809a;
  --tycoon-sky: #79d9f4;
  --tycoon-teal: #25b9ae;
  --tycoon-teal-dark: #118d8c;
  --tycoon-mango: #ffba45;
  --tycoon-coral: #ff786c;
  --tycoon-cream: #fff9e9;
  --tycoon-green: #66c978;
  --tycoon-lilac: #8d7ff1;
  --tycoon-line: rgba(23, 50, 77, 0.12);
  --tycoon-soft-shadow: 0 14px 28px rgba(35, 87, 112, 0.17);
  --tycoon-deep-shadow: 0 26px 70px rgba(21, 68, 88, 0.26);
}

/* --------------------------------------------------------------------------
   V4 — Character Sheet protagonist + diegetic command console
   -------------------------------------------------------------------------- */
body.theme-modern {
  --game-accent: #25c9b5;
  --game-accent-deep: #087f82;
  --game-highlight: #ffd86b;
  --game-surface: rgba(255, 250, 225, .94);
  --game-panel: rgba(15, 54, 66, .94);
  --game-screen: rgba(9, 80, 91, .9);
  --game-glow: rgba(52, 232, 213, .45);
}

body.theme-modern[data-product-type="EXPENSIVE"] {
  --game-accent: #25c9ff;
  --game-accent-deep: #1260a6;
  --game-highlight: #ffad52;
  --game-surface: rgba(241, 249, 255, .95);
  --game-panel: rgba(10, 27, 52, .95);
  --game-screen: rgba(7, 42, 78, .92);
  --game-glow: rgba(42, 207, 255, .55);
}

.game-world-stage[data-product="EXPENSIVE"] {
  background-image:
    linear-gradient(180deg, rgba(5, 21, 42, .03) 44%, rgba(5, 18, 38, .58) 100%),
    url('/assets/images/store-it-tycoon-v1.png') !important;
  background-position: center center !important;
}

.game-world-stage[data-product="EXPENSIVE"][data-mode="SPEEDRUN"] {
  background-image:
    linear-gradient(180deg, rgba(255, 135, 42, .07) 35%, rgba(48, 19, 22, .58) 100%),
    url('/assets/images/store-it-tycoon-v1.png') !important;
}

.game-world-stage[data-product="EXPENSIVE"][data-mode="HARDCORE"] {
  background-image:
    linear-gradient(180deg, rgba(6, 15, 40, .22) 30%, rgba(2, 9, 28, .78) 100%),
    url('/assets/images/store-it-tycoon-v1.png') !important;
  filter: saturate(.84) contrast(1.06);
}

.game-world-stage[data-product="EXPENSIVE"][data-mode="SANDBOX"] {
  background-image:
    linear-gradient(180deg, rgba(85, 42, 122, .08) 35%, rgba(31, 17, 67, .58) 100%),
    url('/assets/images/store-it-tycoon-v1.png') !important;
}

.world-character-player {
  z-index: 9 !important;
  bottom: 5% !important;
  left: 1.5% !important;
  height: min(66%, 620px) !important;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 18px 14px rgba(4, 17, 28, .38)) !important;
  object-fit: contain;
  object-position: center bottom;
}

.world-character-player.pose-pop {
  animation: characterPosePop .34s cubic-bezier(.2,.9,.3,1.18);
}

.character-is-speaking .world-character-player {
  filter: drop-shadow(0 0 18px var(--game-glow)) drop-shadow(0 18px 14px rgba(4,17,28,.4)) !important;
}

@keyframes characterPosePop {
  0% { opacity: .6; transform: translateY(5px) scale(.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.world-player-label {
  bottom: 11% !important;
  left: 5% !important;
  color: #fff !important;
  border-color: rgba(255,255,255,.88) !important;
  background: linear-gradient(180deg, var(--game-accent), var(--game-accent-deep)) !important;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--game-accent-deep) 80%, #071b2d), 0 12px 20px rgba(5,24,37,.3) !important;
}

.world-dialogue {
  z-index: 15 !important;
  bottom: 24% !important;
  left: 22% !important;
  width: min(32vw, 380px) !important;
  color: #17324d !important;
  border: 3px solid rgba(255,255,255,.96) !important;
  background: var(--game-surface) !important;
  box-shadow: 0 7px 0 rgba(6,42,56,.25), 0 18px 38px rgba(5,23,35,.25) !important;
}

.character-is-speaking .world-dialogue {
  animation: dialoguePulse .52s ease-in-out infinite alternate;
}

@keyframes dialoguePulse {
  from { transform: translateX(-50%) translateY(0) !important; }
  to { transform: translateX(-50%) translateY(-3px) !important; }
}

.world-command-console {
  position: absolute;
  z-index: 8;
  top: 54%;
  left: 55%;
  width: min(44vw, 570px);
  padding: 12px 13px 14px;
  color: #effcff;
  border: 4px solid rgba(255,255,255,.9);
  border-radius: 34px 34px 46px 46px;
  background:
    radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--game-accent) 30%, transparent), transparent 47%),
    var(--game-panel);
  box-shadow:
    0 9px 0 rgba(4,19,31,.58),
    0 0 0 3px color-mix(in srgb, var(--game-accent) 55%, transparent),
    0 24px 55px rgba(2,15,27,.43);
  transform: translate(-50%, -50%) perspective(900px) rotateX(1.5deg);
  backdrop-filter: blur(14px) saturate(1.2);
}

.world-command-console::before,
.world-command-console::after {
  content: "";
  position: absolute;
  z-index: -1;
  bottom: -19px;
  width: 24%;
  height: 24px;
  border-radius: 0 0 18px 18px;
  background: color-mix(in srgb, var(--game-panel) 88%, #000);
}

.world-command-console::before { left: 10%; transform: skewX(-18deg); }
.world-command-console::after { right: 10%; transform: skewX(18deg); }

.console-screen {
  padding: 13px 16px 14px;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--game-accent) 68%, white);
  border-radius: 23px;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 0, color-mix(in srgb, var(--game-accent) 28%, transparent), transparent 60%),
    var(--game-screen);
  background-size: 18px 18px, 18px 18px, auto, auto;
  box-shadow: inset 0 0 28px rgba(1,18,30,.55), 0 0 22px var(--game-glow);
}

.console-screen-head,
.console-main-readout,
.console-meter-row {
  display: flex;
  align-items: center;
}

.console-screen-head {
  justify-content: space-between;
  color: #bdf9ff;
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .09em;
}

.console-online { display: inline-flex; align-items: center; gap: 6px; }
.console-online i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #71ffab;
  box-shadow: 0 0 10px #71ffab;
  animation: consoleOnline 1.2s ease-in-out infinite alternate;
}

@keyframes consoleOnline { to { opacity: .45; } }

.console-main-readout {
  gap: 10px;
  margin-top: 8px;
}

.console-store-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 16px;
  background: color-mix(in srgb, var(--game-accent) 24%, transparent);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
  font-size: 1.55rem;
}

.console-main-readout > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.console-main-readout small { color: #9edce5; font-size: .6rem; }
.console-main-readout b {
  overflow: hidden;
  color: white;
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#world-console-status {
  min-height: 34px;
  margin: 9px 0;
  color: #d8f9ff;
  font-size: .7rem;
  line-height: 1.45;
}

.console-meter-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.console-meter-row > span {
  display: flex;
  min-width: 0;
  padding: 7px 6px;
  align-items: center;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px;
  background: rgba(255,255,255,.075);
}

.console-meter-row small { color: #9edce5; font-size: .54rem; }
.console-meter-row b {
  max-width: 100%;
  overflow: hidden;
  color: #fff;
  font-size: .72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 10px;
}

.console-controls button {
  display: flex;
  min-width: 0;
  height: 52px;
  padding: 5px 3px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  color: #ebfbff;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 15px;
  background: rgba(255,255,255,.09);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.16);
  font-family: 'Sarabun', sans-serif;
  font-size: .58rem;
  font-weight: 800;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}

.console-controls button i { color: var(--game-accent); font-size: 1.08rem; }
.console-controls button:nth-child(2) {
  color: #102f45;
  border-color: rgba(255,255,255,.8);
  background: linear-gradient(180deg, var(--game-highlight), color-mix(in srgb, var(--game-highlight) 68%, #df7531));
}
.console-controls button:nth-child(2) i { color: #143b51; }
.console-controls button:hover,
.console-controls button:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--game-accent) 28%, rgba(255,255,255,.12));
  box-shadow: 0 0 18px var(--game-glow);
  transform: translateY(-3px);
}

.fixed-bottom.game-action-dock {
  background: var(--game-panel) !important;
  box-shadow: 0 8px 0 rgba(4,25,35,.42), 0 0 28px var(--game-glow), 0 22px 50px rgba(6,28,39,.35) !important;
}

.game-dock-primary {
  background: linear-gradient(180deg, var(--game-accent), var(--game-accent-deep)) !important;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--game-accent-deep) 70%, #031a2b), 0 12px 24px rgba(6,25,33,.24) !important;
}

.game-command-window,
.swal2-popup.game-dialog-popup,
#gameMenuOffcanvas {
  background: linear-gradient(145deg, var(--game-surface), color-mix(in srgb, var(--game-surface) 84%, var(--game-accent))) !important;
  border-color: rgba(255,255,255,.95) !important;
}

.advisor-popup-message {
  background: color-mix(in srgb, var(--game-accent) 13%, white) !important;
}

.advisor-actions button {
  background: color-mix(in srgb, var(--game-highlight) 55%, white) !important;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--game-accent-deep) 35%, transparent) !important;
}

@media (max-width: 900px) {
  .world-command-console { left: 57%; width: min(48vw, 500px); }
  .world-character-player { left: -4% !important; height: min(62%, 540px) !important; }
  .world-dialogue { left: 23% !important; width: min(36vw, 330px) !important; }
}

@media (max-width: 720px) {
  .world-character-player {
    bottom: 10% !important;
    left: -8% !important;
    height: 45% !important;
  }

  .world-command-console {
    top: 51%;
    left: 63%;
    width: 58%;
    padding: 7px 7px 9px;
    border-width: 3px;
    border-radius: 23px 23px 29px 29px;
  }

  .console-screen { padding: 8px 9px 9px; border-radius: 17px; }
  .console-screen-head { font-size: .43rem; }
  .console-store-icon { width: 34px; height: 34px; border-radius: 11px; font-size: 1.05rem; }
  .console-main-readout b { font-size: .72rem; }
  .console-main-readout small { font-size: .48rem; }
  #world-console-status { min-height: 28px; margin: 5px 0; font-size: .52rem; line-height: 1.25; }
  .console-meter-row { gap: 3px; }
  .console-meter-row > span { padding: 4px 2px; border-radius: 8px; }
  .console-meter-row small { font-size: .42rem; }
  .console-meter-row b { font-size: .53rem; }
  .console-controls { grid-template-columns: repeat(2, 1fr); gap: 4px; margin-top: 6px; }
  .console-controls button { height: 34px; flex-direction: row; gap: 4px; border-radius: 10px; font-size: .48rem; }
  .console-controls button i { font-size: .75rem; }

  .world-player-label {
    bottom: 10% !important;
    left: 3% !important;
    max-width: 31%;
    white-space: normal;
  }

  .world-dialogue {
    bottom: 25% !important;
    left: 20% !important;
    width: 36% !important;
    padding: 7px 9px !important;
    font-size: .58rem !important;
    line-height: 1.3 !important;
  }
}

html {
  background: #b9ecf4;
}

body.theme-modern {
  min-height: 100vh;
  color: var(--tycoon-ink) !important;
  background-color: #e7f8ec !important;
  background-image:
    radial-gradient(circle at 10% 12%, rgba(255,255,255,.92) 0 5%, transparent 5.3%),
    radial-gradient(circle at 91% 20%, rgba(255,255,255,.7) 0 4%, transparent 4.3%),
    linear-gradient(180deg, #bdeffd 0, #e6f9f3 38%, #fff8df 100%) !important;
  background-attachment: fixed !important;
}

body.theme-modern::before,
body.theme-modern::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(2px);
}

body.theme-modern::before {
  width: 46vw;
  height: 20vw;
  left: -10vw;
  bottom: -8vw;
  background: rgba(91, 194, 119, .2);
}

body.theme-modern::after {
  width: 38vw;
  height: 18vw;
  right: -8vw;
  bottom: -7vw;
  background: rgba(255, 190, 78, .2);
}

/* Splash / title screen */
.splash-overlay {
  justify-content: flex-start !important;
  padding: clamp(20px, 5vw, 84px) !important;
  background-color: #9ee4ef !important;
  background-image:
    linear-gradient(90deg, rgba(18, 59, 72, .72) 0%, rgba(18, 59, 72, .35) 34%, rgba(18, 59, 72, .05) 68%),
    linear-gradient(180deg, rgba(255, 240, 184, .08), rgba(17, 60, 70, .18)),
    url('/assets/images/data-tycoon-town-v1.png') !important;
  background-size: cover !important;
  background-position: center !important;
}

.splash-overlay::after {
  background:
    linear-gradient(180deg, transparent 55%, rgba(19, 63, 69, .46) 100%) !important;
}

.splash-content {
  align-items: flex-start !important;
  width: min(92vw, 600px) !important;
  margin: 0 !important;
  padding: clamp(24px, 4vw, 44px) !important;
  text-align: left !important;
  color: white !important;
  border: 2px solid rgba(255, 255, 255, .7) !important;
  border-radius: 44px !important;
  background: linear-gradient(145deg, rgba(16, 89, 99, .88), rgba(21, 62, 78, .76)) !important;
  box-shadow: 0 28px 80px rgba(23, 67, 75, .38), inset 0 1px 0 rgba(255,255,255,.34) !important;
  backdrop-filter: blur(16px) saturate(1.15) !important;
}

.splash-kicker {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 8px 14px !important;
  margin-bottom: 10px;
  color: #16465d !important;
  background: #fff4bd !important;
  border: 2px solid rgba(255,255,255,.8);
  border-radius: 999px;
  box-shadow: 0 7px 0 rgba(9, 70, 79, .2);
  letter-spacing: .04em !important;
}

.splash-title {
  margin: 6px 0 0 !important;
  font-family: 'Monomaniac One', 'Sarabun', sans-serif !important;
  font-size: clamp(4.6rem, 10vw, 8.7rem) !important;
  line-height: .78 !important;
  letter-spacing: -.04em !important;
  color: #fff !important;
  text-shadow: 0 7px 0 #127c83, 0 13px 25px rgba(0,0,0,.2) !important;
}

.splash-subtitle {
  max-width: 520px;
  margin: 22px 0 18px !important;
  font-size: clamp(1rem, 2vw, 1.28rem) !important;
  line-height: 1.65;
  color: #f5fdff !important;
}

.splash-feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.splash-feature {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  font-size: .84rem;
  font-weight: 700;
  color: #16465d;
  background: rgba(255,255,255,.88);
  border-radius: 999px;
  box-shadow: 0 5px 0 rgba(9, 70, 79, .16);
}

.game-start-button {
  min-width: 245px;
  padding: 15px 28px !important;
  color: #603c07 !important;
  border: 3px solid #fff1ad !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #ffd86a, #ffad36) !important;
  box-shadow: 0 8px 0 #cf722a, 0 16px 28px rgba(27, 65, 65, .28) !important;
  transition: transform .18s ease, box-shadow .18s ease !important;
}

.game-start-button:hover,
.game-start-button:focus-visible {
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 11px 0 #cf722a, 0 20px 30px rgba(27, 65, 65, .32) !important;
}

.game-start-button:active {
  transform: translateY(5px) !important;
  box-shadow: 0 3px 0 #cf722a !important;
}

.splash-hint {
  margin: 18px 0 0;
  color: rgba(255,255,255,.76);
  font-size: .78rem;
}

.splash-character {
  z-index: 4 !important;
  height: min(48vh, 570px) !important;
  bottom: -7vh !important;
  opacity: 1 !important;
  filter: drop-shadow(0 20px 22px rgba(19, 60, 62, .35)) !important;
}

.splash-character-player {
  left: auto !important;
  right: min(2vw, 28px) !important;
}

.splash-character-rival {
  display: none !important;
}

/* Floating system controls and news ribbon */
.top-btn-group {
  top: 18px !important;
  right: max(18px, calc((100vw - 1160px) / 2)) !important;
  gap: 10px !important;
}

.btn-circle-icon {
  width: 48px !important;
  height: 48px !important;
  color: var(--tycoon-ink) !important;
  border: 2px solid rgba(255,255,255,.9) !important;
  background: rgba(255, 252, 235, .93) !important;
  box-shadow: 0 7px 0 rgba(45, 113, 118, .16), var(--tycoon-soft-shadow) !important;
  backdrop-filter: blur(12px);
}

.news-container {
  top: 18px !important;
}

.news-bar {
  width: min(calc(100% - 150px), 770px) !important;
  height: 48px !important;
  margin-left: max(18px, calc((100vw - 1160px) / 2)) !important;
  color: var(--tycoon-ink) !important;
  border: 2px solid rgba(255,255,255,.92) !important;
  background: rgba(255, 250, 225, .93) !important;
  box-shadow: 0 7px 0 rgba(45, 113, 118, .14), var(--tycoon-soft-shadow) !important;
}

.ticker-scroll-text,
.news-bar .text-white {
  color: var(--tycoon-ink) !important;
}

.out-badge-pill {
  color: #fff !important;
  background: linear-gradient(180deg, #33c5b9, #159c99) !important;
  border: 0 !important;
}

/* Main simulation scene */
.main-container {
  width: min(100% - 28px, 1160px) !important;
  max-width: 1160px !important;
  margin-top: 82px !important;
  padding: 0 0 150px !important;
}

.game-world-stage {
  min-height: clamp(360px, 48vw, 560px) !important;
  margin-bottom: 0 !important;
  border: 5px solid rgba(255,255,255,.92) !important;
  border-radius: 48px !important;
  background-image:
    linear-gradient(180deg, rgba(49, 166, 199, .02) 45%, rgba(19, 57, 70, .72) 100%),
    url('/assets/images/market-scene-v2.png') !important;
  background-position: center !important;
  box-shadow: var(--tycoon-deep-shadow), 0 10px 0 rgba(36, 129, 136, .15) !important;
}

.game-world-stage::before {
  content: "";
  position: absolute;
  inset: auto -5% -25% -5%;
  height: 45%;
  z-index: 1;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(68, 205, 139, .3), transparent 66%);
  pointer-events: none;
}

.game-world-stage::after {
  background: linear-gradient(90deg, rgba(19, 57, 70, .2), transparent 26% 75%, rgba(19, 57, 70, .18)) !important;
}

.world-topline {
  top: 18px !important;
  left: 18px !important;
  right: auto !important;
  gap: 8px !important;
}

.world-chip {
  padding: 9px 14px !important;
  color: var(--tycoon-ink) !important;
  border: 2px solid rgba(255,255,255,.9) !important;
  background: rgba(255, 250, 229, .9) !important;
  box-shadow: 0 6px 0 rgba(18, 79, 90, .14) !important;
  backdrop-filter: blur(10px);
}

.world-character {
  height: 82% !important;
  bottom: -10% !important;
  filter: drop-shadow(0 22px 20px rgba(15, 48, 58, .35)) !important;
}

.world-character-player {
  left: 2.5% !important;
}

.world-rival-button {
  right: 1.5% !important;
  width: 34% !important;
}

.world-rival-label {
  bottom: 20px !important;
  color: #fff !important;
  border: 2px solid rgba(255,255,255,.9) !important;
  background: linear-gradient(180deg, #ff8c7d, #e65e67) !important;
  box-shadow: 0 6px 0 #ae4658, 0 14px 24px rgba(61, 35, 54, .2) !important;
}

.world-dialogue {
  left: 50% !important;
  bottom: 24px !important;
  max-width: 440px !important;
  padding: 13px 20px !important;
  color: var(--tycoon-ink) !important;
  border: 3px solid rgba(255,255,255,.94) !important;
  border-radius: 24px 24px 24px 8px !important;
  background: rgba(255, 250, 231, .94) !important;
  box-shadow: 0 8px 0 rgba(25, 99, 105, .18), 0 18px 30px rgba(19, 57, 70, .18) !important;
  transform: translateX(-50%);
}

/* Resource HUD — capsules instead of dashboard cards */
.scroll-x-container {
  position: relative;
  z-index: 8;
  justify-content: center;
  gap: 12px !important;
  width: min(92%, 860px);
  margin: -42px auto 18px !important;
  padding: 0 8px 12px !important;
}

.scroll-card {
  min-width: 150px !important;
  flex: 1 1 0 !important;
}

.card-stat {
  color: var(--tycoon-ink) !important;
  border: 3px solid rgba(255,255,255,.96) !important;
  border-radius: 999px !important;
  background: rgba(255, 250, 231, .96) !important;
  box-shadow: 0 8px 0 rgba(39, 125, 129, .17), var(--tycoon-soft-shadow) !important;
  backdrop-filter: blur(12px);
}

.card-stat:nth-child(2) { background: #e2fbff !important; }
.card-stat:nth-child(3) { background: #e6f8df !important; }
.card-stat:nth-child(4) { background: #fff0c9 !important; }
.card-stat .card-body { padding: 10px 15px !important; }
.card-stat .text-muted { color: var(--tycoon-muted) !important; }
.card-stat h5 { color: var(--tycoon-ink) !important; text-shadow: none !important; }

/* Game mode switch */
#mainGameTabs {
  position: relative;
  z-index: 6;
  width: min(100%, 620px);
  margin: 0 auto 22px !important;
  padding: 7px !important;
  border: 3px solid rgba(255,255,255,.94) !important;
  border-radius: 999px !important;
  background: rgba(255, 250, 230, .88) !important;
  box-shadow: 0 8px 0 rgba(39, 125, 129, .14), var(--tycoon-soft-shadow) !important;
  backdrop-filter: blur(12px);
}

#mainGameTabs .nav-link {
  padding: 13px 18px !important;
  color: #52728b !important;
  border-radius: 999px !important;
}

#mainGameTabs .nav-link.active {
  color: white !important;
  background: linear-gradient(180deg, #35c7b7, #159c99) !important;
  box-shadow: 0 5px 0 #0c7778, 0 10px 18px rgba(17, 141, 140, .22) !important;
}

/* Open, flowing work area */
.tab-content {
  overflow: visible;
}

#tab-market.show.active {
  display: grid !important;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr);
  gap: 18px;
  align-items: stretch;
}

#tab-market > .accordion {
  grid-row: span 2;
  margin: 0 !important;
}

.accordion,
.accordion-item,
.accordion-button,
.accordion-body {
  border: 0 !important;
  background: transparent !important;
}

.accordion-item {
  height: 100%;
  padding: 17px !important;
  border: 3px solid rgba(255,255,255,.9) !important;
  border-radius: 38px !important;
  background: rgba(255, 252, 238, .82) !important;
  box-shadow: var(--tycoon-soft-shadow) !important;
  backdrop-filter: blur(10px);
}

.accordion-button {
  padding: 8px 10px 14px !important;
  color: var(--tycoon-ink) !important;
  font-size: 1.08rem !important;
  box-shadow: none !important;
}

.accordion-body {
  padding: 4px 8px 8px !important;
}

.chart-container {
  min-height: 260px;
  padding: 12px;
  border-radius: 28px;
  background: rgba(224, 249, 250, .62);
}

#tab-market > .row {
  margin: 0 !important;
  padding: 16px;
  border: 3px solid rgba(255,255,255,.9);
  border-radius: 34px;
  background: rgba(232, 250, 225, .82);
  box-shadow: var(--tycoon-soft-shadow);
}

#tab-market .alert {
  padding: 10px 4px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.action-card-live {
  color: #fff !important;
  border-radius: 24px !important;
  background: linear-gradient(180deg, #ff8977, #ec6370) !important;
  box-shadow: 0 6px 0 #bc4c5d !important;
}

.price-slider-container {
  margin: 0 !important;
  padding: 22px !important;
  border: 3px solid rgba(255,255,255,.9) !important;
  border-radius: 34px !important;
  background: rgba(255, 241, 201, .88) !important;
  box-shadow: var(--tycoon-soft-shadow) !important;
}

.form-range::-webkit-slider-thumb {
  width: 25px;
  height: 25px;
  margin-top: -9px;
  border: 4px solid #fff;
  background: var(--tycoon-coral);
  box-shadow: 0 3px 0 #b44d58;
}

/* Operations zone */
#tab-ops > .row {
  align-items: stretch;
}

.card-gacha,
.marketing-card,
.modern-tool-card,
#mini-game-wrapper > * {
  border: 3px solid rgba(255,255,255,.9) !important;
  border-radius: 34px !important;
  box-shadow: 0 8px 0 rgba(39, 125, 129, .14), var(--tycoon-soft-shadow) !important;
}

.card-gacha {
  background: linear-gradient(135deg, #8f81ec, #5ec9db) !important;
}

.modern-tool-card {
  min-height: 132px;
  padding: 18px 8px !important;
  color: var(--tycoon-ink) !important;
  border-radius: 30px !important;
  background: rgba(255,252,238,.9) !important;
}

.modern-tool-card:not(.locked-tool):hover {
  transform: translateY(-5px) rotate(-1deg) !important;
  box-shadow: 0 13px 0 rgba(39, 125, 129, .14), 0 22px 30px rgba(35, 87, 112, .2) !important;
}

.modern-tool-icon {
  font-size: 2.3rem !important;
  filter: drop-shadow(0 4px 2px rgba(24, 71, 84, .12));
}

.marketing-card {
  color: #71450a !important;
  background: linear-gradient(145deg, #ffe88e, #ffbf56) !important;
}

/* Floating bottom action dock */
.fixed-bottom.bg-white {
  left: 50% !important;
  bottom: 16px !important;
  width: min(calc(100% - 28px), 620px) !important;
  padding: 10px 12px !important;
  border: 3px solid rgba(255,255,255,.94) !important;
  border-radius: 28px !important;
  background: rgba(255, 250, 230, .9) !important;
  box-shadow: 0 9px 0 rgba(39, 125, 129, .16), 0 22px 55px rgba(21,68,88,.25) !important;
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
}

.fixed-bottom .btn {
  border: 0 !important;
  border-radius: 20px !important;
}

.fixed-bottom .btn-modern-primary {
  color: #fff !important;
  background: linear-gradient(180deg, #31c8b3, #139b97) !important;
  box-shadow: 0 6px 0 #087778 !important;
}

.fixed-bottom .btn-modern-shop {
  color: #774a0b !important;
  background: linear-gradient(180deg, #ffdd6c, #ffb33e) !important;
  box-shadow: 0 6px 0 #cf762f !important;
}

.fixed-bottom .btn-modern-danger {
  color: #fff !important;
  background: linear-gradient(180deg, #ff8b7a, #e65e68) !important;
  box-shadow: 0 6px 0 #b84759 !important;
}

/* Sheets and dialogs feel like game menus. */
.offcanvas-bottom {
  height: min(86vh, 760px) !important;
  border: 4px solid rgba(255,255,255,.95) !important;
  border-bottom: 0 !important;
  border-radius: 44px 44px 0 0 !important;
  background: #fff9e9 !important;
  box-shadow: 0 -20px 60px rgba(21, 68, 88, .24) !important;
}

.offcanvas-header,
.offcanvas-body,
.modal-content,
.swal2-popup {
  color: var(--tycoon-ink) !important;
  background: #fff9e9 !important;
}

.modal-content,
.swal2-popup {
  border: 4px solid white !important;
  border-radius: 38px !important;
  box-shadow: var(--tycoon-deep-shadow) !important;
}

@media (max-width: 900px) {
  .splash-overlay {
    align-items: flex-end !important;
    padding: 18px 18px 32px !important;
    background-position: 58% center !important;
  }

  .splash-content {
    width: min(100%, 520px) !important;
    padding: 24px !important;
  }

  .splash-character { display: none !important; }

  #tab-market.show.active {
    display: block !important;
  }

  #tab-market > * {
    margin-bottom: 16px !important;
  }
}

@media (max-width: 620px) {
  .news-container { top: 10px !important; }
  .news-bar {
    width: calc(100% - 124px) !important;
    height: 44px !important;
    margin-left: 10px !important;
  }
  .top-btn-group { top: 10px !important; right: 10px !important; }
  .btn-circle-icon { width: 43px !important; height: 43px !important; }
  .main-container { width: calc(100% - 18px) !important; margin-top: 66px !important; }
  .game-world-stage {
    min-height: 330px !important;
    border-width: 3px !important;
    border-radius: 32px !important;
    background-position: 49% center !important;
  }
  .world-topline { top: 12px !important; left: 12px !important; }
  .world-chip { padding: 7px 10px !important; font-size: .72rem !important; }
  .world-character { height: 69% !important; }
  .world-character-player { left: -7% !important; }
  .world-rival-button { right: -4% !important; width: 43% !important; }
  .world-dialogue {
    left: 50% !important;
    bottom: 18px !important;
    width: calc(100% - 30px) !important;
    padding: 10px 14px !important;
    font-size: .82rem !important;
  }
  .scroll-x-container {
    justify-content: flex-start;
    width: calc(100% - 16px);
    margin-top: -25px !important;
    overflow-x: auto;
  }
  .scroll-card { min-width: 132px !important; }
  #mainGameTabs .nav-link { padding: 11px 8px !important; font-size: .8rem; }
  .accordion-item { padding: 12px !important; border-radius: 30px !important; }
  .chart-container { min-height: 220px; padding: 6px; }
  .fixed-bottom.bg-white { bottom: 8px !important; width: calc(100% - 16px) !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Single-screen simulation shell
   The world is now the viewport; management tools float inside it.
   -------------------------------------------------------------------------- */
body.theme-modern {
  width: 100%;
  height: 100dvh;
  overflow: hidden !important;
}

.main-container {
  position: relative !important;
  width: 100% !important;
  max-width: none !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
}

.game-world-stage {
  position: absolute !important;
  inset: 8px !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  border-radius: 42px !important;
}

.news-container {
  z-index: 30 !important;
}

.top-btn-group {
  z-index: 32 !important;
}

.world-topline {
  top: 82px !important;
  left: 24px !important;
}

.world-character {
  height: min(71%, 620px) !important;
  bottom: -5% !important;
}

.world-character-player {
  left: 1% !important;
}

.world-rival-button {
  right: 0 !important;
  width: 27% !important;
  height: 72% !important;
  bottom: 0 !important;
}

.world-dialogue {
  top: auto !important;
  bottom: 104px !important;
  left: 25% !important;
  width: min(34vw, 410px) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 96px !important;
  margin: 0 !important;
  padding: 11px 17px !important;
  overflow: hidden;
  transform: translateX(-50%) !important;
}

.scroll-x-container {
  position: absolute !important;
  z-index: 26 !important;
  top: 78px !important;
  left: 50% !important;
  justify-content: center !important;
  width: min(64vw, 760px) !important;
  margin: 0 !important;
  padding: 0 5px 10px !important;
  overflow: visible !important;
  transform: translateX(-50%);
}

.scroll-card {
  min-width: 128px !important;
  max-width: 180px !important;
}

.card-stat .card-body {
  padding: 8px 13px !important;
}

.card-stat .text-xxs {
  font-size: .62rem !important;
  letter-spacing: .02em;
}

.card-stat h5 {
  font-size: 1rem !important;
}

#mainGameTabs {
  position: absolute !important;
  z-index: 25 !important;
  right: 25px !important;
  bottom: 92px !important;
  left: auto !important;
  width: min(35vw, 430px) !important;
  margin: 0 !important;
  transition: transform .28s ease, opacity .2s ease !important;
}

#game-command-panel {
  position: absolute !important;
  z-index: 24 !important;
  top: 142px !important;
  right: 25px !important;
  bottom: 158px !important;
  width: min(35vw, 430px) !important;
  min-height: 0 !important;
  padding: 12px !important;
  overflow: hidden !important;
  border: 3px solid rgba(255,255,255,.92) !important;
  border-radius: 34px !important;
  background: rgba(255, 250, 231, .86) !important;
  box-shadow: 0 10px 0 rgba(34, 111, 117, .16), 0 26px 60px rgba(20,63,76,.25) !important;
  backdrop-filter: blur(18px) saturate(1.12);
  transition: transform .32s cubic-bezier(.22,.8,.24,1), opacity .2s ease !important;
}

#game-command-panel > .tab-pane {
  height: 100%;
}

#game-command-panel #tab-market.show.active {
  display: flex !important;
  flex-direction: column;
  gap: 9px;
}

#game-command-panel #tab-market > .accordion {
  flex: 1 1 auto;
  min-height: 0;
}

#game-command-panel .accordion-item {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px !important;
  border-width: 2px !important;
  border-radius: 26px !important;
  box-shadow: none !important;
}

#game-command-panel .accordion-header {
  flex: 0 0 auto;
}

#game-command-panel .accordion-button {
  padding: 6px 8px 9px !important;
  font-size: .92rem !important;
}

#game-command-panel .accordion-collapse,
#game-command-panel .accordion-body {
  min-height: 0;
  flex: 1 1 auto;
}

#game-command-panel .accordion-collapse.show {
  display: flex;
  flex-direction: column;
}

#game-command-panel .accordion-body {
  display: flex;
  flex-direction: column;
  padding: 0 5px 4px !important;
}

#game-command-panel .chart-container {
  flex: 1 1 auto;
  min-height: 120px !important;
  height: auto !important;
  padding: 6px !important;
  border-radius: 20px;
}

#game-command-panel #tab-market > .row {
  flex: 0 0 74px;
  min-height: 0;
  padding: 8px !important;
  border-width: 2px;
  border-radius: 24px;
  box-shadow: none;
}

#game-command-panel .action-card-live {
  border-radius: 18px !important;
}

#game-command-panel .price-slider-container {
  flex: 0 0 auto;
  padding: 13px 15px !important;
  border-width: 2px !important;
  border-radius: 24px !important;
  box-shadow: none !important;
}

#game-command-panel #tab-ops.show.active {
  display: block !important;
  padding: 2px 4px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

#game-command-panel .card-gacha {
  border-radius: 26px !important;
  box-shadow: none !important;
}

#game-command-panel .card-gacha .card-body {
  padding-top: 16px !important;
  padding-bottom: 16px !important;
}

#game-command-panel .modern-tool-card {
  min-height: 90px;
  padding: 10px 5px !important;
  border-radius: 24px !important;
  box-shadow: none !important;
}

#game-command-panel .modern-tool-icon {
  font-size: 1.7rem !important;
}

.command-panel-toggle {
  position: absolute;
  z-index: 28;
  right: min(36vw, 452px);
  bottom: 101px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 46px;
  padding: 9px 14px;
  color: white;
  font-size: .78rem;
  font-weight: 700;
  border: 3px solid rgba(255,255,255,.92);
  border-radius: 999px;
  background: linear-gradient(180deg, #7082e9, #5366cd);
  box-shadow: 0 6px 0 #3f4ca0, 0 14px 26px rgba(21,68,88,.24);
  transition: right .32s ease, transform .2s ease;
}

.command-panel-toggle:hover,
.command-panel-toggle:focus-visible {
  transform: translateY(-2px);
}

body.command-panel-collapsed #game-command-panel,
body.command-panel-collapsed #mainGameTabs {
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 50px));
}

body.command-panel-collapsed .command-panel-toggle {
  right: 24px;
}

.fixed-bottom.bg-white {
  z-index: 31 !important;
}

@media (max-width: 900px) {
  .world-character {
    height: min(67%, 500px) !important;
  }

  .scroll-x-container {
    width: min(72vw, 620px) !important;
  }

  #game-command-panel,
  #mainGameTabs {
    width: min(42vw, 390px) !important;
  }

  .command-panel-toggle {
    right: min(43vw, 412px);
  }
}

@media (max-width: 720px) {
  .game-world-stage {
    inset: 4px !important;
    border-radius: 28px !important;
    background-position: 43% center !important;
  }

  .news-container {
    top: 8px !important;
  }

  .news-bar {
    margin-left: 8px !important;
  }

  .world-topline {
    top: 62px !important;
    left: 10px !important;
  }

  .world-character {
    height: 61% !important;
    bottom: 4% !important;
  }

  .world-character-player {
    left: -15% !important;
  }

  .world-rival-button {
    right: -10% !important;
    width: 49% !important;
    height: 58% !important;
    bottom: 8% !important;
  }

  .world-dialogue {
    bottom: 168px !important;
    left: 50% !important;
    width: min(calc(100% - 34px), 370px) !important;
    max-height: 74px !important;
    padding: 9px 13px !important;
  }

  .scroll-x-container {
    top: 107px !important;
    left: 8px !important;
    justify-content: flex-start !important;
    width: calc(100% - 16px) !important;
    padding: 0 2px 10px !important;
    overflow-x: auto !important;
    transform: none;
    scroll-snap-type: x mandatory;
  }

  .scroll-card {
    min-width: 122px !important;
    max-width: 132px !important;
  }

  #mainGameTabs {
    right: auto !important;
    bottom: 91px !important;
    left: 8px !important;
    width: calc(100% - 82px) !important;
    padding: 5px !important;
  }

  #mainGameTabs .nav-link {
    padding: 10px 5px !important;
    font-size: .76rem;
  }

  #game-command-panel {
    top: auto !important;
    right: 7px !important;
    bottom: 158px !important;
    left: 7px !important;
    width: auto !important;
    height: min(46dvh, 410px) !important;
    padding: 9px !important;
    border-radius: 30px !important;
    transform: translateY(0);
  }

  .command-panel-toggle,
  body.command-panel-collapsed .command-panel-toggle {
    right: 9px;
    bottom: 100px;
    width: 62px;
    min-height: 48px;
    justify-content: center;
    padding: 8px;
  }

  .command-panel-toggle-label {
    display: none;
  }

  body.command-panel-collapsed #game-command-panel {
    transform: translateY(calc(100% + 180px));
  }

  body.command-panel-collapsed #mainGameTabs {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .fixed-bottom.bg-white {
    bottom: 7px !important;
  }
}

/* --------------------------------------------------------------------------
   V3 — mobile-game world, contextual characters and popup command tablet
   -------------------------------------------------------------------------- */
.news-container {
  display: none !important;
}

.game-world-stage {
  inset: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background-position: center !important;
  transition: background-image .45s ease, filter .45s ease !important;
}

.game-world-stage[data-mode="ENDLESS"] {
  background-image:
    linear-gradient(180deg, rgba(19,57,70,.02) 52%, rgba(11,41,48,.6) 100%),
    url('/assets/images/market-scene-v2.png') !important;
}

.game-world-stage[data-mode="CUSTOM_DAYS"] {
  background-image:
    linear-gradient(180deg, rgba(19,57,70,.01) 50%, rgba(11,41,48,.58) 100%),
    url('/assets/images/data-tycoon-town-v1.png') !important;
}

.game-world-stage[data-mode="SPEEDRUN"] {
  background-image:
    linear-gradient(180deg, rgba(62,32,22,.02) 50%, rgba(57,24,23,.62) 100%),
    url('/assets/images/mode-speedrun-v1.png') !important;
}

.game-world-stage[data-mode="HARDCORE"] {
  background-image:
    linear-gradient(180deg, rgba(6,14,38,.08) 42%, rgba(4,11,28,.74) 100%),
    url('/assets/images/mode-hardcore-v1.png') !important;
}

.game-world-stage[data-mode="SANDBOX"] {
  background-image:
    linear-gradient(180deg, rgba(89,43,104,.01) 50%, rgba(55,30,78,.52) 100%),
    url('/assets/images/mode-sandbox-v1.png') !important;
}

.game-world-stage[data-weather="RAINY"]::after,
.game-world-stage[data-weather="STORM"]::after {
  background:
    repeating-linear-gradient(105deg, transparent 0 16px, rgba(190,235,255,.12) 17px 19px, transparent 20px 34px),
    linear-gradient(180deg, rgba(22,75,111,.12), rgba(7,34,63,.32)) !important;
  animation: tycoonRain .85s linear infinite;
}

@keyframes tycoonRain {
  from { background-position: 0 0, 0 0; }
  to { background-position: -26px 70px, 0 0; }
}

.top-btn-group {
  top: 14px !important;
  right: 14px !important;
}

.btn-circle-icon {
  width: 46px !important;
  height: 46px !important;
  border-width: 3px !important;
  box-shadow: 0 5px 0 rgba(23,70,74,.25), 0 12px 22px rgba(17,53,63,.18) !important;
}

.world-topline {
  top: 80px !important;
  left: 16px !important;
  right: auto !important;
  justify-content: flex-start !important;
}

.world-mode-card {
  position: absolute;
  z-index: 11;
  top: 76px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 270px;
  max-width: 42vw;
  padding: 9px 16px 9px 10px;
  color: var(--tycoon-ink);
  border: 3px solid rgba(255,255,255,.94);
  border-radius: 999px;
  background: rgba(255,250,230,.93);
  box-shadow: 0 6px 0 rgba(25,96,101,.2), 0 14px 28px rgba(15,51,61,.2);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.world-mode-card > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.15;
}

.world-mode-card b {
  font-size: .82rem;
}

.world-mode-card small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--tycoon-muted);
  font-size: .68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.world-mode-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #dff7f0;
}

.scroll-x-container {
  top: 11px !important;
  left: 50% !important;
  width: min(68vw, 700px) !important;
}

.card-stat {
  height: 54px !important;
  border-width: 2px !important;
  box-shadow: 0 5px 0 rgba(26,96,101,.2), 0 10px 20px rgba(15,51,61,.14) !important;
}

.card-stat .card-body {
  display: flex !important;
  height: 100% !important;
  padding: 6px 12px !important;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.card-stat .text-xxs,
.card-stat h5 {
  margin: 0 !important;
  line-height: 1.15 !important;
}

.world-player-interactive {
  pointer-events: auto !important;
  cursor: pointer;
  transition: filter .2s ease, transform .2s ease !important;
}

.world-player-interactive:hover,
.world-player-interactive:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 18px rgba(255,230,120,.92)) !important;
  transform: translateY(-5px) scale(1.015);
}

.world-player-label {
  position: absolute;
  z-index: 12;
  bottom: 90px;
  left: 7%;
  padding: 8px 13px;
  color: #17445c;
  font-size: .72rem;
  font-weight: 800;
  border: 3px solid rgba(255,255,255,.94);
  border-radius: 999px;
  background: linear-gradient(180deg, #fff8c8, #ffdf7d);
  box-shadow: 0 5px 0 #ce8a36, 0 12px 20px rgba(16,50,60,.2);
  animation: guideNudge 2.8s ease-in-out infinite;
}

@keyframes guideNudge {
  0%, 70%, 100% { transform: translateY(0); }
  80% { transform: translateY(-5px); }
  90% { transform: translateY(1px); }
}

.world-rival-label {
  right: 16px !important;
  bottom: 88px !important;
  padding: 8px 13px !important;
  font-size: .7rem !important;
}

.world-dialogue {
  bottom: 154px !important;
  left: 24% !important;
  max-width: 360px !important;
  max-height: 76px !important;
  border-radius: 24px 24px 24px 7px !important;
}

/* The management dashboard is a modal tablet, never part of page flow. */
.game-command-backdrop {
  position: fixed;
  z-index: 1035;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(8,28,39,.58);
  opacity: 1;
  backdrop-filter: blur(7px);
  transition: opacity .22s ease;
}

.game-command-window {
  position: fixed;
  z-index: 1040;
  top: 50%;
  left: 50%;
  display: flex;
  width: min(calc(100% - 36px), 880px);
  height: min(calc(100dvh - 42px), 720px);
  padding: 16px;
  flex-direction: column;
  overflow: hidden;
  border: 5px solid rgba(255,255,255,.94);
  border-radius: 42px;
  background: linear-gradient(145deg, #fffced, #e7f8f3);
  box-shadow: 0 15px 0 rgba(17,86,92,.28), 0 38px 90px rgba(5,27,39,.42);
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center;
  transition: opacity .22s ease, transform .3s cubic-bezier(.2,.9,.25,1.12);
}

.game-command-titlebar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 2px 2px 12px;
}

.game-command-titlebar > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.game-command-titlebar small {
  color: var(--tycoon-teal-dark);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.game-command-titlebar strong {
  overflow: hidden;
  color: var(--tycoon-ink);
  font-size: 1.08rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-command-title-icon,
.game-command-titlebar > button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 0;
  border-radius: 15px;
}

.game-command-title-icon {
  background: #d8f5ee;
  box-shadow: inset 0 -4px 0 rgba(25,155,151,.14);
}

.game-command-titlebar > button {
  color: white;
  background: linear-gradient(180deg, #ff8979, #e65d68);
  box-shadow: 0 5px 0 #ae4557;
}

.game-command-window .command-panel-toggle {
  display: none !important;
}

.game-command-window #mainGameTabs {
  position: static !important;
  z-index: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: 100% !important;
  margin: 0 0 12px !important;
  flex: 0 0 auto;
  transform: none !important;
}

.game-command-window #game-command-panel {
  position: static !important;
  z-index: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  flex: 1 1 auto;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 1 !important;
  transform: none !important;
  backdrop-filter: none !important;
}

.game-command-window #tab-market.show.active {
  display: grid !important;
  grid-template-columns: minmax(0, 1.45fr) minmax(250px, .8fr);
  grid-template-rows: 1fr auto;
  gap: 12px;
}

.game-command-window #tab-market > .accordion {
  grid-row: 1 / 3;
}

.game-command-window #tab-market > .row,
.game-command-window #tab-market > .price-slider-container {
  margin: 0 !important;
}

.game-command-window #tab-market > .row {
  min-height: 105px;
}

.game-command-window #tab-market > .price-slider-container {
  min-height: 135px;
}

.game-command-window #tab-ops.show.active {
  height: 100%;
  padding: 0 5px 8px !important;
}

body.command-panel-collapsed .game-command-backdrop {
  opacity: 0;
  pointer-events: none;
}

body.command-panel-collapsed .game-command-window {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -46%) scale(.88);
}

body.command-panel-collapsed #game-command-panel,
body.command-panel-collapsed #mainGameTabs {
  opacity: 1;
  transform: none;
}

/* One coherent mobile-game action dock. */
.fixed-bottom.game-action-dock {
  position: fixed !important;
  left: 50% !important;
  bottom: 12px !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(64px, 1fr)) minmax(116px, 1.45fr) repeat(2, minmax(64px, 1fr));
  gap: 7px;
  width: min(calc(100% - 24px), 720px) !important;
  padding: 9px !important;
  border: 4px solid rgba(255,255,255,.94) !important;
  border-radius: 28px !important;
  background: rgba(14,45,59,.91) !important;
  box-shadow: 0 8px 0 rgba(4,25,35,.35), 0 22px 50px rgba(6,28,39,.35) !important;
  transform: translateX(-50%);
  backdrop-filter: blur(15px) saturate(1.2);
}

.game-dock-btn {
  display: flex;
  min-width: 0;
  height: 62px;
  padding: 7px 5px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  color: #e9fbff;
  border: 0;
  border-radius: 18px;
  background: rgba(255,255,255,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
  font-family: 'Sarabun', sans-serif;
  font-size: .65rem;
  font-weight: 800;
  transition: transform .16s ease, background .16s ease;
}

.game-dock-btn i {
  font-size: 1.25rem;
}

.game-dock-btn:hover,
.game-dock-btn:focus-visible {
  color: white;
  outline: none;
  background: rgba(255,255,255,.2);
  transform: translateY(-3px);
}

.game-dock-primary {
  height: 68px;
  margin-top: -6px;
  color: #fff !important;
  border: 3px solid rgba(255,255,255,.88) !important;
  background: linear-gradient(180deg, #35cdb8, #119b97) !important;
  box-shadow: 0 6px 0 #087274, 0 12px 24px rgba(6,25,33,.24) !important;
  font-size: .76rem;
}

.game-dock-primary i {
  font-size: 1.55rem;
}

.game-dock-danger {
  color: #ffd9dc;
}

/* Character advisor popup */
.game-dialog-popup {
  width: min(calc(100% - 24px), 620px) !important;
}

.advisor-popup-message {
  margin: 0 0 16px;
  padding: 14px 16px;
  color: var(--tycoon-ink);
  border-radius: 22px;
  background: #e7f8f3;
  line-height: 1.6;
}

.advisor-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.advisor-actions button {
  display: flex;
  min-height: 92px;
  padding: 12px 7px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: var(--tycoon-ink);
  border: 3px solid white;
  border-radius: 22px;
  background: #fff2c7;
  box-shadow: 0 5px 0 rgba(31,106,109,.18);
}

.advisor-actions button span {
  font-size: 1.8rem;
}

@media (max-width: 720px) {
  .top-btn-group {
    top: 8px !important;
    right: 8px !important;
  }

  .btn-circle-icon {
    width: 40px !important;
    height: 40px !important;
  }

  .scroll-x-container {
    top: 53px !important;
    left: 7px !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px !important;
    width: calc(100% - 14px) !important;
    overflow: visible !important;
    transform: none !important;
  }

  .scroll-card {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 48px !important;
  }

  .card-stat .card-body {
    padding: 5px 3px !important;
  }

  .card-stat .text-xxs {
    max-width: 100%;
    overflow: hidden;
    font-size: .48rem !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .card-stat h5 {
    font-size: .78rem !important;
  }

  .world-topline {
    top: 112px !important;
    left: 8px !important;
  }

  .world-topline .world-chip:nth-child(2) {
    display: none;
  }

  .world-mode-card {
    top: 109px;
    right: 8px;
    left: auto;
    min-width: 0;
    max-width: calc(100% - 104px);
    padding: 7px 10px 7px 7px;
    transform: none;
  }

  .world-mode-card small {
    max-width: 210px;
  }

  .world-character {
    bottom: 10% !important;
    height: 56% !important;
  }

  .world-character-player {
    left: -17% !important;
  }

  .world-rival-button {
    right: -12% !important;
    bottom: 12% !important;
    width: 50% !important;
    height: 51% !important;
  }

  .world-player-label {
    bottom: 94px;
    left: 8px;
    padding: 6px 9px;
    font-size: .62rem;
  }

  .world-rival-label {
    right: 20px !important;
    bottom: 12px !important;
    max-width: 120px;
    padding: 6px 8px !important;
    font-size: .58rem !important;
  }

  .world-dialogue {
    bottom: 151px !important;
    left: 50% !important;
    width: min(calc(100% - 28px), 360px) !important;
    max-height: 68px !important;
    font-size: .72rem !important;
  }

  .game-command-window {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(78dvh, 690px);
    padding: 13px 10px max(16px, env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 32px 32px 0 0;
    transform: translateY(0);
    transform-origin: bottom;
  }

  body.command-panel-collapsed .game-command-window {
    transform: translateY(105%);
  }

  .game-command-window #tab-market.show.active {
    display: flex !important;
    flex-direction: column;
    gap: 9px;
    overflow-y: auto;
  }

  .game-command-window #tab-market > .accordion {
    flex: 1 0 260px;
  }

  .game-command-window #tab-market > .row,
  .game-command-window #tab-market > .price-slider-container {
    flex: 0 0 auto;
  }

  .fixed-bottom.game-action-dock {
    bottom: 6px !important;
    grid-template-columns: repeat(2, 1fr) 1.35fr repeat(2, 1fr);
    gap: 4px;
    width: calc(100% - 12px) !important;
    padding: 6px !important;
    border-width: 3px !important;
    border-radius: 22px !important;
  }

  .game-dock-btn {
    height: 53px;
    padding: 5px 2px;
    border-radius: 15px;
    font-size: .53rem;
  }

  .game-dock-btn i {
    font-size: 1.08rem;
  }

  .game-dock-primary {
    height: 59px;
    font-size: .6rem;
  }

  .advisor-actions {
    grid-template-columns: 1fr;
  }

  .advisor-actions button {
    min-height: 58px;
    flex-direction: row;
  }
}


/* UI layer 2: game-mobile-tycoon-v5.css */
/* Data Pop V5 — portrait-first mobile tycoon presentation layer. */
:root { --mobile-game-width: min(100vw, 480px); }

html,
body.theme-modern {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden !important;
  background: #071c28 !important;
}

body.theme-modern::before {
  z-index: 0;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  border-radius: 0;
  background: linear-gradient(120deg, #0b3342, #174a55 42%, #071927) !important;
  filter: none;
}

body.theme-modern::after {
  z-index: 0;
  top: 50%;
  left: 50%;
  width: min(94vw, 620px);
  height: 92dvh;
  border-radius: 50%;
  background: var(--game-glow) !important;
  filter: blur(80px);
  transform: translate(-50%, -50%);
}

#main-game-content { display: block; }

body.theme-modern .main-container {
  position: relative !important;
  z-index: 1;
  width: var(--mobile-game-width) !important;
  max-width: 480px !important;
  height: 100dvh !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #173945;
  box-shadow: 0 0 0 2px rgba(255,255,255,.18), 0 0 80px rgba(0,0,0,.7);
}

body.theme-modern .game-world-stage {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background-size: cover !important;
  background-position: center top !important;
  box-shadow: none !important;
}

body.theme-modern .game-world-stage[data-product="CHEAP"],
body.theme-modern .game-world-stage:not([data-product]),
body.theme-modern .game-world-stage[data-product="CHEAP"][data-mode="ENDLESS"],
body.theme-modern .game-world-stage[data-product="CHEAP"][data-mode="CUSTOM_DAYS"] {
  background-image: linear-gradient(180deg, rgba(9,38,45,.04) 40%, rgba(6,29,35,.35) 74%, rgba(4,18,25,.82) 100%), url('/assets/images/store-boba-portrait-v1.png') !important;
}

body.theme-modern .game-world-stage[data-product="CHEAP"][data-mode="SPEEDRUN"] {
  background-image: linear-gradient(180deg, rgba(255,135,55,.08) 34%, rgba(76,28,14,.45) 78%, rgba(31,13,16,.84) 100%), url('/assets/images/store-boba-portrait-v1.png') !important;
}

body.theme-modern .game-world-stage[data-product="CHEAP"][data-mode="HARDCORE"] {
  background-image: linear-gradient(180deg, rgba(4,16,39,.22) 25%, rgba(2,10,28,.72) 100%), url('/assets/images/store-boba-portrait-v1.png') !important;
}

body.theme-modern .game-world-stage[data-product="CHEAP"][data-mode="SANDBOX"] {
  background-image: linear-gradient(180deg, rgba(89,50,128,.08) 35%, rgba(42,22,68,.62) 100%), url('/assets/images/store-boba-portrait-v1.png') !important;
}

body.theme-modern .game-world-stage[data-product="EXPENSIVE"],
body.theme-modern .game-world-stage[data-product="EXPENSIVE"][data-mode="ENDLESS"],
body.theme-modern .game-world-stage[data-product="EXPENSIVE"][data-mode="CUSTOM_DAYS"] {
  background-image: linear-gradient(180deg, rgba(5,21,42,.03) 40%, rgba(5,18,38,.42) 76%, rgba(3,12,29,.86) 100%), url('/assets/images/store-it-portrait-v1.png') !important;
  background-position: center top !important;
  filter: none;
}

body.theme-modern .game-world-stage[data-product="EXPENSIVE"][data-mode="SPEEDRUN"] {
  background-image: linear-gradient(180deg, rgba(255,126,35,.08) 33%, rgba(50,17,22,.72) 100%), url('/assets/images/store-it-portrait-v1.png') !important;
}

body.theme-modern .game-world-stage[data-product="EXPENSIVE"][data-mode="HARDCORE"] {
  background-image: linear-gradient(180deg, rgba(4,11,31,.28) 22%, rgba(2,8,24,.82) 100%), url('/assets/images/store-it-portrait-v1.png') !important;
  filter: saturate(.82) contrast(1.06);
}

body.theme-modern .game-world-stage[data-product="EXPENSIVE"][data-mode="SANDBOX"] {
  background-image: linear-gradient(180deg, rgba(78,36,118,.12) 30%, rgba(28,14,63,.72) 100%), url('/assets/images/store-it-portrait-v1.png') !important;
}

body.theme-modern .game-world-stage::before {
  z-index: 3;
  background: linear-gradient(180deg, rgba(3,16,24,.48) 0, transparent 19%, transparent 68%, rgba(3,15,25,.66) 100%) !important;
}

body.theme-modern .game-world-stage::after { z-index: 4; background: none; }
body.theme-modern .game-world-stage[data-weather="RAINY"]::after,
body.theme-modern .game-world-stage[data-weather="STORM"]::after {
  background: repeating-linear-gradient(105deg, transparent 0 15px, rgba(198,235,255,.18) 16px 18px, transparent 19px 31px), linear-gradient(180deg, rgba(22,75,111,.08), rgba(6,28,55,.32)) !important;
}

/* Zone 1: compact game HUD */
body.theme-modern .top-btn-group {
  position: fixed !important;
  z-index: 42 !important;
  top: max(9px, env(safe-area-inset-top)) !important;
  right: max(9px, calc((100vw - 480px) / 2 + 9px)) !important;
  left: auto !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 6px !important;
}

body.theme-modern .btn-circle-icon {
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  color: #ecfdff !important;
  border: 2px solid rgba(255,255,255,.84) !important;
  border-radius: 14px !important;
  background: rgba(8,35,48,.82) !important;
  box-shadow: 0 4px 0 rgba(3,18,26,.65), 0 8px 18px rgba(0,0,0,.3) !important;
  backdrop-filter: blur(10px);
}

body.theme-modern .world-topline {
  z-index: 20 !important;
  top: max(10px, env(safe-area-inset-top)) !important;
  right: auto !important;
  left: 10px !important;
  display: flex !important;
  width: calc(100% - 100px);
  justify-content: flex-start !important;
  gap: 6px;
}

body.theme-modern .world-chip {
  min-height: 37px;
  padding: 5px 10px;
  color: #effcff;
  border: 2px solid rgba(255,255,255,.72);
  border-radius: 14px;
  background: rgba(8,35,48,.8);
  box-shadow: 0 4px 0 rgba(3,18,26,.6);
  backdrop-filter: blur(10px);
  font-size: .62rem;
}

body.theme-modern .world-topline .world-chip:nth-child(2) { display: flex !important; }

body.theme-modern .scroll-x-container {
  position: fixed !important;
  z-index: 24 !important;
  top: calc(max(9px, env(safe-area-inset-top)) + 47px) !important;
  left: 50% !important;
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 5px !important;
  width: min(calc(100% - 18px), 462px) !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  transform: translateX(-50%) !important;
}

body.theme-modern .scroll-card {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 53px !important;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.82) !important;
  border-radius: 17px 17px 21px 21px !important;
  background: rgba(255,249,223,.94) !important;
  box-shadow: 0 4px 0 rgba(9,57,67,.45), 0 9px 20px rgba(0,0,0,.22) !important;
  backdrop-filter: blur(9px);
}

body.theme-modern[data-product-type="EXPENSIVE"] .scroll-card { background: rgba(235,247,255,.95) !important; }
body.theme-modern .card-stat .card-body { padding: 5px 2px !important; }
body.theme-modern .card-stat .text-xxs { color: #5f7890 !important; font-size: .43rem !important; line-height: 1 !important; white-space: nowrap; }
body.theme-modern .card-stat h5 { color: #15374d !important; font-size: .72rem !important; line-height: 1.2 !important; }

body.theme-modern .world-mode-card {
  z-index: 19;
  top: calc(max(9px, env(safe-area-inset-top)) + 111px) !important;
  right: 10px !important;
  left: 10px !important;
  width: auto;
  min-width: 0;
  max-width: none;
  padding: 8px 12px 8px 9px;
  color: #17374c;
  border: 3px solid rgba(255,255,255,.9);
  border-radius: 19px;
  background: var(--game-surface);
  box-shadow: 0 5px 0 rgba(7,58,69,.35), 0 12px 28px rgba(0,0,0,.2);
  transform: none;
}

body.theme-modern .world-mode-icon { width: 34px; height: 34px; background: color-mix(in srgb, var(--game-accent) 20%, white); }
body.theme-modern .world-mode-card b { font-size: .72rem; }
body.theme-modern .world-mode-card small { max-width: 340px; font-size: .56rem; }

/* Zone 2: the playable world */
.world-store-plaque {
  position: absolute;
  z-index: 12;
  top: calc(max(9px, env(safe-area-inset-top)) + 170px);
  left: 50%;
  display: flex;
  min-width: 180px;
  padding: 7px 12px 7px 8px;
  align-items: center;
  gap: 8px;
  color: #ecfdff;
  border: 2px solid rgba(255,255,255,.35);
  border-radius: 999px;
  background: rgba(7,31,45,.72);
  box-shadow: 0 7px 20px rgba(0,0,0,.25);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.world-store-plaque > span:first-child { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--game-accent) 35%, transparent); }
.world-store-plaque > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.world-store-plaque small { color: #b8e8ef; font-size: .48rem; line-height: 1; }
.world-store-plaque b { max-width: 210px; overflow: hidden; font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }

body.theme-modern .game-world-stage .world-character-player {
  z-index: 10 !important;
  bottom: 10.5% !important;
  left: -5% !important;
  width: auto !important;
  height: min(48%, 455px) !important;
  filter: drop-shadow(0 17px 14px rgba(1,13,21,.5)) !important;
}

body.theme-modern .game-world-stage .world-character-player.pose-pop {
  animation: v5CharacterPose .34s cubic-bezier(.2,.9,.3,1.18);
}

body.theme-modern .game-world-stage.character-is-speaking .world-character-player {
  filter: drop-shadow(0 0 18px var(--game-glow)) drop-shadow(0 17px 14px rgba(1,13,21,.5)) !important;
}

@keyframes v5CharacterPose {
  0% { opacity: .58; transform: translateY(7px) scale(.965); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

body.theme-modern .game-world-stage .world-player-label { display: none !important; }
body.theme-modern .game-world-stage .world-dialogue {
  z-index: 16 !important;
  top: auto !important;
  right: 12px !important;
  bottom: 30% !important;
  left: auto !important;
  width: 64% !important;
  max-width: 300px !important;
  max-height: 82px !important;
  padding: 9px 12px !important;
  color: #17374c !important;
  border: 3px solid rgba(255,255,255,.94) !important;
  border-radius: 20px 20px 7px 20px !important;
  background: var(--game-surface) !important;
  box-shadow: 0 6px 0 rgba(6,42,56,.28), 0 14px 30px rgba(0,0,0,.28) !important;
  transform: none !important;
  font-size: .63rem !important;
  line-height: 1.45 !important;
}

body.theme-modern .game-world-stage .world-dialogue::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: -10px;
  width: 17px;
  height: 17px;
  border-right: 3px solid white;
  border-bottom: 3px solid white;
  background: var(--game-surface);
  transform: rotate(45deg);
}

.world-hotspot {
  position: absolute;
  z-index: 11;
  display: flex;
  width: 57px;
  height: 57px;
  padding: 4px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #effdff;
  border: 3px solid rgba(255,255,255,.9);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, color-mix(in srgb, var(--game-accent) 78%, white), var(--game-accent-deep));
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--game-accent) 22%, transparent), 0 7px 0 rgba(3,27,39,.52), 0 14px 24px rgba(0,0,0,.28);
  font-family: 'Sarabun', sans-serif;
  animation: hotspotFloat 2.4s ease-in-out infinite;
}

.world-hotspot span { font-size: 1.25rem; line-height: 1; }
.world-hotspot small { margin-top: 2px; font-size: .45rem; font-weight: 900; }
.world-hotspot-market { top: 37%; right: 8%; }
.world-hotspot-lab { top: 52%; right: 13%; animation-delay: -1.15s; }
.world-hotspot:focus-visible { outline: 4px solid var(--game-highlight); outline-offset: 5px; }
@keyframes hotspotFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* Zone 3: three tactile game controls */
body.theme-modern .fixed-bottom.game-action-dock {
  z-index: 38 !important;
  right: auto !important;
  bottom: max(8px, env(safe-area-inset-bottom)) !important;
  left: 50% !important;
  display: grid !important;
  grid-template-columns: 1fr 1.35fr 1fr !important;
  gap: 7px !important;
  width: min(calc(100% - 18px), 462px) !important;
  padding: 8px !important;
  border: 3px solid rgba(255,255,255,.9) !important;
  border-radius: 27px !important;
  background: var(--game-panel) !important;
  box-shadow: 0 7px 0 rgba(2,17,27,.72), 0 0 25px var(--game-glow), 0 18px 40px rgba(0,0,0,.42) !important;
  transform: translateX(-50%) !important;
}

body.theme-modern .game-dock-btn {
  height: 59px;
  padding: 5px 3px;
  gap: 1px;
  color: #ddf8fd;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: rgba(255,255,255,.08);
  font-size: .53rem;
}

body.theme-modern .game-action-icon { font-size: 1.35rem; line-height: 1; }
body.theme-modern .game-dock-primary {
  height: 68px;
  margin-top: -8px;
  border: 3px solid white !important;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--game-highlight), color-mix(in srgb, var(--game-highlight) 55%, var(--game-accent-deep))) !important;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--game-accent-deep) 72%, #061727), 0 10px 22px rgba(0,0,0,.3) !important;
  color: #153448 !important;
  font-size: .63rem;
}

/* Main command chooser popup */
.quick-command-backdrop {
  position: fixed;
  z-index: 1044;
  top: 0;
  bottom: 0;
  left: 50%;
  display: block;
  width: var(--mobile-game-width);
  padding: 0;
  border: 0;
  background: rgba(3,16,27,.68);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  backdrop-filter: blur(7px);
  transition: opacity .2s ease;
}

.quick-command-menu {
  position: fixed;
  z-index: 1045;
  right: auto;
  bottom: 0;
  left: 50%;
  width: var(--mobile-game-width);
  max-height: 88dvh;
  padding: 15px 13px max(18px, env(safe-area-inset-bottom));
  overflow-y: auto;
  color: #17374c;
  border: 4px solid rgba(255,255,255,.94);
  border-bottom: 0;
  border-radius: 34px 34px 0 0;
  background: linear-gradient(155deg, var(--game-surface), color-mix(in srgb, var(--game-surface) 83%, var(--game-accent)));
  box-shadow: 0 -16px 50px rgba(0,0,0,.38);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 105%);
  transition: opacity .2s ease, transform .32s cubic-bezier(.2,.85,.22,1);
}

body.quick-command-open .quick-command-backdrop { opacity: 1; pointer-events: auto; }
body.quick-command-open .quick-command-menu { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
body.quick-command-open .main-container,
body.theme-modern:not(.command-panel-collapsed) .main-container { z-index: 50 !important; }
body.quick-command-open .game-action-dock,
body.theme-modern:not(.command-panel-collapsed) .game-action-dock { opacity: 0 !important; pointer-events: none !important; transform: translate(-50%, 120%) !important; }

.quick-command-header { display: grid; grid-template-columns: 48px 1fr 38px; align-items: center; gap: 9px; margin-bottom: 13px; }
.quick-command-avatar { width: 48px; height: 48px; overflow: hidden; border: 3px solid white; border-radius: 17px; background: color-mix(in srgb, var(--game-accent) 20%, white); box-shadow: 0 4px 0 rgba(9,58,69,.25); }
.quick-command-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 13%; transform: scale(1.65); }
.quick-command-header small { color: var(--game-accent-deep); font-size: .58rem; font-weight: 800; }
.quick-command-header h2 { margin: 0; font-size: 1.12rem; font-weight: 900; }
.quick-command-header > button { width: 38px; height: 38px; color: white; border: 2px solid white; border-radius: 14px; background: #f06d6f; box-shadow: 0 4px 0 #a94756; }
.quick-command-header > button { font-size: 1rem; font-weight: 900; line-height: 1; }

.quick-command-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.quick-command-grid > button {
  display: grid;
  min-height: 88px;
  padding: 10px 8px;
  align-content: center;
  justify-items: center;
  color: #17374c;
  border: 3px solid rgba(255,255,255,.96);
  border-radius: 23px;
  background: color-mix(in srgb, var(--game-accent) 13%, white);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--game-accent-deep) 26%, #d3d8d6), 0 11px 20px rgba(14,48,60,.12);
  font-family: 'Sarabun', sans-serif;
}
.quick-command-grid > button span { font-size: 1.65rem; line-height: 1; }
.quick-command-grid > button b { margin-top: 4px; font-size: .72rem; }
.quick-command-grid > button small { color: #688094; font-size: .5rem; }
.quick-command-grid > button:active { transform: translateY(5px); box-shadow: 0 1px 0 color-mix(in srgb, var(--game-accent-deep) 26%, #d3d8d6); }
.quick-command-grid > .quick-command-primary { background: color-mix(in srgb, var(--game-highlight) 62%, white); }

.quick-command-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 16px; padding-top: 11px; border-top: 2px dashed color-mix(in srgb, var(--game-accent) 32%, transparent); }
.quick-command-tools button { display: flex; min-width: 0; height: 46px; padding: 4px 2px; align-items: center; justify-content: center; flex-direction: column; color: #456173; border: 0; border-radius: 14px; background: rgba(255,255,255,.55); font-family: 'Sarabun', sans-serif; font-size: .48rem; }
.quick-command-tools button.danger { color: #b74150; background: #ffe6e6; }

/* Every detailed system opens as an in-game popup, never as page content. */
body.theme-modern .game-command-backdrop {
  left: 50%;
  width: var(--mobile-game-width);
  transform: translateX(-50%);
}

body.theme-modern .game-command-window {
  top: auto !important;
  right: auto !important;
  bottom: 0 !important;
  left: 50% !important;
  width: var(--mobile-game-width) !important;
  height: min(88dvh, 820px) !important;
  padding: 13px 10px max(16px, env(safe-area-inset-bottom)) !important;
  border: 4px solid white !important;
  border-bottom: 0 !important;
  border-radius: 34px 34px 0 0 !important;
  background: linear-gradient(155deg, var(--game-surface), color-mix(in srgb, var(--game-surface) 84%, var(--game-accent))) !important;
  opacity: 1;
  transform: translateX(-50%) !important;
}

body.theme-modern.command-panel-collapsed .game-command-window { opacity: 0; pointer-events: none; transform: translate(-50%, 105%) !important; }
body.theme-modern .game-command-titlebar { padding: 0 2px 10px; }
body.theme-modern .game-command-title-icon { background: color-mix(in srgb, var(--game-accent) 20%, white); }
body.theme-modern .game-command-titlebar > button i { display: none; }
body.theme-modern .game-command-titlebar > button::before { content: "✕"; color: white; font-size: 1rem; font-weight: 900; }
body.theme-modern .game-command-window #mainGameTabs { padding: 5px !important; border: 2px solid white !important; border-radius: 18px !important; background: rgba(11,48,62,.1) !important; box-shadow: none !important; }
body.theme-modern .game-command-window #mainGameTabs .nav-link { min-height: 40px; border-radius: 14px !important; font-size: .66rem; }
body.theme-modern .game-command-window #mainGameTabs .nav-link.active { color: white; background: linear-gradient(180deg, var(--game-accent), var(--game-accent-deep)); box-shadow: 0 4px 0 color-mix(in srgb, var(--game-accent-deep) 78%, #061a25); }
body.theme-modern .game-command-window #game-command-panel { overflow-y: auto !important; }
body.theme-modern .game-command-window #tab-market.show.active { display: flex !important; flex-direction: column; gap: 9px; overflow-y: auto; }
body.theme-modern .game-command-window #tab-market > .accordion { flex: 1 0 285px; margin: 0 !important; }
body.theme-modern .game-command-window #tab-market > .row,
body.theme-modern .game-command-window #tab-market > .price-slider-container { flex: 0 0 auto; margin: 0 !important; }
body.theme-modern .game-command-window .accordion-item,
body.theme-modern .game-command-window .price-slider-container,
body.theme-modern .game-command-window .alert { border: 2px solid rgba(255,255,255,.92) !important; border-radius: 20px !important; background: rgba(255,255,255,.72) !important; box-shadow: 0 5px 0 rgba(13,75,83,.12) !important; }
body.theme-modern .game-command-window .btn { border: 2px solid rgba(255,255,255,.9) !important; border-radius: 14px !important; box-shadow: 0 4px 0 rgba(8,49,61,.18) !important; font-family: 'Sarabun', sans-serif; font-weight: 800; }

body.theme-modern #gameMenuOffcanvas {
  right: auto;
  left: 50%;
  width: var(--mobile-game-width);
  max-width: 480px !important;
  height: 88dvh !important;
  margin: 0 !important;
  border: 4px solid white;
  border-bottom: 0;
  border-radius: 34px 34px 0 0;
  transform: translate(-50%, 100%);
}
body.theme-modern #gameMenuOffcanvas.show,
body.theme-modern #gameMenuOffcanvas.showing { transform: translate(-50%, 0); }

body.theme-modern .modal-dialog,
body.theme-modern .swal2-popup { width: min(calc(100vw - 20px), 454px) !important; max-width: 454px !important; margin-right: auto !important; margin-left: auto !important; border: 3px solid rgba(255,255,255,.95) !important; border-radius: 28px !important; background: linear-gradient(155deg, var(--game-surface), color-mix(in srgb, var(--game-surface) 84%, var(--game-accent))) !important; box-shadow: 0 12px 0 rgba(7,51,61,.3), 0 30px 70px rgba(0,0,0,.4) !important; }
body.theme-modern .swal2-confirm,
body.theme-modern .swal2-cancel,
body.theme-modern .modal .btn { min-height: 46px; border: 2px solid rgba(255,255,255,.9) !important; border-radius: 16px !important; box-shadow: 0 4px 0 rgba(8,49,61,.25) !important; font-family: 'Sarabun', sans-serif !important; font-weight: 800 !important; }

/* Portrait title screen uses the same game world visual language. */
body.theme-modern .splash-overlay {
  right: auto !important;
  left: 50% !important;
  width: var(--mobile-game-width) !important;
  max-width: 480px !important;
  padding: 18px !important;
  justify-content: center !important;
  overflow: hidden;
  background-image: linear-gradient(180deg, rgba(7,27,37,.08), rgba(4,20,29,.76)), url('/assets/images/store-boba-portrait-v1.png') !important;
  background-position: center top !important;
  transform: translateX(-50%);
  box-shadow: 0 0 70px rgba(0,0,0,.68);
}
body.theme-modern .splash-content { z-index: 9; width: 100% !important; margin: auto 0 9vh !important; padding: 20px 17px !important; align-items: center !important; text-align: center; border: 3px solid rgba(255,255,255,.76); border-radius: 30px; background: rgba(7,39,49,.82) !important; box-shadow: 0 10px 0 rgba(2,19,27,.6), 0 28px 60px rgba(0,0,0,.38); backdrop-filter: blur(14px); }
body.theme-modern .splash-title { font-size: clamp(3rem, 17vw, 5.2rem); }
body.theme-modern .splash-subtitle { max-width: 370px; font-size: .72rem; }
body.theme-modern .splash-feature-row { justify-content: center; }
body.theme-modern .splash-character { display: none !important; }
body.theme-modern .game-start-button { width: min(100%, 270px) !important; }

@media (max-height: 720px) {
  body.theme-modern .world-mode-card { top: 105px !important; }
  .world-store-plaque { top: 155px; }
  body.theme-modern .game-world-stage .world-character-player { height: 43% !important; }
  body.theme-modern .game-world-stage .world-dialogue { bottom: 29% !important; }
  .world-hotspot-market { top: 36%; }
  .world-hotspot-lab { top: 50%; }
}

@media (min-width: 481px) {
  body.theme-modern .main-container,
  body.theme-modern .splash-overlay { border-radius: 28px; }
  body.theme-modern .main-container { height: calc(100dvh - 20px) !important; margin-top: 10px !important; }
  body.theme-modern .game-world-stage { border-radius: 28px !important; }
  body.theme-modern .scroll-x-container { top: 67px !important; }
  body.theme-modern .world-topline { top: 20px !important; }
  body.theme-modern .world-mode-card { top: 131px !important; }
  .world-store-plaque { top: 190px; }
}

@media (prefers-reduced-motion: reduce) {
  .world-hotspot,
  .console-online i { animation: none !important; }
}


/* UI layer 3: game-kawaii-v6.css */
/* Data Pop V6 — 2D kawaii shop-tycoon skin inspired by the supplied references. */
*, *::before, *::after { box-sizing: border-box; }
html, body.theme-modern { margin: 0 !important; }
.d-none { display: none !important; }
.modal:not(.show) { display: none !important; }
.offcanvas { position: fixed; z-index: 1045; max-width: 100%; }
.offcanvas-bottom { right: 0; bottom: 0; left: 0; transform: translateY(100%); }
.offcanvas:not(.show) { visibility: hidden !important; }
.offcanvas.show { visibility: visible; transform: none; }
.collapse:not(.show) { display: none; }
.tab-pane:not(.active) { display: none; }
.splash-hidden { visibility: hidden !important; }

body.theme-modern {
  --k-ink: #6d3740;
  --k-line: #75404a;
  --k-cream: #fff5df;
  --k-pink: #ff7fab;
  --k-pink-deep: #df4f83;
  --k-blue: #76dceb;
  --k-blue-deep: #3ca8bb;
  --k-lime: #bce96d;
  --k-yellow: #ffd76d;
  --k-lilac: #d49be9;
  --game-accent: var(--k-pink);
  --game-accent-deep: var(--k-pink-deep);
  --game-highlight: var(--k-yellow);
  --game-surface: rgba(255,245,223,.98);
  --game-panel: rgba(255,236,218,.98);
  --game-glow: rgba(255,126,171,.38);
  background: repeating-linear-gradient(90deg, #f5c4aa 0 52px, #e7b391 52px 104px, #aad7d2 104px 156px) !important;
}

body.theme-modern[data-product-type="EXPENSIVE"] {
  --game-accent: var(--k-blue);
  --game-accent-deep: var(--k-blue-deep);
  --game-highlight: #ffae7d;
  --game-glow: rgba(85,200,225,.42);
}

body.theme-modern::before { background: rgba(116,64,74,.2) !important; }
body.theme-modern::after { background: var(--game-glow) !important; }

body.theme-modern .main-container {
  background: #f9d7ba !important;
  box-shadow: 0 0 0 5px #4e2933, 0 0 0 9px #f8aec1, 0 18px 70px rgba(65,31,40,.55) !important;
}

body.theme-modern .game-world-stage,
body.theme-modern .game-world-stage[data-product="CHEAP"],
body.theme-modern .game-world-stage[data-product="CHEAP"][data-mode] {
  background-image: linear-gradient(180deg, rgba(255,255,255,.02) 67%, rgba(110,60,62,.16) 100%), url('/assets/images/store-boba-kawaii-v1.png') !important;
  background-position: center top !important;
}

body.theme-modern .game-world-stage[data-product="EXPENSIVE"],
body.theme-modern .game-world-stage[data-product="EXPENSIVE"][data-mode] {
  background-image: linear-gradient(180deg, rgba(255,255,255,.02) 67%, rgba(66,72,94,.18) 100%), url('/assets/images/store-it-kawaii-v1.png') !important;
  background-position: center top !important;
  filter: none !important;
}

body.theme-modern .game-world-stage::before { background: linear-gradient(180deg, rgba(255,246,225,.18), transparent 24% 80%, rgba(93,48,57,.16)) !important; }
body.theme-modern .game-world-stage::after { background: none !important; }
body.theme-modern .game-world-stage[data-weather="RAINY"]::after,
body.theme-modern .game-world-stage[data-weather="STORM"]::after {
  background: repeating-linear-gradient(105deg, transparent 0 17px, rgba(87,158,200,.17) 18px 20px, transparent 21px 36px), rgba(75,102,138,.12) !important;
}

/* Candy HUD */
body.theme-modern .world-topline {
  top: max(8px, env(safe-area-inset-top)) !important;
  left: 9px !important;
  gap: 5px !important;
  width: auto !important;
  max-width: calc(100% - 96px) !important;
}

body.theme-modern .world-chip {
  min-height: 39px !important;
  padding: 5px 9px !important;
  color: var(--k-ink) !important;
  border: 3px solid var(--k-line) !important;
  border-radius: 16px !important;
  background: var(--k-cream) !important;
  box-shadow: inset 0 2px 0 white, 0 4px 0 #c87982 !important;
  font-size: .58rem !important;
  font-weight: 900 !important;
}

body.theme-modern .top-btn-group { top: max(8px, env(safe-area-inset-top)) !important; }
body.theme-modern .top-btn-group { bottom: auto !important; }
body.theme-modern .btn-circle-icon {
  width: 38px !important;
  height: 38px !important;
  color: var(--k-ink) !important;
  border: 3px solid var(--k-line) !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #a7eff8, var(--k-blue)) !important;
  box-shadow: inset 0 2px 0 white, 0 4px 0 var(--k-blue-deep) !important;
  font-size: 1rem;
}

body.theme-modern .scroll-x-container {
  top: calc(max(8px, env(safe-area-inset-top)) + 48px) !important;
  gap: 4px !important;
  width: min(calc(100% - 14px), 466px) !important;
}

body.theme-modern .scroll-card {
  height: 49px !important;
  border: 3px solid var(--k-line) !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #fffdf6, #fff1d5) !important;
  box-shadow: inset 0 2px 0 white, 0 4px 0 #d28b86 !important;
}

body.theme-modern .card-stat .text-xxs { color: #9a6065 !important; font-size: .4rem !important; font-weight: 900 !important; }
body.theme-modern .card-stat h5 { color: var(--k-ink) !important; font-size: .68rem !important; font-weight: 900 !important; }

.world-store-plaque {
  z-index: 20 !important;
  top: calc(max(8px, env(safe-area-inset-top)) + 105px) !important;
  left: 50% !important;
  min-width: 72% !important;
  padding: 8px 15px !important;
  justify-content: center;
  color: white !important;
  border: 4px solid var(--k-line) !important;
  border-radius: 20px 20px 26px 26px !important;
  background: linear-gradient(180deg, #ff9dbd, var(--k-pink)) !important;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.65), 0 6px 0 var(--k-pink-deep), 0 11px 20px rgba(104,50,62,.22) !important;
}

body.theme-modern[data-product-type="EXPENSIVE"] .world-store-plaque { background: linear-gradient(180deg, #a9eef6, var(--k-blue)) !important; box-shadow: inset 0 3px 0 rgba(255,255,255,.65), 0 6px 0 var(--k-blue-deep), 0 11px 20px rgba(63,105,119,.22) !important; }
.world-store-plaque > span:first-child { background: rgba(255,255,255,.38) !important; }
.world-store-plaque small { color: rgba(255,255,255,.85) !important; }
.world-store-plaque b { font-size: .76rem !important; text-shadow: 0 2px 0 rgba(91,42,53,.32); }

body.theme-modern .world-mode-card {
  z-index: 18 !important;
  top: calc(max(8px, env(safe-area-inset-top)) + 164px) !important;
  right: 14px !important;
  left: 14px !important;
  padding: 6px 10px !important;
  color: var(--k-ink) !important;
  border: 3px solid var(--k-line) !important;
  border-radius: 16px !important;
  background: rgba(255,248,229,.95) !important;
  box-shadow: inset 0 2px 0 white, 0 4px 0 #d29a87 !important;
}

body.theme-modern .world-mode-icon { width: 29px !important; height: 29px !important; background: #dff6f3 !important; }
body.theme-modern .world-mode-card b { font-size: .62rem !important; }
body.theme-modern .world-mode-card small { color: #9a656b !important; font-size: .48rem !important; }

/* Current-orders board */
.daily-order-board {
  position: absolute;
  z-index: 17;
  top: calc(max(8px, env(safe-area-inset-top)) + 215px);
  left: 50%;
  width: calc(100% - 28px);
  padding: 22px 9px 9px;
  color: var(--k-ink);
  border: 4px solid var(--k-line);
  border-radius: 24px;
  background: rgba(255,239,222,.96);
  box-shadow: inset 0 3px 0 white, 0 7px 0 #c9827e, 0 15px 25px rgba(104,56,63,.2);
  transform: translateX(-50%);
}

.daily-board-ribbon {
  position: absolute;
  top: -19px;
  left: 50%;
  display: flex;
  min-width: 58%;
  min-height: 38px;
  padding: 5px 13px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--k-ink);
  border: 4px solid var(--k-line);
  border-radius: 999px;
  background: linear-gradient(180deg, #b4f2f7, var(--k-blue));
  box-shadow: inset 0 2px 0 white, 0 4px 0 var(--k-blue-deep);
  transform: translateX(-50%);
  font-size: .7rem;
}

.daily-order-row {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  grid-template-rows: auto 7px;
  gap: 2px 7px;
  min-height: 57px;
  margin-top: 7px;
  padding: 6px 8px;
  align-items: center;
  border: 3px solid var(--k-line);
  border-radius: 16px;
  background: #fffaf0;
  box-shadow: inset 0 2px 0 white, 0 3px 0 #e5aaa0;
}

.daily-item-icon { display: grid; grid-row: 1 / 3; width: 37px; height: 37px; place-items: center; border: 2px solid #d6848c; border-radius: 12px; background: #ffe0e9; font-size: 1.2rem; }
.daily-order-info { display: flex; min-width: 0; flex-direction: column; line-height: 1.1; }
.daily-order-info b { font-size: .62rem; }
.daily-order-info small { margin-top: 2px; color: #a0696e; font-size: .46rem; }
.daily-order-state { min-width: 54px; padding: 4px 7px; color: #7a3e4a; border: 2px solid #d56a8d; border-radius: 999px; background: #ffb1c8; font-size: .48rem; font-style: normal; font-weight: 900; text-align: center; }
.daily-progress { position: relative; grid-column: 2 / 4; display: block; width: 100%; height: 7px; overflow: hidden; border: 1px solid #a85e68; border-radius: 999px; background: #ead4ce; }
.daily-progress > i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #64d6bd, #8be7c9); transition: width .35s ease; }
.daily-order-row:nth-of-type(3) .daily-progress > i { background: linear-gradient(90deg, #ff7daa, #ffb2c8); }

/* Main character behind the shop counter */
body.theme-modern .game-world-stage .world-character-player {
  z-index: 10 !important;
  right: auto !important;
  bottom: 8.5% !important;
  left: 50% !important;
  width: 74% !important;
  height: auto !important;
  max-height: 43% !important;
  object-fit: contain !important;
  transform: translateX(-50%);
  filter: drop-shadow(0 8px 0 rgba(117,64,74,.18)) drop-shadow(0 13px 12px rgba(82,42,51,.22)) !important;
}

@keyframes worldCharacterIdle {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}

@keyframes v5CharacterPose {
  0% { opacity: .55; transform: translateX(-50%) translateY(6px) scale(.96); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

body.theme-modern .game-world-stage .world-dialogue {
  z-index: 16 !important;
  top: 53% !important;
  right: auto !important;
  bottom: auto !important;
  left: 12px !important;
  width: 62% !important;
  max-height: 58px !important;
  padding: 8px 10px !important;
  color: var(--k-ink) !important;
  border: 3px solid var(--k-line) !important;
  border-radius: 18px 18px 6px 18px !important;
  background: #fff9e9 !important;
  box-shadow: inset 0 2px 0 white, 0 4px 0 #cf8985 !important;
  font-size: .55rem !important;
}

body.theme-modern .game-world-stage .world-dialogue::after { border-color: var(--k-line) !important; background: #fff9e9 !important; }

/* Five-button game navigation like a handheld tycoon game. */
body.theme-modern .fixed-bottom.game-action-dock {
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 4px !important;
  width: min(calc(100% - 8px), 474px) !important;
  padding: 6px 5px 7px !important;
  border: 4px solid var(--k-line) !important;
  border-radius: 24px 24px 0 0 !important;
  background: rgba(255,234,212,.97) !important;
  box-shadow: inset 0 3px 0 white, 0 -5px 0 rgba(218,126,129,.45), 0 -12px 24px rgba(102,50,61,.16) !important;
}

body.theme-modern .game-dock-btn,
body.theme-modern .game-dock-primary {
  height: 61px !important;
  margin: 0 !important;
  padding: 4px 1px !important;
  color: var(--k-ink) !important;
  border: 3px solid var(--k-line) !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #aef2f8, var(--k-blue)) !important;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.7), 0 4px 0 var(--k-blue-deep) !important;
  font-size: .45rem !important;
  text-shadow: 0 1px 0 white;
}

body.theme-modern .game-dock-btn:nth-child(2) { background: linear-gradient(180deg, #ffc0d3, var(--k-pink)) !important; box-shadow: inset 0 3px 0 rgba(255,255,255,.7), 0 4px 0 var(--k-pink-deep) !important; }
body.theme-modern .game-dock-primary { background: linear-gradient(180deg, #ffe58f, var(--k-yellow)) !important; box-shadow: inset 0 3px 0 rgba(255,255,255,.7), 0 4px 0 #d49b43 !important; }
body.theme-modern .game-dock-btn:nth-child(4) { background: linear-gradient(180deg, #d8f7a1, var(--k-lime)) !important; box-shadow: inset 0 3px 0 rgba(255,255,255,.7), 0 4px 0 #83b548 !important; }
body.theme-modern .game-dock-btn:nth-child(5) { background: linear-gradient(180deg, #edc2fa, var(--k-lilac)) !important; box-shadow: inset 0 3px 0 rgba(255,255,255,.7), 0 4px 0 #a469bd !important; }
body.theme-modern .game-dock-btn:active { transform: translateY(4px) !important; box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 1px 0 var(--k-line) !important; }
body.theme-modern .game-action-icon { font-size: 1.45rem !important; filter: drop-shadow(0 2px 0 rgba(255,255,255,.7)); }

/* Menus and detailed systems inherit the same candy-toy language. */
.quick-command-menu,
body.theme-modern .game-command-window,
body.theme-modern #gameMenuOffcanvas {
  color: var(--k-ink) !important;
  border-color: var(--k-line) !important;
  background: linear-gradient(180deg, #fff7e7, #ffe9d7) !important;
  box-shadow: inset 0 3px 0 white, 0 -9px 0 #d78486, 0 -22px 48px rgba(85,39,50,.34) !important;
}

body.theme-modern.quick-command-open .quick-command-menu {
  transform: translate(-50%, 0) !important;
}

.quick-command-header h2,
body.theme-modern .game-command-titlebar strong { color: var(--k-ink) !important; }
.quick-command-header small,
body.theme-modern .game-command-titlebar small { color: var(--k-pink-deep) !important; }
.quick-command-avatar { border-color: var(--k-line) !important; background: #ffe1e9 !important; box-shadow: 0 4px 0 #d17b88 !important; }
.quick-command-header > button,
body.theme-modern .game-command-titlebar > button { border: 3px solid var(--k-line) !important; background: linear-gradient(180deg, #ff9bac, #f0637d) !important; box-shadow: 0 4px 0 #bd4860 !important; }

.quick-command-grid > button {
  color: var(--k-ink) !important;
  border-color: var(--k-line) !important;
  background: linear-gradient(180deg, #c9f6f8, #a7e7eb) !important;
  box-shadow: inset 0 3px 0 white, 0 5px 0 #6fb6bf !important;
}
.quick-command-grid > button:nth-child(2),
.quick-command-grid > button:nth-child(5) { background: linear-gradient(180deg, #ffd0dc, #ffabc2) !important; box-shadow: inset 0 3px 0 white, 0 5px 0 #d96e92 !important; }
.quick-command-grid > button:nth-child(3),
.quick-command-grid > button:nth-child(6) { background: linear-gradient(180deg, #def6b0, #c1e77a) !important; box-shadow: inset 0 3px 0 white, 0 5px 0 #8eb94d !important; }
.quick-command-grid > button b { color: var(--k-ink); }
.quick-command-grid > button small { color: #9b646b; }
.quick-command-tools { border-color: #e0a09c !important; }

body.theme-modern .game-command-window #mainGameTabs { border-color: var(--k-line) !important; background: #f8d9d0 !important; }
body.theme-modern .game-command-window #mainGameTabs .nav-link { color: var(--k-ink) !important; }
body.theme-modern .game-command-window #mainGameTabs .nav-link.active { color: var(--k-ink) !important; border: 2px solid var(--k-line) !important; background: linear-gradient(180deg, #9cecf3, var(--k-blue)) !important; box-shadow: 0 4px 0 var(--k-blue-deep) !important; }
body.theme-modern .game-command-window .accordion-item,
body.theme-modern .game-command-window .price-slider-container,
body.theme-modern .game-command-window .alert { border-color: #bd737a !important; background: #fffaf0 !important; box-shadow: 0 4px 0 #dfa29a !important; }

body.theme-modern .swal2-popup,
body.theme-modern .modal-dialog { color: var(--k-ink) !important; border-color: var(--k-line) !important; background: linear-gradient(180deg, #fff8e9, #ffe5d8) !important; box-shadow: inset 0 3px 0 white, 0 8px 0 #ce7d82, 0 25px 60px rgba(82,36,47,.4) !important; }
body.theme-modern .swal2-title { color: var(--k-ink) !important; }
body.theme-modern .swal2-confirm { color: var(--k-ink) !important; background: linear-gradient(180deg, #b9f2f4, var(--k-blue)) !important; border-color: var(--k-line) !important; }
body.theme-modern .advisor-popup-message { color: var(--k-ink) !important; border: 3px solid #c77e85; background: #fffaf0 !important; }
body.theme-modern .advisor-actions button { color: var(--k-ink) !important; border-color: var(--k-line) !important; background: #ffd0dc !important; box-shadow: 0 5px 0 #d6768e !important; }

body.theme-modern .splash-overlay {
  background-image: linear-gradient(180deg, rgba(255,243,222,.08), rgba(110,57,66,.42)), url('/assets/images/store-boba-kawaii-v1.png') !important;
}
body.theme-modern .splash-character {
  z-index: 8 !important;
  right: auto !important;
  bottom: 51% !important;
  left: 50% !important;
  display: block !important;
  width: auto !important;
  height: min(32vh, 285px) !important;
  opacity: 1 !important;
  transform: translateX(-50%);
  filter: drop-shadow(0 8px 0 rgba(117,64,74,.16)) drop-shadow(0 14px 14px rgba(82,42,51,.22)) !important;
}
body.theme-modern .splash-content { color: var(--k-ink) !important; border: 4px solid var(--k-line) !important; background: rgba(255,240,222,.94) !important; box-shadow: inset 0 3px 0 white, 0 8px 0 #d47d87, 0 26px 55px rgba(84,38,49,.35) !important; }
body.theme-modern .splash-title { color: var(--k-pink) !important; -webkit-text-stroke: 2px var(--k-line); text-shadow: 0 5px 0 #fff2d8, 0 8px 0 var(--k-pink-deep) !important; }
body.theme-modern .splash-subtitle,
body.theme-modern .splash-hint { color: var(--k-ink) !important; }
body.theme-modern .splash-feature { color: var(--k-ink) !important; border: 2px solid var(--k-line) !important; background: #d9f5ef !important; }
body.theme-modern .game-start-button { color: var(--k-ink) !important; border: 4px solid var(--k-line) !important; background: linear-gradient(180deg, #ffe692, var(--k-yellow)) !important; box-shadow: inset 0 3px 0 white, 0 6px 0 #d29a46 !important; }

@media (max-height: 760px) {
  .quick-command-menu { transition: none !important; }
  .world-store-plaque { top: 109px !important; }
  body.theme-modern .world-mode-card { top: 166px !important; }
  .daily-order-board { top: 216px; transform: translateX(-50%) scale(.92); transform-origin: top center; }
  body.theme-modern .game-world-stage .world-dialogue { top: max(402px, 62%) !important; }
  body.theme-modern .game-world-stage .world-character-player { max-height: 39% !important; }
}

@media (max-width: 360px) {
  body.theme-modern .world-topline { width: 145px !important; }
  body.theme-modern .world-topline .world-chip:nth-child(2) { width: 40px; padding: 5px !important; justify-content: center; }
  body.theme-modern #world-weather-label { display: none !important; }
}

@media (min-width: 481px) {
  .world-store-plaque { top: 123px !important; }
  body.theme-modern .world-mode-card { top: 182px !important; }
  .daily-order-board { top: 233px; }
}


/* UI layer 4: game-responsive-v7.css */
/* Data Pop V7 — device-aware layout and interaction polish. */
:root {
  --game-radius-panel: 28px;
  --game-radius-card: 18px;
  --game-primary: #55cedd;
  --game-primary-deep: #2996aa;
  --game-danger: #d94e69;
  --game-neutral: #fff7e8;
}

/* Information must not look like a button. */
.strategy-summary,
.stock-input-card {
  border: 0 !important;
  box-shadow: 0 3px 0 rgba(117, 64, 74, .12) !important;
}

.strategy-info-grid .strategy-info {
  min-height: 62px;
  border: 0 !important;
  background: rgba(246, 241, 232, .72) !important;
  box-shadow: none !important;
}

.wallet-status {
  padding: 4px 4px 10px !important;
  color: var(--k-ink) !important;
  border-bottom: 1px solid rgba(117, 64, 74, .18) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.stock-stepper {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: stretch;
}

.stock-stepper button,
.stock-stepper input {
  min-height: 52px;
  border: 2px solid #d99aa2 !important;
  border-radius: 15px !important;
}

.stock-stepper button {
  color: var(--k-ink);
  background: #d9f4f3;
  font-size: 1.45rem;
  font-weight: 900;
  box-shadow: 0 3px 0 #83bdc3;
}

.stock-stepper input {
  background: #fff !important;
  box-shadow: inset 0 2px 5px rgba(117, 64, 74, .09) !important;
}

.settings-advanced-toggle {
  color: #80636a !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: .72rem !important;
}

.settings-danger-zone {
  padding: 10px;
  color: #9e344a;
  border: 1px solid #e7a5b1;
  border-radius: 16px;
  background: #fff0f2;
  font-size: .7rem;
}

/* Collapsible in-world status drawer. */
.daily-order-board {
  transition: padding .24s ease, background .24s ease, box-shadow .24s ease;
}

.daily-board-ribbon {
  cursor: pointer;
}

.daily-board-chevron {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .7);
  transition: transform .22s ease;
}

.daily-board-content {
  max-height: 150px;
  overflow: hidden;
  opacity: 1;
  transition: max-height .28s ease, opacity .2s ease, margin .28s ease;
}

.daily-order-board.is-collapsed {
  padding: 0 !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: none;
}

.daily-order-board.is-collapsed .daily-board-ribbon {
  pointer-events: auto;
}

.daily-order-board.is-collapsed .daily-board-content {
  max-height: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.daily-order-board:not(.is-collapsed) .daily-board-chevron {
  transform: rotate(180deg);
}

/* One navigation color system: only the active command is colourful. */
body.theme-modern .game-dock-btn,
body.theme-modern .game-dock-primary,
body.theme-modern .game-dock-btn:nth-child(2),
body.theme-modern .game-dock-btn:nth-child(4),
body.theme-modern .game-dock-btn:nth-child(5) {
  color: #77505a !important;
  background: linear-gradient(180deg, #fffdf6, #f5ead8) !important;
  box-shadow: inset 0 2px 0 #fff, 0 4px 0 #cca8a2 !important;
  filter: saturate(.74);
}

body.theme-modern .game-dock-btn.is-active {
  color: var(--k-ink) !important;
  background: linear-gradient(180deg, #aaf1f4, var(--game-primary)) !important;
  box-shadow: inset 0 3px 0 #fff, 0 4px 0 var(--game-primary-deep) !important;
  filter: none;
}

/* Keep market action controls in their own layout cells. */
body.theme-modern .game-command-window #tab-market > .row {
  align-items: stretch !important;
}

body.theme-modern .game-command-window .action-card-live {
  position: static !important;
  inset: auto !important;
  min-height: 72px !important;
  transform: none !important;
}

/* Consistent modal geometry and close control. */
body.theme-modern .swal2-popup,
body.theme-modern .modal-content,
body.theme-modern #gameMenuOffcanvas,
body.theme-modern .game-command-window,
.quick-command-menu {
  border-radius: var(--game-radius-panel) var(--game-radius-panel) 0 0 !important;
}

body.theme-modern .swal2-close,
body.theme-modern .btn-close,
body.theme-modern .game-command-titlebar > button,
.quick-command-header > button {
  width: 42px !important;
  height: 42px !important;
  color: #fff !important;
  border: 2px solid #8f4454 !important;
  border-radius: 14px !important;
  background-color: #ef7088 !important;
  box-shadow: 0 4px 0 #b94960 !important;
}

/* Feature chips on the title screen are labels, not controls. */
body.theme-modern .splash-feature {
  border: 0 !important;
  background: rgba(255, 255, 255, .6) !important;
  box-shadow: none !important;
}

/* Portrait phones: compact HUD, side speech bubble, internally scrolling drawers. */
@media (max-width: 899px) {
  .daily-order-board {
    top: calc(max(8px, env(safe-area-inset-top)) + 234px) !important;
  }

  body.theme-modern .scroll-card {
    height: 45px !important;
    border-width: 2px !important;
    border-radius: 14px !important;
    background: rgba(255, 250, 235, .86) !important;
    box-shadow: inset 0 1px 0 #fff, 0 3px 0 rgba(117, 64, 74, .3) !important;
  }

  body.theme-modern .card-stat .text-xxs { font-size: .39rem !important; }
  body.theme-modern .card-stat h5 { font-size: .75rem !important; font-weight: 900 !important; }

  body.theme-modern .game-world-stage .world-dialogue {
    top: auto !important;
    right: auto !important;
    bottom: calc(max(104px, env(safe-area-inset-bottom) + 96px)) !important;
    left: 9px !important;
    width: 47% !important;
    max-width: 205px !important;
  }

  body.theme-modern .game-command-window,
  body.theme-modern #gameMenuOffcanvas,
  .quick-command-menu {
    max-height: calc(100dvh - max(10px, env(safe-area-inset-top))) !important;
    overflow: hidden !important;
  }

  body.theme-modern .game-command-window #game-command-panel,
  body.theme-modern #gameMenuOffcanvas .offcanvas-body,
  .quick-command-menu {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .quick-command-menu { overflow-y: auto !important; }
}

@media (max-height: 680px) and (max-width: 899px) {
  .daily-order-board { top: 235px !important; }
  body.theme-modern .game-world-stage .world-dialogue {
    bottom: 96px !important;
    max-height: 48px !important;
  }

  .quick-command-header { margin-bottom: 8px; }
  .quick-command-grid { gap: 6px; }
  .quick-command-grid > button { min-height: 70px; padding: 6px; }
  .quick-command-grid > button small { display: none; }
  .quick-command-tools { margin-top: 10px; padding-top: 8px; }
}

/* Desktop/web: a true landscape playfield rather than a stretched phone. */
@media (min-width: 900px) {
  :root { --mobile-game-width: min(calc(100vw - 24px), 1280px); }

  body.theme-modern .main-container {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    width: var(--mobile-game-width) !important;
    max-width: 1280px !important;
    height: min(calc(100dvh - 24px), 780px) !important;
    margin: 0 !important;
    border-radius: 34px !important;
    transform: translate(-50%, -50%);
  }

  body.theme-modern .game-world-stage,
  body.theme-modern .game-world-stage[data-product="CHEAP"],
  body.theme-modern .game-world-stage[data-product="CHEAP"][data-mode] {
    border-radius: 34px !important;
    background-image: linear-gradient(90deg, rgba(255, 247, 226, .04) 35%, rgba(104, 57, 66, .16) 100%), url('/assets/images/market-scene-v2.png') !important;
    background-position: center center !important;
  }

  body.theme-modern .game-world-stage[data-product="EXPENSIVE"],
  body.theme-modern .game-world-stage[data-product="EXPENSIVE"][data-mode] {
    background-image: linear-gradient(90deg, rgba(235, 251, 255, .03) 35%, rgba(38, 60, 94, .18) 100%), url('/assets/images/store-it-tycoon-v1.png') !important;
  }

  body.theme-modern .world-topline {
    position: absolute !important;
    top: 18px !important;
    left: 20px !important;
  }

  body.theme-modern .top-btn-group {
    top: max(30px, calc((100dvh - 780px) / 2 + 18px)) !important;
    right: max(30px, calc((100vw - 1280px) / 2 + 30px)) !important;
  }

  body.theme-modern .scroll-x-container {
    position: absolute !important;
    top: 18px !important;
    left: 50% !important;
    width: min(54%, 660px) !important;
  }

  body.theme-modern .scroll-card { height: 51px !important; }

  .world-store-plaque {
    top: 88px !important;
    left: 32px !important;
    min-width: 320px !important;
    width: 34% !important;
    transform: none !important;
  }

  body.theme-modern .world-mode-card {
    top: 151px !important;
    right: auto !important;
    left: 32px !important;
    width: 34% !important;
  }

  .daily-order-board,
  .daily-order-board.is-collapsed {
    top: 224px !important;
    right: 34px !important;
    left: auto !important;
    width: min(38%, 430px) !important;
    padding: 22px 11px 11px !important;
    border-color: var(--k-line) !important;
    background: rgba(255, 239, 222, .96) !important;
    box-shadow: inset 0 3px 0 #fff, 0 7px 0 #c9827e, 0 15px 25px rgba(104, 56, 63, .2) !important;
    transform: none !important;
    pointer-events: auto;
  }

  .daily-order-board.is-collapsed .daily-board-content {
    max-height: 150px;
    opacity: 1;
    pointer-events: auto;
  }

  .daily-board-ribbon { pointer-events: none !important; }
  .daily-board-chevron { display: none; }

  body.theme-modern .game-world-stage .world-character-player {
    bottom: 3% !important;
    left: 26% !important;
    width: min(34%, 420px) !important;
    max-height: 58% !important;
  }

  body.theme-modern .game-world-stage .world-dialogue {
    top: auto !important;
    right: auto !important;
    bottom: 25% !important;
    left: 43% !important;
    width: min(25%, 290px) !important;
    max-width: 290px !important;
  }

  body.theme-modern .fixed-bottom.game-action-dock {
    bottom: max(18px, env(safe-area-inset-bottom)) !important;
    width: min(58%, 700px) !important;
    border-radius: 25px !important;
  }

  body.theme-modern .game-command-backdrop,
  .quick-command-backdrop {
    width: 100vw !important;
  }

  body.theme-modern .game-command-window {
    top: 50% !important;
    bottom: auto !important;
    width: min(calc(100vw - 56px), 980px) !important;
    height: min(calc(100dvh - 56px), 720px) !important;
    border: 4px solid var(--k-line) !important;
    border-radius: var(--game-radius-panel) !important;
    transform: translate(-50%, -50%) !important;
  }

  body.theme-modern.command-panel-collapsed .game-command-window {
    transform: translate(-50%, calc(-50% + 110vh)) !important;
  }

  .quick-command-menu {
    top: 50%;
    bottom: auto;
    width: min(calc(100vw - 56px), 820px);
    max-height: min(calc(100dvh - 56px), 700px);
    border: 4px solid var(--k-line) !important;
    border-radius: var(--game-radius-panel) !important;
    transform: translate(-50%, 120vh);
  }

  body.theme-modern.quick-command-open .quick-command-menu {
    transform: translate(-50%, -50%) !important;
  }

  .quick-command-grid { grid-template-columns: repeat(3, 1fr); }

  body.theme-modern #gameMenuOffcanvas {
    top: 50% !important;
    bottom: auto !important;
    width: min(calc(100vw - 56px), 900px) !important;
    max-width: 900px !important;
    height: min(calc(100dvh - 56px), 700px) !important;
    border: 4px solid var(--k-line) !important;
    border-radius: var(--game-radius-panel) !important;
    transform: translate(-50%, 120vh);
  }

  body.theme-modern #gameMenuOffcanvas.show,
  body.theme-modern #gameMenuOffcanvas.showing {
    transform: translate(-50%, -50%);
  }

  body.theme-modern .swal2-popup,
  body.theme-modern .modal-content {
    border-radius: var(--game-radius-panel) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .daily-order-board,
  .daily-board-content,
  .daily-board-chevron { transition: none !important; }
}


/* UI layer 5: game-unified-v8.css */
/* Data Pop V8 — unified HUD, compact panels, safe-area sheets and livelier character. */

/* Unified business card replaces three floating panels. */
body.theme-modern .world-unified-dashboard {
  position: absolute;
  z-index: 22;
  top: calc(max(8px, env(safe-area-inset-top)) + 101px);
  right: 16px;
  left: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(105px, .75fr);
  grid-template-areas:
    "store mode"
    "board board";
  gap: 7px;
  padding: 8px;
  color: var(--k-ink);
  border: 3px solid var(--k-line);
  border-radius: 22px;
  background: rgba(255, 247, 228, .94);
  box-shadow: inset 0 2px 0 #fff, 0 5px 0 #cc8181, 0 12px 22px rgba(95, 48, 58, .18);
  backdrop-filter: blur(9px);
}

body.theme-modern .world-unified-dashboard .world-store-plaque,
body.theme-modern .world-unified-dashboard .world-mode-card,
body.theme-modern .world-unified-dashboard .daily-order-board {
  position: static !important;
  inset: auto !important;
  min-width: 0 !important;
  width: auto !important;
  margin: 0 !important;
  transform: none !important;
}

body.theme-modern .world-unified-dashboard .world-store-plaque {
  grid-area: store;
  justify-content: flex-start;
  padding: 3px 5px !important;
  color: var(--k-ink) !important;
  border: 0 !important;
  border-radius: 13px !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.theme-modern .world-unified-dashboard .world-store-plaque > span:first-child {
  width: 34px;
  height: 34px;
  background: #ffe0e9 !important;
}

body.theme-modern .world-unified-dashboard .world-store-plaque small {
  color: #ac6874 !important;
  font-size: .43rem;
}

body.theme-modern .world-unified-dashboard .world-store-plaque b {
  color: var(--k-ink);
  font-size: .72rem !important;
  text-shadow: none !important;
}

body.theme-modern .world-unified-dashboard .world-mode-card {
  grid-area: mode;
  padding: 4px 6px !important;
  border: 0 !important;
  border-radius: 13px !important;
  background: #e4f7f2 !important;
  box-shadow: none !important;
}

body.theme-modern .world-unified-dashboard .world-mode-icon {
  width: 25px !important;
  height: 25px !important;
}

body.theme-modern .world-unified-dashboard .world-mode-card b { font-size: .56rem !important; }
body.theme-modern .world-unified-dashboard .world-mode-card small { display: none; }

body.theme-modern .world-unified-dashboard .daily-order-board,
body.theme-modern .world-unified-dashboard .daily-order-board.is-collapsed {
  grid-area: board;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: auto;
}

body.theme-modern .world-unified-dashboard .daily-board-ribbon {
  position: relative;
  inset: auto;
  left: auto;
  width: 100%;
  min-width: 0;
  min-height: 33px;
  padding: 4px 10px;
  border-width: 2px;
  border-radius: 13px;
  transform: none;
  box-shadow: inset 0 2px 0 #fff, 0 3px 0 var(--k-blue-deep);
  font-size: .58rem;
  pointer-events: auto !important;
}

body.theme-modern .world-unified-dashboard .daily-board-content {
  max-height: 138px;
  margin-top: 7px;
}

body.theme-modern .world-unified-dashboard .daily-order-board.is-collapsed .daily-board-content {
  max-height: 0;
  margin-top: 0;
}

body.theme-modern .world-unified-dashboard .daily-order-row {
  min-height: 49px;
  margin-top: 5px;
  padding: 4px 7px;
  border-width: 2px;
  border-radius: 13px;
  box-shadow: none;
}

/* Status ticker stays above navigation and never covers the character's face. */
body.theme-modern .game-world-stage .world-status-ticker {
  position: absolute !important;
  z-index: 24 !important;
  top: auto !important;
  right: 16px !important;
  bottom: calc(max(88px, env(safe-area-inset-bottom) + 80px)) !important;
  left: 16px !important;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  width: auto !important;
  max-width: none !important;
  min-height: 40px;
  max-height: 52px !important;
  padding: 6px 10px !important;
  align-items: center;
  overflow: hidden;
  border: 2px solid var(--k-line) !important;
  border-radius: 14px !important;
  background: rgba(255, 249, 233, .93) !important;
  box-shadow: inset 0 2px 0 #fff, 0 4px 0 rgba(175, 96, 104, .78) !important;
  font-size: .52rem !important;
  line-height: 1.35 !important;
}

body.theme-modern .game-world-stage .world-status-ticker::after { display: none !important; }
.world-status-icon { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 9px; background: #b8edf0; }
.world-status-ticker.ticker-pop { animation: v8TickerPop .3s ease both; }
@keyframes v8TickerPop { 0% { opacity: .55; transform: translateY(5px) scale(.985); } 100% { opacity: 1; transform: none; } }

/* Micro animation for the current frame-based character rig. */
body.theme-modern .game-world-stage .world-character-player {
  animation: v8CharacterIdle 3.8s ease-in-out infinite !important;
  transform-origin: 50% 92%;
  will-change: transform, filter;
}

body.theme-modern .game-world-stage .world-character-player.pose-pop {
  animation: v8PoseChange .28s cubic-bezier(.2, .85, .24, 1.14), v8CharacterIdle 3.8s .28s ease-in-out infinite !important;
}

body.theme-modern .game-world-stage.character-is-speaking .world-character-player {
  animation: v8CharacterTalk .42s ease-in-out infinite alternate !important;
}

@keyframes v8CharacterIdle {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-.35deg); }
  50% { transform: translateX(-50%) translateY(-5px) rotate(.35deg); }
}

@keyframes v8CharacterTalk {
  from { transform: translateX(-50%) translateY(0) rotate(-.5deg) scale(1); }
  to { transform: translateX(-50%) translateY(-3px) rotate(.7deg) scale(1.012); }
}

@keyframes v8PoseChange {
  0% { opacity: .35; filter: blur(1px); transform: translateX(-50%) scale(.97); }
  100% { opacity: 1; filter: none; transform: translateX(-50%) scale(1); }
}

/* Compact navigation: icons first, text only for the active destination. */
body.theme-modern .fixed-bottom.game-action-dock {
  bottom: max(10px, env(safe-area-inset-bottom)) !important;
  gap: 5px !important;
  width: min(calc(100% - 32px), 448px) !important;
  padding: 6px !important;
  border-radius: 21px !important;
}

body.theme-modern .game-action-dock .game-dock-btn,
body.theme-modern .game-action-dock .game-dock-primary {
  height: 56px !important;
  border-width: 2px !important;
  border-radius: 15px !important;
}

body.theme-modern .game-action-dock .game-action-icon { font-size: 1.55rem !important; }
body.theme-modern .game-action-dock .game-dock-btn > span:last-child { display: none; }
body.theme-modern .game-action-dock .game-dock-btn.is-active > span:last-child {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: .42rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Safe-area modal sheets: never touch the phone's side edges. */
@media (max-width: 899px) {
  body.theme-modern .game-command-window,
  body.theme-modern #gameMenuOffcanvas,
  .quick-command-menu {
    right: auto !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    left: 50% !important;
    width: min(calc(100vw - 32px), 448px) !important;
    height: min(calc(100dvh - max(24px, env(safe-area-inset-top) + 18px)), 820px) !important;
    max-height: calc(100dvh - max(24px, env(safe-area-inset-top) + 18px)) !important;
    border: 3px solid var(--k-line) !important;
    border-radius: 27px !important;
  }

  body.theme-modern .game-command-backdrop,
  .quick-command-backdrop { width: 100vw !important; }

  body.theme-modern #gameMenuOffcanvas { transform: translate(-50%, calc(100% + 18px)); }
  body.theme-modern #gameMenuOffcanvas.show,
  body.theme-modern #gameMenuOffcanvas.showing { transform: translate(-50%, 0); }

  body.theme-modern .swal2-popup,
  body.theme-modern .modal-dialog {
    width: min(calc(100vw - 32px), 448px) !important;
    max-height: calc(100dvh - 24px) !important;
    margin: 12px auto !important;
    overflow-y: auto;
    border-radius: 27px !important;
  }

  body.theme-modern .game-world-stage .world-character-player {
    bottom: 8.5% !important;
    width: 76% !important;
    max-height: 48% !important;
  }

  /* The graph owns the visual hierarchy; supporting controls stay compact. */
  body.theme-modern .game-command-window #tab-market.show.active {
    display: flex !important;
    gap: 10px !important;
    overflow-y: auto !important;
  }

  body.theme-modern .game-command-window #tab-market > .accordion {
    flex: 0 0 auto !important;
    min-height: 0 !important;
  }

  body.theme-modern .game-command-window #tab-market .chart-container {
    height: clamp(210px, 38dvh, 330px) !important;
  }

  body.theme-modern .game-command-window #tab-market > .row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 8px;
    min-height: 62px !important;
  }

  body.theme-modern .game-command-window #tab-market > .row > .col-8,
  body.theme-modern .game-command-window #tab-market > .row > .col-4 {
    width: auto !important;
    padding: 0 !important;
  }

  body.theme-modern .game-command-window .action-card-live {
    width: 54px !important;
    min-height: 54px !important;
    padding: 4px !important;
    border-radius: 15px !important;
  }

  body.theme-modern .game-command-window .action-card-live .fw-bold { font-size: 0 !important; }
  body.theme-modern .game-command-window .action-card-live .mkt-icon-wrapper { margin: 0 !important; }
  body.theme-modern .game-command-window .action-card-live i { font-size: 1.45rem !important; }
  body.theme-modern .game-command-window .competitor-icon { font-size: 1.45rem !important; line-height: 1; }

  body.theme-modern .game-command-window .price-slider-container {
    position: relative !important;
    z-index: 1;
    min-height: 126px !important;
    padding: 13px !important;
    overflow: hidden;
  }

  body.theme-modern .game-command-window #price-slider {
    display: block;
    width: 100%;
    margin: 14px 0 10px;
  }

  /* Data Lab tools remain reachable without giant cards. */
  body.theme-modern .game-command-window #tab-ops.show.active {
    overflow-y: auto !important;
    padding: 0 3px 24px !important;
  }

  body.theme-modern #tab-ops .row.g-3 { --bs-gutter-y: .65rem; }
  body.theme-modern #tab-ops #gacha-card { min-height: 106px !important; border-radius: 18px !important; }
  body.theme-modern #tab-ops #gacha-card .card-body { padding: 12px !important; }
  body.theme-modern #tab-ops .icon-gacha { margin: 0 0 3px !important; font-size: 1.8rem !important; }
  body.theme-modern #tab-ops .title-gacha {
    margin: 0 0 6px !important;
    overflow: visible !important;
    font-size: 1.05rem !important;
    line-height: 1.15 !important;
    white-space: normal !important;
  }

  body.theme-modern #tab-ops .modern-tool-card {
    min-height: 84px !important;
    padding: 8px 4px !important;
    border-radius: 17px !important;
  }

  body.theme-modern #tab-ops .modern-tool-icon { margin-bottom: 4px !important; font-size: 1.55rem !important; }
  body.theme-modern #tab-ops .marketing-card { min-height: 78px !important; padding: 9px !important; border-radius: 18px !important; }
}

/* Desktop keeps the same system but opens into a landscape command layout. */
@media (min-width: 900px) {
  body.theme-modern .world-unified-dashboard {
    top: 90px;
    right: auto;
    left: 32px;
    width: min(38%, 455px);
    grid-template-columns: minmax(0, 1.35fr) minmax(125px, .65fr);
  }

  body.theme-modern .world-unified-dashboard .world-mode-card small {
    display: block;
    font-size: .44rem !important;
  }

  body.theme-modern .world-unified-dashboard .daily-order-board.is-collapsed .daily-board-content {
    max-height: 138px;
    margin-top: 7px;
    opacity: 1;
    pointer-events: auto;
  }

  body.theme-modern .world-unified-dashboard .daily-board-chevron { display: none; }
  body.theme-modern .world-unified-dashboard .daily-board-ribbon { pointer-events: none !important; }

  body.theme-modern .game-world-stage .world-status-ticker {
    right: 32px !important;
    bottom: 108px !important;
    left: auto !important;
    width: min(38%, 455px) !important;
  }

  body.theme-modern .game-action-dock .game-dock-btn > span:last-child {
    display: block;
    font-size: .48rem;
    font-weight: 900;
  }

  body.theme-modern .game-command-window #tab-market .chart-container {
    height: min(50dvh, 430px) !important;
    min-height: 320px !important;
  }

  body.theme-modern .game-command-window #tab-market > .accordion {
    min-height: 430px !important;
  }
}

/* Animated title treatment and lightweight particles without extra downloads. */
body.theme-modern .splash-title { animation: v8LogoFloat 3.2s ease-in-out infinite; }
body.theme-modern .splash-overlay::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.9) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(255,220,116,.8) 0 3px, transparent 4px),
    radial-gradient(circle, rgba(255,139,180,.72) 0 2px, transparent 3px);
  background-position: 14% 86%, 82% 68%, 65% 22%;
  background-size: 130px 160px, 190px 210px, 160px 180px;
  animation: v8Particles 9s linear infinite;
}

@keyframes v8LogoFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes v8Particles { from { transform: translateY(16px); opacity: .45; } 50% { opacity: .9; } to { transform: translateY(-24px); opacity: .42; } }

@media (prefers-reduced-motion: reduce) {
  body.theme-modern .game-world-stage .world-character-player,
  body.theme-modern .splash-title,
  body.theme-modern .splash-overlay::after { animation: none !important; }
}


/* UI layer 6: game-adaptive-v9.css */
/* Data Pop V9 — adaptive portrait/landscape game UI system. */

:root {
  --v9-cream: #fff9f1;
  --v9-yellow: #f8e9a1;
  --v9-mint: #85dcb8;
  --v9-peach: #e8a87c;
  --v9-coral: #e27d60;
  --v9-ink: #563841;
  --v9-line: #824757;
  --v9-panel-radius: 32px;
  --v9-button-radius: 20px;
  --v9-control: 52px;
}

html,
body.theme-modern {
  width: 100%;
  min-height: 100%;
  overflow: hidden !important;
}

body.theme-modern button,
body.theme-modern input,
body.theme-modern select {
  font-family: 'Sarabun', sans-serif;
}

/* A single, high-contrast shape language for every interactive surface. */
body.theme-modern .quick-command-grid > button,
body.theme-modern .quick-command-tools > button,
body.theme-modern .modern-tool-card,
body.theme-modern .marketing-card,
body.theme-modern .shop-card-live,
body.theme-modern .action-card-live {
  border-radius: var(--v9-button-radius) !important;
}

body.theme-modern .game-command-window,
body.theme-modern #gameMenuOffcanvas,
body.theme-modern .quick-command-menu,
body.theme-modern .swal2-popup,
body.theme-modern .modal-content {
  border-radius: var(--v9-panel-radius) !important;
}

body.theme-modern .quick-command-tools > button {
  min-height: var(--v9-control);
  color: #563841 !important;
  border: 2px solid #c8878d !important;
  background: #fffdf8 !important;
  box-shadow: inset 0 2px 0 #fff, 0 3px 0 #d9a09b !important;
  font-size: .7rem !important;
  font-weight: 800;
}

body.theme-modern .quick-command-tools > button.danger {
  color: #922f44 !important;
  border-color: #c95d72 !important;
  background: #ffe9e9 !important;
}

body.theme-modern .quick-command-tools > button span {
  display: block;
  margin-top: 2px;
  line-height: 1.1;
}

/* Only one modal backdrop may visually own the stage at a time. */
body.theme-modern .game-command-backdrop,
body.theme-modern .quick-command-backdrop,
body.theme-modern .offcanvas-backdrop,
body.theme-modern .swal2-container {
  background-color: rgba(70, 43, 51, .58) !important;
  backdrop-filter: blur(6px);
}

body.theme-modern.quick-command-open .game-command-backdrop,
body.theme-modern:not(.command-panel-collapsed) .quick-command-backdrop {
  opacity: 0 !important;
  pointer-events: none !important;
}

body.theme-modern.splash-active .main-container,
body.theme-modern.splash-active .top-btn-group,
body.theme-modern.splash-active .game-action-dock,
body.theme-modern.splash-active .game-command-window,
body.theme-modern.splash-active .game-command-backdrop,
body.theme-modern.splash-active .quick-command-menu,
body.theme-modern.splash-active .quick-command-backdrop {
  visibility: hidden !important;
}

body.theme-modern.splash-active .splash-overlay {
  visibility: visible !important;
}

body.theme-modern .game-command-window .accordion-button,
body.theme-modern .game-command-window .price-slider-container,
body.theme-modern .game-command-window .alert,
body.theme-modern #gameMenuOffcanvas .offcanvas-title {
  color: var(--v9-ink) !important;
}

body.theme-modern .game-command-window .price-slider-container {
  isolation: isolate;
  overflow: hidden !important;
}

body.theme-modern .game-command-window .action-card-live {
  position: relative !important;
  z-index: 1;
  overflow: hidden;
}

/* Market mood and competitor are siblings, not overlapping floating layers. */
body.theme-modern .game-command-window .market-status-row {
  align-items: stretch !important;
}

body.theme-modern .game-command-window .market-mood-zone,
body.theme-modern .game-command-window .market-rival-zone {
  min-width: 0;
  padding: 0 !important;
}

body.theme-modern .game-command-window .market-mood-card {
  display: grid !important;
  gap: 10px;
  padding: 12px 14px !important;
  align-content: center;
}

body.theme-modern .game-command-window .market-mood-copy,
body.theme-modern .game-command-window .market-mood-meter {
  display: flex;
  min-width: 0;
  gap: 9px;
  align-items: center;
}

body.theme-modern .game-command-window .market-mood-copy {
  justify-content: space-between;
}

body.theme-modern .game-command-window .market-mood-copy > span:first-child {
  min-width: 0;
}

body.theme-modern .game-command-window .market-mood-meter {
  margin: 0 !important;
}

body.theme-modern .game-command-window .market-mood-meter .progress {
  height: 10px !important;
  overflow: hidden;
  border: 1px solid rgba(130, 71, 87, .24);
  background: #f4dde0;
}

body.theme-modern .game-command-window .market-rival-zone {
  display: flex;
}

body.theme-modern .game-command-window .market-rival-zone .action-card-live {
  inset: auto !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  transform: none !important;
}

body.theme-modern .game-command-window #tab-market > .row {
  padding: 0 !important;
}

body.theme-modern .game-command-window #tab-market > .row > [class*="col-"] {
  margin-top: 0 !important;
}

/* Legacy game updates may replace the ticker's child spans with plain text. */
body.theme-modern .game-world-stage .world-status-ticker {
  display: flex !important;
  gap: 9px;
  align-items: center;
}

body.theme-modern .game-world-stage .world-status-ticker::before {
  content: "💬";
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 9px;
  background: #b8edf0;
}

body.theme-modern .game-world-stage .world-status-ticker .world-status-icon {
  display: none !important;
}

/* Portrait is a dedicated phone composition with its own focal point. */
@media (max-width: 899px), (orientation: portrait) and (max-width: 1100px) {
  body.theme-modern .game-world-stage,
  body.theme-modern .game-world-stage[data-product="CHEAP"],
  body.theme-modern .game-world-stage[data-product="CHEAP"][data-mode] {
    background-image: linear-gradient(180deg, rgba(255,249,233,.02), rgba(102,58,65,.13)), url('/assets/images/store-boba-portrait-v1.png') !important;
    background-position: center top !important;
  }

  body.theme-modern .game-world-stage[data-product="EXPENSIVE"],
  body.theme-modern .game-world-stage[data-product="EXPENSIVE"][data-mode] {
    background-image: linear-gradient(180deg, rgba(237,250,255,.02), rgba(40,65,96,.14)), url('/assets/images/store-it-portrait-v1.png') !important;
    background-position: center top !important;
  }

  body.theme-modern .quick-command-menu {
    top: auto !important;
    height: auto !important;
    max-height: calc(100dvh - max(32px, env(safe-area-inset-top) + 24px)) !important;
    padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
  }

  body.theme-modern .quick-command-grid > button {
    min-height: 82px;
  }

  body.theme-modern .quick-command-grid > button b {
    font-size: .78rem !important;
  }

  body.theme-modern .quick-command-grid > button small {
    font-size: .62rem !important;
    line-height: 1.25;
  }

  body.theme-modern .game-action-dock .game-dock-btn.is-active > span:last-child {
    font-size: .62rem !important;
  }

  body.theme-modern .game-command-window #mainGameTabs .nav-link {
    font-size: .76rem !important;
  }

  body.theme-modern .game-command-window .accordion-button,
  body.theme-modern .game-command-window .price-slider-container,
  body.theme-modern .game-command-window .alert {
    font-size: .75rem !important;
  }

  body.theme-modern .game-command-window #tab-market > .row {
    position: relative;
    z-index: 2;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.theme-modern .game-command-window #tab-market > .row > [class*="col-"] {
    margin-top: 0 !important;
  }

  body.theme-modern .game-command-window .price-slider-container {
    position: relative !important;
    z-index: 1 !important;
    margin: 0 !important;
  }

  body.theme-modern #gameMenuOffcanvas {
    height: auto !important;
    max-height: calc(100dvh - max(32px, env(safe-area-inset-top) + 24px)) !important;
  }
}

/* True landscape layout: full playfield, right command rail, two-column consoles. */
@media (min-width: 900px) and (orientation: landscape) {
  :root {
    --mobile-game-width: calc(100vw - 16px);
    --v9-landscape-sidebar: 88px;
  }

  body.theme-modern .main-container {
    top: 8px !important;
    left: 8px !important;
    width: calc(100vw - 16px) !important;
    max-width: none !important;
    height: calc(100dvh - 16px) !important;
    max-height: none !important;
    border-radius: 32px !important;
    transform: none !important;
  }

  body.theme-modern .splash-overlay {
    top: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    left: 8px !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    padding: 28px !important;
    border-radius: 32px !important;
    background-image: linear-gradient(90deg, rgba(255,247,226,.06), rgba(86,49,59,.48)), url('/assets/images/market-scene-v2.png') !important;
    background-position: center !important;
    background-size: cover !important;
    transform: none !important;
  }

  body.theme-modern .splash-content {
    width: min(47vw, 620px) !important;
    margin: auto 7vw auto auto !important;
    padding: 28px 32px !important;
  }

  body.theme-modern .splash-character {
    right: auto !important;
    bottom: 0 !important;
    left: 24% !important;
    width: auto !important;
    height: min(72dvh, 650px) !important;
    max-height: 82% !important;
    transform: translateX(-50%) !important;
  }

  body.theme-modern .splash-title {
    font-size: clamp(4rem, 7vw, 6.5rem) !important;
  }

  body.theme-modern .game-world-stage,
  body.theme-modern .game-world-stage[data-product="CHEAP"],
  body.theme-modern .game-world-stage[data-product="CHEAP"][data-mode] {
    border-radius: 32px !important;
    background-image: linear-gradient(90deg, rgba(255,247,226,.03) 35%, rgba(104,57,66,.17) 100%), url('/assets/images/market-scene-v2.png') !important;
    background-position: center center !important;
    background-size: cover !important;
  }

  body.theme-modern .game-world-stage[data-product="EXPENSIVE"],
  body.theme-modern .game-world-stage[data-product="EXPENSIVE"][data-mode] {
    background-image: linear-gradient(90deg, rgba(235,251,255,.02) 35%, rgba(38,60,94,.2) 100%), url('/assets/images/store-it-tycoon-v1.png') !important;
  }

  body.theme-modern .top-btn-group {
    top: 24px !important;
    right: 24px !important;
  }

  body.theme-modern .scroll-x-container {
    top: 18px !important;
    left: 50% !important;
    width: min(50vw, 650px) !important;
    transform: translateX(-50%) !important;
  }

  body.theme-modern .world-unified-dashboard {
    top: 92px !important;
    left: 30px !important;
    width: min(36vw, 470px) !important;
  }

  body.theme-modern .game-world-stage .world-character-player {
    bottom: 1.5% !important;
    left: 25% !important;
    width: min(29vw, 410px) !important;
    max-height: 57% !important;
  }

  body.theme-modern .game-world-stage .world-status-ticker {
    right: calc(var(--v9-landscape-sidebar) + 44px) !important;
    bottom: 24px !important;
    left: auto !important;
    width: min(35vw, 470px) !important;
    min-height: 54px;
    max-height: 66px !important;
    font-size: .8rem !important;
  }

  /* The old bottom dock becomes a game-style command sidebar. */
  body.theme-modern .fixed-bottom.game-action-dock {
    top: 50% !important;
    right: 22px !important;
    bottom: auto !important;
    left: auto !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: repeat(5, 1fr) !important;
    gap: 9px !important;
    width: var(--v9-landscape-sidebar) !important;
    height: auto !important;
    padding: 9px !important;
    border: 3px solid var(--v9-line) !important;
    border-radius: 27px !important;
    background: rgba(255,241,218,.96) !important;
    box-shadow: inset 0 3px 0 #fff, 6px 7px 0 rgba(128,71,87,.58), 0 16px 30px rgba(72,38,49,.25) !important;
    transform: translateY(-50%) !important;
    transition: opacity .2s ease, transform .28s ease !important;
  }

  body.theme-modern .game-action-dock .game-dock-btn,
  body.theme-modern .game-action-dock .game-dock-primary {
    width: 64px !important;
    height: 67px !important;
    min-height: 67px !important;
    margin: 0 !important;
    padding: 6px 3px !important;
    gap: 3px;
    border-radius: 18px !important;
  }

  body.theme-modern .game-action-dock .game-action-icon {
    font-size: 1.65rem !important;
  }

  body.theme-modern .game-action-dock .game-dock-btn > span:last-child,
  body.theme-modern .game-action-dock .game-dock-btn.is-active > span:last-child {
    display: block !important;
    max-width: 100%;
    overflow: hidden;
    color: var(--v9-ink);
    font-size: .66rem !important;
    font-weight: 900;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.theme-modern.quick-command-open .game-action-dock,
  body.theme-modern:not(.command-panel-collapsed) .game-action-dock {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-50%) translateX(130%) !important;
  }

  body.theme-modern .game-command-window {
    width: min(calc(100vw - 128px), 1120px) !important;
    height: min(calc(100dvh - 48px), 760px) !important;
    padding: 16px 18px 18px !important;
  }

  body.theme-modern .game-command-titlebar strong {
    font-size: 1.25rem !important;
  }

  body.theme-modern .game-command-titlebar small,
  body.theme-modern .game-command-window #mainGameTabs .nav-link,
  body.theme-modern .game-command-window .accordion-button,
  body.theme-modern .game-command-window .price-slider-container,
  body.theme-modern .game-command-window .alert {
    font-size: 1rem !important;
  }

  body.theme-modern .game-command-window #game-command-panel {
    height: calc(100% - 112px);
    min-height: 0;
    overflow: hidden !important;
  }

  html body.theme-modern .game-command-window #tab-market.show.active {
    display: flex !important;
    flex-flow: column wrap !important;
    align-content: space-between;
    gap: 14px !important;
    height: 100%;
    overflow: hidden !important;
  }

  body.theme-modern .game-command-window #tab-market > .accordion {
    width: calc(65% - 7px) !important;
    height: 100%;
    flex: 0 0 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
  }

  body.theme-modern .game-command-window #tab-market .accordion-item,
  body.theme-modern .game-command-window #tab-market .accordion-collapse,
  body.theme-modern .game-command-window #tab-market .accordion-body {
    height: 100%;
  }

  body.theme-modern .game-command-window #tab-market .accordion-body {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  body.theme-modern .game-command-window #tab-market .chart-container {
    flex: 1 1 auto;
    width: 100%;
    height: auto !important;
    min-height: 310px !important;
  }

  body.theme-modern .game-command-window #tab-market > .row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 10px;
    width: calc(35% - 7px) !important;
    min-height: 92px !important;
    flex: 0 0 92px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.theme-modern .game-command-window #tab-market > .row > [class*="col-"] {
    width: auto !important;
    padding: 0 !important;
    margin-top: 0 !important;
  }

  body.theme-modern .game-command-window .action-card-live {
    min-height: 92px !important;
    padding: 8px 4px !important;
  }

  body.theme-modern .game-command-window .competitor-icon {
    font-size: 1.75rem !important;
  }

  body.theme-modern .game-command-window .price-slider-container {
    width: calc(35% - 7px) !important;
    display: flex;
    flex: 1 1 0 !important;
    justify-content: center;
    flex-direction: column;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 18px !important;
  }

  body.theme-modern .game-command-window #price-slider {
    width: 100%;
    margin: 28px 0 20px;
  }

  body.theme-modern .game-command-window #tab-ops.show.active {
    height: 100%;
    overflow: hidden !important;
    padding: 0 4px 4px !important;
  }

  body.theme-modern #tab-ops > .row.g-3 {
    display: grid;
    grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
    grid-template-rows: 1fr auto;
    gap: 14px;
    height: 100%;
    margin: 0;
  }

  body.theme-modern #tab-ops > .row.g-3 > .col-12 {
    width: auto;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.theme-modern #tab-ops > .row.g-3 > .col-12:first-child {
    grid-row: 1 / 3;
  }

  body.theme-modern #tab-ops #gacha-card {
    height: 100%;
    min-height: 0 !important;
  }

  body.theme-modern #tab-ops .modern-tool-card {
    min-height: 122px !important;
  }

  body.theme-modern #tab-ops .modern-tool-card small,
  body.theme-modern #tab-ops .marketing-card span {
    font-size: 1rem !important;
  }

  body.theme-modern .quick-command-menu {
    width: min(calc(100vw - 128px), 900px) !important;
    height: auto !important;
    max-height: calc(100dvh - 48px) !important;
    padding: 18px !important;
  }

  body.theme-modern .quick-command-header h2 {
    font-size: 1.5rem !important;
  }

  body.theme-modern .quick-command-header small,
  body.theme-modern .quick-command-grid > button b,
  body.theme-modern .quick-command-grid > button small,
  body.theme-modern .quick-command-tools > button {
    font-size: 1rem !important;
  }

  body.theme-modern .quick-command-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  body.theme-modern .quick-command-grid > button {
    min-height: 118px;
  }

  body.theme-modern #gameMenuOffcanvas {
    width: min(calc(100vw - 128px), 1040px) !important;
    max-width: 1040px !important;
    height: auto !important;
    min-height: 520px;
    max-height: calc(100dvh - 48px) !important;
  }

  body.theme-modern #gameMenuOffcanvas .offcanvas-body {
    min-height: 0;
  }

  body.theme-modern #gameMenuOffcanvas .tab-pane > div > .d-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  body.theme-modern #gameMenuOffcanvas .wallet-status {
    grid-column: 1 / -1;
    margin-bottom: 0 !important;
  }

  body.theme-modern #gameMenuOffcanvas .shop-card-live,
  body.theme-modern #gameMenuOffcanvas .tab-pane > div > .d-grid > div {
    min-height: 112px;
    margin: 0 !important;
  }
}

/* Tablet portrait keeps the phone navigation but gets more breathable panels. */
@media (min-width: 700px) and (max-width: 1100px) and (orientation: portrait) {
  :root { --mobile-game-width: min(calc(100vw - 32px), 620px); }

  body.theme-modern .world-unified-dashboard,
  body.theme-modern .game-world-stage .world-status-ticker {
    right: 24px !important;
    left: 24px !important;
  }

  body.theme-modern .fixed-bottom.game-action-dock {
    width: min(calc(100vw - 48px), 560px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.theme-modern .fixed-bottom.game-action-dock {
    transition: none !important;
  }
}


/* UI layer 7: game-polish-v10.css */
/* Data Pop V10 — clean shadows, readable controls and collision-proof panels. */

:root {
  --v10-ink: #50373e;
  --v10-line: #744755;
  --v10-panel: #fff8ed;
  --v10-soft-shadow: 0 16px 38px rgba(55, 43, 45, .24);
  --v10-stage-shadow: 0 12px 32px rgba(42, 34, 36, .2);
}

/* Remove every hard pink drop-shadow from the game shell. */
body.theme-modern .main-container,
body.theme-modern .game-world-stage,
body.theme-modern .world-unified-dashboard,
body.theme-modern .game-world-stage .world-status-ticker,
body.theme-modern .fixed-bottom.game-action-dock,
body.theme-modern .quick-command-menu,
body.theme-modern .game-command-window,
body.theme-modern #gameMenuOffcanvas,
body.theme-modern .swal2-popup,
body.theme-modern .modal-content,
body.theme-modern .splash-content {
  box-shadow: var(--v10-soft-shadow) !important;
}

body.theme-modern .game-world-stage {
  box-shadow: var(--v10-stage-shadow) !important;
}

body.theme-modern .quick-command-header > button,
body.theme-modern .game-command-titlebar > button,
body.theme-modern .swal2-close,
body.theme-modern .btn-close {
  box-shadow: 0 4px 10px rgba(87, 48, 59, .2) !important;
}

body.theme-modern .quick-command-grid > button,
body.theme-modern .quick-command-tools > button,
body.theme-modern .game-action-dock .game-dock-btn,
body.theme-modern .game-command-window .btn,
body.theme-modern .modern-tool-card,
body.theme-modern .marketing-card,
body.theme-modern .shop-card-live {
  box-shadow: 0 5px 12px rgba(67, 52, 56, .16) !important;
}

body.theme-modern .quick-command-grid > button:active,
body.theme-modern .game-action-dock .game-dock-btn:active {
  box-shadow: 0 2px 5px rgba(67, 52, 56, .16) !important;
}

/* Popup backgrounds are mutually exclusive and use one neutral dim layer. */
body.theme-modern .game-command-backdrop,
body.theme-modern .quick-command-backdrop,
body.theme-modern .offcanvas-backdrop,
body.theme-modern .swal2-container {
  background: rgba(47, 42, 43, .56) !important;
  backdrop-filter: blur(7px);
}

body.theme-modern.quick-command-open .game-command-backdrop,
body.theme-modern:not(.command-panel-collapsed) .quick-command-backdrop,
body.theme-modern.splash-active .game-command-backdrop,
body.theme-modern.splash-active .quick-command-backdrop {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* SweetAlert is the only interactive layer while a decision popup is open. */
body.theme-modern.swal2-shown .game-command-backdrop,
body.theme-modern.swal2-shown .quick-command-backdrop,
body.theme-modern.swal2-shown .offcanvas-backdrop,
body.theme-modern.swal2-shown .game-command-window,
body.theme-modern.swal2-shown .quick-command-menu,
body.theme-modern.swal2-shown #gameMenuOffcanvas {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Market status is a real row. Nothing floats across the price panel. */
body.theme-modern .game-command-window .market-status-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 64px !important;
  gap: 10px !important;
  min-height: 68px !important;
  padding: 0 !important;
  overflow: visible !important;
}

body.theme-modern .game-command-window .market-status-row > * {
  width: auto !important;
  min-width: 0 !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.theme-modern .game-command-window .market-mood-card {
  min-height: 68px;
  padding: 10px 12px !important;
  overflow: hidden;
  border: 2px solid #b97982 !important;
  border-radius: 20px !important;
  background: #eef8df !important;
  box-shadow: none !important;
}

body.theme-modern .game-command-window .market-mood-copy {
  gap: 8px;
}

body.theme-modern .game-command-window .market-mood-copy > span:first-child {
  color: var(--v10-ink) !important;
  font-size: .78rem;
  white-space: nowrap;
}

body.theme-modern .game-command-window #market-mood {
  max-width: 58%;
  overflow: hidden;
  font-size: .68rem !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.theme-modern .game-command-window .market-mood-meter {
  width: 100%;
}

body.theme-modern .game-command-window .market-rival-zone .action-card-live {
  display: grid;
  min-height: 68px !important;
  padding: 5px 2px !important;
  place-items: center;
  color: var(--v10-ink) !important;
  border: 2px solid #b97982 !important;
  border-radius: 20px !important;
  background: #ffd6d1 !important;
  box-shadow: none !important;
}

body.theme-modern .game-command-window .market-rival-zone .action-card-live .fw-bold {
  font-size: 0 !important;
}

body.theme-modern .game-command-window .market-rival-zone .action-card-live .fw-bold::after {
  content: "คู่แข่ง";
  display: block;
  margin-top: 3px;
  font-size: .6rem;
  font-weight: 900;
  line-height: 1;
}

body.theme-modern .game-command-window .competitor-icon {
  font-size: 1.45rem !important;
  line-height: 1;
}

body.theme-modern .game-command-window .price-slider-container {
  position: relative !important;
  z-index: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: 2px solid #b97982 !important;
  box-shadow: none !important;
}

body.theme-modern .game-command-window #price-slider {
  max-width: 100%;
}

/* Readability: hide labels only when space is truly constrained. */
body.theme-modern .quick-command-header small,
body.theme-modern .quick-command-grid > button small,
body.theme-modern .quick-command-tools > button,
body.theme-modern .game-world-stage .world-status-ticker {
  color: var(--v10-ink) !important;
  font-size: clamp(.78rem, 1.3vw, 1rem) !important;
}

body.theme-modern .quick-command-grid > button b,
body.theme-modern .game-command-window #mainGameTabs .nav-link {
  color: var(--v10-ink) !important;
  font-size: clamp(.8rem, 1.45vw, 1rem) !important;
}

@media (min-width: 900px) and (orientation: landscape) {
  body.theme-modern .game-command-window .market-status-row {
    grid-template-columns: minmax(0, 1fr) 84px !important;
    width: calc(35% - 7px) !important;
    min-height: 96px !important;
    flex: 0 0 96px !important;
  }

  body.theme-modern .game-command-window .market-mood-card,
  body.theme-modern .game-command-window .market-rival-zone .action-card-live {
    min-height: 96px !important;
  }

  body.theme-modern .game-command-window .market-mood-copy > span:first-child,
  body.theme-modern .game-command-window #market-mood {
    font-size: .9rem !important;
  }

  body.theme-modern .game-action-dock .game-dock-btn span,
  body.theme-modern .game-action-dock .game-dock-btn small {
    font-size: .78rem !important;
  }

  body.theme-modern .game-command-window .market-rival-zone .action-card-live .fw-bold::after {
    font-size: .72rem;
  }

  body.theme-modern .game-command-window .price-slider-container {
    width: calc(35% - 7px) !important;
  }
}

@media (max-width: 360px), (max-height: 620px) and (max-width: 899px) {
  body.theme-modern .quick-command-grid > button small {
    display: none;
  }

  body.theme-modern .quick-command-tools > button {
    font-size: .66rem !important;
  }

  body.theme-modern .game-command-window .market-mood-copy > span:first-child {
    font-size: .68rem;
  }
}


/* UI layer 8: game-polish-v11.css */
/* Data Pop V11 — compact decisions, unified game icons and smoother character motion. */

:root {
  --v11-ink: #573941;
  --v11-line: #8a5563;
  --v11-cream: #fff8ec;
  --v11-pink: #ff8faa;
  --v11-blue: #72d8e9;
  --v11-mint: #94dfb8;
  --v11-yellow: #ffd66e;
}

.game-ui-icon {
  display: inline-block;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  overflow: visible;
  vertical-align: middle;
}

body.theme-modern .quick-command-grid > button > .game-ui-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 3px;
}

body.theme-modern .quick-command-tools .game-ui-icon {
  width: 25px;
  height: 25px;
}

body.theme-modern .game-action-dock .game-action-icon.game-ui-icon {
  width: 34px !important;
  height: 34px !important;
  margin: 0 auto 2px !important;
}

body.theme-modern .mkt-icon-wrapper .game-ui-icon {
  width: 32px;
  height: 32px;
}

/* Compact close controls: large enough to tap, without dominating the panel. */
body.theme-modern .swal2-close,
body.theme-modern .btn-close-modern,
body.theme-modern .game-command-titlebar > button,
body.theme-modern .quick-command-header > button {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  margin: 6px 6px 0 0 !important;
  border-radius: 12px !important;
  font-size: 1.2rem !important;
  line-height: 1 !important;
}

body.theme-modern #gameMenuOffcanvas .btn-close {
  width: 30px !important;
  height: 30px !important;
  padding: 5px !important;
  border-radius: 10px !important;
}

/* All shop cards keep the same rhythm; HR no longer has a double gap. */
body.theme-modern #shop-content-container .shop-card-live {
  margin-top: 0 !important;
  margin-bottom: 12px !important;
}

body.theme-modern #shop-content-container .shop-card-live:last-child {
  margin-bottom: 0 !important;
}

/* Order strategy board starts collapsed to shorten the order dialog. */
body.theme-modern .strategy-summary {
  overflow: hidden;
  border: 2px solid #d29aa3 !important;
  background: #fffaf1 !important;
  box-shadow: none !important;
}

body.theme-modern .strategy-summary-toggle {
  display: flex;
  width: 100%;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: var(--v11-ink);
  border: 0;
  background: linear-gradient(110deg, #fff8e8, #eefcf5);
  text-align: left;
}

body.theme-modern .strategy-summary-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

body.theme-modern .strategy-summary-title .game-ui-icon {
  width: 35px;
  height: 35px;
}

body.theme-modern .strategy-summary-title > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

body.theme-modern .strategy-summary-title b {
  font-size: .92rem;
  line-height: 1.25;
}

body.theme-modern .strategy-summary-title small {
  overflow: hidden;
  color: #876c72;
  font-size: .7rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.theme-modern .strategy-toggle-meta {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  color: #8a5563;
  font-size: .72rem;
  font-weight: 800;
}

body.theme-modern .strategy-toggle-meta i {
  font-size: 1.15rem;
  font-style: normal;
  transition: transform .25s ease;
}

body.theme-modern .strategy-summary-content {
  max-height: 0;
  overflow: hidden;
  padding: 0 12px;
  opacity: 0;
  transition: max-height .32s ease, padding .25s ease, opacity .2s ease;
}

body.theme-modern .strategy-summary.is-open .strategy-summary-content {
  max-height: 460px;
  padding: 0 12px 12px;
  opacity: 1;
}

body.theme-modern .strategy-summary.is-open .strategy-toggle-meta i {
  transform: rotate(180deg);
}

body.theme-modern .strategy-info {
  min-height: 58px;
  border: 1px solid rgba(138, 85, 99, .13);
}

/* Competitor control uses a purpose-built game illustration and stable dimensions. */
body.theme-modern .game-command-window .market-status-row {
  grid-template-columns: minmax(0, 1fr) 76px !important;
}

body.theme-modern .game-command-window .market-rival-zone .action-card-live {
  width: 76px !important;
  min-width: 76px !important;
  padding: 6px 3px !important;
  border-radius: 20px !important;
  background: linear-gradient(160deg, #fff3df, #ffd8df) !important;
}

body.theme-modern .game-command-window .competitor-icon {
  width: 38px !important;
  height: 38px !important;
  margin: 0 auto !important;
  font-size: initial !important;
}

body.theme-modern .game-command-window .market-rival-zone .action-card-live .fw-bold::after {
  color: var(--v11-ink);
  font-size: .72rem;
}

/* Layered character rig: eye blink and mouth motion no longer swap the full image. */
body.theme-modern .game-world-stage .character-rig {
  position: absolute;
  z-index: 10 !important;
  bottom: 10.5% !important;
  left: -5% !important;
  width: min(68vw, 430px) !important;
  height: auto !important;
  aspect-ratio: 1;
  pointer-events: auto;
  filter: drop-shadow(0 15px 13px rgba(52, 40, 43, .34)) !important;
  animation: v11CharacterBreathing 4.8s ease-in-out infinite !important;
  transform-origin: 50% 88%;
  cursor: pointer;
}

body.theme-modern .character-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity .32s ease, filter .32s ease;
  user-select: none;
  pointer-events: none;
}

body.theme-modern .character-frame-current { opacity: 1; }
body.theme-modern .character-frame-next { opacity: 0; }
body.theme-modern .character-rig.is-pose-swapping .character-frame-current { opacity: 0; }
body.theme-modern .character-rig.is-pose-swapping .character-frame-next { opacity: 1; }

body.theme-modern .character-face-layer {
  position: absolute;
  z-index: 4;
  pointer-events: none;
}

body.theme-modern .character-blink-layer {
  inset: 0;
}

body.theme-modern .character-blink-layer i {
  position: absolute;
  top: 39.2%;
  width: 12.4%;
  height: 6.2%;
  border-bottom: 3px solid #56302f;
  border-radius: 50%;
  background: #efae89;
  opacity: 0;
  transform: scaleY(.12);
  transform-origin: 50% 80%;
  animation: v11NaturalBlink 5.2s infinite;
}

body.theme-modern .character-blink-layer i:first-child { left: 32.5%; }
body.theme-modern .character-blink-layer i:last-child { left: 55.4%; }

body.theme-modern .character-mouth-layer {
  top: 51.7%;
  left: 47.1%;
  width: 12.3%;
  height: 7.4%;
  border: 2px solid #6b3135;
  border-radius: 45% 45% 52% 52%;
  background: radial-gradient(ellipse at 50% 78%, #f48c87 0 38%, #7a3038 42% 100%);
  opacity: 0;
  transform: scaleY(.55);
  transform-origin: 50% 20%;
}

body.theme-modern .game-world-stage.character-is-speaking .character-mouth-layer {
  opacity: .96;
  animation: v11MouthTalk .28s ease-in-out infinite alternate;
}

body.theme-modern .game-world-stage.character-is-speaking .character-rig {
  animation: v11CharacterTalking 1.1s ease-in-out infinite alternate !important;
}

body.theme-modern .character-action-menu {
  position: absolute;
  z-index: 18;
  right: 10px;
  bottom: 17%;
  width: min(58%, 235px);
  padding: 10px;
  visibility: hidden;
  color: var(--v11-ink);
  border: 2px solid var(--v11-line);
  border-radius: 20px;
  background: rgba(255, 248, 236, .97);
  box-shadow: 0 10px 24px rgba(55, 43, 45, .22);
  opacity: 0;
  transform: translateY(12px) scale(.96);
  transform-origin: 20% 100%;
  transition: opacity .22s ease, transform .28s cubic-bezier(.2, .85, .25, 1.1), visibility .22s;
  pointer-events: none;
}

body.theme-modern .character-action-menu.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

body.theme-modern .character-action-menu::after {
  position: absolute;
  right: 76%;
  bottom: -10px;
  width: 18px;
  height: 18px;
  content: "";
  border-right: 2px solid var(--v11-line);
  border-bottom: 2px solid var(--v11-line);
  background: #fff8ec;
  transform: rotate(45deg);
}

body.theme-modern .character-action-menu header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

body.theme-modern .character-action-menu header > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

body.theme-modern .character-action-menu header small {
  color: #c05c7a;
  font-size: .6rem;
  font-weight: 800;
}

body.theme-modern .character-action-menu header strong {
  font-size: .88rem;
}

body.theme-modern .character-action-menu header button {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  padding: 0;
  place-items: center;
  color: white;
  border: 0;
  border-radius: 9px;
  background: #ef728b;
  font-weight: 900;
}

body.theme-modern .character-action-menu p {
  margin: 0 0 8px;
  color: #755d63;
  font-size: .7rem;
  line-height: 1.35;
}

body.theme-modern .character-action-menu > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

body.theme-modern .character-action-menu > div button {
  display: grid;
  min-width: 0;
  min-height: 56px;
  padding: 5px 2px;
  place-items: center;
  color: var(--v11-ink);
  border: 1px solid rgba(138, 85, 99, .34);
  border-radius: 14px;
  background: #fff;
  font-size: .62rem;
  font-weight: 800;
  line-height: 1.1;
}

body.theme-modern .character-action-menu > div .game-ui-icon {
  width: 30px;
  height: 30px;
}

@keyframes v11NaturalBlink {
  0%, 43%, 46%, 76%, 79%, 100% { opacity: 0; transform: scaleY(.12); }
  44%, 45%, 77%, 78% { opacity: 1; transform: scaleY(1); }
}

@keyframes v11MouthTalk {
  from { transform: scale(.92, .45); }
  to { transform: scale(1.02, 1); }
}

@keyframes v11CharacterBreathing {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  50% { transform: translateY(-3px) rotate(-.35deg) scale(1.006); }
}

@keyframes v11CharacterTalking {
  from { transform: translateY(0) rotate(-.6deg); }
  to { transform: translateY(-4px) rotate(.6deg); }
}

@media (min-width: 900px) and (orientation: landscape) {
  body.theme-modern .game-command-window .market-status-row {
    grid-template-columns: minmax(0, 1fr) 92px !important;
  }

  body.theme-modern .game-command-window .market-rival-zone .action-card-live {
    width: 92px !important;
    min-width: 92px !important;
  }

  body.theme-modern .game-world-stage .character-rig {
    bottom: 1.5% !important;
    left: 25% !important;
    width: min(29vw, 410px) !important;
  }

  body.theme-modern .character-action-menu {
    right: 145px;
    bottom: 115px;
    width: 300px;
  }

  body.theme-modern .character-action-menu header strong { font-size: 1rem; }
  body.theme-modern .character-action-menu p { font-size: .78rem; }
  body.theme-modern .character-action-menu > div button { font-size: .7rem; }
}

@media (max-width: 420px) {
  body.theme-modern .strategy-summary-title small {
    max-width: 165px;
  }

  body.theme-modern .strategy-toggle-meta .strategy-toggle-label {
    display: none;
  }

  body.theme-modern .quick-command-grid > button > .game-ui-icon {
    width: 37px;
    height: 37px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.theme-modern .game-world-stage .character-rig,
  body.theme-modern .game-world-stage.character-is-speaking .character-rig,
  body.theme-modern .character-blink-layer i,
  body.theme-modern .character-mouth-layer {
    animation: none !important;
  }
}


/* UI layer 9: game-polish-v12.css */
/* DATA POP V12 — unified analytics controls and single-base character performance. */

:root {
  --game-ink: #5f3d48;
  --game-line: #b87383;
  --game-paper: #fff9ec;
  --game-paper-2: #fff2e2;
  --game-cyan: #70dced;
  --game-pink: #ff8eab;
  --game-mint: #91dfb6;
  --game-gold: #ffd66d;
  --game-shadow: 0 5px 0 rgba(91, 57, 67, .18), 0 10px 22px rgba(91, 57, 67, .12);
}

/* V12 never crossfades two complete character renders. */
body.theme-modern .character-frame-next { display: none !important; }

body.theme-modern .game-world-stage .character-rig {
  isolation: isolate;
  animation: v12IdleBody 5.4s ease-in-out infinite !important;
  transform-origin: 50% 91%;
}

body.theme-modern .character-frame-current {
  opacity: 1 !important;
  transform-origin: 51% 73%;
  transition: filter .35s ease;
}

body.theme-modern .character-rig[data-pose="happy"] .character-frame-current {
  filter: saturate(1.08) brightness(1.03);
}

body.theme-modern .character-blink-layer i {
  top: 39.6%;
  width: 12.2%;
  height: 5.2%;
  border: 0;
  border-bottom: 3px solid #553338;
  background: linear-gradient(180deg, #efaa86 25%, #f6bd9b 100%);
  box-shadow: 0 -1px 0 rgba(255,255,255,.3) inset;
  animation: v12Blink 3.8s infinite;
}

body.theme-modern .character-blink-layer i:first-child { left: 32.4%; }
body.theme-modern .character-blink-layer i:last-child { left: 55.2%; }

/* Keep the painted base mouth untouched while idle. During speech only, a small
   aligned opening is drawn over it. This avoids a permanent second mouth/skin patch. */
body.theme-modern .character-mouth-layer {
  top: 51.3%;
  left: 39.8%;
  width: 14.4%;
  height: 7.2%;
  overflow: visible;
  border: 0;
  background: none;
  opacity: 0;
  transform: none;
  transform-origin: 50% 45%;
}

body.theme-modern .character-mouth-layer::after {
  position: absolute;
  top: 40%;
  left: 34%;
  width: 32%;
  height: 24%;
  content: "";
  border: 2px solid #71333b;
  border-radius: 50%;
  background: #823943;
  box-shadow: 0 1px 0 rgba(255,255,255,.28);
  transform-origin: 50% 10%;
  transition: width .07s linear, height .07s linear, left .07s linear, top .07s linear, border-radius .07s linear;
}

body.theme-modern .game-world-stage.character-is-speaking .character-mouth-layer:not([data-viseme="closed"]) {
  opacity: 1;
}

body.theme-modern .character-mouth-layer[data-viseme="closed"] {
  opacity: 0 !important;
}

body.theme-modern .character-mouth-layer[data-viseme="small"]::after {
  top: 39%; left: 39%; width: 22%; height: 28%;
  border: 2px solid #71333b; border-radius: 50%;
  background: #8e3c48;
}

body.theme-modern .character-mouth-layer[data-viseme="a"]::after {
  top: 28%; left: 28%; width: 44%; height: 48%;
  border: 2px solid #71333b; border-radius: 44% 44% 52% 52%;
  background: radial-gradient(ellipse at 50% 78%, #f48d91 0 35%, #7b3540 40% 100%);
}

body.theme-modern .character-mouth-layer[data-viseme="o"]::after {
  top: 26%; left: 38%; width: 24%; height: 51%;
  border: 2px solid #71333b; border-radius: 50%;
  background: #79343d;
}

body.theme-modern .character-mouth-layer[data-viseme="wide"]::after {
  top: 27%; left: 22%; width: 56%; height: 42%;
  border: 2px solid #71333b; border-radius: 40% 40% 55% 55%;
  background: linear-gradient(#fff 0 22%, #7c3540 25% 64%, #f38b8e 66% 100%);
}

body.theme-modern .game-world-stage.character-is-speaking .character-rig {
  animation: v12SpeakingBody 1.35s ease-in-out infinite alternate !important;
}

body.theme-modern .game-world-stage.character-is-speaking .character-frame-current {
  animation: v12SpeakingPulse .72s ease-in-out infinite alternate;
}

body.theme-modern .character-motion-accent {
  position: absolute;
  z-index: 5;
  width: 18px;
  height: 34px;
  opacity: 0;
  pointer-events: none;
}

body.theme-modern .character-motion-accent::before,
body.theme-modern .character-motion-accent::after {
  position: absolute;
  width: 12px;
  height: 3px;
  content: "";
  border-radius: 999px;
  background: var(--game-gold);
  box-shadow: 0 0 0 2px var(--game-ink);
}

body.theme-modern .character-motion-accent-left { left: 23%; top: 65%; transform: rotate(-22deg); }
body.theme-modern .character-motion-accent-right { right: 12%; top: 74%; transform: rotate(18deg); }
body.theme-modern .character-motion-accent::before { top: 6px; }
body.theme-modern .character-motion-accent::after { top: 23px; transform: rotate(18deg); }

body.theme-modern .character-rig[data-gesture="explain"] .character-motion-accent,
body.theme-modern .character-rig[data-gesture="celebrate"] .character-motion-accent-right {
  animation: v12GestureAccent 1.1s ease-in-out infinite alternate;
}

/* Daily plan uses purpose-built art and a proper rotating disclosure affordance. */
body.theme-modern .daily-board-ribbon {
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
  text-align: left;
}

body.theme-modern .daily-board-plan-icon { width: 34px; height: 34px; }
body.theme-modern .daily-board-chevron { width: 27px; height: 27px; transition: transform .25s ease; }
body.theme-modern .daily-order-board:not(.is-collapsed) .daily-board-chevron { transform: rotate(180deg); }

/* Market mood and rival intelligence now form one balanced control row. */
body.theme-modern .game-command-window .market-status-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 136px !important;
  gap: 10px !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

body.theme-modern .game-command-window .market-status-row > * {
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
}

body.theme-modern .market-rival-button {
  display: grid;
  width: 100%;
  min-height: 76px;
  grid-template-columns: 44px minmax(0,1fr);
  align-items: center;
  gap: 7px;
  padding: 8px;
  color: var(--game-ink);
  border: 2px solid var(--game-line);
  border-radius: 20px;
  background: linear-gradient(145deg, #fff9e8, #ffe2e7);
  box-shadow: 0 4px 0 rgba(95,61,72,.15);
  text-align: left;
}

body.theme-modern .market-rival-button .competitor-icon { width: 44px !important; height: 44px !important; }
body.theme-modern .market-rival-button span { display: flex; min-width: 0; flex-direction: column; }
body.theme-modern .market-rival-button b { font-size: .78rem; line-height: 1.15; }
body.theme-modern .market-rival-button small { color: #92747c; font-size: .62rem; }

/* Unified analytics hierarchy. */
body.theme-modern .analytics-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--game-ink);
}

body.theme-modern .analytics-section-title > .game-ui-icon { width: 38px; height: 38px; }
body.theme-modern .analytics-section-title > span { display: flex; flex-direction: column; }
body.theme-modern .analytics-section-title b { font-size: .94rem; }
body.theme-modern .analytics-section-title small { color: #957980; font-size: .68rem; font-weight: 700; }

body.theme-modern #tab-ops .modern-tool-card {
  display: grid;
  min-height: 112px;
  grid-template-columns: 48px minmax(0,1fr);
  gap: 9px;
  padding: 12px;
  color: var(--game-ink);
  border: 2px solid rgba(184,115,131,.46);
  border-radius: 20px;
  background: linear-gradient(150deg, #fffdf7, #fff4e7);
  box-shadow: 0 4px 0 rgba(95,61,72,.12);
  text-align: left;
}

body.theme-modern #tab-ops .modern-tool-icon {
  width: 48px;
  height: 48px;
  margin: 0;
}

body.theme-modern #tab-ops .modern-tool-card > span { display: flex; min-width: 0; flex-direction: column; }
body.theme-modern #tab-ops .modern-tool-card b { font-size: .82rem; line-height: 1.12; overflow-wrap: anywhere; }
body.theme-modern #tab-ops .modern-tool-card small { margin-top: 3px; color: #94787f; font-size: .62rem; line-height: 1.2; }
body.theme-modern #tab-ops .modern-tool-card.locked-tool { opacity: .58; filter: grayscale(.7); }

body.theme-modern .analytics-primary-action {
  display: grid;
  min-height: 88px;
  grid-template-columns: 48px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: var(--game-ink);
  border: 2px solid var(--game-line);
  border-radius: 22px;
  background: linear-gradient(145deg, #ddfbff, #88e0ed);
  box-shadow: var(--game-shadow);
  text-align: left;
}

body.theme-modern .analytics-primary-action.action-marketing { background: linear-gradient(145deg, #fff4cf, #ffd66d); }
body.theme-modern .analytics-primary-action .game-ui-icon { width: 48px; height: 48px; }
body.theme-modern .analytics-primary-action > span { display: flex; flex-direction: column; }
body.theme-modern .analytics-primary-action b { font-size: .9rem; }
body.theme-modern .analytics-primary-action small { color: #80656d; font-size: .65rem; }

/* Software shop cards use the same icon, state and spacing grammar. */
body.theme-modern .software-upgrade-card {
  padding: 13px;
  color: var(--game-ink);
  border: 2px solid rgba(184,115,131,.42);
  border-radius: 20px;
  background: linear-gradient(145deg, #fffdf7, #fff3e3);
  box-shadow: 0 4px 0 rgba(95,61,72,.11);
}

body.theme-modern .software-upgrade-card.is-locked { opacity: .62; filter: grayscale(.72); }
body.theme-modern .software-state-badge { display: inline-flex; align-items: center; gap: 5px; color: #277554; font-size: .68rem; font-weight: 900; }
body.theme-modern .software-state-badge .game-ui-icon { width: 25px; height: 25px; }

body.theme-modern #gameMenuOffcanvas #menuTabs .nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

body.theme-modern #gameMenuOffcanvas #menuTabs .game-ui-icon { width: 29px; height: 29px; }

/* Disclosure controls: illustration + readable label + animated chevron. */
body.theme-modern .strategy-toggle-meta .strategy-detail-icon { width: 29px; height: 29px; }
body.theme-modern .strategy-toggle-meta .strategy-chevron-icon { width: 25px; height: 25px; transition: transform .25s ease; }
body.theme-modern .strategy-summary.is-open .strategy-chevron-icon { transform: rotate(180deg); }

/* V1.1 uses one full character render at a time. Each state has its own
   expression and hand pose, so movement is visible without stacked bodies. */
body.theme-modern .character-mouth-layer { display: none !important; }
body.theme-modern .character-rig:not([data-pose="idle"]) .character-blink-layer { display: none !important; }

body.theme-modern .character-frame-current.character-pose-pop {
  animation: v13PosePop .24s cubic-bezier(.2,.9,.25,1.12) !important;
}

body.theme-modern .character-rig[data-pose="talk"] .character-frame-current {
  animation: v13TalkMotion .48s ease-in-out infinite alternate !important;
}

body.theme-modern .character-rig[data-pose="thinking"] .character-frame-current {
  animation: v13ThinkMotion 1.5s ease-in-out infinite alternate !important;
}

@keyframes v12IdleBody {
  0%,100% { transform: translateY(0) rotate(0deg) scale(1); }
  45% { transform: translateY(-2px) rotate(-.22deg) scale(1.004,1.009); }
  55% { transform: translateY(-3px) rotate(.18deg) scale(.999,1.01); }
}

@keyframes v12SpeakingBody {
  from { transform: translateY(0) rotate(-.35deg) scale(1); }
  to { transform: translateY(-3px) rotate(.42deg) scale(1.004); }
}

@keyframes v12SpeakingPulse {
  from { transform: translateY(0); }
  to { transform: translateY(-1.5px); }
}

@keyframes v12Blink {
  0%, 39%, 42%, 72%, 75%, 100% { opacity: 0; transform: scaleY(.1); }
  40%, 41%, 73%, 74% { opacity: 1; transform: scaleY(1); }
}

@keyframes v12GestureAccent {
  from { opacity: 0; transform: translateY(5px) scale(.8) rotate(-12deg); }
  to { opacity: .9; transform: translateY(-3px) scale(1) rotate(4deg); }
}

@keyframes v13PosePop {
  0% { transform: translateY(5px) scale(.975); }
  70% { transform: translateY(-2px) scale(1.012); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes v13TalkMotion {
  0% { transform: translateY(0) rotate(-.35deg) scale(1); }
  100% { transform: translateY(-4px) rotate(.45deg) scale(1.012); }
}

@keyframes v13ThinkMotion {
  0% { transform: translateY(0) rotate(0); }
  100% { transform: translateY(-3px) rotate(-.5deg); }
}

@media (max-width: 520px) {
  body.theme-modern .game-command-window:has(#tab-ops.active) {
    height: auto !important;
    max-height: calc(100dvh - 32px) !important;
  }
  body.theme-modern .game-command-window .market-status-row { grid-template-columns: minmax(0,1fr) 80px !important; }
  body.theme-modern .market-rival-button { min-height: 72px; grid-template-columns: 1fr; justify-items: center; gap: 1px; padding: 5px; text-align: center; }
  body.theme-modern .market-rival-button .competitor-icon { width: 39px !important; height: 39px !important; }
  body.theme-modern .market-rival-button small { display: none; }
  body.theme-modern #tab-ops .modern-tool-card { min-height: 104px; grid-template-columns: 42px minmax(0,1fr); padding: 9px; }
  body.theme-modern #tab-ops .modern-tool-icon { width: 42px; height: 42px; }
  body.theme-modern .analytics-primary-action { min-height: 78px; grid-template-columns: 42px minmax(0,1fr); padding: 9px; }
  body.theme-modern .analytics-primary-action .game-ui-icon { width: 42px; height: 42px; }
  body.theme-modern .strategy-toggle-meta .strategy-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  body.theme-modern .game-world-stage .character-rig,
  body.theme-modern .game-world-stage.character-is-speaking .character-rig,
  body.theme-modern .game-world-stage.character-is-speaking .character-frame-current,
  body.theme-modern .character-blink-layer i,
  body.theme-modern .character-motion-accent { animation: none !important; }
}


/* UI layer 10: game-kawaii-v2.css */
/* DATA POP Kawaii V2 — final readability, dialogue and safe-layout layer. */

:root {
  --k2-ink: #573b46;
  --k2-line: #9d6170;
  --k2-paper: #fff9ec;
  --k2-paper-soft: #fff1dc;
  --k2-pink: #ff8fac;
  --k2-pink-deep: #db5f81;
  --k2-cyan: #75ddea;
  --k2-mint: #9be3bb;
  --k2-gold: #ffd975;
  --k2-shadow: 0 5px 0 rgba(87, 59, 70, .24), 0 14px 30px rgba(55, 39, 45, .18);
  --k2-safe-x: clamp(14px, 4vw, 24px);
}

html { text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }

body.theme-modern {
  font-family: "Sarabun", "Leelawadee UI", Tahoma, sans-serif !important;
  color: var(--k2-ink) !important;
}

body.theme-modern :where(button, input, select, textarea) {
  font: inherit;
}

body.theme-modern :where(.game-command-window, .quick-command-menu, #gameMenuOffcanvas, .swal2-popup) {
  overflow-wrap: anywhere;
}

body.theme-modern :where(.game-command-window, .quick-command-menu, #gameMenuOffcanvas) button {
  min-width: 0;
}

/* Prevent the former stage character and the dialogue portrait from appearing together. */
body.theme-modern.advisor-dialogue-open .game-world-stage > .character-rig,
body.theme-modern.advisor-dialogue-open .game-world-stage > .world-player-label,
body.theme-modern.advisor-dialogue-open .game-world-stage > .world-status-ticker {
  opacity: 0 !important;
  transform: translateY(14px) scale(.97) !important;
  pointer-events: none !important;
}

body.theme-modern .advisor-dialogue-backdrop {
  position: absolute;
  z-index: 27;
  inset: 0;
  display: block;
  visibility: hidden;
  padding: 0;
  border: 0;
  background: linear-gradient(180deg, rgba(39, 31, 37, .18), rgba(39, 31, 37, .58));
  opacity: 0;
  transition: opacity .22s ease, visibility .22s;
  pointer-events: none;
  backdrop-filter: blur(1.5px);
}

body.theme-modern.advisor-dialogue-open .advisor-dialogue-backdrop {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

body.theme-modern .character-action-menu.game-dialogue-layer {
  position: absolute !important;
  z-index: 29 !important;
  right: var(--k2-safe-x) !important;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
  left: var(--k2-safe-x) !important;
  width: auto !important;
  max-width: none !important;
  min-height: 204px;
  padding: 0 !important;
  visibility: hidden;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 0;
  transform: translateY(20px) scale(.985) !important;
  transform-origin: 50% 100% !important;
  transition: opacity .2s ease, transform .28s cubic-bezier(.2,.85,.25,1.08), visibility .2s !important;
  pointer-events: none;
}

body.theme-modern .character-action-menu.game-dialogue-layer::after { display: none !important; }

body.theme-modern .character-action-menu.game-dialogue-layer.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale(1) !important;
  pointer-events: auto;
}

body.theme-modern .game-dialogue-layer > .advisor-portrait-wrap {
  position: absolute;
  z-index: 2;
  bottom: 0;
  left: -2%;
  display: block !important;
  width: clamp(132px, 40%, 210px);
  height: 115%;
  overflow: visible;
  filter: drop-shadow(0 8px 8px rgba(50, 35, 39, .25));
  pointer-events: none;
}

body.theme-modern .advisor-portrait-wrap > img {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 118%;
  height: 118%;
  object-fit: contain;
  object-position: 50% 100%;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  animation: k2PortraitTalk .9s ease-in-out infinite alternate;
}

body.theme-modern .advisor-portrait-tag {
  position: absolute;
  bottom: 4px;
  left: 50%;
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  color: #fff;
  border: 2px solid #fff7e8;
  border-radius: 999px;
  background: #5c8090;
  box-shadow: 0 3px 0 rgba(58, 48, 53, .26);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .08em;
  white-space: nowrap;
  transform: translateX(-50%);
}

body.theme-modern .advisor-spark {
  position: absolute;
  z-index: 3;
  color: var(--k2-gold);
  font-size: 1.45rem;
  filter: drop-shadow(0 2px 0 #8d5e55);
  animation: k2Spark 1.15s ease-in-out infinite alternate;
}

body.theme-modern .advisor-spark-one { top: 9%; left: 8%; }
body.theme-modern .advisor-spark-two { top: 22%; right: -1%; color: var(--k2-pink); animation-delay: -.5s; }

body.theme-modern .game-dialogue-layer > .advisor-dialogue-card {
  position: relative;
  z-index: 1;
  display: flex !important;
  min-height: 188px;
  margin: 0 0 0 clamp(90px, 27%, 145px);
  padding: 13px 13px 12px clamp(42px, 11vw, 66px);
  flex-direction: column;
  color: var(--k2-ink);
  border: 3px solid var(--k2-line);
  border-radius: 24px;
  background: linear-gradient(155deg, #fffdf4 0%, var(--k2-paper) 55%, #ffeddd 100%);
  box-shadow: var(--k2-shadow);
}

body.theme-modern .game-dialogue-layer > .advisor-dialogue-card::before {
  position: absolute;
  top: 0;
  right: 19px;
  left: clamp(48px, 11vw, 70px);
  height: 7px;
  content: "";
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, var(--k2-cyan), var(--k2-pink), var(--k2-gold));
}

body.theme-modern .game-dialogue-layer .advisor-dialogue-card > header {
  display: flex !important;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 5px !important;
}

body.theme-modern .game-dialogue-layer .advisor-dialogue-card > header > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

body.theme-modern .game-dialogue-layer .advisor-dialogue-card > header small {
  color: var(--k2-pink-deep);
  font-size: clamp(.68rem, 2.8vw, .78rem) !important;
  font-weight: 800;
  line-height: 1.1;
}

body.theme-modern .game-dialogue-layer .advisor-dialogue-card > header strong {
  color: var(--k2-ink);
  font-size: clamp(1rem, 4.4vw, 1.25rem) !important;
  font-weight: 900;
  line-height: 1.2;
}

body.theme-modern .advisor-dialogue-close {
  display: grid !important;
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  flex: 0 0 38px !important;
  padding: 0 !important;
  place-items: center;
  color: #704653 !important;
  border: 2px solid #c77b8c !important;
  border-radius: 13px !important;
  background: #ffdce4 !important;
  box-shadow: 0 3px 0 rgba(112,70,83,.18) !important;
  font-size: .9rem !important;
}

body.theme-modern .advisor-message-button {
  position: relative;
  display: block !important;
  width: 100%;
  min-height: 56px;
  margin: 0 !important;
  padding: 8px 25px 8px 10px !important;
  color: #674b53 !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: rgba(255,255,255,.72) !important;
  box-shadow: 0 0 0 1.5px rgba(157,97,112,.2) inset !important;
  font-size: clamp(.82rem, 3.6vw, 1rem) !important;
  font-weight: 700 !important;
  line-height: 1.48 !important;
  text-align: left !important;
}

body.theme-modern .advisor-message-button > i {
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 0;
  height: 0;
  border-top: 7px solid var(--k2-pink-deep);
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
  animation: k2MessageCue .7s ease-in-out infinite alternate;
}

body.theme-modern .advisor-choice-label {
  display: block;
  margin: 6px 0 4px;
  color: #98717c;
  font-size: .66rem;
  font-weight: 800;
}

body.theme-modern .game-dialogue-layer .advisor-dialogue-actions {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

body.theme-modern .game-dialogue-layer .advisor-dialogue-actions > button {
  display: flex !important;
  min-width: 0;
  min-height: 48px !important;
  padding: 5px 3px !important;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--k2-ink) !important;
  border: 2px solid rgba(117, 79, 90, .38) !important;
  border-radius: 14px !important;
  background: linear-gradient(155deg, #effdff, #b9edf3) !important;
  box-shadow: 0 3px 0 rgba(87,59,70,.16) !important;
  font-size: clamp(.65rem, 2.7vw, .76rem) !important;
  font-weight: 900 !important;
  line-height: 1.08;
}

body.theme-modern .game-dialogue-layer .advisor-dialogue-actions > button:nth-child(2) {
  background: linear-gradient(155deg, #fff0f5, #ffc4d3) !important;
}

body.theme-modern .game-dialogue-layer .advisor-dialogue-actions > button:nth-child(3) {
  background: linear-gradient(155deg, #f3ffe8, #bce9a4) !important;
}

body.theme-modern .game-dialogue-layer .advisor-dialogue-actions .game-ui-icon {
  width: 27px !important;
  height: 27px !important;
  flex: 0 0 27px;
}

/* Cloud Save is a game panel, not a Bootstrap form floating above the theme. */
body.theme-modern .swal2-popup.game-cloud-popup {
  width: min(calc(100vw - (var(--k2-safe-x) * 2)), 430px) !important;
  padding: 20px !important;
  color: var(--k2-ink) !important;
  border: 3px solid var(--k2-line) !important;
  border-radius: 28px !important;
  background: linear-gradient(160deg, #fffdf5, #ffefdf) !important;
  box-shadow: var(--k2-shadow) !important;
}

body.theme-modern .game-cloud-title {
  padding: 0 !important;
  color: var(--k2-ink) !important;
  font-size: clamp(1.25rem, 5.2vw, 1.65rem) !important;
  font-weight: 900 !important;
}

body.theme-modern .cloud-save-form { display: grid; gap: 7px; text-align: left; }
body.theme-modern .cloud-save-badge { display: inline-flex; width: max-content; align-items: center; gap: 7px; margin: 5px auto 9px; padding: 5px 12px; color: #5d5565; border: 2px solid #d3a974; border-radius: 999px; background: #fff1b8; font-size: .72rem; font-weight: 900; letter-spacing: .06em; }
body.theme-modern .cloud-save-badge .game-ui-icon { width: 25px; height: 25px; }
body.theme-modern .cloud-save-form label { color: var(--k2-ink); font-size: .84rem; font-weight: 900; }
body.theme-modern .cloud-save-form input { width: 100%; min-height: 50px; padding: 10px 13px; color: var(--k2-ink); border: 2px solid #d0a0aa; border-radius: 15px; outline: none; background: #fff; font-size: 1rem; }
body.theme-modern .cloud-save-form input:focus { border-color: #5ebdce; box-shadow: 0 0 0 4px rgba(117,221,234,.24); }
body.theme-modern .cloud-save-form p { margin: 5px 0 0; padding: 9px 11px; color: #7d6269; border-radius: 13px; background: #fff4c9; font-size: .75rem; font-weight: 700; line-height: 1.45; }
body.theme-modern .game-cloud-actions { display: grid !important; width: 100%; grid-template-columns: 1fr 1.3fr; gap: 9px; margin: 15px 0 0 !important; }
body.theme-modern .game-cloud-actions button { min-height: 50px; margin: 0 !important; border: 2px solid var(--k2-line) !important; border-radius: 16px !important; font-weight: 900 !important; }
body.theme-modern .game-cloud-confirm { color: #50343f !important; background: linear-gradient(155deg, #c9f7fb, var(--k2-cyan)) !important; box-shadow: 0 4px 0 #4d9eaa !important; }
body.theme-modern .game-cloud-cancel { color: #735861 !important; background: #fff7ec !important; box-shadow: 0 4px 0 rgba(87,59,70,.16) !important; }

/* Settings keeps the same kawaii geometry and readable touch targets. */
body.theme-modern .swal2-popup.game-settings-popup {
  width: min(calc(100vw - (var(--k2-safe-x) * 2)), 460px) !important;
  max-height: calc(100dvh - 24px);
  padding: 20px !important;
  overflow-y: auto;
  color: var(--k2-ink) !important;
  border: 3px solid var(--k2-line) !important;
  border-radius: 28px !important;
  background: linear-gradient(160deg, #fffdf5, #ffeddd) !important;
  box-shadow: var(--k2-shadow) !important;
}

body.theme-modern .game-settings-popup .swal2-title {
  padding: 2px 38px 8px !important;
  color: var(--k2-ink) !important;
  font-size: clamp(1.28rem, 5.6vw, 1.7rem) !important;
  font-weight: 900 !important;
}

body.theme-modern .game-settings-popup .swal2-html-container { margin: 4px 0 0 !important; overflow: visible !important; }
body.theme-modern .game-settings-content { gap: 10px !important; }
body.theme-modern .game-settings-content > :where(.bg-white, .save-system-container) { padding: 11px !important; border: 2px solid rgba(157,97,112,.28) !important; border-radius: 19px !important; background: rgba(255,255,255,.78) !important; box-shadow: 0 3px 0 rgba(87,59,70,.1) !important; }
body.theme-modern .game-settings-content .fw-bold { font-size: clamp(.78rem, 3.3vw, .9rem) !important; }
body.theme-modern .game-settings-content .form-switch .form-check-input { width: 2.4em; height: 1.3em; }
body.theme-modern .game-settings-content .form-range { min-height: 24px; }
body.theme-modern .settings-game-button { min-height: 68px; justify-content: center; gap: 3px; color: var(--k2-ink) !important; border: 2px solid rgba(157,97,112,.28) !important; background: linear-gradient(150deg, #f2fdff, #d0f2f6) !important; box-shadow: 0 3px 0 rgba(87,59,70,.12) !important; }
body.theme-modern .settings-game-button:nth-child(2) { background: linear-gradient(150deg, #fff8d9, #ffe6a1) !important; }
body.theme-modern .settings-game-button .game-ui-icon { width: 31px; height: 31px; }
body.theme-modern .settings-game-button span { font-size: clamp(.7rem, 2.8vw, .8rem); font-weight: 900; }
body.theme-modern .settings-save-button { min-height: 42px; gap: 5px; padding-inline: 9px !important; color: #6a5360 !important; border: 2px solid #bea3aa !important; border-radius: 12px !important; background: #fffaf1 !important; box-shadow: 0 2px 0 rgba(87,59,70,.1) !important; font-size: clamp(.7rem, 2.8vw, .8rem) !important; font-weight: 800 !important; }
body.theme-modern .settings-save-button .game-ui-icon { width: 24px; height: 24px; flex: 0 0 24px; }
body.theme-modern .settings-cloud-button { color: #3e5961 !important; border-color: #62bcca !important; background: linear-gradient(150deg, #eaffff, #aeeaf1) !important; }
body.theme-modern .settings-advanced-toggle { min-height: 40px; color: #735c65 !important; font-size: .78rem !important; font-weight: 800; }
body.theme-modern .game-settings-close { top: 14px !important; right: 14px !important; width: 38px !important; height: 38px !important; color: #704653 !important; border: 2px solid #c77b8c !important; border-radius: 13px !important; background: #ffdce4 !important; box-shadow: 0 3px 0 rgba(112,70,83,.18) !important; font-size: 1.4rem !important; }

@media (max-width: 359px) {
  body.theme-modern .game-settings-popup .save-system-container > .row { grid-template-columns: 1fr; }
  body.theme-modern .game-settings-popup .save-system-container > .row > [class*="col-"] { width: 100%; }
}

/* Last-resort guards for long Thai labels and narrow viewports. */
body.theme-modern .game-action-dock .game-dock-btn > span:last-child { font-size: clamp(.64rem, 2.7vw, .78rem) !important; }
body.theme-modern .quick-command-grid b { font-size: clamp(.76rem, 3vw, .9rem) !important; }
body.theme-modern .quick-command-grid small { font-size: clamp(.65rem, 2.4vw, .74rem) !important; }
body.theme-modern .game-command-window :where(.accordion-button, .price-slider-container, .market-mood-card) { max-width: 100%; }

@keyframes k2PortraitTalk {
  from { transform: translateX(-50%) translateY(0) rotate(-.35deg); }
  to { transform: translateX(-50%) translateY(-3px) rotate(.35deg); }
}

@keyframes k2Spark { from { opacity: .45; transform: scale(.82) rotate(-7deg); } to { opacity: 1; transform: scale(1.12) rotate(7deg); } }
@keyframes k2MessageCue { from { transform: translateY(0); } to { transform: translateY(3px); } }

@media (min-width: 900px) {
  body.theme-modern .character-action-menu.game-dialogue-layer {
    right: clamp(118px, 9vw, 154px) !important;
    bottom: 26px !important;
    left: auto !important;
    width: min(760px, calc(100vw - 210px)) !important;
    min-height: 228px;
  }

  body.theme-modern .game-dialogue-layer > .advisor-portrait-wrap { left: 0; width: 245px; height: 128%; }
  body.theme-modern .game-dialogue-layer > .advisor-dialogue-card { min-height: 216px; margin-left: 176px; padding: 18px 18px 15px 79px; }
  body.theme-modern .game-dialogue-layer .advisor-dialogue-actions { gap: 10px; }
  body.theme-modern .game-dialogue-layer .advisor-dialogue-actions > button { min-height: 58px !important; font-size: .86rem !important; }
  body.theme-modern .game-dialogue-layer .advisor-dialogue-actions .game-ui-icon { width: 34px !important; height: 34px !important; }
}

@media (max-width: 359px), (max-height: 680px) and (max-width: 899px) {
  body.theme-modern .character-action-menu.game-dialogue-layer { bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important; min-height: 180px; }
  body.theme-modern .game-dialogue-layer > .advisor-portrait-wrap { width: 122px; height: 108%; }
  body.theme-modern .game-dialogue-layer > .advisor-dialogue-card { min-height: 168px; margin-left: 78px; padding: 10px 9px 9px 37px; border-radius: 20px; }
  body.theme-modern .advisor-choice-label { display: none; }
  body.theme-modern .advisor-message-button { min-height: 49px; padding-block: 6px !important; font-size: .76rem !important; }
  body.theme-modern .game-dialogue-layer .advisor-dialogue-actions > button { min-height: 43px !important; }
  body.theme-modern .game-dialogue-layer .advisor-dialogue-actions .game-ui-icon { width: 23px !important; height: 23px !important; }
}

@media (prefers-reduced-motion: reduce) {
  body.theme-modern .advisor-portrait-wrap > img,
  body.theme-modern .advisor-spark,
  body.theme-modern .advisor-message-button > i { animation: none !important; }
}


/* UI layer 11: game-kawaii-v3.css */
/* DATA POP Kawaii V3 — visual-novel dialogue, with a consistent type scale. */

:root {
  --k3-ink: #513946;
  --k3-line: #a96f82;
  --k3-paper: #fffaf1;
  --k3-pink: #f58aaa;
  --k3-lilac: #d5b4ed;
  --k3-mint: #9fe1d2;
  --k3-shadow: 0 7px 0 rgba(81, 57, 70, .18), 0 18px 38px rgba(46, 31, 38, .28);
}

/* A contained visual-novel panel: portrait, speaker label, message, then choices. */
body.theme-modern .visual-novel-dialogue.game-dialogue-layer {
  display: grid !important;
  grid-template-columns: clamp(118px, 28vw, 218px) minmax(0, 1fr);
  min-height: 216px;
  align-items: end;
  gap: 0;
}

body.theme-modern .visual-novel-dialogue .dialogue-character-stage {
  position: relative;
  z-index: 2;
  height: 100%;
  min-height: 216px;
  overflow: hidden;
  border: 3px solid var(--k3-line);
  border-right: 0;
  border-radius: 25px 0 0 25px;
  background: linear-gradient(155deg, #fdf1ff, #dff8f2);
  box-shadow: var(--k3-shadow);
}

body.theme-modern .visual-novel-dialogue .dialogue-portrait-glow {
  position: absolute;
  z-index: 1;
  inset: 12% 8% 10%;
  border-radius: 42% 48% 45% 40%;
  background: radial-gradient(circle, rgba(255, 255, 255, .82), rgba(255, 210, 230, .08) 66%);
}

body.theme-modern .visual-novel-dialogue .dialogue-character-stage > img {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  mix-blend-mode: multiply;
  transition: transform .24s ease, filter .24s ease;
}

body.theme-modern .visual-novel-dialogue .dialogue-character-stage > img[data-reaction="talk"] {
  animation: k3PortraitSpeak .72s ease-in-out infinite alternate;
}

body.theme-modern .visual-novel-dialogue .dialogue-character-stage > img[data-reaction="happy"] {
  filter: saturate(1.12) brightness(1.04);
}

body.theme-modern .visual-novel-dialogue .dialogue-character-stage > img[data-reaction="thinking"] {
  filter: saturate(.88) brightness(.98);
  transform: translateX(-2%) scale(1.025);
}

body.theme-modern .visual-novel-dialogue .dialogue-character-label {
  position: absolute;
  z-index: 3;
  right: 9px;
  bottom: 10px;
  padding: 4px 8px;
  color: #fff;
  border: 2px solid #fff7ef;
  border-radius: 999px;
  background: #5f8090;
  box-shadow: 0 3px 0 rgba(74, 55, 61, .24);
  font-size: clamp(.52rem, 1.7vw, .64rem);
  font-weight: 900;
  letter-spacing: .07em;
}

body.theme-modern .visual-novel-dialogue .dialogue-content-card {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  min-height: 196px;
  padding: 13px 14px 12px;
  flex-direction: column;
  color: var(--k3-ink);
  border: 3px solid var(--k3-line);
  border-radius: 0 25px 25px 0;
  background: linear-gradient(150deg, #fffef8 0%, var(--k3-paper) 58%, #ffebf0 100%);
  box-shadow: var(--k3-shadow);
}

body.theme-modern .visual-novel-dialogue .dialogue-content-card::before {
  position: absolute;
  top: 0;
  right: 24px;
  left: 0;
  height: 7px;
  content: "";
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, var(--k3-mint), var(--k3-lilac), var(--k3-pink));
}

body.theme-modern .visual-novel-dialogue .dialogue-speaker-bar {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

body.theme-modern .visual-novel-dialogue .dialogue-speaker { display: flex; min-width: 0; flex-direction: column; }
body.theme-modern .visual-novel-dialogue .dialogue-speaker small { color: #c95d80; font-size: clamp(.65rem, 2.4vw, .76rem); font-weight: 800; line-height: 1.1; }
body.theme-modern .visual-novel-dialogue .dialogue-speaker strong { color: var(--k3-ink); font-size: clamp(1rem, 4vw, 1.22rem); font-weight: 900; line-height: 1.15; }

body.theme-modern .visual-novel-dialogue .advisor-message-button {
  min-height: 62px;
  padding: 9px 27px 9px 11px !important;
  color: #5d4750 !important;
  border: 2px solid rgba(169, 111, 130, .28) !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, .86) !important;
  font-size: clamp(.84rem, 3.25vw, 1rem) !important;
  font-weight: 700 !important;
  line-height: 1.48 !important;
}

body.theme-modern .visual-novel-dialogue .dialogue-choice-area { margin-top: auto; }
body.theme-modern .visual-novel-dialogue .advisor-choice-label { margin: 7px 0 4px; font-size: clamp(.62rem, 2.2vw, .7rem); }
body.theme-modern .visual-novel-dialogue .advisor-dialogue-actions { gap: 7px; }
body.theme-modern .visual-novel-dialogue .advisor-dialogue-actions > button { min-height: 47px !important; border-radius: 14px !important; font-size: clamp(.66rem, 2.45vw, .78rem) !important; }

@keyframes k3PortraitSpeak {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-3px) scale(1.018); }
}

@media (min-width: 900px) {
  body.theme-modern .visual-novel-dialogue.game-dialogue-layer {
    grid-template-columns: 236px minmax(0, 1fr);
    min-height: 238px;
  }
  body.theme-modern .visual-novel-dialogue .dialogue-character-stage { min-height: 238px; }
  body.theme-modern .visual-novel-dialogue .dialogue-content-card { min-height: 224px; padding: 18px 19px 15px; }
  body.theme-modern .visual-novel-dialogue .advisor-message-button { min-height: 72px; }
  body.theme-modern .visual-novel-dialogue .advisor-dialogue-actions > button { min-height: 58px !important; }
}

@media (max-width: 430px) {
  body.theme-modern .visual-novel-dialogue.game-dialogue-layer { grid-template-columns: 102px minmax(0, 1fr); min-height: 190px; }
  body.theme-modern .visual-novel-dialogue .dialogue-character-stage { min-height: 190px; border-radius: 21px 0 0 21px; }
  body.theme-modern .visual-novel-dialogue .dialogue-content-card { min-height: 180px; padding: 10px 10px 9px; border-radius: 0 21px 21px 0; }
  body.theme-modern .visual-novel-dialogue .dialogue-speaker-bar { min-height: 34px; margin-bottom: 4px; }
  body.theme-modern .visual-novel-dialogue .advisor-dialogue-close { width: 32px !important; height: 32px !important; min-height: 32px !important; flex-basis: 32px !important; }
  body.theme-modern .visual-novel-dialogue .advisor-message-button { min-height: 53px; padding: 7px 21px 7px 8px !important; font-size: .78rem !important; }
  body.theme-modern .visual-novel-dialogue .advisor-choice-label { display: none; }
  body.theme-modern .visual-novel-dialogue .dialogue-choice-area { margin-top: 6px; }
  body.theme-modern .visual-novel-dialogue .advisor-dialogue-actions { gap: 4px; }
  body.theme-modern .visual-novel-dialogue .advisor-dialogue-actions > button { min-height: 41px !important; padding: 3px 2px !important; }
  body.theme-modern .visual-novel-dialogue .advisor-dialogue-actions .game-ui-icon { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.theme-modern .visual-novel-dialogue .dialogue-character-stage > img { animation: none !important; }
}


/* UI layer 12: game-assistant-v4.css */
/* DATA POP assistant V4 — one male coach, one clear decision flow. */

:root {
  --assistant-ink: #493946;
  --assistant-line: #8b6677;
  --assistant-paper: #fffaf0;
  --assistant-cyan: #a9ebee;
  --assistant-pink: #ffc0d0;
  --assistant-mint: #c6edbd;
  --assistant-shadow: 0 6px 0 rgba(73, 57, 70, .18), 0 17px 34px rgba(42, 30, 37, .32);
}

/* The dialog has exactly two regions: the coach portrait and the decision card. */
body.theme-modern .assistant-console-dialogue.game-dialogue-layer {
  display: grid !important;
  grid-template-columns: clamp(126px, 27vw, 198px) minmax(0, 1fr);
  width: min(760px, calc(100vw - 32px)) !important;
  min-height: 208px !important;
  align-items: stretch;
  gap: 0;
  color: var(--assistant-ink);
}

body.theme-modern .assistant-console-dialogue .assistant-console-portrait {
  position: relative;
  z-index: 2;
  min-height: 208px;
  overflow: hidden;
  border: 3px solid var(--assistant-line);
  border-right: 0;
  border-radius: 25px 0 0 25px;
  background:
    radial-gradient(circle at 48% 27%, rgba(255,255,255,.92) 0 18%, transparent 19%),
    linear-gradient(155deg, #ddfbff, #d9eeff 50%, #ffe5ee);
  box-shadow: var(--assistant-shadow);
}

body.theme-modern .assistant-console-dialogue .assistant-portrait-orbit {
  position: absolute;
  z-index: 1;
  top: 14%;
  left: 50%;
  width: 74%;
  aspect-ratio: 1;
  border: 2px dashed rgba(92, 115, 138, .35);
  border-radius: 50%;
  transform: translateX(-50%);
}

body.theme-modern .assistant-console-dialogue .assistant-console-portrait > img {
  position: absolute;
  z-index: 2;
  bottom: -3%;
  left: 50%;
  width: 123%;
  height: 123%;
  object-fit: contain;
  object-position: 50% 100%;
  filter: drop-shadow(0 6px 6px rgba(50, 38, 43, .25));
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  transition: filter .2s ease;
}

body.theme-modern .assistant-console-dialogue .assistant-console-portrait > img[data-reaction="talk"] {
  animation: assistantCoachTalk .64s ease-in-out infinite alternate;
}

body.theme-modern .assistant-console-dialogue .assistant-console-portrait > img[data-reaction="happy"] {
  filter: saturate(1.1) brightness(1.04) drop-shadow(0 6px 6px rgba(50, 38, 43, .25));
}

body.theme-modern .assistant-console-dialogue .assistant-console-portrait > img[data-reaction="thinking"] {
  filter: saturate(.84) brightness(.97) drop-shadow(0 6px 6px rgba(50, 38, 43, .25));
}

body.theme-modern .assistant-console-dialogue .assistant-online-dot {
  position: absolute;
  z-index: 3;
  bottom: 10px;
  left: 50%;
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 9px;
  color: #fff;
  border: 2px solid #fff9ef;
  border-radius: 999px;
  background: #589b7a;
  box-shadow: 0 3px 0 rgba(59, 84, 70, .23);
  font-size: clamp(.58rem, 1.9vw, .68rem);
  font-weight: 900;
  white-space: nowrap;
  transform: translateX(-50%);
}

body.theme-modern .assistant-console-dialogue .assistant-console-card {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  min-height: 208px;
  padding: 14px 15px 13px;
  flex-direction: column;
  border: 3px solid var(--assistant-line);
  border-radius: 0 25px 25px 0;
  background: linear-gradient(155deg, #fffef9, var(--assistant-paper) 58%, #ffecf1);
  box-shadow: var(--assistant-shadow);
}

body.theme-modern .assistant-console-dialogue .assistant-console-card::before {
  position: absolute;
  top: 0;
  right: 24px;
  left: 0;
  height: 7px;
  content: "";
  border-radius: 0 0 9px 9px;
  background: linear-gradient(90deg, var(--assistant-cyan), #cbb8ed, var(--assistant-pink));
}

body.theme-modern .assistant-console-dialogue .assistant-console-header {
  display: flex;
  min-height: 41px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

body.theme-modern .assistant-console-dialogue .assistant-console-title {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

body.theme-modern .assistant-console-dialogue .assistant-console-title small {
  color: #b25875;
  font-size: clamp(.58rem, 2.1vw, .69rem);
  font-weight: 900;
  letter-spacing: .045em;
  line-height: 1.15;
}

body.theme-modern .assistant-console-dialogue .assistant-console-title strong {
  color: var(--assistant-ink);
  font-size: clamp(.94rem, 3.4vw, 1.18rem);
  font-weight: 900;
  line-height: 1.2;
}

body.theme-modern .assistant-console-dialogue .advisor-message-button {
  min-height: 61px;
  padding: 9px 28px 9px 11px !important;
  color: #5a4650 !important;
  border: 2px solid rgba(139, 102, 119, .25) !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, .88) !important;
  font-size: clamp(.8rem, 2.9vw, .96rem) !important;
  font-weight: 700 !important;
  line-height: 1.46 !important;
  text-align: left !important;
}

body.theme-modern .assistant-console-dialogue .assistant-console-actions { margin-top: auto; }
body.theme-modern .assistant-console-dialogue .advisor-choice-label { display: block; margin: 7px 0 4px; color: #8c6b77; font-size: clamp(.6rem, 1.9vw, .68rem); font-weight: 800; }

body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions > button {
  display: flex !important;
  min-width: 0;
  min-height: 48px !important;
  padding: 6px 7px !important;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  color: var(--assistant-ink) !important;
  border: 2px solid rgba(108, 80, 92, .28) !important;
  border-radius: 14px !important;
  background: linear-gradient(155deg, #eaffff, var(--assistant-cyan)) !important;
  box-shadow: 0 3px 0 rgba(73, 57, 70, .14) !important;
  text-align: left;
}

body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions > button:nth-child(2) { background: linear-gradient(155deg, #fff2f6, var(--assistant-pink)) !important; }
body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions > button:nth-child(3) { background: linear-gradient(155deg, #f7fff0, var(--assistant-mint)) !important; }
body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions .game-ui-icon { width: 28px !important; height: 28px !important; flex: 0 0 28px; }
body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions span { display: flex; min-width: 0; flex-direction: column; }
body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions b { font-size: clamp(.64rem, 2vw, .74rem); font-weight: 900; line-height: 1.05; overflow-wrap: anywhere; }
body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions small { color: rgba(73, 57, 70, .72); font-size: clamp(.49rem, 1.55vw, .57rem); font-weight: 700; line-height: 1.1; }

@keyframes assistantCoachTalk {
  from { transform: translateX(-50%) translateY(0) rotate(-.25deg); }
  to { transform: translateX(-50%) translateY(-3px) rotate(.35deg); }
}

@media (min-width: 900px) {
  body.theme-modern .assistant-console-dialogue.game-dialogue-layer { grid-template-columns: 212px minmax(0, 1fr); min-height: 234px !important; }
  body.theme-modern .assistant-console-dialogue .assistant-console-portrait,
  body.theme-modern .assistant-console-dialogue .assistant-console-card { min-height: 234px; }
  body.theme-modern .assistant-console-dialogue .assistant-console-card { padding: 17px 19px 15px; }
  body.theme-modern .assistant-console-dialogue .advisor-message-button { min-height: 69px; }
  body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions > button { min-height: 58px !important; }
}

@media (max-width: 430px) {
  body.theme-modern .assistant-console-dialogue.game-dialogue-layer { grid-template-columns: 88px minmax(0, 1fr); width: calc(100vw - 24px) !important; min-height: 190px !important; }
  body.theme-modern .assistant-console-dialogue .assistant-console-portrait,
  body.theme-modern .assistant-console-dialogue .assistant-console-card { min-height: 190px; }
  body.theme-modern .assistant-console-dialogue .assistant-console-portrait { border-radius: 21px 0 0 21px; }
  body.theme-modern .assistant-console-dialogue .assistant-console-card { padding: 10px 10px 9px; border-radius: 0 21px 21px 0; }
  body.theme-modern .assistant-console-dialogue .assistant-console-header { min-height: 34px; margin-bottom: 4px; }
  body.theme-modern .assistant-console-dialogue .assistant-console-title small { font-size: .48rem; }
  body.theme-modern .assistant-console-dialogue .assistant-console-title strong { font-size: .78rem; }
  body.theme-modern .assistant-console-dialogue .advisor-dialogue-close { width: 31px !important; height: 31px !important; min-height: 31px !important; flex-basis: 31px !important; }
  body.theme-modern .assistant-console-dialogue .advisor-message-button { min-height: 58px; padding: 7px 21px 7px 8px !important; font-size: .72rem !important; }
  body.theme-modern .assistant-console-dialogue .advisor-choice-label { margin: 5px 0 3px; font-size: .55rem; }
  body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions { gap: 4px; }
  body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions > button { min-height: 42px !important; justify-content: center; padding: 3px !important; text-align: center; }
  body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions .game-ui-icon,
  body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions small { display: none; }
  body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions b { font-size: .58rem; line-height: 1.12; }
  body.theme-modern .assistant-console-dialogue .assistant-online-dot { bottom: 7px; min-height: 20px; padding: 2px 6px; font-size: .48rem; }
}

@media (prefers-reduced-motion: reduce) {
  body.theme-modern .assistant-console-dialogue .assistant-console-portrait > img { animation: none !important; }
}


/* UI layer 13: game-layout-v5.css */
/* DATA POP V5 — the final layout layer.  This file intentionally wins over
   earlier visual experiments and arranges all existing controls into one UI. */

:root {
  --layout-ink: #392d41;
  --layout-muted: #766a78;
  --layout-line: rgba(97, 74, 91, .24);
  --layout-paper: #fffdf8;
  --layout-panel: rgba(255, 253, 248, .94);
  --layout-shadow: 0 16px 34px rgba(61, 42, 55, .16);
  --layout-radius: 22px;
}

body.theme-modern {
  min-height: 100dvh;
  color: var(--layout-ink);
  background: #fff8ee !important;
}

/* Header has one job: show the current notice. Help and settings form a single
   quiet utility group on its right, rather than floating in a second column. */
body.theme-modern .news-container {
  position: fixed !important;
  z-index: 1120 !important;
  top: 0 !important;
  right: 0;
  left: 0;
  height: 58px;
  padding: 8px max(86px, calc((100vw - 1180px) / 2)) 0 !important;
  pointer-events: none;
}

body.theme-modern .news-bar {
  width: 100% !important;
  max-width: none !important;
  height: 44px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  border: 1px solid var(--layout-line) !important;
  border-radius: 14px !important;
  background: var(--layout-panel) !important;
  box-shadow: 0 5px 17px rgba(70, 53, 65, .10) !important;
}

body.theme-modern .live-badge-wrapper .badge {
  min-width: 68px;
  justify-content: center;
  padding: 5px 8px !important;
  border-radius: 8px !important;
  font-size: .62rem !important;
  letter-spacing: .05em;
}

body.theme-modern .ticker-content { justify-content: flex-start !important; }
body.theme-modern .ticker-marquee-text,
body.theme-modern #news-ticker-content {
  overflow: hidden;
  color: var(--layout-ink) !important;
  font-size: .83rem !important;
  font-weight: 700 !important;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.theme-modern .out-badge-pill {
  min-width: 74px !important;
  height: 30px !important;
  margin-left: 8px !important;
  padding: 0 8px !important;
  border: 1px solid rgba(64, 117, 127, .22) !important;
  border-radius: 9px !important;
  background: #e8fbfb !important;
  box-shadow: none !important;
}

body.theme-modern .top-btn-group {
  position: fixed !important;
  z-index: 1130 !important;
  top: 13px !important;
  right: max(14px, calc((100vw - 1240px) / 2)) !important;
  bottom: auto !important;
  left: auto !important;
  flex-direction: row !important;
  gap: 6px !important;
}
body.theme-modern .btn-circle-icon {
  width: 32px !important;
  height: 32px !important;
  border: 1px solid var(--layout-line) !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: 0 2px 7px rgba(63, 47, 58, .10) !important;
  font-size: .95rem !important;
}

body.theme-modern .main-container {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  max-width: 1180px !important;
  margin: 0 auto !important;
  padding: 128px 0 118px !important;
}

/* A compact, four-part HUD replaces the loose collection of cards. */
body.theme-modern .scroll-x-container {
  position: absolute !important;
  z-index: 40;
  top: 70px;
  left: 0;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(520px, 56%);
  gap: 8px;
  margin: 0 !important;
  overflow: visible !important;
}
body.theme-modern .scroll-x-container .scroll-card {
  min-width: 0 !important;
  height: 52px;
  margin: 0 !important;
  border: 1px solid var(--layout-line) !important;
  border-radius: 14px !important;
  background: var(--layout-panel) !important;
  box-shadow: 0 4px 13px rgba(60, 45, 54, .10) !important;
}
body.theme-modern .scroll-x-container .card-body { display: grid; height: 100%; padding: 7px 8px !important; place-content: center; }
body.theme-modern .scroll-x-container .text-xxs { margin: 0 0 1px !important; color: var(--layout-muted) !important; font-size: .56rem !important; line-height: 1; text-transform: none; }
body.theme-modern .scroll-x-container h5 { font-size: .94rem !important; line-height: 1 !important; }

/* The scene is a single visual canvas. Context lives at the top; the human
   character and the one-line suggestion live at the bottom. */
body.theme-modern .game-world-stage {
  min-height: clamp(500px, 66vh, 680px) !important;
  margin: 0 !important;
  overflow: hidden;
  border: 1px solid rgba(83, 65, 80, .34) !important;
  border-radius: 28px !important;
  box-shadow: var(--layout-shadow) !important;
}
body.theme-modern .game-world-stage::before { background: linear-gradient(180deg, rgba(29, 21, 35, .18), transparent 34%, rgba(27, 19, 32, .18)) !important; }
body.theme-modern .world-topline {
  top: 16px !important;
  right: 18px !important;
  left: auto !important;
  display: flex;
  gap: 6px !important;
}
body.theme-modern .world-chip {
  min-height: 30px !important;
  padding: 5px 9px !important;
  border: 1px solid rgba(255,255,255,.62) !important;
  border-radius: 9px !important;
  background: rgba(45, 36, 52, .76) !important;
  box-shadow: 0 3px 10px rgba(29, 22, 34, .18) !important;
  font-size: .68rem !important;
}
body.theme-modern .world-unified-dashboard {
  position: absolute !important;
  z-index: 4;
  top: 76px !important;
  right: 18px !important;
  left: auto !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  width: min(470px, 49%);
  max-width: none !important;
  gap: 8px !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
}
body.theme-modern .world-store-plaque,
body.theme-modern .world-mode-card,
body.theme-modern .daily-order-board {
  min-width: 0;
  color: var(--layout-ink) !important;
  border: 1px solid rgba(255,255,255,.64) !important;
  border-radius: 14px !important;
  background: rgba(255, 253, 248, .92) !important;
  box-shadow: 0 4px 15px rgba(39, 29, 44, .13) !important;
}
body.theme-modern .world-store-plaque,
body.theme-modern .world-mode-card { min-height: 58px !important; padding: 8px 10px !important; }
body.theme-modern .world-store-plaque small,
body.theme-modern .world-mode-card small { color: var(--layout-muted) !important; font-size: .61rem !important; }
body.theme-modern .world-store-plaque b,
body.theme-modern .world-mode-card b { color: var(--layout-ink) !important; font-size: .79rem !important; line-height: 1.15; }
body.theme-modern .daily-order-board { grid-column: 1 / -1; overflow: hidden; }
body.theme-modern .daily-board-ribbon { min-height: 38px !important; padding: 8px 10px !important; border: 0 !important; background: transparent !important; box-shadow: none !important; font-size: .74rem !important; }
body.theme-modern .daily-board-content { padding: 0 10px 9px !important; }
body.theme-modern .daily-order-row { min-height: 42px !important; padding: 5px 0 !important; }

/* Character is a stable, quiet affordance: no artificial eyes, mouth, bobbing
   or idle pose swaps. Static pose changes still reflect a deliberate command. */
body.theme-modern .game-world-stage .character-rig,
body.theme-modern .game-world-stage.character-is-speaking .character-rig,
body.theme-modern .game-world-stage .world-character-player,
body.theme-modern .game-world-stage .world-character-player.pose-pop,
body.theme-modern .game-world-stage.character-is-speaking .world-character-player {
  right: auto !important;
  bottom: 0 !important;
  left: 4% !important;
  width: min(31%, 310px) !important;
  height: min(73%, 500px) !important;
  max-width: none !important;
  max-height: none !important;
  animation: none !important;
  filter: drop-shadow(0 10px 10px rgba(31, 22, 37, .25));
  transform: none !important;
}
body.theme-modern .character-frame-current,
body.theme-modern .character-frame-current.character-pose-pop,
body.theme-modern .game-world-stage.character-is-speaking .character-frame-current { animation: none !important; transform: none !important; }
body.theme-modern .character-blink-layer,
body.theme-modern .character-mouth-layer,
body.theme-modern .character-motion-accent { display: none !important; }
body.theme-modern .world-player-label {
  z-index: 5;
  right: auto !important;
  bottom: 24px !important;
  left: 28px !important;
  padding: 7px 11px !important;
  border: 1px solid rgba(255,255,255,.7) !important;
  border-radius: 10px !important;
  background: rgba(47, 37, 53, .85) !important;
  box-shadow: 0 4px 12px rgba(30,21,35,.23) !important;
  font-size: .72rem !important;
}
body.theme-modern .world-dialogue {
  z-index: 5;
  top: auto !important;
  right: 22px !important;
  bottom: 22px !important;
  left: auto !important;
  width: min(48%, 500px) !important;
  min-height: 60px;
  padding: 11px 14px !important;
  border: 1px solid rgba(255,255,255,.66) !important;
  border-radius: 15px !important;
  background: rgba(255, 253, 248, .94) !important;
  box-shadow: 0 6px 18px rgba(40,29,45,.17) !important;
  color: var(--layout-ink) !important;
  font-size: .78rem !important;
  line-height: 1.38 !important;
}

/* Persistent actions become one centered dock; desktop gets text, mobile gets
   the same five actions in a compact thumb-friendly rail. */
body.theme-modern .game-action-dock {
  position: fixed !important;
  z-index: 1100 !important;
  right: 50% !important;
  bottom: 16px !important;
  left: auto !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(650px, calc(100vw - 32px)) !important;
  min-height: 65px !important;
  padding: 6px !important;
  transform: translateX(50%);
  border: 1px solid var(--layout-line) !important;
  border-radius: 18px !important;
  background: rgba(255,253,248,.96) !important;
  box-shadow: 0 10px 27px rgba(57, 39, 53, .23) !important;
}
body.theme-modern .game-action-dock .game-dock-btn {
  min-width: 0 !important;
  min-height: 51px !important;
  padding: 4px 8px !important;
  gap: 2px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--layout-muted) !important;
}
body.theme-modern .game-action-dock .game-dock-btn.is-active,
body.theme-modern .game-action-dock .game-dock-primary { background: #e4f8f7 !important; color: #257888 !important; }
body.theme-modern .game-action-dock .game-action-icon { width: 22px !important; height: 22px !important; }
body.theme-modern .game-action-dock .game-dock-btn span { font-size: .67rem !important; font-weight: 800; }

/* Decision menus all share the same measured sheet/card dimensions. */
body.theme-modern .quick-command-menu {
  width: min(760px, calc(100vw - 32px)) !important;
  max-height: min(720px, calc(100dvh - 110px)) !important;
  padding: 18px !important;
  border: 1px solid rgba(100, 75, 92, .3) !important;
  border-radius: var(--layout-radius) !important;
  background: var(--layout-paper) !important;
  box-shadow: var(--layout-shadow) !important;
}
body.theme-modern .quick-command-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 10px !important; }
body.theme-modern .quick-command-grid > button { min-height: 112px !important; padding: 13px !important; border: 1px solid var(--layout-line) !important; border-radius: 15px !important; box-shadow: none !important; }
body.theme-modern .quick-command-tools { display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 7px; }
body.theme-modern .quick-command-tools button { min-height: 38px !important; border-radius: 10px !important; }

body.theme-modern .game-command-window {
  right: 50% !important;
  bottom: auto !important;
  left: auto !important;
  width: min(920px, calc(100vw - 32px)) !important;
  max-height: min(760px, calc(100dvh - 104px)) !important;
  padding: 18px !important;
  transform: translate(50%, -50%) !important;
  border: 1px solid var(--layout-line) !important;
  border-radius: var(--layout-radius) !important;
  background: var(--layout-paper) !important;
  box-shadow: var(--layout-shadow) !important;
}
body.theme-modern .game-command-window .game-command-titlebar { padding: 0 0 12px !important; }
body.theme-modern .game-command-window #mainGameTabs { margin-bottom: 13px !important; border-color: var(--layout-line) !important; box-shadow: none !important; }
body.theme-modern .game-command-window .tab-content { overflow: auto; max-height: calc(min(760px, 100dvh - 104px) - 130px); padding: 0 2px 4px !important; }
body.theme-modern .game-command-window .accordion,
body.theme-modern .game-command-window .price-slider-container,
body.theme-modern .game-command-window .market-mood-card { border: 1px solid var(--layout-line) !important; box-shadow: none !important; }

body.theme-modern .offcanvas.offcanvas-bottom {
  right: 50% !important;
  bottom: 12px !important;
  left: auto !important;
  width: min(760px, calc(100vw - 32px)) !important;
  height: min(78dvh, 760px) !important;
  max-width: none !important;
  margin: 0 !important;
  transform: translate(50%, 110%) !important;
  border: 1px solid var(--layout-line) !important;
  border-radius: var(--layout-radius) !important;
}
body.theme-modern .offcanvas.offcanvas-bottom.show { transform: translate(50%, 0) !important; }

/* Splash uses the same limited palette and a single content column. */
body.theme-modern .splash-content { width: min(570px, calc(100vw - 32px)) !important; padding: 34px !important; border: 1px solid rgba(255,255,255,.62); border-radius: 28px; background: rgba(45,34,51,.66); box-shadow: var(--layout-shadow); }
body.theme-modern .splash-feature-row { justify-content: center; gap: 7px !important; }
body.theme-modern .splash-feature { padding: 5px 8px !important; font-size: .72rem !important; }

@media (max-width: 760px) {
  body.theme-modern .news-container { height: 50px; padding: 6px 56px 0 10px !important; }
  body.theme-modern .news-bar { height: 38px !important; padding: 0 8px !important; border-radius: 12px !important; }
  body.theme-modern .live-badge-wrapper .badge { display: none !important; }
  body.theme-modern .out-badge-pill { display: none !important; }
  body.theme-modern .ticker-marquee-text, body.theme-modern #news-ticker-content { font-size: .7rem !important; }
  body.theme-modern .top-btn-group { top: 9px !important; right: 10px !important; }
  body.theme-modern .btn-circle-icon { width: 31px !important; height: 31px !important; }
  body.theme-modern .main-container { width: calc(100% - 20px); padding: 112px 0 94px !important; }
  body.theme-modern .scroll-x-container { top: 60px; width: 100%; gap: 5px; }
  body.theme-modern .scroll-x-container .scroll-card { height: 45px; border-radius: 11px !important; }
  body.theme-modern .scroll-x-container .card-body { padding: 5px 3px !important; }
  body.theme-modern .scroll-x-container .text-xxs { font-size: .48rem !important; }
  body.theme-modern .scroll-x-container h5 { font-size: .76rem !important; }
  body.theme-modern .game-world-stage { min-height: calc(100dvh - 224px) !important; border-radius: 21px !important; }
  body.theme-modern .world-topline { top: 10px !important; right: 10px !important; }
  body.theme-modern .world-chip { min-height: 27px !important; padding: 4px 6px !important; font-size: .58rem !important; }
  /* The four metrics occupy 56–101px on this viewport.  Keep store context
     below that strip instead of letting the two information systems overlap. */
  body.theme-modern .world-unified-dashboard { top: 110px !important; right: 10px !important; left: 10px !important; width: auto; gap: 5px !important; }
  body.theme-modern .world-store-plaque, body.theme-modern .world-mode-card { min-height: 49px !important; padding: 6px 7px !important; border-radius: 11px !important; }
  body.theme-modern .world-store-plaque small, body.theme-modern .world-mode-card small { display: none; }
  body.theme-modern .world-store-plaque b, body.theme-modern .world-mode-card b { font-size: .62rem !important; }
  body.theme-modern .daily-board-ribbon { min-height: 32px !important; padding: 5px 8px !important; font-size: .64rem !important; }
  body.theme-modern .daily-board-content { padding: 0 8px 6px !important; }
  body.theme-modern .daily-order-row { min-height: 34px !important; }
  body.theme-modern .daily-order-info small { display: none; }
  body.theme-modern .daily-order-info b, body.theme-modern .daily-order-state { font-size: .58rem !important; }
  body.theme-modern .game-world-stage .character-rig,
  body.theme-modern .game-world-stage .world-character-player { left: -1% !important; width: 50% !important; height: 45% !important; }
  body.theme-modern .world-player-label { bottom: 15px !important; left: 12px !important; padding: 5px 7px !important; font-size: .59rem !important; }
  body.theme-modern .world-dialogue { right: 10px !important; bottom: 13px !important; width: 54% !important; min-height: 52px; padding: 8px 9px !important; border-radius: 12px !important; font-size: .65rem !important; }
  body.theme-modern .game-action-dock { bottom: 8px !important; width: calc(100vw - 20px) !important; min-height: 58px !important; border-radius: 15px !important; }
  body.theme-modern .game-action-dock .game-dock-btn { min-height: 46px !important; padding: 3px 2px !important; }
  body.theme-modern .game-action-dock .game-action-icon { width: 20px !important; height: 20px !important; }
  body.theme-modern .game-action-dock .game-dock-btn span { font-size: .55rem !important; }
  body.theme-modern .quick-command-menu { width: calc(100vw - 20px) !important; padding: 13px !important; border-radius: 18px !important; }
  body.theme-modern .quick-command-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 7px !important; }
  body.theme-modern .quick-command-grid > button { min-height: 76px !important; padding: 9px !important; }
  body.theme-modern .quick-command-tools button span { font-size: .58rem; }
  body.theme-modern .game-command-window { width: calc(100vw - 20px) !important; max-height: calc(100dvh - 82px) !important; padding: 13px !important; border-radius: 18px !important; }
  body.theme-modern .game-command-window .tab-content { max-height: calc(100dvh - 196px); }
  body.theme-modern .offcanvas.offcanvas-bottom { right: 10px !important; bottom: 8px !important; width: calc(100vw - 20px) !important; height: min(80dvh, 760px) !important; transform: translate(0, 110%) !important; border-radius: 18px !important; }
  body.theme-modern .offcanvas.offcanvas-bottom.show { transform: translate(0, 0) !important; }
  body.theme-modern .splash-content { padding: 24px 16px !important; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  body.theme-modern *, body.theme-modern *::before, body.theme-modern *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}


/* UI layer 14: game-modal-v6.css */
/* DATA POP V6 — a single safe-viewport contract for every modal surface.
   Earlier layers contain experimental bottom sheets and side panels.  This
   final layer deliberately makes every task surface predictable: centred,
   inset from system controls, and internally scrollable. */

:root {
  --modal-gutter: 16px;
  --modal-safe-top: max(16px, env(safe-area-inset-top, 0px));
  --modal-safe-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  --modal-radius: 22px;
  --modal-ink: #34283a;
  --modal-line: rgba(91, 66, 84, .28);
  --modal-surface: #fffdf8;
  --modal-shadow: 0 22px 56px rgba(32, 22, 35, .34);
}

/* Never leave global controls above an active modal.  A modal is one focused
   task, so its close control is the only exit affordance in that layer. */
body.theme-modern.quick-command-open .top-btn-group,
body.theme-modern.advisor-dialogue-open .top-btn-group,
body.theme-modern:not(.command-panel-collapsed) .top-btn-group,
body.theme-modern:has(#gameMenuOffcanvas.show) .top-btn-group,
body.theme-modern.quick-command-open .game-action-dock,
body.theme-modern.advisor-dialogue-open .game-action-dock,
body.theme-modern:not(.command-panel-collapsed) .game-action-dock,
body.theme-modern:has(#gameMenuOffcanvas.show) .game-action-dock {
  opacity: 0 !important;
  pointer-events: none !important;
}

body.theme-modern .game-command-backdrop,
body.theme-modern .quick-command-backdrop,
body.theme-modern .advisor-dialogue-backdrop,
body.theme-modern .offcanvas-backdrop {
  z-index: 1390 !important;
  background: rgba(32, 23, 35, .50) !important;
  backdrop-filter: blur(4px);
}

/* Shared card mechanics.  box-sizing and min-height: 0 stop inherited
   Bootstrap dimensions from expanding a card beyond the visible viewport. */
body.theme-modern .game-command-window,
body.theme-modern .quick-command-menu,
body.theme-modern #gameMenuOffcanvas,
body.theme-modern .assistant-console-dialogue.game-dialogue-layer {
  box-sizing: border-box !important;
  max-width: calc(100dvw - (var(--modal-gutter) * 2)) !important;
  max-height: calc(100dvh - var(--modal-safe-top) - var(--modal-safe-bottom)) !important;
  color: var(--modal-ink) !important;
  border: 1px solid var(--modal-line) !important;
  border-radius: var(--modal-radius) !important;
  box-shadow: var(--modal-shadow) !important;
  overflow: hidden !important;
}

/* Market / Data Lab is a conventional centred dialog on every breakpoint. */
body.theme-modern .game-command-window {
  position: fixed !important;
  z-index: 1400 !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  display: flex !important;
  width: min(920px, calc(100dvw - (var(--modal-gutter) * 2))) !important;
  height: min(760px, calc(100dvh - var(--modal-safe-top) - var(--modal-safe-bottom))) !important;
  min-height: 0 !important;
  padding: 16px !important;
  flex-direction: column !important;
  transform: translate(-50%, -50%) !important;
  transform-origin: center !important;
  background: var(--modal-surface) !important;
}
body.theme-modern.command-panel-collapsed .game-command-window {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translate(-50%, -50%) scale(.96) !important;
}
body.theme-modern .game-command-window .game-command-titlebar,
body.theme-modern .game-command-window #mainGameTabs { flex: 0 0 auto; }
body.theme-modern .game-command-window #game-command-panel {
  min-height: 0 !important;
  flex: 1 1 auto !important;
  overflow: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
body.theme-modern .game-command-window #tab-market.show.active {
  display: flex !important;
  min-height: 0 !important;
  flex-flow: column nowrap !important;
  gap: 10px !important;
  overflow: visible !important;
}

/* The command menu and upgrade shop use the same centred sheet geometry.
   Hidden state travels below the viewport; open state always recentres. */
body.theme-modern .quick-command-menu,
body.theme-modern #gameMenuOffcanvas {
  position: fixed !important;
  z-index: 1410 !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  width: min(760px, calc(100dvw - (var(--modal-gutter) * 2))) !important;
  height: min(720px, calc(100dvh - var(--modal-safe-top) - var(--modal-safe-bottom))) !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 16px !important;
  transform: translate(-50%, calc(-50% + 110dvh)) !important;
  transform-origin: center !important;
  background: var(--modal-surface) !important;
}
body.theme-modern.quick-command-open .quick-command-menu,
body.theme-modern #gameMenuOffcanvas.show {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translate(-50%, -50%) !important;
}
body.theme-modern .quick-command-menu {
  display: flex !important;
  flex-direction: column;
  gap: 12px;
}
body.theme-modern .quick-command-grid {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
}
body.theme-modern #gameMenuOffcanvas {
  display: flex !important;
  flex-direction: column;
  padding: 0 !important;
}
body.theme-modern #gameMenuOffcanvas .offcanvas-header { flex: 0 0 auto; padding: 15px 17px !important; }
body.theme-modern #gameMenuOffcanvas .offcanvas-body { min-height: 0; flex: 1 1 auto; overflow: auto !important; }

/* Assistant choices are small enough for a dialog, not a bottom overlay.
   Centering gives the close target and all three actions a reliable touch area. */
body.theme-modern .assistant-console-dialogue.game-dialogue-layer {
  position: fixed !important;
  z-index: 1420 !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  width: min(760px, calc(100dvw - (var(--modal-gutter) * 2))) !important;
  min-height: 0 !important;
  transform: translate(-50%, calc(-50% + 110dvh)) !important;
  transform-origin: center !important;
}
body.theme-modern .assistant-console-dialogue.game-dialogue-layer.is-open {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translate(-50%, -50%) !important;
}
body.theme-modern .assistant-console-dialogue .assistant-console-portrait,
body.theme-modern .assistant-console-dialogue .assistant-console-card { min-height: 0 !important; }

/* Alert and report content stay in the same safe region. */
body.theme-modern .swal2-container { z-index: 1500 !important; padding: var(--modal-safe-top) var(--modal-gutter) var(--modal-safe-bottom) !important; }
body.theme-modern .swal2-popup,
body.theme-modern .modal-dialog { max-width: calc(100dvw - (var(--modal-gutter) * 2)) !important; }
body.theme-modern .swal2-popup { max-height: calc(100dvh - var(--modal-safe-top) - var(--modal-safe-bottom)) !important; overflow: auto !important; border-radius: var(--modal-radius) !important; }
body.theme-modern .modal-dialog { margin: var(--modal-safe-top) auto var(--modal-safe-bottom) !important; }
body.theme-modern .modal-content { max-height: calc(100dvh - var(--modal-safe-top) - var(--modal-safe-bottom)) !important; overflow: auto; border-radius: var(--modal-radius) !important; }

/* One radius scale and 44px minimum close targets improve touch reliability. */
body.theme-modern .game-command-titlebar > button,
body.theme-modern .quick-command-header > button,
body.theme-modern .advisor-dialogue-close,
body.theme-modern #gameMenuOffcanvas .btn-close,
body.theme-modern .swal2-close {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  border-radius: 12px !important;
}

@media (max-width: 760px) {
  :root { --modal-gutter: 12px; --modal-radius: 18px; }

  body.theme-modern .game-command-window {
    width: calc(100dvw - 24px) !important;
    height: min(680px, calc(100dvh - var(--modal-safe-top) - var(--modal-safe-bottom))) !important;
    padding: 12px !important;
    border-radius: 18px !important;
  }
  body.theme-modern .game-command-window .game-command-titlebar { min-height: 46px; padding: 0 0 8px !important; }
  body.theme-modern .game-command-window #mainGameTabs { margin-bottom: 8px !important; }
  body.theme-modern .game-command-window .chart-container { height: min(31dvh, 250px) !important; min-height: 190px !important; }
  body.theme-modern .game-command-window .accordion-button { min-height: 42px; padding: 9px 10px !important; }

  body.theme-modern .quick-command-menu,
  body.theme-modern #gameMenuOffcanvas {
    width: calc(100dvw - 24px) !important;
    height: min(680px, calc(100dvh - var(--modal-safe-top) - var(--modal-safe-bottom))) !important;
    border-radius: 18px !important;
  }
  body.theme-modern .quick-command-menu { padding: 12px !important; gap: 8px; }
  body.theme-modern .quick-command-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  body.theme-modern .quick-command-grid > button { min-height: 76px !important; }

  body.theme-modern .assistant-console-dialogue.game-dialogue-layer {
    width: calc(100dvw - 24px) !important;
    max-height: min(430px, calc(100dvh - var(--modal-safe-top) - var(--modal-safe-bottom))) !important;
    grid-template-columns: 106px minmax(0, 1fr) !important;
  }
  body.theme-modern .assistant-console-dialogue .assistant-console-portrait,
  body.theme-modern .assistant-console-dialogue .assistant-console-card { min-height: 236px !important; }
  body.theme-modern .assistant-console-dialogue .assistant-console-card { padding: 12px 11px 10px !important; overflow: auto; }
  body.theme-modern .assistant-console-dialogue .assistant-console-title small { display: none; }
  body.theme-modern .assistant-console-dialogue .assistant-console-title strong { font-size: .91rem !important; }
  body.theme-modern .assistant-console-dialogue .advisor-message-button { min-height: 65px !important; font-size: .77rem !important; }
  body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions > button { min-height: 50px !important; }
  body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions b { font-size: .65rem !important; }
  body.theme-modern .assistant-console-dialogue .advisor-dialogue-close { width: 40px !important; min-width: 40px !important; height: 40px !important; min-height: 40px !important; }
}

@media (max-height: 620px) and (orientation: landscape) {
  body.theme-modern .game-command-window,
  body.theme-modern .quick-command-menu,
  body.theme-modern #gameMenuOffcanvas { height: calc(100dvh - var(--modal-safe-top) - var(--modal-safe-bottom)) !important; }
  body.theme-modern .assistant-console-dialogue.game-dialogue-layer { max-height: calc(100dvh - var(--modal-safe-top) - var(--modal-safe-bottom)) !important; }
}


/* UI layer 15: game-ui-system-v7.css */
/* DATA POP V7 — unified responsive game UI contract.
   Semantic colors are intentionally stable: aqua = insight, pink = action,
   lime = positive/unlocked, violet = primary progression, red = destructive. */
:root {
  --ui-ink: #392d41;
  --ui-muted: #685f6b;
  --ui-paper: #fffdf8;
  --ui-aqua: #4ebfd1;
  --ui-pink: #ec7896;
  --ui-lime: #9bce65;
  --ui-violet: #7058e8;
  --ui-danger: #ca4e68;
  --ui-line: rgba(87, 62, 82, .22);
  --ui-radius: 20px;
}

body.theme-modern { background: #f8f0ed !important; }
body.theme-modern button:focus-visible,
body.theme-modern [role="button"]:focus-visible { outline: 3px solid #245fd8 !important; outline-offset: 3px !important; }
body.theme-modern button { min-height: 44px; }

/* Keep the desktop game a single intentional composition instead of a world
   on the left and an unrelated empty strip on the right. */
@media (min-width: 761px) {
  /* Browser zoom must not turn a fixed CSS cap into a blank desktop column. */
  body.theme-modern .main-container { width: calc(100dvw - 32px) !important; max-width: none !important; }
  body.theme-modern .game-world-stage { min-height: clamp(560px, 72vh, 760px) !important; }
  body.theme-modern .scroll-x-container { width: min(570px, 60%) !important; }
  body.theme-modern .world-unified-dashboard { width: min(480px, 46%) !important; }
  body.theme-modern .game-action-dock { width: min(720px, calc(100vw - 40px)) !important; }
}

/* A single readable visual language for button hierarchy and muted text. */
body.theme-modern .btn-modern-primary,
body.theme-modern .quick-command-primary,
body.theme-modern .advisor-dialogue-actions > button:first-child,
body.theme-modern .game-action-dock .game-dock-primary {
  color: #fff !important;
  background: var(--ui-violet) !important;
  border-color: #5843c6 !important;
}
body.theme-modern .quick-command-tools .danger,
body.theme-modern .btn-danger { color: #fff !important; background: var(--ui-danger) !important; border-color: #a83852 !important; }
body.theme-modern .text-muted,
body.theme-modern .form-text,
body.theme-modern .price-slider-container small,
body.theme-modern .market-mood-card small { color: var(--ui-muted) !important; opacity: 1 !important; }

/* Market and Data Lab: content determines the space.  The market is a two
   column decision workspace, never a tall empty price card. */
body.theme-modern .game-command-window { width: min(1060px, calc(100dvw - 32px)) !important; height: min(740px, calc(100dvh - 32px)) !important; }
body.theme-modern .game-command-window #tab-market.show.active { display: grid !important; grid-template-columns: minmax(0, 1.65fr) minmax(260px, .75fr); align-items: stretch; gap: 12px !important; }
body.theme-modern .game-command-window #tab-market > .accordion { grid-column: 1; grid-row: 1 / span 2; min-height: 0; }
body.theme-modern .game-command-window #tab-market > .market-status-row { grid-column: 2; grid-row: 1; margin: 0 !important; align-content: start; }
body.theme-modern .game-command-window #tab-market > .market-status-row > [class*="col-"] { width: 100%; max-width: 100%; }
body.theme-modern .game-command-window #tab-market > .market-status-row .market-rival-zone { margin-top: 8px; }
body.theme-modern .game-command-window #tab-market > .price-slider-container { grid-column: 2; grid-row: 2; align-self: start; min-height: 0 !important; padding: 16px !important; }
body.theme-modern .game-command-window .chart-container { min-height: 280px !important; height: min(47dvh, 430px) !important; }
body.theme-modern .game-command-window .price-slider-container { border-radius: 16px !important; background: #fffaf1 !important; }
body.theme-modern .game-command-window .price-slider-container > * { max-width: 100%; }
body.theme-modern .market-mood-card,
body.theme-modern .market-rival-button { min-height: 76px !important; border-radius: 16px !important; }

/* Report cards use the width of a desktop report, while their body scrolls
   internally on small screens rather than pushing action buttons off-screen. */
body.theme-modern #reportModal .modal-dialog { width: min(720px, calc(100dvw - 32px)) !important; max-width: none !important; }
body.theme-modern #reportModal .modal-content { display: flex; max-height: calc(100dvh - 32px); flex-direction: column; background: var(--ui-paper); }
body.theme-modern #reportModal .modal-body { min-height: 0; margin-top: 0 !important; padding: 22px 24px 12px !important; overflow: auto; }
body.theme-modern #reportModal .modal-footer { flex: 0 0 auto; padding: 14px 24px 22px !important; background: linear-gradient(180deg, transparent, #fff8ee); }
body.theme-modern #reportModal .modal-footer .btn { min-width: min(100%, 280px); min-height: 52px; }

/* Rewards remain in the game context and use an explicit claim action. */
body.theme-modern #gacha-overlay { z-index: 1600 !important; }
body.theme-modern #gacha-overlay .overlay-bg { background: rgba(40, 29, 48, .58) !important; backdrop-filter: blur(6px) !important; }
body.theme-modern #gacha-overlay .gacha-wrapper { padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)) !important; }
body.theme-modern #gacha-overlay .gacha-machine,
body.theme-modern #gacha-result > div { width: min(440px, calc(100dvw - 32px)) !important; max-width: none !important; padding: 26px !important; border: 1px solid var(--ui-line) !important; border-radius: var(--ui-radius) !important; box-shadow: 0 22px 56px rgba(30, 20, 35, .36) !important; }
body.theme-modern #gacha-overlay .gacha-machine .btn-spin,
body.theme-modern #gacha-result button:last-child { min-height: 52px !important; font-size: 1rem !important; border-radius: 14px !important; }
body.theme-modern #gacha-result button:last-child { color: #fff !important; background: var(--ui-violet) !important; border-color: #5843c6 !important; }

/* Assistant is a compact decision conversation: one short message and three
   discoverable actions.  The portrait provides character, not a second panel. */
body.theme-modern .assistant-console-dialogue.game-dialogue-layer { width: min(820px, calc(100dvw - 32px)) !important; display: grid !important; grid-template-columns: 220px minmax(0, 1fr) !important; background: var(--ui-paper) !important; }
body.theme-modern .assistant-console-dialogue .assistant-console-portrait { min-height: 270px !important; border-radius: var(--ui-radius) 0 0 var(--ui-radius) !important; }
body.theme-modern .assistant-console-dialogue .assistant-console-card { min-height: 270px !important; padding: 18px 18px 16px !important; }
body.theme-modern .assistant-console-dialogue .assistant-console-title small { color: #a54f70 !important; font-weight: 800; letter-spacing: .06em; }
body.theme-modern .assistant-console-dialogue .advisor-message-button { min-height: 66px !important; padding: 12px 14px !important; color: var(--ui-ink) !important; background: #fffaf5 !important; border: 1px solid var(--ui-line) !important; border-radius: 14px !important; text-align: left; line-height: 1.35; }
body.theme-modern .assistant-console-dialogue .advisor-choice-label { display: block; margin: 10px 0 6px; color: var(--ui-muted); font-size: .74rem; }
body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px !important; }
body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions > button { min-height: 70px !important; padding: 8px !important; border-radius: 13px !important; }
body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions > button:nth-child(2) { background: #fff0f4 !important; border-color: #df8aa2 !important; }
body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions > button:nth-child(3) { background: #edf9dc !important; border-color: #9fc677 !important; }
body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions small { display: none; }

/* Alerts make consequences readable and retain a clearly available secondary
   action. This catches all existing SweetAlert event dialogs consistently. */
body.theme-modern .swal2-popup { width: min(560px, calc(100dvw - 32px)) !important; padding: 24px !important; color: var(--ui-ink) !important; background: var(--ui-paper) !important; }
body.theme-modern .swal2-title { color: var(--ui-ink) !important; font-size: clamp(1.3rem, 3vw, 1.8rem) !important; }
body.theme-modern .swal2-html-container { color: var(--ui-muted) !important; line-height: 1.45 !important; }
body.theme-modern .swal2-actions { width: 100%; gap: 8px; }
body.theme-modern .swal2-confirm,
body.theme-modern .swal2-cancel { min-height: 48px !important; margin: 0 !important; border-radius: 13px !important; font-weight: 800 !important; }
body.theme-modern .swal2-confirm { background: var(--ui-violet) !important; }
body.theme-modern .swal2-cancel { color: var(--ui-ink) !important; background: #f1eef4 !important; }

@media (max-width: 760px) {
  body.theme-modern .main-container { width: calc(100% - 16px) !important; padding-top: 106px !important; padding-bottom: 90px !important; }
  body.theme-modern .game-world-stage { min-height: calc(100dvh - 204px) !important; }
  body.theme-modern .scroll-x-container { top: 55px !important; }
  body.theme-modern .world-unified-dashboard { top: 106px !important; }
  body.theme-modern .game-action-dock { bottom: max(8px, env(safe-area-inset-bottom)) !important; width: calc(100dvw - 16px) !important; }

  body.theme-modern .game-command-window { width: calc(100dvw - 20px) !important; height: calc(100dvh - 20px) !important; padding: 11px !important; }
  body.theme-modern .game-command-window #tab-market.show.active { display: flex !important; gap: 8px !important; }
  body.theme-modern .game-command-window #tab-market > .accordion { order: 1; }
  body.theme-modern .game-command-window #tab-market > .market-status-row { order: 2; margin: 0 !important; }
  body.theme-modern .game-command-window #tab-market > .price-slider-container { order: 3; min-height: 132px !important; }
  body.theme-modern .game-command-window .chart-container { min-height: 190px !important; height: min(32dvh, 260px) !important; }
  body.theme-modern .game-command-window .market-status-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(116px, .72fr); gap: 8px; }
  body.theme-modern .game-command-window .market-status-row > [class*="col-"] { display: block; padding: 0; }
  body.theme-modern .market-mood-card, body.theme-modern .market-rival-button { min-height: 68px !important; }

  body.theme-modern #reportModal .modal-dialog { width: calc(100dvw - 20px) !important; margin: 10px auto !important; }
  body.theme-modern #reportModal .modal-content { max-height: calc(100dvh - 20px); }
  body.theme-modern #reportModal .modal-body { padding: 16px 14px 8px !important; }
  body.theme-modern #reportModal .modal-footer { padding: 10px 14px 16px !important; }

  body.theme-modern .assistant-console-dialogue.game-dialogue-layer { width: calc(100dvw - 20px) !important; max-height: calc(100dvh - 20px) !important; grid-template-columns: 92px minmax(0, 1fr) !important; }
  body.theme-modern .assistant-console-dialogue .assistant-console-portrait { min-height: 244px !important; border-radius: 18px 0 0 18px !important; }
  /* The large dashed orbit made the narrow mobile portrait look unfinished.
     Make the coach fill his column and keep only the useful status badge. */
  body.theme-modern .assistant-console-dialogue .assistant-console-portrait > img { width: 172% !important; height: 154% !important; bottom: -5% !important; }
  body.theme-modern .assistant-console-dialogue .assistant-console-card { min-height: 244px !important; padding: 12px 10px !important; }
  body.theme-modern .assistant-console-dialogue .assistant-console-title strong { font-size: .88rem !important; }
  body.theme-modern .assistant-console-dialogue .advisor-message-button { min-height: 62px !important; padding: 9px !important; font-size: .76rem !important; }
  body.theme-modern .assistant-console-dialogue .advisor-message-button i { display: none !important; }
  body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions { grid-template-columns: 1fr !important; gap: 5px !important; }
  body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions > button { display: flex !important; min-height: 38px !important; padding: 5px 7px !important; align-items: center; justify-content: flex-start; }
  body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions > button span { text-align: left; }
  body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions > button .game-ui-icon { width: 20px; height: 20px; }
  body.theme-modern .assistant-console-dialogue .advisor-choice-label { margin: 6px 0 4px; font-size: .66rem; }

  body.theme-modern .swal2-popup { width: calc(100dvw - 20px) !important; padding: 18px 14px !important; }
  body.theme-modern .swal2-actions { flex-direction: column; }
  body.theme-modern .swal2-confirm, body.theme-modern .swal2-cancel { width: 100%; }
  body.theme-modern #gacha-overlay .gacha-machine, body.theme-modern #gacha-result > div { width: calc(100dvw - 24px) !important; padding: 20px 16px !important; }
  body.theme-modern #gacha-overlay .gacha-glass { width: 132px; height: 132px; }
}

/* The status chips and fixed utility controls share the upper edge on phones.
   Reserve a clear lane for each rather than allowing them to collide. */
@media (max-width: 760px) {
  body.theme-modern .world-topline { right: 92px !important; }
  body.theme-modern .world-topline .world-chip { max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-height: 620px) and (orientation: landscape) {
  body.theme-modern .assistant-console-dialogue.game-dialogue-layer { grid-template-columns: 132px minmax(0, 1fr) !important; }
  body.theme-modern .assistant-console-dialogue .assistant-console-portrait,
  body.theme-modern .assistant-console-dialogue .assistant-console-card { min-height: 210px !important; }
  body.theme-modern .assistant-console-dialogue .advisor-dialogue-actions { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}


/* UI layer 16: game-shell-v8.css */
/* DATA POP V8 — one presentation canvas, three responsive layouts.
   The game shell is the coordinate system for every persistent control.
   No HUD, dock, or utility control is positioned against the browser edge. */
:root {
  --shell-gutter: clamp(14px, 2vw, 28px);
  --shell-radius: 28px;
  --shell-shadow: 0 24px 70px rgba(42, 27, 42, .36);
}

body.theme-modern {
  display: grid;
  min-height: 100dvh;
  padding: var(--shell-gutter);
  place-items: center;
  overflow: hidden;
  background: #352938 !important;
}
body.theme-modern::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: -36px;
  background: linear-gradient(rgba(50, 33, 47, .52), rgba(50, 33, 47, .62)), url('/assets/images/store-boba-kawaii-v1.png') center / cover no-repeat;
  filter: blur(22px) saturate(.86);
  transform: scale(1.06);
}
body.theme-modern[data-product-type="EXPENSIVE"]::before {
  background-image: linear-gradient(rgba(35, 39, 57, .58), rgba(35, 39, 57, .68)), url('/assets/images/store-it-kawaii-v1.png');
}

/* This is the only coordinate system used by the playable UI on desktop. */
body.theme-modern .game-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100dvw - (var(--shell-gutter) * 2)), calc((100dvh - (var(--shell-gutter) * 2)) * 1.77778));
  height: auto;
  max-height: calc(100dvh - (var(--shell-gutter) * 2));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .46);
  border-radius: var(--shell-radius);
  box-shadow: var(--shell-shadow);
  isolation: isolate;
  background: #1f1926;
}
body.theme-modern .game-shell .main-container {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  max-width: none !important;
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
}
body.theme-modern .game-shell .game-world-stage {
  position: absolute !important;
  inset: 0;
  width: 100%;
  min-height: 0 !important;
  height: 100%;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
/* The portrait is a character panel, not a glass ornament.  Earlier layers
   drew a large white radial highlight here, which looked like a broken avatar. */
body.theme-modern .assistant-console-dialogue .assistant-console-portrait {
  background: linear-gradient(160deg, #dff9fc 0%, #e8f3ff 56%, #f8e6ef 100%) !important;
}

/* These were previously fixed to the browser and were the source of overlap. */
body.theme-modern .game-shell .top-btn-group {
  position: absolute !important;
  z-index: 70 !important;
  top: 16px !important;
  right: 16px !important;
  bottom: auto !important;
  left: auto !important;
}
body.theme-modern .game-shell .news-container { display: none !important; }
body.theme-modern .game-shell .scroll-x-container {
  position: absolute !important;
  z-index: 45;
  top: 16px !important;
  left: 16px !important;
  width: min(48%, 560px) !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  scroll-snap-type: none !important;
  transform: none !important;
}
body.theme-modern .game-shell .scroll-x-container .scroll-card { width: auto !important; min-width: 0 !important; }
body.theme-modern .game-shell .world-topline { top: 18px !important; right: 104px !important; }
body.theme-modern .game-shell .world-unified-dashboard { top: 78px !important; right: 18px !important; }
/* Store context must be readable at a glance.  Remove the old frosted layer:
   it blurred the shop behind the copy and made this look like a glass defect. */
body.theme-modern .game-shell .world-store-plaque,
body.theme-modern .game-shell .world-mode-card,
body.theme-modern .game-shell .daily-order-board {
  color: var(--ui-ink) !important;
  background: #fffdf8 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 6px 16px rgba(44, 29, 42, .16) !important;
}
body.theme-modern .game-shell .world-store-plaque,
body.theme-modern .game-shell .world-mode-card { border-color: rgba(110, 79, 98, .24) !important; }
body.theme-modern .game-shell .daily-order-board { border: 1px solid rgba(110, 79, 98, .24) !important; }
body.theme-modern .game-shell .daily-board-ribbon { color: var(--ui-ink) !important; background: #fff7fa !important; }
body.theme-modern .game-shell .game-action-dock {
  position: absolute !important;
  z-index: 65 !important;
  right: 50% !important;
  bottom: 14px !important;
  left: auto !important;
  width: min(680px, calc(100% - 40px)) !important;
  transform: translateX(50%) !important;
}
body.theme-modern .game-shell .world-dialogue { bottom: 94px !important; }
body.theme-modern .game-shell .world-player-label { bottom: 96px !important; }

/* UI layers are deliberately ordered and never compete with shell controls. */
body.theme-modern .game-command-backdrop,
body.theme-modern .quick-command-backdrop,
body.theme-modern .advisor-dialogue-backdrop,
body.theme-modern .offcanvas-backdrop { z-index: 300 !important; }
body.theme-modern .game-command-window,
body.theme-modern .quick-command-menu,
body.theme-modern #gameMenuOffcanvas,
body.theme-modern .assistant-console-dialogue.game-dialogue-layer { z-index: 310 !important; }
body.theme-modern .modal-backdrop { z-index: 400 !important; }
body.theme-modern #reportModal { z-index: 410 !important; }
body.theme-modern .swal2-container { z-index: 500 !important; }
body.theme-modern #gacha-overlay { z-index: 600 !important; }

/* Portrait tablets get a centred board with a taller working area. */
@media (min-width: 761px) and (max-aspect-ratio: 1 / 1) {
  body.theme-modern .game-shell { width: min(calc(100dvw - (var(--shell-gutter) * 2)), calc((100dvh - (var(--shell-gutter) * 2)) * 1.2)); aspect-ratio: 6 / 5; }
  body.theme-modern .game-shell .world-unified-dashboard { width: min(48%, 430px) !important; }
}

/* Phones are a separate portrait presentation, not a shrunken desktop board. */
@media (max-width: 760px) {
  body.theme-modern {
    display: block;
    padding: 0;
    overflow: hidden;
    background: #1e1823 !important;
  }
  body.theme-modern::before { display: none; }
  body.theme-modern .game-shell {
    width: 100dvw;
    height: 100dvh;
    max-height: none;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  body.theme-modern .game-shell .top-btn-group { top: max(8px, env(safe-area-inset-top)) !important; right: 8px !important; }
  body.theme-modern .game-shell .btn-circle-icon { width: 36px !important; height: 36px !important; }
  body.theme-modern .game-shell .scroll-x-container { top: calc(max(8px, env(safe-area-inset-top)) + 44px) !important; left: 8px !important; width: calc(100% - 16px) !important; }
  body.theme-modern .game-shell .world-topline { top: max(8px, env(safe-area-inset-top)) !important; right: 92px !important; }
  body.theme-modern .game-shell .world-topline .world-chip { max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.theme-modern .game-shell .world-unified-dashboard { top: calc(max(8px, env(safe-area-inset-top)) + 96px) !important; right: 8px !important; left: 8px !important; width: auto !important; }
  body.theme-modern .game-shell .world-store-plaque,
  body.theme-modern .game-shell .world-mode-card { min-height: 46px !important; }
  body.theme-modern .game-shell .daily-order-board { grid-column: 1 / -1; }
  body.theme-modern .game-shell .daily-board-ribbon { min-height: 34px !important; }
  body.theme-modern .game-shell .game-action-dock {
    right: 8px !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    left: 8px !important;
    width: auto !important;
    transform: none !important;
  }
  body.theme-modern .game-shell .world-dialogue { right: 10px !important; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 68px) !important; }
  body.theme-modern .game-shell .world-player-label { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 74px) !important; }
}

@media (max-height: 520px) and (orientation: landscape) {
  body.theme-modern { padding: 8px; }
  body.theme-modern .game-shell { width: min(calc(100dvw - 16px), calc((100dvh - 16px) * 1.77778)); }
  body.theme-modern .game-shell .scroll-x-container { top: 8px !important; left: 8px !important; }
  body.theme-modern .game-shell .top-btn-group { top: 8px !important; right: 8px !important; }
  body.theme-modern .game-shell .world-unified-dashboard { top: 60px !important; right: 10px !important; }
  body.theme-modern .game-shell .game-action-dock { bottom: 8px !important; }
}
