:root {
  --ink: #100b0e;
  --ink-2: #191115;
  --panel: rgba(34, 22, 28, .92);
  --panel-solid: #24171d;
  --wine: #721e31;
  --wine-bright: #a22d48;
  --gold: #d9ad58;
  --gold-bright: #f3d790;
  --cream: #f5ead7;
  --muted: #b9a99f;
  --line: rgba(217, 173, 88, .22);
  --good: #5fc38b;
  --bad: #ff6b6b;
  --blue: #6ab5ff;
  --radius: 18px;
}

* { box-sizing: border-box; }

html { background: var(--ink); color-scheme: dark; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  color: var(--cream);
  font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  background:
    radial-gradient(circle at 18% -10%, rgba(162,45,72,.34), transparent 34rem),
    radial-gradient(circle at 95% 28%, rgba(217,173,88,.11), transparent 30rem),
    linear-gradient(155deg, #0d090b 0%, #1b1016 50%, #0d090b 100%);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button { font: inherit; }
button:focus-visible, [role="radio"]:focus-visible, summary:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 3px; }
button { touch-action: manipulation; }

.opening-sequence {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #080507;
  isolation: isolate;
  animation: opening-release var(--opening-duration,4.285714s) linear forwards;
}

.opening-sequence[hidden] { display: none; }

.opening-stage {
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 15%, rgba(243,215,144,.32), transparent 65%),
    linear-gradient(155deg, #0d090b 0%, #1b1016 55%, #080507 100%);
}

.opening-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .18;
  background-image: linear-gradient(90deg, transparent 49.7%, rgba(243,215,144,.28) 50%, transparent 50.3%);
  background-size: 46px 100%;
}

.opening-curtain {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 51%;
  box-shadow: 0 10px 22px rgba(0,0,0,.48);
  will-change: transform;
  backface-visibility: hidden;
}

.opening-fabric {
  position: absolute;
  inset: -2% -5%;
  background: #530b19 url('./assets/opening/velvet-panel-v045.webp') center / cover;
  transform-origin: 50% 0;
}

.opening-curtain-right .opening-fabric { scale: -1 1; }

.opening-curtain-left {
  left: 0;
  transform-origin: left top;
  animation: curtain-open-left var(--opening-duration,4.285714s) cubic-bezier(.32,0,.18,1) forwards;
}

.opening-curtain-right {
  right: 0;
  transform-origin: right top;
  animation: curtain-open-right var(--opening-duration,4.285714s) cubic-bezier(.32,0,.18,1) forwards;
}

.opening-valance {
  position: absolute;
  z-index: 4;
  top: -4vw;
  left: -4%;
  width: 108%;
  height: auto;
  will-change: transform, opacity;
  animation: opening-valance-away var(--opening-duration,4.285714s) ease-in forwards;
}

.opening-title {
  position: relative;
  z-index: 5;
  width: min(88vw, 600px);
  padding: 28px 18px;
  color: var(--cream);
  text-align: center;
  text-shadow: 0 12px 36px rgba(0,0,0,.75);
  will-change: transform, opacity;
  animation: opening-title-reveal var(--opening-duration,4.285714s) cubic-bezier(.2,.7,.2,1) forwards;
}

.opening-crown {
  display: block;
  color: var(--gold-bright);
  font-size: clamp(2.8rem, 12vw, 4.8rem);
  line-height: 1;
  filter: drop-shadow(0 0 20px rgba(243,215,144,.42));
}

.opening-title p {
  margin: 12px 0 5px;
  color: var(--gold-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 4.1vw, 1.45rem);
  font-weight: 700;
  letter-spacing: .12em;
}

.opening-title h1 {
  margin: 0;
  color: #fff5df;
  font-size: clamp(2.65rem, 13vw, 5.4rem);
  font-weight: 950;
  letter-spacing: -.055em;
  line-height: 1.06;
}

.opening-title i {
  display: block;
  width: min(66%, 280px);
  height: 1px;
  margin: 18px auto 0;
  overflow: hidden;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  box-shadow: 0 0 16px rgba(243,215,144,.65);
}

.opening-title i::after {
  content: "";
  display: block;
  width: 35%;
  height: 5px;
  margin-top: -2px;
  background: #fff8df;
  filter: blur(3px);
  animation: opening-glint 2.1s .7s ease-in-out both;
}

@keyframes opening-title-reveal {
  0% { opacity: 0; transform: translate3d(0,12px,0) scale(.94); }
  13%, 30% { opacity: 1; transform: translate3d(0,0,0) scale(1); }
  55%, 100% { opacity: 0; transform: translate3d(0,-7px,0) scale(1.04); }
}

@keyframes opening-glint {
  0% { transform: translateX(-180%); opacity: 0; }
  22%, 74% { opacity: 1; }
  100% { transform: translateX(470%); opacity: 0; }
}

@keyframes curtain-open-left {
  0%, 24% { transform: translate3d(0,0,0) scaleX(1); }
  100% { transform: translate3d(-122%,0,0) scaleX(.86); }
}

@keyframes curtain-open-right {
  0%, 24% { transform: translate3d(0,0,0) scaleX(1); }
  100% { transform: translate3d(122%,0,0) scaleX(.86); }
}

@keyframes opening-valance-away {
  0%, 40% { transform: translate3d(0,0,0); opacity: 1; }
  100% { transform: translate3d(0,-115%,0); opacity: 0; }
}

@keyframes opening-release {
  0%, 82% { opacity: 1; visibility: visible; pointer-events: auto; }
  100% { opacity: 0; visibility: hidden; pointer-events: none; }
}

.app-shell { width: min(100%, 760px); min-height: 100dvh; margin: 0 auto; }
.screen { min-height: 100dvh; }

.start-screen {
  position: relative;
  overflow: hidden;
  padding: max(26px, env(safe-area-inset-top)) 18px max(26px, env(safe-area-inset-bottom));
}

.start-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: linear-gradient(90deg, transparent 49.6%, rgba(255,255,255,.16) 50%, transparent 50.4%), linear-gradient(transparent 49.6%, rgba(255,255,255,.1) 50%, transparent 50.4%);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 50%);
}

.start-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  left: 50%;
  top: 40px;
  translate: -50% 0;
  border: 1px solid rgba(217,173,88,.25);
  border-radius: 50%;
  box-shadow: 0 0 80px rgba(217,173,88,.12), inset 0 0 50px rgba(217,173,88,.08);
}

.brand-lockup { position: relative; text-align: center; }
.eyebrow { display: flex; justify-content: center; gap: 9px; margin-bottom: 12px; color: var(--gold-bright); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow span { padding: 5px 9px; border: 1px solid rgba(217,173,88,.3); border-radius: 99px; background: rgba(16,11,14,.55); }
.crown-mark { color: var(--gold); font-size: 2.7rem; line-height: 1; filter: drop-shadow(0 5px 14px rgba(217,173,88,.25)); }
.brand-lockup h1 { margin: 2px 0 8px; font-size: clamp(3.3rem, 15vw, 5.8rem); line-height: .8; letter-spacing: -.08em; font-weight: 950; text-shadow: 0 12px 35px rgba(0,0,0,.5); }
.brand-lockup h1 em { color: var(--gold-bright); font-style: normal; font-family: Georgia, "Times New Roman", serif; font-weight: 700; letter-spacing: -.04em; }
.subhead { margin: 16px auto 0; color: var(--muted); font-size: .95rem; }

.account-chip { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 9px; width: min(100%, 520px); margin: 18px auto 0; padding: 9px 11px; border: 1px solid rgba(106,181,255,.28); border-radius: 13px; color: var(--cream); background: linear-gradient(110deg, rgba(32,49,65,.72), rgba(36,23,29,.88)); text-align: left; cursor: pointer; }
.account-chip-icon { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(106,181,255,.28); border-radius: 10px; color: #9bd9ff; background: rgba(106,181,255,.08); font-size: 1.1rem; }
.account-chip small, .account-chip strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chip small { color: #9fb6c8; font-size: .62rem; font-weight: 850; }
.account-chip strong { margin-top: 1px; font-size: .76rem; }
.account-chip > b { color: #9bd9ff; font-size: .62rem; white-space: nowrap; }
.account-chip.is-synced { border-color: rgba(95,195,139,.34); background: linear-gradient(110deg, rgba(31,65,49,.65), rgba(36,23,29,.88)); }
.account-chip.is-synced .account-chip-icon, .account-chip.is-synced > b { color: #8ee1ad; }

.quick-facts { position: relative; display: flex; gap: 7px; overflow-x: auto; margin: 22px -18px 0; padding: 0 18px 6px; scrollbar-width: none; }
.quick-facts::-webkit-scrollbar { display: none; }
.quick-facts span { flex: 0 0 auto; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; color: #ddcfc3; background: rgba(36,23,29,.72); font-size: .82rem; font-weight: 700; }

.career-section { position: relative; margin-top: 20px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 11px; }
.step-label { color: var(--gold); font-size: .73rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.section-heading h2 { margin: 1px 0 0; font-size: 1.35rem; }
.icon-button, .header-button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; color: var(--gold-bright); background: rgba(36,23,29,.82); cursor: pointer; font-weight: 900; font-size: 1.15rem; }

.career-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.career-card { position: relative; min-height: 145px; padding: 14px 12px; border: 1px solid rgba(217,173,88,.16); border-radius: 15px; color: var(--cream); background: linear-gradient(145deg, rgba(43,27,34,.95), rgba(25,17,21,.95)); text-align: left; cursor: pointer; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.career-card:active { transform: scale(.98); }
.career-card.selected { border-color: var(--gold-bright); background: linear-gradient(145deg, rgba(113,30,49,.58), rgba(35,23,29,.98)); box-shadow: 0 0 0 2px rgba(217,173,88,.12), 0 12px 30px rgba(0,0,0,.22); }
.career-card.selected::after { content: "✓"; position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #1b1115; background: var(--gold-bright); font-size: .8rem; font-weight: 950; }
.career-icon { display: block; font-size: 1.65rem; margin-bottom: 7px; }
.career-card strong { display: block; padding-right: 18px; font-size: .95rem; line-height: 1.25; }
.career-card small { display: block; margin-top: 6px; color: var(--muted); font-size: .82rem; line-height: 1.42; }

.primary-button, .roll-button { border: 0; border-radius: 14px; color: #1a1115; background: linear-gradient(135deg, var(--gold-bright), #bd8737); font-weight: 950; cursor: pointer; box-shadow: 0 12px 30px rgba(217,173,88,.18); }
.primary-button:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.start-button { position: relative; display: flex; justify-content: space-between; width: 100%; margin-top: 14px; padding: 16px 18px; font-size: 1.05rem; }
.fiction-note { position: relative; margin: 13px auto 0; max-width: 520px; color: #897a77; text-align: center; font-size: .72rem; line-height: 1.45; }

.game-screen { padding-bottom: calc(100px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(114,30,49,.1), transparent 190px); }
.game-header { display: flex; align-items: center; justify-content: space-between; padding: max(13px, env(safe-area-inset-top)) 14px 9px; }
.mini-brand { display: flex; align-items: center; gap: 9px; }
.mini-crown { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 12px; color: var(--gold); background: var(--panel); font-size: 1.35rem; }
.mini-brand strong, .mini-brand small { display: block; }
.mini-brand strong { font-size: 1rem; line-height: 1.1; }
.mini-brand small { margin-top: 3px; color: var(--muted); font-family: Georgia, serif; font-size: .56rem; letter-spacing: .11em; }
.header-actions { display: flex; gap: 7px; }
.header-button { width: 37px; height: 37px; border-radius: 11px; }

.round-strip { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 0 14px 10px; color: var(--muted); font-size: .76rem; font-weight: 800; }
.round-track { height: 4px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.round-track i { display: block; width: 8.33%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--wine-bright), var(--gold)); transition: width .4s ease; }
#turn-label { color: var(--gold-bright); }

.season-banner { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: calc(100% - 28px); margin: 0 14px 10px; padding: 10px 11px; border: 1px solid rgba(217,173,88,.3); border-radius: 14px; color: var(--cream); background: linear-gradient(110deg, rgba(91,35,46,.74), rgba(36,23,29,.94)); box-shadow: 0 10px 26px rgba(0,0,0,.18); text-align: left; cursor: pointer; }
.season-banner:active { transform: scale(.99); }
.season-icon { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(217,173,88,.35); border-radius: 12px; background: rgba(217,173,88,.09); font-size: 1.25rem; }
.season-main small, .season-main strong, .season-meta b, .season-meta small { display: block; }
.season-main small { color: #cbbab0; font-size: .65rem; font-weight: 800; }
.season-main strong { margin-top: 1px; color: var(--gold-bright); font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; }
.season-meta { text-align: right; }
.season-meta b { color: var(--cream); font-size: .7rem; }
.season-meta small { margin-top: 2px; color: var(--muted); font-size: .57rem; }

.score-section { padding: 0 14px 10px; }
.scoreboard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.player-card { position: relative; min-width: 0; padding: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,.09); border-radius: 12px; color: var(--cream); background: var(--panel); font: inherit; text-align: left; cursor: pointer; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.player-card:active { transform: scale(.985); }
.player-card:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.player-card.active { border-color: var(--player-color); box-shadow: inset 3px 0 var(--player-color); }
.player-title { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.player-token { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: #160e12; background: var(--player-color); font-size: .72rem; font-weight: 950; box-shadow: 0 0 0 2px rgba(255,255,255,.1); }
.player-identity { min-width: 0; }
.player-title b, .player-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-title b { font-size: .74rem; line-height: 1.1; }
.player-title small { margin-top: 2px; color: var(--muted); font-size: .6rem; }
.compact-level { padding: 4px 5px; border-radius: 6px; color: var(--gold-bright); background: rgba(217,173,88,.09); font-size: .58rem; font-weight: 950; white-space: nowrap; }
.money-line { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; margin-top: 7px; color: var(--gold-bright); }
.money-line strong { overflow: hidden; font-family: Georgia, serif; font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.money-line small { flex: 0 0 auto; color: var(--muted); font-size: .55rem; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin-top: 6px; }
.mini-stat { min-width: 0; padding: 4px 1px; border-radius: 6px; color: #cfc1ba; background: rgba(255,255,255,.035); text-align: center; }
.mini-stat small, .mini-stat b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-stat small { color: var(--muted); font-size: .58rem; line-height: 1; }
.mini-stat b { margin-top: 3px; color: var(--cream); font-size: .7rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1; }
.mini-stat.danger-stat { background: rgba(255,107,107,.09); }
.mini-stat.danger-stat small, .mini-stat.danger-stat b { color: #ff9e9e; }

.empire-strip { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 12px; align-items: center; gap: 9px; width: calc(100% - 28px); margin: 0 14px 10px; padding: 9px 10px; border: 1px solid rgba(217,173,88,.26); border-radius: 13px; color: var(--cream); background: linear-gradient(105deg, rgba(74,45,27,.74), rgba(36,23,29,.94) 58%); box-shadow: 0 9px 24px rgba(0,0,0,.16); text-align: left; cursor: pointer; }
.empire-strip:active { transform: scale(.99); }
.empire-strip-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(217,173,88,.28); border-radius: 10px; background: rgba(217,173,88,.08); font-size: 1.15rem; }
.empire-strip-main, .empire-strip-yield { min-width: 0; }
.empire-strip-main small, .empire-strip-main strong, .empire-strip-yield b, .empire-strip-yield small { display: block; }
.empire-strip-main small { color: var(--gold); font-size: .61rem; font-weight: 900; }
.empire-strip-main strong { overflow: hidden; margin-top: 1px; font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.empire-strip-yield { text-align: right; }
.empire-strip-yield b { color: var(--gold-bright); font-size: .72rem; }
.empire-strip-yield small { margin-top: 1px; color: var(--muted); font-size: .55rem; }
.empire-strip-arrow { color: var(--gold); font-family: Georgia, serif; font-size: 1.3rem; }

.board-wrap { padding: 0 8px; }
.board-viewport { scroll-margin-top: 12px; scroll-margin-bottom: calc(110px + env(safe-area-inset-bottom)); }
.board-viewport { position: relative; width: 100%; max-width: 620px; aspect-ratio: 1; margin: 0 auto; overflow: hidden; border: 1px solid rgba(217,173,88,.36); border-radius: 19px; background: #0d090b; box-shadow: 0 22px 60px rgba(0,0,0,.42), inset 0 0 45px rgba(217,173,88,.05); isolation: isolate; }
.board { position: absolute; inset: 0; display: grid; grid-template-rows: repeat(11, minmax(0, 1fr)); grid-template-columns: repeat(11, minmax(0, 1fr)); width: 100%; height: 100%; gap: 3px; padding: 6px; background: radial-gradient(ellipse at center, #3b1a26 0 19%, #1b1116 48%, #0d090b 78%); transform: translate3d(0, 0, 0) scale(1); transform-origin: 0 0; transition: transform .38s cubic-bezier(.22,.75,.22,1); will-change: transform; }
.camera-status { position: absolute; z-index: 8; top: calc(9.1% + 8px); right: calc(9.1% + 8px); max-width: calc(81.8% - 16px); overflow: hidden; padding: 6px 9px; border: 1px solid rgba(243,215,144,.38); border-radius: 99px; color: var(--gold-bright); background: rgba(19,12,16,.84); box-shadow: 0 5px 18px rgba(0,0,0,.28); backdrop-filter: blur(9px); font-size: .72rem; font-weight: 900; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.board-viewport[data-camera="follow"] .camera-status::before { content: "◎ "; }
.board-viewport[data-camera="overview"] .camera-status::before { content: "▦ "; }
.board-viewport[data-camera="dice"] .camera-status::before { content: "⚄⚄ "; }
.board-cell { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; overflow: hidden; padding: 3px 1px; border: 1px solid rgba(217,173,88,.17); border-radius: 7px; background: linear-gradient(150deg, rgba(50,31,39,.98), rgba(24,16,20,.98)); text-align: center; }
.board-cell.special { border-color: rgba(255,107,107,.52); background: linear-gradient(145deg, rgba(116,27,45,.95), rgba(44,18,25,.98)); }
.board-cell.start { border-color: rgba(217,173,88,.58); background: linear-gradient(145deg, rgba(113,78,27,.8), rgba(45,29,20,.98)); }
.board-cell.space-inspection, .board-cell.space-journalist, .board-cell.space-exposed { border-color: rgba(255,114,136,.3); }
.board-cell.space-donation { background: linear-gradient(150deg, rgba(69,48,27,.96), rgba(28,20,20,.98)); }
.board-cell.space-chance { border-color: rgba(243,215,144,.68); background: radial-gradient(circle at 50% 15%, rgba(243,215,144,.22), transparent 45%), linear-gradient(145deg, rgba(82,38,108,.98), rgba(31,18,43,.98)); box-shadow: inset 0 0 14px rgba(217,173,88,.1); }
.board-cell.space-chance .cell-name { color: var(--gold-bright); }
.board-cell.space-chance .cell-icon { filter: drop-shadow(0 2px 5px rgba(243,215,144,.28)); }
.cell-icon { font-size: clamp(.76rem, 2.9vw, 1.2rem); line-height: 1; }
.cell-name { display: -webkit-box; margin-top: 2px; overflow: hidden; color: #dfd0c6; font-size: clamp(.44rem, 1.8vw, .68rem); font-weight: 800; line-height: 1.05; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.cell-number { position: absolute; top: 2px; left: 3px; color: rgba(255,255,255,.25); font-size: .43rem; }
.tokens { position: absolute; left: 1px; right: 1px; bottom: 2px; display: flex; justify-content: center; gap: 0; min-height: 9px; }
.board-token { display: grid; place-items: center; width: 9px; height: 9px; margin-left: -2px; border-radius: 50%; color: #130c0f; font-size: .35rem; font-weight: 950; box-shadow: 0 0 0 1px rgba(0,0,0,.72); animation: token-in .28s ease; }
.board-token:first-child { margin-left: 0; }
.board-cell.token-path { z-index: 5; overflow: visible; }
.board-token.token-hopping { position: relative; z-index: 6; box-shadow: 0 4px 8px rgba(0,0,0,.62), 0 0 0 1px rgba(243,215,144,.88); animation-name: token-hop; animation-timing-function: cubic-bezier(.24,.72,.28,1); animation-fill-mode: both; }
.inspector-token { font-size: .58rem; line-height: .7; filter: drop-shadow(0 1px 2px #000); animation: token-in .28s ease; }
@keyframes token-in { from { scale: .5; opacity: .2; } to { scale: 1; opacity: 1; } }
@keyframes token-hop {
  0% { transform: translate3d(var(--hop-from-x), var(--hop-from-y), 0) scale(1); }
  46% { transform: translate3d(var(--hop-mid-x), var(--hop-mid-y), 0) scale(1.24); }
  78% { transform: translate3d(0, -2px, 0) scale(.94); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}
.board-cell.camera-focus { z-index: 2; border-color: rgba(243,215,144,.9); box-shadow: inset 0 0 0 1px rgba(243,215,144,.36), 0 0 12px rgba(217,173,88,.38); }
.board-cell.battle-clash { z-index: 4; border-color: #ffcf70; animation: battle-clash .62s ease-in-out infinite alternate; }
@keyframes battle-clash { from { box-shadow: inset 0 0 0 1px rgba(255,207,112,.3), 0 0 5px rgba(255,114,136,.28); } to { box-shadow: inset 0 0 0 2px rgba(255,207,112,.75), 0 0 18px rgba(255,114,136,.8); } }

.board-center { grid-area: 2 / 2 / 11 / 11; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; margin: 6px; padding: 12px; border: 1px solid rgba(217,173,88,.18); border-radius: 28px; background: radial-gradient(ellipse, rgba(74,29,43,.96), rgba(21,14,18,.98) 68%); box-shadow: inset 0 0 38px rgba(0,0,0,.58), 0 0 30px rgba(114,30,49,.15); }
.center-topline { display: flex; gap: 10px; color: var(--gold-bright); font-size: clamp(.55rem, 2vw, .75rem); font-weight: 900; }
#inspector-status { color: var(--muted); }
.dice-display { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: clamp(112px, 33vw, 160px); height: clamp(82px, 24vw, 110px); margin: 7px 0 5px; padding: 7px 9px 6px; border: 1px solid rgba(217,173,88,.38); border-radius: 20px; color: var(--cream); background: radial-gradient(circle at 50% 9%, rgba(255,255,255,.08), transparent 35%), linear-gradient(145deg, rgba(48,30,38,.98), rgba(11,7,9,.99)); box-shadow: 0 13px 26px rgba(0,0,0,.4), inset 0 1px rgba(255,255,255,.1), inset 0 -10px 20px rgba(0,0,0,.2); cursor: pointer; isolation: isolate; transform-style: preserve-3d; }
.dice-display:disabled { opacity: .62; cursor: default; }
.dice-display.rolling, .dice-display.settling, .dice-display.showing-result { opacity: 1; }
.dice-stage { --die-size: clamp(26px, 7.6vw, 40px); --die-depth: clamp(13px, 3.8vw, 20px); position: relative; display: flex; align-items: center; justify-content: center; gap: clamp(9px, 2.4vw, 14px); width: 100%; height: calc(var(--die-size) + 12px); perspective: 680px; perspective-origin: 50% 42%; transform-style: preserve-3d; will-change: transform; }
.die-slot { position: relative; display: block; flex: 0 0 auto; width: var(--die-size); height: var(--die-size); transform-style: preserve-3d; will-change: transform; }
.die-slot::before { position: absolute; z-index: -1; inset: -12%; border-radius: 34%; background: radial-gradient(circle, rgba(243,215,144,.2), transparent 70%); content: ""; opacity: 0; filter: blur(7px); transition: opacity .2s ease; }
.die-slot::after { position: absolute; z-index: -1; left: 8%; right: 8%; bottom: -13%; height: 24%; border-radius: 50%; background: rgba(0,0,0,.68); filter: blur(5px); content: ""; transform: rotateX(68deg); transition: opacity .2s ease, scale .2s ease; }
.die-cube { position: absolute; inset: 0; display: block; transform-style: preserve-3d; transform-origin: 50% 50% 0; transition: transform .34s cubic-bezier(.2,.78,.25,1); will-change: transform; }
.die-side { position: absolute; inset: 0; display: block; overflow: hidden; border: 1px solid rgba(92,65,43,.48); border-radius: 11%; outline: 1px solid rgba(255,255,255,.24); outline-offset: -2px; background: radial-gradient(circle at 27% 15%, rgba(255,255,255,.98), transparent 31%), linear-gradient(145deg, #fffdf7 0%, #f1e5d2 53%, #cdb99e 100%); box-shadow: inset 2px 2px 5px rgba(255,255,255,.9), inset -4px -5px 8px rgba(104,76,52,.3), 0 2px 5px rgba(20,12,10,.28); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.die-side::before { position: absolute; inset: 0; content: ""; }
.die-face-1::before { background: radial-gradient(circle at 50% 50%, #120b0d 0 7%, #53202c 8%, transparent 10%); }
.die-face-2::before { background: radial-gradient(circle at 28% 28%, #120b0d 0 7%, #53202c 8%, transparent 10%), radial-gradient(circle at 72% 72%, #120b0d 0 7%, #53202c 8%, transparent 10%); }
.die-face-3::before { background: radial-gradient(circle at 28% 28%, #120b0d 0 7%, #53202c 8%, transparent 10%), radial-gradient(circle at 50% 50%, #120b0d 0 7%, #53202c 8%, transparent 10%), radial-gradient(circle at 72% 72%, #120b0d 0 7%, #53202c 8%, transparent 10%); }
.die-face-4::before { background: radial-gradient(circle at 28% 28%, #120b0d 0 7%, #53202c 8%, transparent 10%), radial-gradient(circle at 72% 28%, #120b0d 0 7%, #53202c 8%, transparent 10%), radial-gradient(circle at 28% 72%, #120b0d 0 7%, #53202c 8%, transparent 10%), radial-gradient(circle at 72% 72%, #120b0d 0 7%, #53202c 8%, transparent 10%); }
.die-face-5::before { background: radial-gradient(circle at 28% 28%, #120b0d 0 7%, #53202c 8%, transparent 10%), radial-gradient(circle at 72% 28%, #120b0d 0 7%, #53202c 8%, transparent 10%), radial-gradient(circle at 50% 50%, #120b0d 0 7%, #53202c 8%, transparent 10%), radial-gradient(circle at 28% 72%, #120b0d 0 7%, #53202c 8%, transparent 10%), radial-gradient(circle at 72% 72%, #120b0d 0 7%, #53202c 8%, transparent 10%); }
.die-face-6::before { background: radial-gradient(circle at 29% 24%, #120b0d 0 7%, #53202c 8%, transparent 10%), radial-gradient(circle at 29% 50%, #120b0d 0 7%, #53202c 8%, transparent 10%), radial-gradient(circle at 29% 76%, #120b0d 0 7%, #53202c 8%, transparent 10%), radial-gradient(circle at 71% 24%, #120b0d 0 7%, #53202c 8%, transparent 10%), radial-gradient(circle at 71% 50%, #120b0d 0 7%, #53202c 8%, transparent 10%), radial-gradient(circle at 71% 76%, #120b0d 0 7%, #53202c 8%, transparent 10%); }
.die-front { transform: translateZ(var(--die-depth)); }
.die-back { transform: rotateY(180deg) translateZ(var(--die-depth)); }
.die-right { transform: rotateY(90deg) translateZ(var(--die-depth)); }
.die-left { transform: rotateY(-90deg) translateZ(var(--die-depth)); }
.die-top { transform: rotateX(90deg) translateZ(var(--die-depth)); }
.die-bottom { transform: rotateX(-90deg) translateZ(var(--die-depth)); }
.die-top { background: radial-gradient(circle at 27% 15%, #fff, transparent 31%), linear-gradient(145deg, #fffefa 0%, #f7eddd 58%, #dac8ad 100%); }
.die-right, .die-left { background: radial-gradient(circle at 27% 15%, rgba(255,255,255,.84), transparent 31%), linear-gradient(145deg, #f7eddd 0%, #dccab0 58%, #bda386 100%); }
.die-back, .die-bottom { background: linear-gradient(145deg, #efe2cf 0%, #cdb99d 58%, #a98d70 100%); }
.die-cube[data-value="1"] { transform: rotateX(-26deg) rotateY(34deg) rotateZ(-3deg); }
.die-cube[data-value="2"] { transform: rotateX(-116deg) rotateY(28deg) rotateZ(5deg); }
.die-cube[data-value="3"] { transform: rotateX(-25deg) rotateY(-58deg) rotateZ(-4deg); }
.die-cube[data-value="4"] { transform: rotateX(-25deg) rotateY(122deg) rotateZ(4deg); }
.die-cube[data-value="5"] { transform: rotateX(64deg) rotateY(-28deg) rotateZ(-4deg); }
.die-cube[data-value="6"] { transform: rotateX(-26deg) rotateY(214deg) rotateZ(3deg); }
.dice-display small { position: relative; z-index: 2; min-height: 1.2em; margin-top: 4px; color: var(--muted); font-size: clamp(.64rem, 2.2vw, .76rem); line-height: 1.2; }
.dice-display.rolling .die-slot::after { opacity: .42; scale: .88; }
.dice-display.rolling .die-slot-one { animation: die-bounce-one 1.6s cubic-bezier(.22,.65,.32,1) both; }
.dice-display.rolling .die-slot-two { animation: die-bounce-two 1.6s .04s cubic-bezier(.22,.65,.32,1) both; }
.dice-display.rolling .die-cube { transition: none; }
.dice-display.rolling .die-slot-one .die-cube { animation: die-spin-one 1.6s cubic-bezier(.18,.72,.22,1) both; }
.dice-display.rolling .die-slot-two .die-cube { animation: die-spin-two 1.6s .04s cubic-bezier(.18,.72,.22,1) both; }
.dice-display.settling .die-slot-one { animation: die-land .34s cubic-bezier(.2,.78,.25,1) both; }
.dice-display.settling .die-slot-two { animation: die-land .34s .05s cubic-bezier(.2,.78,.25,1) both; }
@keyframes die-bounce-one { 0% { transform: translate3d(0,0,0); } 18% { transform: translate3d(-2px,-6px,0); } 42% { transform: translate3d(3px,-10px,0); } 66% { transform: translate3d(-2px,-7px,0); } 84% { transform: translate3d(1px,-3px,0); } 100% { transform: translate3d(0,-2px,0); } }
@keyframes die-bounce-two { 0% { transform: translate3d(0,0,0); } 17% { transform: translate3d(2px,-7px,0); } 44% { transform: translate3d(-3px,-11px,0); } 69% { transform: translate3d(2px,-6px,0); } 86% { transform: translate3d(-1px,-3px,0); } 100% { transform: translate3d(0,-2px,0); } }
@keyframes die-spin-one { 0% { transform: rotateX(-28deg) rotateY(36deg) rotateZ(0); } 24% { transform: rotateX(-35deg) rotateY(46deg) rotateZ(205deg); } 49% { transform: rotateX(-23deg) rotateY(31deg) rotateZ(430deg); } 74% { transform: rotateX(-36deg) rotateY(48deg) rotateZ(650deg); } 100% { transform: rotateX(-28deg) rotateY(36deg) rotateZ(900deg); } }
@keyframes die-spin-two { 0% { transform: rotateX(-31deg) rotateY(-38deg) rotateZ(0); } 23% { transform: rotateX(-22deg) rotateY(-48deg) rotateZ(-220deg); } 51% { transform: rotateX(-37deg) rotateY(-30deg) rotateZ(-445deg); } 76% { transform: rotateX(-25deg) rotateY(-47deg) rotateZ(-675deg); } 100% { transform: rotateX(-31deg) rotateY(-38deg) rotateZ(-900deg); } }
@keyframes die-land { 0% { transform: translateY(-2px); } 58% { transform: translateY(1px); } 100% { transform: translateY(0); } }
.dice-display.showing-result { z-index: 6; border-color: rgba(243,215,144,.94); box-shadow: 0 22px 48px rgba(0,0,0,.58), 0 0 32px rgba(243,215,144,.46), inset 0 0 20px rgba(243,215,144,.13); pointer-events: none; }
.dice-display.showing-result::after { position: absolute; inset: -8px; border: 1px solid rgba(243,215,144,.74); border-radius: 27px; content: ""; animation: dice-result-ring 1.16s ease-out both; pointer-events: none; }
.dice-display.showing-result .die-slot::before { opacity: 1; }
.dice-display.showing-result .die-side { box-shadow: inset 2px 2px 5px rgba(255,255,255,.94), inset -4px -5px 8px rgba(104,76,52,.32), 0 0 8px rgba(243,215,144,.34); }
.dice-display.showing-result .dice-stage { animation: dice-result-confirm 1.16s cubic-bezier(.2,.72,.22,1) both; }
.dice-display.showing-result small { color: var(--gold-bright); font-weight: 950; text-shadow: 0 0 14px rgba(243,215,144,.42); }
@keyframes dice-result-confirm {
  0% { transform: translateY(0) scale(1); }
  22% { transform: translateY(-7px) scale(1.5); }
  39% { transform: translateY(-5px) scale(1.42); }
  72% { transform: translateY(-6px) scale(1.46); }
  84% { transform: translateY(-5px) scale(1.45); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes dice-result-ring {
  0% { opacity: 0; transform: scale(.82); }
  24% { opacity: .9; }
  100% { opacity: 0; transform: scale(1.24); }
}
.center-message { max-width: 240px; color: #bfaea6; text-align: center; font-size: clamp(.68rem, 2.3vw, .82rem); line-height: 1.42; }

.activity-panel { margin: 10px 14px 0; padding: 12px; border: 1px solid rgba(255,255,255,.07); border-radius: 14px; background: rgba(28,18,23,.82); }
.activity-heading { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; font-weight: 800; }
#wealth-leader { color: var(--gold); }
.activity-feed { display: grid; gap: 6px; margin-top: 8px; }
.feed-item { display: flex; align-items: flex-start; gap: 8px; min-height: 34px; padding: 7px 8px; border-radius: 9px; background: rgba(255,255,255,.035); font-size: .75rem; line-height: 1.38; }
.feed-item i { flex: 0 0 auto; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--feed-color, var(--gold)); }
.feed-item b { color: var(--cream); }
.history-details { margin-top: 7px; color: var(--muted); font-size: .72rem; }
.history-details summary { padding: 6px 2px; cursor: pointer; font-weight: 800; }
.history-details ol { max-height: 210px; margin: 5px 0 0; padding: 0 0 0 23px; overflow-y: auto; }
.history-details li { padding: 4px 0; line-height: 1.4; }

.bottom-action { position: fixed; z-index: 20; left: 50%; bottom: 0; display: flex; align-items: center; justify-content: space-between; width: min(100%, 760px); padding: 10px 14px max(10px, env(safe-area-inset-bottom)); translate: -50% 0; border-top: 1px solid rgba(217,173,88,.16); background: rgba(16,11,14,.92); backdrop-filter: blur(16px); }
.turn-prompt { min-width: 0; padding-right: 10px; }
.turn-prompt small, .turn-prompt strong { display: block; }
.turn-prompt small { color: var(--gold); font-size: .65rem; font-weight: 900; letter-spacing: .06em; }
.turn-prompt strong { overflow: hidden; margin-top: 1px; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.roll-button { flex: 0 0 auto; min-width: 128px; min-height: 50px; padding: 0 16px; font-size: .95rem; }
.roll-button:disabled { color: #8c7e79; background: #2a2024; box-shadow: none; cursor: not-allowed; }

dialog { max-width: none; max-height: none; padding: 0; border: 0; color: var(--cream); background: transparent; }
dialog::backdrop { background: rgba(6,4,5,.79); backdrop-filter: blur(5px); }
.game-dialog, .rules-dialog, .result-dialog { width: min(calc(100% - 28px), 500px); }
.level-up-dialog { width: min(calc(100% - 24px), 430px); }
.level-up-dialog::backdrop { background: radial-gradient(circle at 50% 42%, rgba(128,55,25,.34), rgba(6,4,5,.93) 62%); backdrop-filter: blur(9px) saturate(.78); }
.level-up-card { --level-color: var(--gold); position: relative; max-height: min(90dvh, 680px); overflow: hidden auto; padding: 30px 22px 22px; border: 1px solid rgba(243,215,144,.72); border-radius: 28px; background: radial-gradient(circle at 50% 31%, color-mix(in srgb, var(--level-color) 23%, transparent), transparent 29%), linear-gradient(155deg, #421c2b 0%, #24131b 44%, #100b0e 100%); box-shadow: 0 32px 110px rgba(0,0,0,.78), 0 0 52px color-mix(in srgb, var(--level-color) 30%, transparent), inset 0 0 42px rgba(243,215,144,.07); text-align: center; isolation: isolate; }
.level-up-card::before { position: absolute; z-index: 3; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, transparent, var(--level-color), var(--gold-bright), var(--level-color), transparent); box-shadow: 0 0 18px color-mix(in srgb, var(--level-color) 60%, transparent); content: ""; }
.level-up-rays { position: absolute; z-index: 0; top: 34%; left: 50%; width: 380px; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; opacity: .24; background: repeating-conic-gradient(from 4deg, transparent 0 10deg, rgba(243,215,144,.38) 11deg 12deg, transparent 13deg 23deg); -webkit-mask-image: radial-gradient(circle, #000 0 24%, transparent 68%); mask-image: radial-gradient(circle, #000 0 24%, transparent 68%); }
.level-up-sparks { position: absolute; z-index: 1; inset: 0; overflow: hidden; pointer-events: none; }
.level-up-sparks i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 11px var(--level-color); opacity: 0; }
.level-up-sparks i:nth-child(1) { top: 18%; left: 13%; animation-delay: .1s; }
.level-up-sparks i:nth-child(2) { top: 29%; right: 12%; animation-delay: .45s; }
.level-up-sparks i:nth-child(3) { top: 48%; left: 9%; animation-delay: .8s; }
.level-up-sparks i:nth-child(4) { top: 55%; right: 10%; animation-delay: 1.15s; }
.level-up-sparks i:nth-child(5) { top: 73%; left: 18%; animation-delay: .28s; }
.level-up-sparks i:nth-child(6) { top: 77%; right: 17%; animation-delay: .68s; }
.level-up-sparks i:nth-child(7) { top: 10%; left: 38%; animation-delay: 1.02s; }
.level-up-sparks i:nth-child(8) { top: 14%; right: 35%; animation-delay: 1.38s; }
.level-up-eyebrow { position: relative; z-index: 2; margin: 0; color: var(--gold-bright); font-family: Georgia, "Times New Roman", serif; font-size: .72rem; font-weight: 900; letter-spacing: .22em; }
.level-up-emblem { position: relative; z-index: 2; display: grid; place-items: center; width: 82px; height: 82px; margin: 18px auto 10px; border: 2px solid rgba(243,215,144,.82); border-radius: 50%; background: radial-gradient(circle at 42% 32%, rgba(255,255,255,.18), transparent 28%), color-mix(in srgb, var(--level-color) 24%, #1a1014); box-shadow: 0 0 0 7px rgba(243,215,144,.07), 0 0 32px color-mix(in srgb, var(--level-color) 55%, transparent), inset 0 0 18px rgba(243,215,144,.17); font-size: 2.35rem; }
.level-up-card h2 { position: relative; z-index: 2; margin: 0; color: #fff4d8; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.35rem, 12vw, 3.7rem); letter-spacing: .04em; line-height: 1; text-shadow: 0 0 26px color-mix(in srgb, var(--level-color) 72%, transparent); }
.level-up-player { position: relative; z-index: 2; margin: 9px 0 0; color: #d8c8bd; font-size: .82rem; line-height: 1.45; }
.level-up-number-row { position: relative; z-index: 2; display: flex; align-items: baseline; justify-content: center; gap: 17px; margin: 13px 0 5px; font-family: Georgia, "Times New Roman", serif; }
.level-up-number-row span { color: #a69790; font-size: 1.75rem; font-weight: 800; }
.level-up-number-row i { color: var(--gold); font-size: 1.2rem; font-style: normal; }
.level-up-number-row strong { color: var(--gold-bright); font-size: 4.2rem; line-height: .9; text-shadow: 0 0 24px color-mix(in srgb, var(--level-color) 60%, transparent); }
.level-up-tier { position: relative; z-index: 2; width: fit-content; max-width: 100%; margin: 13px auto 0; padding: 8px 13px; border: 1px solid color-mix(in srgb, var(--level-color) 62%, var(--gold)); border-radius: 99px; color: #fff0cf; background: color-mix(in srgb, var(--level-color) 14%, rgba(24,14,19,.9)); font-size: .76rem; font-weight: 900; }
.level-up-unlocks { position: relative; z-index: 2; margin-top: 11px; padding: 9px; border: 1px solid rgba(243,215,144,.22); border-radius: 12px; background: rgba(243,215,144,.06); }
.level-up-unlocks > span { display: block; color: var(--gold); font-size: .62rem; font-weight: 900; }
.level-up-unlocks > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 6px; }
.level-up-unlocks b { padding: 5px 7px; border-radius: 7px; color: #fff0cf; background: rgba(255,255,255,.055); font-size: .59rem; }
.level-up-reason { position: relative; z-index: 2; display: block; margin-top: 9px; color: var(--muted); font-size: .68rem; line-height: 1.4; }
.level-up-continue { position: relative; z-index: 2; width: 100%; margin-top: 19px; padding: 13px; }
.level-up-dialog[open] .level-up-card { animation: level-card-arrive .55s cubic-bezier(.18,.78,.2,1) both; }
.level-up-dialog[open] .level-up-rays { animation: level-rays-spin 13s linear infinite; }
.level-up-dialog[open] .level-up-sparks i { animation-name: level-spark; animation-duration: 1.8s; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
.level-up-dialog[open] .level-up-emblem { animation: level-emblem-rise .7s cubic-bezier(.2,.78,.2,1) both; }
.level-up-dialog[open] .level-up-number-row strong { animation: level-number-pop .78s .18s cubic-bezier(.18,.8,.18,1) both; }
@keyframes level-card-arrive { from { opacity: 0; transform: translateY(18px) scale(.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes level-emblem-rise { from { opacity: 0; transform: translateY(18px) scale(.66) rotate(-12deg); } to { opacity: 1; transform: translateY(0) scale(1) rotate(0); } }
@keyframes level-number-pop { 0% { opacity: 0; transform: translateY(10px) scale(.55); } 68% { opacity: 1; transform: translateY(-2px) scale(1.15); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes level-rays-spin { to { transform: rotate(360deg); } }
@keyframes level-spark { 0%,100% { opacity: 0; transform: translateY(5px) scale(.45); } 45% { opacity: 1; transform: translateY(-7px) scale(1); } }
.dialog-card, .rules-card, .result-card { position: relative; overflow: hidden; padding: 24px 20px 20px; border: 1px solid rgba(217,173,88,.32); border-radius: 22px; background: linear-gradient(150deg, #321d26, #171014 72%); box-shadow: 0 25px 90px rgba(0,0,0,.65); }
.dialog-card::before, .result-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--wine-bright), var(--event-color, var(--gold)), var(--wine-bright)); }
.dialog-accent { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 13px; border: 1px solid rgba(217,173,88,.25); border-radius: 16px; color: var(--event-color, var(--gold-bright)); background: rgba(217,173,88,.08); font-size: 1.7rem; }
.tile-art-icon { display:inline-block; width:100%; aspect-ratio:1; background-image:url('./assets/board/empire-icons-v042.webp?v=0.42'); background-size:500% 400%; background-position:var(--tile-art-x) var(--tile-art-y); background-repeat:no-repeat; vertical-align:middle; }
.dialog-accent .tile-art-icon { width:46px; }
.game-ui-icon { display: inline-block; flex: 0 0 auto; width: 1.45em; height: 1.45em; object-fit: contain; vertical-align: -.3em; }
.dialog-accent > .game-ui-icon { width: 44px; height: 44px; }
.choice-button:has(.game-ui-icon) b { display: flex; align-items: center; gap: 10px; }
.choice-button b > .game-ui-icon { width: 30px; height: 30px; }
.level-up-emblem > .game-ui-icon { width: 62px; height: 62px; }
.level-up-tier { display: flex; align-items: center; justify-content: center; gap: 7px; }
.level-up-tier > .game-ui-icon { width: 23px; height: 23px; }
.profile-tier-icon > .game-ui-icon { width: 24px; height: 24px; }
.profile-growth-icon > .game-ui-icon { width: 32px; height: 32px; }
.compact-level > .game-ui-icon { width: 18px; height: 18px; margin-right: 3px; }
.battle-card-front > .game-ui-icon { width: 42px; height: 42px; }
.cell-icon .tile-art-icon { width:22px; }
.dialog-origin { margin:0 0 5px; color:var(--muted); font-size:14px; line-height:1.5; }
.dialog-origin[hidden] { display:none; }
.dialog-type { color: var(--gold); font-size: .7rem; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }
.dialog-card h2, .result-card h2 { margin: 4px 0 7px; font-size: 1.6rem; line-height: 1.15; }
.dialog-card p, .result-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.dialog-impact { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.impact-chip { padding: 6px 9px; border-radius: 8px; color: #d8c9c0; background: rgba(255,255,255,.055); font-size: .72rem; font-weight: 800; }
.impact-chip.good { color: #8ee1ad; background: rgba(95,195,139,.09); }
.impact-chip.bad { color: #ff9c9c; background: rgba(255,107,107,.09); }
.dialog-actions { display: grid; gap: 8px; margin-top: 18px; }
.choice-button { width: 100%; padding: 13px 14px; border: 1px solid rgba(217,173,88,.25); border-radius: 12px; color: var(--cream); background: rgba(255,255,255,.045); text-align: left; cursor: pointer; }
.choice-button b, .choice-button small { display: block; }
.choice-button b { font-size: .9rem; }
.choice-button small { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.choice-button.primary-choice { border-color: rgba(217,173,88,.55); background: rgba(217,173,88,.12); }

.battle-mode .dialog-card { max-height: min(90dvh, 760px); overflow-y: auto; }
.battle-mode .dialog-impact { display: block; margin-top: 14px; }
.battle-sequence { position: relative; }
.battle-countdown { display: grid; place-items: center; min-height: 52px; color: var(--gold-bright); font-family: Georgia, "Times New Roman", serif; font-size: 2.8rem; font-weight: 950; line-height: 1; text-shadow: 0 0 24px rgba(243,215,144,.55); transition: opacity .2s ease, min-height .25s ease; }
.battle-countdown.counting { animation: battle-count .52s cubic-bezier(.2,.72,.2,1) both; }
.battle-countdown.finished { min-height: 10px; opacity: 0; animation: none; }
@keyframes battle-count { 0% { opacity: 0; transform: scale(.5); } 55% { opacity: 1; transform: scale(1.18); } 100% { opacity: 1; transform: scale(1); } }
.battle-duel { display: grid; grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); align-items: center; gap: 7px; }
.battle-vs { color: var(--gold); font-family: Georgia, "Times New Roman", serif; font-size: .76rem; font-weight: 950; text-align: center; }
.battle-contender { min-width: 0; padding: 9px; border: 1px solid rgba(255,255,255,.09); border-radius: 14px; background: rgba(255,255,255,.035); text-align: center; transition: opacity .28s ease, border-color .28s ease, box-shadow .28s ease, transform .28s ease; }
.battle-contender > small, .battle-contender > b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.battle-contender > small { color: var(--muted); font-size: .62rem; }
.battle-contender > b { margin-top: 2px; color: var(--cream); font-size: .72rem; }
.battle-contender.winner { border-color: var(--contender-color); box-shadow: 0 0 0 1px var(--contender-color), 0 0 22px color-mix(in srgb, var(--contender-color) 48%, transparent); transform: translateY(-3px); }
.battle-contender.loser { opacity: .52; transform: scale(.96); }
.battle-contender.tie { border-color: rgba(255,207,112,.62); }
.battle-card { height: 94px; margin-top: 8px; perspective: 700px; }
.battle-card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2,.74,.2,1); }
.battle-card.revealed .battle-card-inner { transform: rotateY(180deg); }
.battle-card-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 7px; border: 1px solid rgba(217,173,88,.3); border-radius: 11px; background: linear-gradient(145deg, rgba(54,32,41,.98), rgba(16,11,14,.98)); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.battle-card-face span { font-size: 1.75rem; line-height: 1; }
.battle-card-face strong { margin-top: 6px; font-size: .7rem; line-height: 1.2; }
.battle-card-back span { color: var(--gold); font-family: Georgia, "Times New Roman", serif; font-size: 2rem; }
.battle-card-back strong { color: var(--muted); }
.battle-card-front { border-color: color-mix(in srgb, var(--contender-color) 62%, var(--gold)); transform: rotateY(180deg); }
.battle-verdict { margin-top: 12px; padding: 10px; border: 1px solid rgba(217,173,88,.25); border-radius: 11px; background: rgba(217,173,88,.075); text-align: center; animation: battle-verdict-in .45s ease both; }
.battle-verdict strong, .battle-verdict span { display: block; }
.battle-verdict strong { color: var(--gold-bright); font-size: .79rem; }
.battle-verdict span { margin-top: 3px; color: #d2c0b7; font-size: .67rem; line-height: 1.4; }
@keyframes battle-verdict-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.follower-transfer { margin-top: 10px; padding: 9px 10px; border-radius: 11px; background: rgba(95,195,139,.07); animation: battle-verdict-in .35s ease both; }
.transfer-route { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; }
.transfer-route span { overflow: hidden; color: #d7c8be; font-size: .64rem; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.transfer-route span:last-child { text-align: right; }
.transfer-route .winner-name { color: #8ee1ad; }
.transfer-route .loser-name { color: #d7c8be; }
.transfer-route b { color: var(--gold-bright); font-size: .64rem; white-space: nowrap; }
.follower-track { display: grid; grid-template-columns: 18px minmax(0, 1fr) 18px; align-items: center; gap: 5px; margin-top: 7px; color: #d6c6bc; }
.follower-end { font-size: .8rem; text-align: center; }
.winner-end { color: #8ee1ad; filter: drop-shadow(0 0 5px rgba(142,225,173,.5)); }
.follower-flight { position: relative; height: 15px; overflow: hidden; border-radius: 99px; background: linear-gradient(90deg, rgba(255,255,255,.035), rgba(217,173,88,.12), rgba(95,195,139,.12)); }
.follower-flight i { position: absolute; top: 50%; left: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 7px rgba(243,215,144,.72); opacity: 0; transform: translateY(-50%); }
.follower-transfer.active .follower-flight i { animation: follower-fly .86s cubic-bezier(.25,.7,.25,1) var(--flight-delay) both; }
.follower-transfer.right-to-left .follower-flight { background: linear-gradient(90deg, rgba(95,195,139,.12), rgba(217,173,88,.12), rgba(255,255,255,.035)); }
.follower-transfer.right-to-left .follower-flight i { right: 3px; left: auto; }
.follower-transfer.right-to-left.active .follower-flight i { animation-name: follower-fly-reverse; }
.follower-transfer.active .winner-end { animation: follower-receive .42s ease .76s 2 alternate; }
@keyframes follower-fly { 0% { left: 3px; opacity: 0; transform: translateY(-50%) scale(.55); } 18% { opacity: 1; } 82% { opacity: 1; } 100% { left: calc(100% - 9px); opacity: 0; transform: translateY(-50%) scale(1.18); } }
@keyframes follower-fly-reverse { 0% { right: 3px; opacity: 0; transform: translateY(-50%) scale(.55); } 18% { opacity: 1; } 82% { opacity: 1; } 100% { right: calc(100% - 9px); opacity: 0; transform: translateY(-50%) scale(1.18); } }
@keyframes follower-receive { from { transform: scale(1); } to { color: #d9ffe5; filter: drop-shadow(0 0 9px rgba(142,225,173,.85)); transform: scale(1.32); } }
.battle-continue { animation: battle-verdict-in .35s ease both; }

.rules-card { max-height: min(84dvh, 720px); overflow-y: auto; }
.rules-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.rules-head span { color: var(--gold); font-size: .72rem; font-weight: 900; letter-spacing: .08em; }
.rules-head h2 { margin: 2px 0 0; font-size: 1.45rem; }
.rules-list { display: grid; gap: 11px; margin: 18px 0; padding: 0; list-style: none; counter-reset: rules; }
.rules-list li { position: relative; padding-left: 42px; counter-increment: rules; }
.rules-list li::before { content: counter(rules); position: absolute; left: 0; top: 1px; display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 9px; color: var(--gold-bright); background: rgba(217,173,88,.06); font-family: Georgia, serif; font-weight: 900; }
.rules-list b, .rules-list span { display: block; }
.rules-list b { font-size: .86rem; }
.rules-list span { margin-top: 2px; color: var(--muted); font-size: .74rem; line-height: 1.45; }
.rules-card > .primary-button, .result-card > .primary-button { width: 100%; padding: 14px; }

.dialog-lead { margin: 9px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.dialog-section-title { margin: 19px 0 8px; color: var(--cream); font-size: .88rem; }
.season-total { display: grid; justify-items: center; margin-top: 15px; padding: 15px; border: 1px solid rgba(217,173,88,.27); border-radius: 14px; background: rgba(217,173,88,.07); text-align: center; }
.season-total span { color: var(--muted); font-size: .7rem; }
.season-total strong { color: var(--gold-bright); font-family: Georgia, "Times New Roman", serif; font-size: 2.2rem; line-height: 1.1; }
.season-total small { margin-top: 3px; color: #d7c7bd; font-size: .68rem; }
.score-breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.score-breakdown > div { min-width: 0; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.045); }
.score-breakdown span, .score-breakdown b, .score-breakdown small { display: block; }
.score-breakdown span { color: var(--muted); font-size: .63rem; }
.score-breakdown b { margin-top: 2px; color: var(--gold-bright); font-size: 1rem; }
.score-breakdown small { margin-top: 1px; overflow: hidden; color: #cfbfb5; font-size: .61rem; text-overflow: ellipsis; white-space: nowrap; }
.season-history { display: grid; gap: 7px; }
.history-season { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.045); }
.history-season b, .history-season small { display: block; }
.history-season b { font-size: .72rem; }
.history-season small { margin-top: 2px; color: var(--muted); font-size: .61rem; }
.history-season > span { color: var(--gold-bright); font-size: .69rem; font-weight: 900; text-align: right; }
.empty-season { padding: 16px 12px; border: 1px dashed rgba(217,173,88,.22); border-radius: 10px; color: var(--muted); font-size: .72rem; line-height: 1.45; text-align: center; }
.prototype-note { margin: 15px 0; padding: 10px 11px; border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; color: #a99890; background: rgba(217,173,88,.055); font-size: .66rem; line-height: 1.5; }

.account-card { max-height: min(88dvh, 680px); }
.account-status-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 12px; margin-top: 16px; padding: 13px; border: 1px solid rgba(106,181,255,.25); border-radius: 14px; background: rgba(106,181,255,.06); }
.account-status-card.is-synced { border-color: rgba(95,195,139,.3); background: rgba(95,195,139,.065); }
.account-status-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; color: #9bd9ff; background: rgba(106,181,255,.1); font-size: 1.45rem; }
.account-status-card.is-synced .account-status-icon { color: #8ee1ad; background: rgba(95,195,139,.1); }
.account-status-card small, .account-status-card strong { display: block; }
.account-status-card small { color: var(--muted); font-size: .64rem; font-weight: 850; }
.account-status-card strong { margin-top: 2px; color: var(--cream); font-size: .88rem; }
.account-status-card p { margin: 3px 0 0; color: #b9a99f; font-size: .66rem; line-height: 1.4; }
.account-form { margin-top: 14px; }
.account-form label { display: block; margin-bottom: 6px; color: var(--gold-bright); font-size: .72rem; font-weight: 900; }
.account-name-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.account-name-row input { min-width: 0; height: 44px; padding: 0 11px; border: 1px solid rgba(217,173,88,.28); border-radius: 11px; outline: none; color: var(--cream); background: rgba(255,255,255,.055); font: inherit; font-size: 1rem; }
.account-name-row input:focus { border-color: var(--gold-bright); box-shadow: 0 0 0 2px rgba(217,173,88,.11); }
.account-name-row .primary-button { min-width: 96px; padding: 0 12px; }
.account-form > small { display: block; margin-top: 7px; color: var(--muted); font-size: .64rem; line-height: 1.4; }
.save-conflict-actions { margin-top: 14px; padding: 12px; border: 1px solid rgba(255,158,114,.32); border-radius: 13px; background: rgba(255,158,114,.07); }
.save-conflict-actions > strong { display: block; color: #ffc19f; font-size: .8rem; }
.save-conflict-actions > p { margin: 3px 0 10px; color: var(--muted); font-size: .66rem; line-height: 1.45; }
.save-conflict-actions .choice-button + .choice-button { margin-top: 7px; }
.account-signin { display: block; width: 100%; margin-top: 14px; padding: 13px; color: #1a1115; text-align: center; text-decoration: none; }
.account-signin[hidden] { display: none; }
.game-save-status { display: block; width: 100%; margin: 0 0 12px; padding: 11px 14px; border: 1px solid rgba(217,173,88,.35); border-radius: 12px; background: rgba(217,173,88,.08); color: var(--cream); font: inherit; font-size: .875rem; text-align: left; cursor: pointer; }
.game-save-status[data-status="synced"] { border-color: rgba(95,195,139,.45); color: #b2efc9; }
.game-save-status[data-status="conflict"], .game-save-status[data-status="offline"] { border-color: #cf895f; color: #ffc19f; }
.save-conflict-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; font-size: .875rem; }
.save-conflict-summary > div { padding: 10px; border: 1px solid rgba(217,173,88,.3); border-radius: 10px; background: rgba(0,0,0,.18); }
.save-conflict-summary p { margin: 6px 0 0; line-height: 1.5; color: var(--cream); }
#sync-current-save[hidden] { display: none; }
.account-message { min-height: 20px; margin: 10px 0 0; color: #9bd9ff; font-size: .7rem; line-height: 1.4; text-align: center; }
.account-message.is-error { color: #ff9e9e; }
.secondary-dialog-button { width: 100%; margin-top: 7px; padding: 12px; border: 1px solid rgba(217,173,88,.24); border-radius: 12px; color: var(--cream); background: rgba(255,255,255,.045); font-weight: 850; cursor: pointer; }
.ranking-loading { padding: 15px 12px; border: 1px dashed rgba(106,181,255,.22); border-radius: 10px; color: #a9bdca; font-size: .72rem; line-height: 1.45; text-align: center; }
.ranking-retry { display: block; width: 100%; margin-top: 11px; padding: 10px 12px; border: 1px solid rgba(217,173,88,.45); border-radius: 9px; color: #f3d790; background: rgba(217,173,88,.08); font: inherit; font-weight: 900; cursor: pointer; }
.ranking-retry:disabled { cursor: wait; opacity: .62; }
.rank-row.is-top-three { background: linear-gradient(100deg, rgba(217,173,88,.11), rgba(255,255,255,.04)); }

.profile-card { max-height: min(88dvh, 760px); }
.profile-content { margin-top: 15px; }
.profile-hero { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 14px; padding: 14px; border: 1px solid color-mix(in srgb, var(--profile-color) 42%, var(--gold)); border-radius: 16px; background: radial-gradient(circle at 18% 25%, color-mix(in srgb, var(--profile-color) 20%, transparent), transparent 43%), rgba(255,255,255,.035); }
.profile-avatar { position: relative; isolation: isolate; display: grid; place-items: center; width: 86px; height: 86px; border: 2px solid color-mix(in srgb, var(--stage-accent) 64%, var(--profile-color)); border-radius: 50%; background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--stage-accent) 22%, transparent), rgba(25,16,21,.96) 68%); box-shadow: 0 0 var(--tier-glow) color-mix(in srgb, var(--stage-accent) 48%, transparent), inset 0 0 18px rgba(243,215,144,.08); }
.profile-avatar::before, .profile-avatar::after { content: ""; position: absolute; z-index: 0; pointer-events: none; border-radius: inherit; }
.profile-avatar::before { inset: 5px; border: 1px solid color-mix(in srgb, var(--stage-accent) 30%, transparent); }
.profile-avatar::after { inset: -7px; border: 1px solid transparent; opacity: 0; }
.profile-avatar.appearance-stage-2::after { opacity: .34; border-color: var(--stage-accent); }
.profile-avatar.appearance-stage-3::after { opacity: .48; border-style: double; border-width: 3px; border-color: var(--stage-accent); }
.profile-avatar.appearance-stage-4::after { inset: -9px; opacity: .58; border: 2px solid var(--stage-accent); box-shadow: 0 0 14px color-mix(in srgb, var(--stage-accent) 46%, transparent); }
.profile-avatar.appearance-stage-5::after { inset: -10px; opacity: .74; border: 2px solid var(--stage-accent); box-shadow: 0 0 18px color-mix(in srgb, var(--stage-accent) 64%, transparent), inset 0 0 12px color-mix(in srgb, var(--stage-accent) 24%, transparent); }
.profile-avatar.appearance-stage-6::after { inset: -11px; opacity: 1; border: 3px double var(--stage-accent); box-shadow: 0 0 24px color-mix(in srgb, var(--stage-accent) 78%, transparent), inset 0 0 15px color-mix(in srgb, var(--stage-accent) 30%, transparent); animation: profile-legend-pulse 2.4s ease-in-out infinite; }
.profile-career-icon { position: relative; z-index: 1; font-size: 2.2rem; filter: drop-shadow(0 4px 8px rgba(0,0,0,.42)); transform: scale(var(--appearance-scale, 1)); }
.appearance-stage-2 { --appearance-scale: 1.03; }
.appearance-stage-3 { --appearance-scale: 1.06; }
.appearance-stage-4 { --appearance-scale: 1.09; }
.appearance-stage-5 { --appearance-scale: 1.12; }
.appearance-stage-6 { --appearance-scale: 1.16; }
.profile-stage-label { position: absolute; z-index: 2; top: -5px; left: -4px; display: grid; place-items: center; min-width: 29px; height: 22px; padding: 0 6px; border: 1px solid color-mix(in srgb, var(--stage-accent) 70%, var(--gold)); border-radius: 99px; color: #160e12; background: var(--stage-accent); font-size: .62rem; font-weight: 950; }
.profile-tier-icon { position: absolute; z-index: 2; top: -5px; right: -3px; display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid rgba(243,215,144,.48); border-radius: 50%; background: #24151b; font-size: .9rem; }
.profile-avatar > b { position: absolute; z-index: 2; right: -2px; bottom: -3px; display: grid; place-items: center; min-width: 30px; height: 24px; padding: 0 6px; border: 1px solid var(--gold); border-radius: 99px; color: #1a1014; background: var(--gold-bright); font-size: .68rem; }
.profile-growth-marks { position: absolute; z-index: 2; left: 50%; bottom: -8px; display: flex; gap: 3px; translate: -50% 0; }
.profile-growth-marks i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 7px var(--gold); }
.profile-identity { min-width: 0; }
.profile-identity small, .profile-identity strong, .profile-identity span { display: block; }
.profile-identity small { color: var(--muted); font-size: .63rem; font-weight: 800; }
.profile-identity h3 { overflow: hidden; margin: 2px 0 5px; color: var(--cream); font-size: 1.05rem; text-overflow: ellipsis; white-space: nowrap; }
.profile-identity strong { color: var(--gold-bright); font-size: .76rem; line-height: 1.35; }
.profile-identity span { margin-top: 4px; color: #cfbfb6; font-size: .66rem; }
.profile-level-panel { margin-top: 10px; padding: 12px; border: 1px solid rgba(217,173,88,.22); border-radius: 13px; background: rgba(217,173,88,.055); }
.profile-level-panel > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.profile-level-panel b { color: var(--cream); font-size: .71rem; }
.profile-level-panel span { color: var(--gold-bright); font-size: .62rem; font-weight: 850; text-align: right; }
.profile-level-panel > small { display: block; margin-top: 5px; color: var(--muted); font-size: .61rem; text-align: right; }
.profile-xp-track { height: 8px; margin-top: 9px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.profile-xp-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--wine-bright), var(--gold-bright)); box-shadow: 0 0 12px rgba(243,215,144,.35); }
.profile-growth-roadmap { margin-top: 10px; padding: 11px; border: 1px solid rgba(217,173,88,.2); border-radius: 13px; background: rgba(255,255,255,.025); }
.profile-growth-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.profile-growth-head b { color: var(--cream); font-size: .75rem; }
.profile-growth-head span { color: var(--muted); font-size: .65rem; }
.profile-growth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.profile-growth-step { position: relative; display: grid; grid-template-columns: 31px minmax(0, 1fr); align-items: center; gap: 7px; min-width: 0; min-height: 58px; padding: 7px 8px; overflow: hidden; border: 1px solid rgba(255,255,255,.065); border-radius: 10px; background: rgba(255,255,255,.025); }
.profile-growth-step::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; background: var(--stage-color); opacity: .16; }
.profile-growth-step > div { min-width: 0; }
.profile-growth-step small, .profile-growth-step b, .profile-growth-step em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-growth-step small { color: var(--stage-color); font-size: .58rem; font-weight: 950; letter-spacing: .04em; }
.profile-growth-step b { margin-top: 1px; color: #d9cbc1; font-size: .68rem; }
.profile-growth-step em { margin-top: 1px; color: #8f817a; font-size: .56rem; font-style: normal; }
.profile-growth-step > i { position: absolute; top: 5px; right: 6px; color: #82766f; font-size: .51rem; font-style: normal; font-weight: 900; }
.profile-growth-icon { position: relative; display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; background: rgba(255,255,255,.035); font-size: .94rem; filter: grayscale(.7); opacity: .58; }
.profile-growth-step.is-complete { border-color: color-mix(in srgb, var(--stage-color) 28%, transparent); }
.profile-growth-step.is-complete::after, .profile-growth-step.is-current::after { opacity: .88; }
.profile-growth-step.is-complete .profile-growth-icon, .profile-growth-step.is-current .profile-growth-icon { filter: none; opacity: 1; }
.profile-growth-step.is-complete > i { color: #8ee1ad; }
.profile-growth-step.is-current { border-color: color-mix(in srgb, var(--stage-color) 72%, transparent); background: color-mix(in srgb, var(--stage-color) 9%, rgba(36,23,29,.92)); box-shadow: inset 0 0 16px color-mix(in srgb, var(--stage-color) 8%, transparent); }
.profile-growth-step.is-current b, .profile-growth-step.is-current > i { color: var(--stage-color); }
.profile-growth-step.is-locked { opacity: .58; }
.profile-growth-step.is-locked .profile-growth-icon::after { content: "🔒"; position: absolute; right: -4px; bottom: -4px; font-size: .48rem; filter: none; }

@keyframes profile-legend-pulse {
  0%, 100% { transform: scale(.96) rotate(0deg); opacity: .7; }
  50% { transform: scale(1.03) rotate(3deg); opacity: 1; }
}
.profile-stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.profile-stats-grid > div { min-width: 0; padding: 9px 10px; border-radius: 10px; background: rgba(255,255,255,.043); }
.profile-stats-grid span, .profile-stats-grid b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-stats-grid span { color: var(--muted); font-size: .59rem; }
.profile-stats-grid b { margin-top: 2px; color: var(--cream); font-size: .72rem; }
.profile-stats-grid .profile-danger { background: rgba(255,107,107,.09); }
.profile-stats-grid .profile-danger span, .profile-stats-grid .profile-danger b { color: #ff9e9e; }
.profile-effects { margin-top: 10px; padding: 11px; border: 1px solid rgba(217,173,88,.2); border-radius: 13px; background: rgba(217,173,88,.045); }
.profile-effects-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.profile-effects-head b { color: var(--cream); font-size: .72rem; }
.profile-effects-head span { color: var(--muted); font-size: .61rem; }
.profile-effect-grid { display: grid; gap: 7px; }
.profile-effect { display: grid; grid-template-columns: 31px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; padding: 8px 9px; border: 1px solid rgba(255,255,255,.065); border-radius: 10px; background: rgba(255,255,255,.035); }
.profile-effect > span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; background: rgba(217,173,88,.09); font-size: .92rem; }
.profile-effect div { min-width: 0; }
.profile-effect small, .profile-effect b, .profile-effect em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-effect small { color: var(--muted); font-size: .61rem; }
.profile-effect b { margin-top: 2px; color: var(--gold-bright); font-size: .7rem; }
.profile-effect em { margin-top: 2px; color: #b9d9c3; font-size: .59rem; font-style: normal; }
.profile-effect.credibility-effect > span { background: rgba(95,195,139,.1); }
.profile-effect.risk-effect > span { background: rgba(255,182,110,.1); }
.profile-effect.risk-effect b { color: #ffbe7d; }
.profile-effect.risk-effect.is-danger { border-color: rgba(255,107,107,.24); background: rgba(255,107,107,.07); }
.profile-effect.risk-effect.is-danger b { color: #ff8e9d; }
.profile-effects > p { margin: 8px 1px 0; color: #a99890; font-size: .61rem; line-height: 1.45; }
.profile-next-growth { margin: 10px 0 0; padding: 11px 12px; border: 1px solid rgba(142,225,173,.22); border-radius: 12px; background: rgba(95,195,139,.06); }
.profile-next-growth span, .profile-next-growth b, .profile-next-growth small { display: block; }
.profile-next-growth span { color: #9bd9ae; font-size: .59rem; font-weight: 900; }
.profile-next-growth b { margin-top: 2px; color: var(--gold-bright); font-size: .76rem; }
.profile-next-growth small { margin-top: 3px; color: #c8bab1; font-size: .62rem; line-height: 1.4; }
.profile-art-note { margin: 10px 0 14px; }
.profile-wardrobe-button { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; padding: 7px 10px; border: 1px solid color-mix(in srgb, var(--stage-accent) 56%, var(--gold)); border-radius: 9px; color: #fff0cf; background: color-mix(in srgb, var(--stage-accent) 10%, rgba(217,173,88,.08)); font-size: .65rem; font-weight: 900; cursor: pointer; }
.profile-auto-style { display: block; margin-top: 6px; color: #a99b93; font-size: .58rem; font-style: normal; line-height: 1.35; }

.wardrobe-avatar { --avatar-height-scale: 1; position: relative; z-index: 1; display: block; width: 72px; height: 72px; }
.wardrobe-avatar.height-type-tall { --avatar-height-scale: 1.1; }
.wardrobe-avatar.height-type-short { --avatar-height-scale: .84; }
.wardrobe-avatar-scene, .wardrobe-avatar-aura { position: absolute; display: grid; place-items: center; line-height: 1; filter: drop-shadow(0 3px 5px rgba(0,0,0,.38)); }
.wardrobe-avatar-scene { z-index: 0; inset: 3px; font-size: 3.1rem; opacity: .2; filter: grayscale(.35) !important; }
.wardrobe-avatar-aura { z-index: 1; inset: 4px; font-size: 3.5rem; opacity: .55; }
.wardrobe-character-base, .wardrobe-character-shoes, .wardrobe-character-foundation, .wardrobe-character-feature, .wardrobe-character-hair { position: absolute; left: 50%; bottom: -2px; width: 93%; height: 93%; object-fit: contain; object-position: center bottom; transform: translateX(-50%) scaleY(var(--avatar-height-scale)); transform-origin: center bottom; }
.wardrobe-character-base { z-index: 3; filter: drop-shadow(0 5px 6px rgba(0,0,0,.52)); }
.wardrobe-character-shoes { z-index: 4; pointer-events: none; }
.wardrobe-character-foundation { z-index: 4; pointer-events: none; }
.wardrobe-character-feature { z-index: 5; pointer-events: none; }
.wardrobe-character-hair { z-index: 6; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.24)); }
.wardrobe-character-hair.hair-color-black { filter: grayscale(1) brightness(.34) contrast(1.32) drop-shadow(0 2px 2px rgba(0,0,0,.28)); }
.wardrobe-character-hair.hair-color-brown { filter: sepia(.14) saturate(1.08) brightness(.88) drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.wardrobe-character-hair.hair-color-blonde { filter: sepia(.78) saturate(1.2) brightness(1.34) hue-rotate(350deg) drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.wardrobe-character-hair.hair-color-auburn { filter: sepia(.72) saturate(1.55) brightness(.78) hue-rotate(325deg) drop-shadow(0 2px 2px rgba(0,0,0,.26)); }
.wardrobe-character-hair.hair-color-silver { filter: grayscale(1) brightness(1.2) contrast(.94) drop-shadow(0 2px 2px rgba(0,0,0,.22)); }
.wardrobe-item-character.is-hair.hair-color-black { filter: grayscale(1) brightness(.34) contrast(1.32) drop-shadow(0 2px 2px rgba(0,0,0,.28)); }
.wardrobe-item-character.is-hair.hair-color-brown { filter: sepia(.14) saturate(1.08) brightness(.88) drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.wardrobe-item-character.is-hair.hair-color-blonde { filter: sepia(.78) saturate(1.2) brightness(1.34) hue-rotate(350deg) drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.wardrobe-item-character.is-hair.hair-color-auburn { filter: sepia(.72) saturate(1.55) brightness(.78) hue-rotate(325deg) drop-shadow(0 2px 2px rgba(0,0,0,.26)); }
.wardrobe-item-character.is-hair.hair-color-silver { filter: grayscale(1) brightness(1.2) contrast(.94) drop-shadow(0 2px 2px rgba(0,0,0,.22)); }
.wardrobe-avatar-badges { position: absolute; z-index: 7; right: -7px; bottom: 1px; display: flex; flex-direction: column; gap: 2px; }
.wardrobe-avatar-badges i { display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid rgba(243,215,144,.38); border-radius: 50%; background: rgba(27,17,21,.9); font-size: .54rem; font-style: normal; box-shadow: 0 2px 5px rgba(0,0,0,.35); }
.profile-avatar .wardrobe-avatar { --avatar-height-scale: 1; overflow: hidden; border-radius: 50%; }
.profile-avatar .wardrobe-character-base, .profile-avatar .wardrobe-character-shoes, .profile-avatar .wardrobe-character-foundation, .profile-avatar .wardrobe-character-feature, .profile-avatar .wardrobe-character-hair { bottom: -39%; width: 138%; height: 138%; }
.profile-avatar .wardrobe-avatar-badges { display: none; }

.wardrobe-dialog { width: min(calc(100% - 18px), 560px); }
.wardrobe-card { max-height: min(94dvh, 820px); padding: 21px 16px 17px; overflow: hidden auto; }
.wardrobe-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.wardrobe-summary > div { min-width: 0; padding: 9px 10px; border: 1px solid rgba(217,173,88,.18); border-radius: 11px; background: rgba(217,173,88,.055); }
.wardrobe-summary span, .wardrobe-summary b, .wardrobe-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wardrobe-summary span { color: var(--muted); font-size: .58rem; }
.wardrobe-summary b { margin-top: 2px; color: var(--cream); font-size: .72rem; }
.wardrobe-summary small { margin-top: 2px; color: var(--gold); font-size: .59rem; }
.wardrobe-gender-section { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; padding: 9px 10px; border-radius: 11px; background: rgba(255,255,255,.03); }
.wardrobe-gender-section > div:first-child b, .wardrobe-gender-section > div:first-child small { display: block; }
.wardrobe-gender-section > div:first-child b { font-size: .7rem; }
.wardrobe-gender-section > div:first-child small { margin-top: 2px; color: var(--muted); font-size: .56rem; }
.wardrobe-gender { display: flex; gap: 5px; }
.wardrobe-gender button { display: flex; align-items: center; gap: 4px; min-width: 60px; padding: 6px 8px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; color: #c9bbb2; background: rgba(255,255,255,.035); font-size: .62rem; cursor: pointer; }
.wardrobe-gender button span { font-size: .9rem; }
.wardrobe-gender button.is-selected { color: #1a1014; border-color: var(--gold-bright); background: var(--gold-bright); }
.wardrobe-body-section { margin-top: 9px; padding: 9px 10px 10px; border: 1px solid rgba(217,173,88,.13); border-radius: 11px; background: rgba(255,255,255,.025); }
.wardrobe-body-head { display: flex; align-items: end; justify-content: space-between; gap: 8px; }
.wardrobe-body-head b { color: var(--cream); font-size: .7rem; }
.wardrobe-body-head small { color: var(--muted); font-size: .53rem; text-align: right; }
.wardrobe-heights, .wardrobe-bodies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.wardrobe-heights button, .wardrobe-bodies button { display: grid; grid-template-rows: 82px auto auto; min-width: 0; padding: 5px 5px 7px; overflow: hidden; border: 1px solid rgba(255,255,255,.075); border-radius: 10px; color: #c9bbb2; background: rgba(255,255,255,.03); text-align: center; cursor: pointer; }
.wardrobe-heights button > span, .wardrobe-bodies button > span { display: grid; place-items: end center; min-height: 0; overflow: hidden; border-radius: 7px; background: radial-gradient(circle at 50% 38%, rgba(217,173,88,.2), rgba(24,13,17,.72)); }
.wardrobe-heights img, .wardrobe-bodies img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; transform-origin: center bottom; filter: drop-shadow(0 4px 4px rgba(0,0,0,.42)); }
.wardrobe-heights img { width: 88%; height: 88%; }
.wardrobe-heights .height-type-tall img { transform: scaleY(1.1); }
.wardrobe-heights .height-type-short img { transform: scaleY(.84); }
.wardrobe-heights b, .wardrobe-heights small, .wardrobe-bodies b, .wardrobe-bodies small { display: block; overflow: hidden; text-overflow: ellipsis; }
.wardrobe-heights b, .wardrobe-bodies b { margin-top: 4px; font-size: .58rem; white-space: nowrap; }
.wardrobe-heights small, .wardrobe-bodies small { display: -webkit-box; margin-top: 2px; min-height: 2.5em; color: var(--muted); font-size: .45rem; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.wardrobe-heights button.is-selected, .wardrobe-bodies button.is-selected { color: #241218; border-color: var(--gold-bright); background: linear-gradient(135deg, #f3d790, #d9ad58); box-shadow: 0 0 14px rgba(243,215,144,.15); }
.wardrobe-heights button.is-selected small, .wardrobe-bodies button.is-selected small { color: rgba(36,18,24,.72); }
.wardrobe-face-section { margin-top: 9px; padding: 9px 10px 10px; border: 1px solid rgba(217,173,88,.13); border-radius: 11px; background: rgba(255,255,255,.025); }
.wardrobe-face-head { display: flex; align-items: end; justify-content: space-between; gap: 8px; }
.wardrobe-face-head b { color: var(--cream); font-size: .7rem; }
.wardrobe-face-head small { color: var(--muted); font-size: .53rem; text-align: right; }
.wardrobe-reset-base { width: 100%; margin-top: 8px; padding: 7px 9px; border: 1px dashed rgba(243,215,144,.36); border-radius: 8px; color: #e8cf98; background: rgba(217,173,88,.055); font-size: .56rem; font-weight: 900; cursor: pointer; }
.wardrobe-face-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.wardrobe-face-tabs button { display: grid; place-items: center; gap: 1px; min-width: 0; padding: 5px 2px; border: 1px solid rgba(255,255,255,.07); border-radius: 8px; color: #bcaea6; background: rgba(255,255,255,.03); cursor: pointer; }
.wardrobe-face-tabs button span { font-size: .76rem; }
.wardrobe-face-tabs button b { overflow: hidden; width: 100%; font-size: .48rem; text-overflow: ellipsis; white-space: nowrap; }
.wardrobe-face-tabs button.is-active { color: #201116; border-color: var(--gold-bright); background: var(--gold-bright); box-shadow: 0 0 12px rgba(243,215,144,.14); }
.wardrobe-faces { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.wardrobe-faces button { display: grid; grid-template-columns: 78px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; min-width: 0; padding: 6px; overflow: hidden; border: 1px solid rgba(255,255,255,.075); border-radius: 11px; color: #c9bbb2; background: rgba(255,255,255,.03); text-align: left; cursor: pointer; }
.wardrobe-faces button > span { grid-row: 1 / 3; display: block; width: 72px; height: 72px; overflow: hidden; border-radius: 9px; background: radial-gradient(circle at 50% 38%, rgba(217,173,88,.2), rgba(24,13,17,.72)); }
.wardrobe-faces img { width: 100%; height: 100%; padding: 5px; object-fit: contain; object-position: center; }
.wardrobe-faces button.is-blank-option img { padding: 3px; }
.wardrobe-faces b, .wardrobe-faces small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wardrobe-faces b { align-self: end; font-size: .62rem; }
.wardrobe-faces small { align-self: start; margin-top: 2px; color: var(--muted); font-size: .5rem; }
.wardrobe-faces button.is-selected { color: #241218; border-color: var(--gold-bright); background: linear-gradient(135deg, #f3d790, #d9ad58); box-shadow: 0 0 14px rgba(243,215,144,.15); }
.wardrobe-faces button.is-selected small { color: rgba(36,18,24,.72); }
.wardrobe-preview { display: grid; grid-template-columns: 184px minmax(0, 1fr); align-items: center; min-height: 218px; margin-top: 9px; overflow: hidden; border: 1px solid rgba(217,173,88,.28); border-radius: 16px; background: radial-gradient(circle at 24% 50%, rgba(217,173,88,.14), transparent 38%), linear-gradient(135deg, rgba(112,34,53,.2), rgba(255,255,255,.025)); }
.wardrobe-preview-stage { position: relative; display: grid; place-items: center; align-self: stretch; overflow: hidden; border-right: 1px solid rgba(217,173,88,.16); background: radial-gradient(circle, color-mix(in srgb, var(--wardrobe-color) 18%, transparent), transparent 66%); isolation: isolate; }
.wardrobe-preview-stage::after { position: absolute; z-index: 1; inset: 0; background: linear-gradient(180deg, rgba(28,15,19,.05), rgba(21,12,15,.64)); pointer-events: none; content: ""; }
.wardrobe-preview-stage.is-room-scene { background-image: url("./assets/scenes/level1-room.webp"); background-position: center; background-size: cover; }
.wardrobe-avatar-large { z-index: 2; width: 176px; height: 208px; }
.wardrobe-avatar-large .wardrobe-avatar-scene { inset: 3px; font-size: 7.5rem; opacity: .24; }
.wardrobe-avatar-large .wardrobe-avatar-aura { inset: 1px; font-size: 8.2rem; opacity: .5; }
.wardrobe-avatar-large .wardrobe-character-base, .wardrobe-avatar-large .wardrobe-character-shoes, .wardrobe-avatar-large .wardrobe-character-foundation, .wardrobe-avatar-large .wardrobe-character-feature, .wardrobe-avatar-large .wardrobe-character-hair { bottom: -6px; width: 104%; height: 104%; }
.wardrobe-avatar-large .wardrobe-character-base { filter: drop-shadow(0 9px 9px rgba(0,0,0,.6)); }
.wardrobe-avatar-large .wardrobe-avatar-badges { right: 7px; bottom: 13px; gap: 4px; }
.wardrobe-avatar-large .wardrobe-avatar-badges i { width: 23px; height: 23px; font-size: .72rem; }
.wardrobe-render-badge { position: absolute; z-index: 8; top: 8px; left: 8px; padding: 4px 6px; border: 1px solid rgba(243,215,144,.46); border-radius: 99px; color: #2a171c; background: rgba(243,215,144,.92); font-size: .46rem; font-weight: 1000; letter-spacing: .04em; }
.wardrobe-face-loupe { position: absolute; z-index: 8; right: 8px; top: 8px; display: grid; place-items: center; width: 74px; height: 74px; overflow: hidden; border: 2px solid rgba(243,215,144,.86); border-radius: 50%; background: radial-gradient(circle at 50% 38%, #edd9bd, #805367 72%); box-shadow: 0 7px 18px rgba(0,0,0,.42); }
.wardrobe-face-loupe::after { position: absolute; right: 4px; bottom: 2px; content: "ซูม"; padding: 2px 4px; border-radius: 99px; color: #28151b; background: var(--gold-bright); font-size: .4rem; font-weight: 1000; }
.wardrobe-avatar.wardrobe-avatar-face { --avatar-height-scale: 1; width: 74px; height: 74px; overflow: hidden; border-radius: 50%; }
.wardrobe-avatar-face .wardrobe-avatar-scene, .wardrobe-avatar-face .wardrobe-avatar-aura, .wardrobe-avatar-face .wardrobe-avatar-badges { display: none; }
.wardrobe-avatar-face .wardrobe-character-base, .wardrobe-avatar-face .wardrobe-character-shoes, .wardrobe-avatar-face .wardrobe-character-foundation, .wardrobe-avatar-face .wardrobe-character-feature, .wardrobe-avatar-face .wardrobe-character-hair { bottom: -192%; width: 308%; height: 308%; }
.wardrobe-preview-copy { min-width: 0; padding: 12px; }
.wardrobe-preview-copy small, .wardrobe-preview-copy b, .wardrobe-preview-copy span { display: block; }
.wardrobe-preview-copy small { color: var(--gold); font-size: .61rem; font-weight: 900; }
.wardrobe-preview-copy b { margin-top: 5px; color: var(--cream); font-size: .85rem; line-height: 1.35; }
.wardrobe-preview-copy span { margin-top: 5px; color: #bbaaa1; font-size: .62rem; line-height: 1.4; }
.wardrobe-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
.wardrobe-tabs button { display: grid; place-items: center; gap: 2px; min-width: 0; padding: 7px 3px; border: 1px solid rgba(255,255,255,.07); border-radius: 9px; color: #bcaea6; background: rgba(255,255,255,.03); cursor: pointer; }
.wardrobe-tabs button span { font-size: .9rem; }
.wardrobe-tabs button b { overflow: hidden; max-width: 100%; font-size: .55rem; text-overflow: ellipsis; white-space: nowrap; }
.wardrobe-tabs button.is-active { color: #1a1014; border-color: var(--gold-bright); background: var(--gold-bright); box-shadow: 0 0 14px rgba(243,215,144,.18); }
.wardrobe-hair-color-section[hidden] { display: none; }
.wardrobe-hair-color-section { margin-top: 8px; padding: 8px 9px 9px; border: 1px solid rgba(217,173,88,.18); border-radius: 11px; background: rgba(217,173,88,.045); }
.wardrobe-hair-color-section > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wardrobe-hair-color-section > div:first-child b { color: var(--cream); font-size: .66rem; }
.wardrobe-hair-color-section > div:first-child small { overflow: hidden; color: var(--muted); font-size: .5rem; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.wardrobe-hair-colors { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 7px; }
.wardrobe-hair-colors button { display: grid; place-items: center; gap: 3px; min-width: 0; padding: 5px 2px; border: 1px solid rgba(255,255,255,.075); border-radius: 8px; color: #c9bbb2; background: rgba(255,255,255,.03); cursor: pointer; }
.wardrobe-hair-colors button i { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.26); border-radius: 50%; background: var(--hair-swatch); box-shadow: inset 0 2px 4px rgba(255,255,255,.22), 0 2px 5px rgba(0,0,0,.35); }
.wardrobe-hair-colors button b { overflow: hidden; width: 100%; font-size: .47rem; text-overflow: ellipsis; white-space: nowrap; }
.wardrobe-hair-colors button.is-selected { color: #241218; border-color: var(--gold-bright); background: linear-gradient(135deg, #f3d790, #d9ad58); }
.wardrobe-hair-colors button.is-selected i { border-color: #fff3ca; box-shadow: 0 0 0 2px rgba(36,18,24,.32); }
.wardrobe-hair-colors button:disabled { opacity: .34; cursor: not-allowed; }
.wardrobe-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
.wardrobe-item { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: start; gap: 7px; min-width: 0; min-height: 105px; padding: 9px; border: 1px solid rgba(255,255,255,.075); border-radius: 11px; color: var(--cream); background: rgba(255,255,255,.035); text-align: left; cursor: pointer; }
.wardrobe-item-icon { display: grid; place-items: center; width: 40px; height: 40px; overflow: hidden; border-radius: 10px; background: rgba(217,173,88,.08); font-size: 1.45rem; }
.wardrobe-item-character { width: 36px; height: 42px; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 3px 3px rgba(0,0,0,.45)); }
.wardrobe-item-character.is-hair { width: 40px; height: 40px; transform: scale(3.25); transform-origin: 50% 8%; }
.wardrobe-item-shoe { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.42)); }
.wardrobe-item-copy { min-width: 0; padding-bottom: 21px; }
.wardrobe-item-copy small, .wardrobe-item-copy b, .wardrobe-item-copy em { display: block; }
.wardrobe-item-copy small { color: var(--gold); font-size: .51rem; }
.wardrobe-item-copy b { overflow: hidden; margin-top: 2px; font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.wardrobe-item-copy em { display: -webkit-box; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: .54rem; font-style: normal; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.wardrobe-item-state { position: absolute; right: 7px; bottom: 7px; padding: 4px 6px; border-radius: 6px; color: #c8b9b0; background: rgba(255,255,255,.05); font-size: .52rem; font-weight: 900; }
.wardrobe-item.is-equipped { border-color: rgba(243,215,144,.66); background: rgba(217,173,88,.1); box-shadow: inset 0 0 15px rgba(243,215,144,.05); }
.wardrobe-item.is-equipped .wardrobe-item-state { color: #17301f; background: #8ee1ad; }
.wardrobe-item.is-locked { opacity: .4; filter: grayscale(.8); cursor: not-allowed; }
.wardrobe-note { margin-bottom: 12px; }

.career-gates { display: grid; gap: 8px; margin-top: 14px; }
.current-career { padding: 12px; border: 1px solid rgba(217,173,88,.28); border-radius: 12px; background: rgba(217,173,88,.07); }
.current-career span, .current-career b, .current-career small { display: block; }
.current-career span { color: var(--muted); font-size: .64rem; }
.current-career b { margin-top: 2px; color: var(--gold-bright); font-size: .92rem; }
.current-career small { margin-top: 3px; color: #cbbab1; font-size: .68rem; line-height: 1.4; }
.gate-row { padding: 10px 11px; border: 1px solid rgba(255,255,255,.07); border-radius: 11px; background: rgba(255,255,255,.035); }
.gate-row > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gate-row b { color: #dacbc2; font-size: .72rem; }
.gate-row > div span { color: var(--muted); font-size: .64rem; text-align: right; }
.gate-row > i { display: block; height: 5px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.gate-row > i span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--wine-bright), var(--gold)); }
.gate-row.ready { border-color: rgba(95,195,139,.32); }
.gate-row.ready b { color: #8ee1ad; }
.career-fee { padding: 11px; border-radius: 11px; background: rgba(114,30,49,.2); }
.career-fee span, .career-fee strong, .career-fee small { display: block; }
.career-fee span { color: var(--muted); font-size: .65rem; }
.career-fee strong { margin-top: 2px; color: var(--gold-bright); font-family: Georgia, "Times New Roman", serif; font-size: 1.2rem; }
.career-fee small { margin-top: 2px; color: #cfbfb5; font-size: .64rem; }
.career-options { display: grid; gap: 7px; margin: 12px 0 15px; }
.career-option { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; padding: 10px; border: 1px solid rgba(217,173,88,.2); border-radius: 11px; color: var(--cream); background: rgba(255,255,255,.04); text-align: left; cursor: pointer; }
.career-option:disabled { opacity: .38; cursor: not-allowed; }
.career-option-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: rgba(217,173,88,.08); font-size: 1.05rem; }
.career-option b, .career-option small { display: block; }
.career-option b { font-size: .76rem; }
.career-option small { margin-top: 2px; color: var(--muted); font-size: .61rem; line-height: 1.35; }
.career-option em { color: var(--gold); font-size: .63rem; font-style: normal; font-weight: 900; white-space: nowrap; }

.empire-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 14px; }
.empire-summary > div { min-width: 0; padding: 10px 7px; border: 1px solid rgba(217,173,88,.16); border-radius: 11px; background: rgba(217,173,88,.055); text-align: center; }
.empire-summary span, .empire-summary b, .empire-summary small { display: block; }
.empire-summary span { color: var(--muted); font-size: .58rem; }
.empire-summary b { overflow: hidden; margin-top: 3px; color: var(--gold-bright); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.empire-summary small { margin-top: 2px; color: #cdbdb4; font-size: .55rem; }
.investment-grid { display: grid; gap: 8px; margin-top: 12px; }
.investment-card { position: relative; overflow: hidden; padding: 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 13px; background: linear-gradient(135deg, rgba(255,255,255,.055), rgba(255,255,255,.025)); }
.investment-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--investment-color, var(--gold)); }
.investment-head { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.investment-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: rgba(217,173,88,.08); font-size: 1.15rem; }
.investment-head b, .investment-head small { display: block; }
.investment-head b { font-size: .78rem; }
.investment-head small { margin-top: 2px; color: var(--muted); font-size: .61rem; line-height: 1.35; }
.investment-level { padding: 5px 7px; border-radius: 7px; color: var(--gold-bright); background: rgba(217,173,88,.08); font-size: .62rem; font-weight: 900; white-space: nowrap; }
.investment-benefit { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.investment-benefit span { padding: 5px 7px; border-radius: 7px; color: #d8c9c0; background: rgba(255,255,255,.045); font-size: .61rem; font-weight: 800; }
.investment-benefit .protect-chip { color: #9bd9ff; background: rgba(106,181,255,.09); }
.investment-benefit .risk-chip { color: #ff9c9c; background: rgba(255,107,107,.09); }
.investment-buy { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; margin-top: 9px; padding: 10px 11px; border: 1px solid rgba(217,173,88,.34); border-radius: 10px; color: var(--cream); background: rgba(217,173,88,.09); cursor: pointer; }
.investment-buy b { font-size: .72rem; }
.investment-buy span { color: var(--gold-bright); font-family: Georgia, serif; font-size: .76rem; font-weight: 900; }
.investment-buy:disabled { opacity: .4; cursor: not-allowed; }
.investment-buy.maxed { justify-content: center; color: #9fdcb6; border-color: rgba(95,195,139,.26); }

.result-card { text-align: center; }
.result-crown { color: var(--gold); font-size: 3.6rem; line-height: 1; filter: drop-shadow(0 8px 20px rgba(217,173,88,.3)); }
.final-ranking { display: grid; gap: 7px; margin: 18px 0; text-align: left; }
.rank-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.045); }
.rank-row.me { border: 1px solid rgba(217,173,88,.38); }
.rank-number { color: var(--gold-bright); font-family: Georgia, serif; font-size: 1.1rem; font-weight: 900; }
.rank-row b { font-size: .78rem; }
.rank-row small { display: block; color: var(--muted); font-size: .64rem; }
.rank-money { color: var(--gold-bright); font-family: Georgia, serif; font-size: .82rem; font-weight: 800; }

.toast { position: fixed; z-index: 50; left: 50%; top: max(16px, env(safe-area-inset-top)); width: max-content; max-width: calc(100% - 30px); padding: 10px 14px; translate: -50% -20px; border: 1px solid rgba(217,173,88,.35); border-radius: 99px; color: var(--cream); background: rgba(26,17,21,.94); box-shadow: 0 12px 40px rgba(0,0,0,.45); font-size: .8rem; font-weight: 800; opacity: 0; pointer-events: none; transition: opacity .2s ease, translate .2s ease; }
.toast.show { opacity: 1; translate: -50% 0; }

@media (min-width: 620px) {
  .start-screen { padding-inline: 34px; }
  .career-grid { grid-template-columns: repeat(4, 1fr); }
  .career-card { min-height: 165px; }
  .scoreboard { grid-template-columns: repeat(4, 1fr); }
  .profile-growth-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board-wrap { padding-inline: 28px; }
  .board { gap: 5px; padding: 9px; }
  .board-cell { border-radius: 10px; }
}

@media (max-width: 380px) {
  .cell-name { font-size: .43rem; }
  .camera-status { font-size: .68rem; }
  .turn-prompt { max-width: 150px; }
  .roll-button { min-width: 118px; }
  .empire-strip { grid-template-columns: 34px minmax(0, 1fr) auto 9px; gap: 7px; }
  .empire-strip-icon { width: 34px; height: 34px; }
  .empire-strip-yield small { display: none; }
  .battle-mode .dialog-card { padding-inline: 15px; }
  .battle-duel { grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr); gap: 5px; }
  .battle-contender { padding: 7px; }
  .battle-card { height: 86px; }
  .profile-hero { grid-template-columns: 76px minmax(0, 1fr); gap: 11px; padding: 12px; }
  .profile-avatar { width: 72px; height: 72px; }
  .profile-career-icon { font-size: 1.85rem; }
  .wardrobe-preview { grid-template-columns: 1fr; }
  .wardrobe-preview-stage { min-height: 218px; border-right: 0; border-bottom: 1px solid rgba(217,173,88,.16); }
  .wardrobe-preview-copy { padding-block: 10px 12px; }
  .account-name-row { grid-template-columns: 1fr; }
  .account-name-row .primary-button { min-height: 42px; }
}

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

/* V0.39: approved character artwork, diamond pieces and gold dice. */
.legacy-customization { display:none !important; }
.locked-avatar { position:relative; display:block; overflow:hidden; width:72px; height:72px; border-radius:14px; isolation:isolate; }
.locked-portrait { display:block; width:100%; height:100%; object-fit:cover; object-position:left center; }
.locked-gender-female .locked-portrait { object-position:right center; }
.locked-poodle { position:absolute; width:28%; height:auto; right:1%; bottom:5%; object-fit:contain; }
.locked-avatar-choice { width:100%; height:140px; border-radius:10px; }
.locked-avatar-large { width:100%; height:auto; aspect-ratio:3/4; border-radius:18px; }
.locked-avatar-hero { width:124px; height:160px; flex:none; }
.profile-avatar .locked-avatar { border-radius:50%; }
.character-panel { display:flex; gap:16px; margin:12px 0; padding:12px; border:1px solid rgba(217,173,88,.3); border-radius:22px; background:linear-gradient(120deg,#31212b,#171015); overflow:hidden; }
.character-panel-copy { min-width:0; display:flex; flex-direction:column; justify-content:center; gap:6px; }
.character-panel-copy small { color:var(--gold); font-size:.68rem; letter-spacing:.06em; }
.character-panel-copy b { font-size:1.15rem; color:var(--cream); }
.character-panel-copy span { font-size:.78rem; color:var(--muted); line-height:1.55; }
.character-panel-copy button { align-self:flex-start; padding:8px 12px; margin-top:6px; border:1px solid var(--gold); border-radius:99px; background:#241920; color:var(--gold-bright); cursor:pointer; font-weight:700; }
.setup-appearance { margin:22px 0; padding:16px; border:1px solid var(--border); border-radius:18px; background:rgba(255,255,255,.025); }
.setup-appearance h2,.setup-appearance h3,.pawn-section h3 { margin:0 0 12px; font-size:1rem; }
.setup-appearance h3 { margin-top:18px; }
.wardrobe-gender button { overflow:hidden; padding:8px; }
.wardrobe-gender button > b { display:block; margin-top:8px; }
.locked-preview { width:min(100%,360px); margin:0 auto; }
.wardrobe-preview { display:block; }
.wardrobe-preview-copy { padding:14px 4px; }
.wardrobe-items { grid-template-columns:repeat(3,minmax(0,1fr)); }
.locked-outfit-card { display:flex; flex-direction:column; gap:8px; padding:8px; min-width:0; }
.locked-outfit-card .locked-avatar-choice { height:auto; aspect-ratio:3/4; }
.locked-outfit-card .wardrobe-item-copy b { font-size:.85rem; }
.locked-outfit-card .wardrobe-item-copy em { font-size:.68rem; }
.pawn-section { margin:20px 0; }
.pawn-options { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:7px; }
.pawn-options button { min-width:0; padding:8px 3px; border:1px solid rgba(217,173,88,.25); border-radius:12px; background:#20151d; color:var(--cream); cursor:pointer; }
.pawn-options button.is-selected { border-color:var(--gold-bright); background:#3d2b25; box-shadow:0 0 0 1px var(--gold); }
.pawn-options .diamond-piece { display:block; width:100%; height:48px; object-fit:contain; }
.pawn-options b { display:block; font-size:.68rem; margin-top:5px; }
.board-token { position:relative; display:block; width:15px; height:15px; margin-left:-1px; border-radius:0; background:transparent; box-shadow:none; flex:none; filter:drop-shadow(0 1px 2px #000); }
.board-token .diamond-piece { display:block; width:100%; height:100%; object-fit:contain; }
.board-token.is-human::after { content:""; position:absolute; left:35%; bottom:-3px; width:4px; height:2px; border-radius:99px; background:white; }
.board-token.token-hopping { box-shadow:none; filter:drop-shadow(0 1px 3px var(--pawn-glow)); }
.tokens { overflow:visible; }
.locked-roadmap { margin:20px 0; font-size:.8rem; }
.locked-roadmap summary { cursor:pointer; color:var(--gold-bright); padding:12px 0; }
.locked-roadmap-step { display:flex; align-items:center; gap:12px; padding:10px; border-bottom:1px solid rgba(217,173,88,.13); }
.locked-roadmap-step > b { width:72px; flex:none; color:var(--gold); font-size:.75rem; }
.locked-roadmap-step small { display:block; color:var(--muted); margin-top:3px; }
.locked-roadmap-step.is-current { background:rgba(217,173,88,.1); border-radius:10px; }
.die-side { border:1px solid #ac730e; outline:1px solid rgba(255,231,143,.75); background:radial-gradient(circle at 27% 15%,#fff1b1,transparent 31%),repeating-linear-gradient(100deg,rgba(255,238,175,.08) 0 1px,transparent 1px 3px),linear-gradient(145deg,#ffe594 0%,#e9b32f 52%,#ad6e08 100%); box-shadow:inset 2px 2px 5px #fff0a2,inset -4px -5px 8px rgba(118,65,0,.48),0 2px 5px rgba(20,12,10,.38); }
.die-top { background:radial-gradient(circle at 27% 15%,#fff8d3,transparent 32%),linear-gradient(145deg,#ffecaa,#f4c94d 58%,#c28a18); }
.die-right,.die-left { background:radial-gradient(circle at 27% 15%,#ffe99b,transparent 31%),linear-gradient(145deg,#efc553,#c68c18 58%,#8a5604); }
.die-back,.die-bottom { background:linear-gradient(145deg,#e1b12e,#b27b10 58%,#774401); }
.dice-display.showing-result .die-side { box-shadow:inset 2px 2px 5px #fff0a2,inset -4px -5px 8px rgba(118,65,0,.48),0 0 12px rgba(243,215,144,.5); }
@media(max-width:420px) { .locked-avatar-choice { height:115px; } .character-panel { gap:12px; } .locked-avatar-hero { width:104px; height:140px; } .character-panel-copy b { font-size:1rem; } .board-token { width:12px; height:12px; } }
.locked-portrait { position:absolute; top:0; left:0; width:200%; height:100%; object-fit:cover; object-position:center; }
.locked-gender-female .locked-portrait { left:auto; right:0; object-position:center; }
.player-token .diamond-piece { width:100%; height:100%; object-fit:contain; }
.wardrobe-gender { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.wardrobe-gender button { display:flex; flex-direction:column; min-width:0; width:100%; }
.wardrobe-gender .locked-avatar-choice { flex:none; }
.tokens { flex-wrap:wrap; gap:0; }
/* V0.40: separate production characters and environments, with a physical 3D board. */
.wardrobe-gender-section { display:block; padding:16px; }
.wardrobe-gender-section > div:first-child { margin-bottom:14px; }
.wardrobe-gender-section .wardrobe-gender { width:100%; min-width:0; }
.wardrobe-gender { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; width:100%; }
.wardrobe-gender button { width:100%; min-width:0; display:flex; flex-direction:column; padding:12px; gap:8px; font-size:.95rem; }
.production-avatar { display:block; position:relative; overflow:hidden; width:72px; height:72px; }
.production-character { display:block; width:100%; height:100%; object-fit:contain; object-position:center bottom; }
.career-outfit-art { display:block; width:100%; height:100%; overflow:hidden; }
.career-outfit-avatar { border-radius:10px; }
.career-roadmap-art { display:block; width:58px; height:116px; flex:none; overflow:hidden; border-radius:8px; }
.production-avatar-choice { width:100%; height:210px; }
.production-avatar-large { position:absolute; inset:12% 12% 5%; width:76%; height:83%; }
.production-avatar-hero { position:absolute; inset:10% 14% 4%; width:72%; height:86%; }
.character-scene { position:relative; overflow:hidden; background-size:cover; background-position:center; isolation:isolate; }
.character-scene::after { content:""; position:absolute; z-index:-1; left:30%; right:30%; bottom:5%; height:6%; border-radius:50%; background:rgba(43,26,14,.25); filter:blur(7px); }
.character-scene-hero { width:230px; height:190px; flex:none; border-radius:16px; }
.character-scene-large { width:100%; aspect-ratio:1.45; border-radius:18px; }
.production-preview { width:100%; }
.locked-outfit-card .production-avatar-choice { height:185px; width:100%; }
.character-panel { gap:18px; }
.character-panel-copy small { font-size:.8rem; }
.character-panel-copy span { font-size:.875rem; }
.pawn-options b,.wardrobe-item-copy em { font-size:.8rem; }
.board-viewport { max-width:none; aspect-ratio:1.3; border-radius:20px; background-image:linear-gradient(rgba(22,15,16,.22),rgba(22,15,16,.5)),var(--game-scene); background-position:center; background-size:cover; }
.board-3d { display:none; position:absolute; inset:0; }
.board-3d canvas { width:100%; height:100%; display:block; }
.has-3d .board-3d { display:block; }
.has-3d #board { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); transform:none !important; }
.has-3d .board3d-hud { position:absolute; left:12px; right:12px; bottom:12px; margin:0; padding:10px 12px; gap:6px; display:grid; grid-template-columns:1fr auto; background:rgba(25,17,20,.86); backdrop-filter:blur(6px); border:1px solid rgba(239,195,110,.45); border-radius:14px; box-shadow:0 5px 20px #0003; transform:none; }
.has-3d .center-topline { grid-column:1; justify-content:flex-start; font-size:.8rem; }
.has-3d .center-message { grid-column:1; font-size:.8rem; text-align:left; max-width:none; margin:0; line-height:1.5; }
.has-3d .dice-display { grid-column:2; grid-row:1/3; width:130px; min-height:52px; height:auto; margin:0; padding:10px; background:linear-gradient(#f3d28a,#c99b44); color:#281b17; border-radius:12px; }
.has-3d .dice-stage { display:none; }
.has-3d .dice-display small { color:#281b17; font-size:.85rem; font-weight:800; margin:0; }
.has-3d .dice-display:disabled { opacity:.75; }
.has-3d .camera-status { left:12px; right:auto; top:12px; bottom:auto; width:auto; max-width:65%; border-radius:8px; padding:6px 10px; font-size:.75rem; color:#fff4dd; background:#231a18c9; }
.board-overview { display:none; position:absolute; z-index:4; right:12px; top:12px; padding:7px 10px; background:#241c1bd6; border:1px solid #dabb74; border-radius:8px; color:#ffe5a6; font-size:.8rem; cursor:pointer; }
.has-3d .board-overview { display:block; }
.webgl-unavailable .board-3d { display:none; }
.board-viewport.has-3d { aspect-ratio:2/3; max-width:680px; background:#281c13; }
.has-3d .camera-status { top:auto; bottom:14px; max-width:calc(100% - 145px); }
.has-3d .board-overview { top:auto; bottom:12px; }
.board-wrap.has-3d > .board3d-hud { position:relative; left:auto; right:auto; bottom:auto; width:100%; max-width:680px; margin:8px auto 0; grid-template-columns:minmax(0,1fr) auto; }
.has-3d .center-topline > span { min-width:0; }
@media(min-width:601px) { .board-viewport.has-3d,.board-wrap.has-3d > .board3d-hud { max-width:min(680px,calc(66.6667dvh - 133.3334px)); } }
@media(min-width:900px) { .game-screen { width:min(100%,1000px); } .app-shell:has(.game-screen:not([hidden])) { width:min(100%,1000px); } .board-wrap { padding-inline:20px; } }
@media(max-width:520px) {
  .production-avatar-choice { height:170px; }
  .locked-outfit-card .production-avatar-choice { height:145px; }
  .character-scene-hero { width:150px; height:155px; }
  .character-panel { gap:12px; padding:10px; }
  .character-panel-copy b { font-size:1rem; }
  .character-panel-copy span { font-size:.8rem; }
  .board-viewport { aspect-ratio:.9; }
  .has-3d .board3d-hud { left:8px; right:8px; bottom:8px; padding:8px; }
  .has-3d .center-topline,.has-3d .center-message { font-size:.75rem; }
  .has-3d .dice-display { width:105px; }
  .has-3d .dice-display small { font-size:.8rem; }
  .wardrobe-gender-section { padding:12px; }
  .character-scene-large { aspect-ratio:1.05; }
}

/* V0.41: mobile layout uses the phone's logical viewport, with readable
   controls and broad character stages rather than a shrunken desktop page. */
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
@media(max-width:600px) {
  body { min-width:0; overflow-x:hidden; }
  .game-header { padding-inline:12px; }
  .header-button { width:44px; height:44px; }
  .header-actions { gap:5px; }
  .mini-crown { width:34px; height:38px; }
  .mini-brand { gap:7px; }
  .mini-brand strong { font-size:.95rem; }
  .mini-brand small { font-size:.55rem; }
  .score-section { padding-inline:10px; }
  .scoreboard { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .player-card { padding:10px 8px; }
  .player-title b { font-size:.82rem; }
  .player-title small { font-size:.7rem; }
  .compact-level { font-size:.65rem; }
  .money-line strong { font-size:1rem; }
  .mini-stats b { font-size:.8rem; }
  .mini-stats small { font-size:.65rem; }
  .season-main small { font-size:.75rem; }
  .season-meta b { font-size:.75rem; }
  .season-meta small { font-size:.65rem; }
  .character-panel { margin:10px; padding:10px; gap:12px; }
  .character-scene-hero { width:48%; height:200px; }
  .character-panel-copy { flex:1; }
  .character-panel-copy small { font-size:.75rem; }
  .character-panel-copy span { font-size:.85rem; }
  .character-panel-copy button { min-height:44px; font-size:.85rem; padding:9px 11px; }
  .board-wrap { padding:0 6px; }
  .board-viewport { width:100%; aspect-ratio:.88; border-radius:16px; }
  .has-3d .camera-status { max-width:calc(100% - 125px); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .board-overview { min-height:44px; right:8px; padding:8px 10px; }
  .has-3d .dice-display { min-height:48px; }
  .bottom-action { padding:10px 12px max(10px,env(safe-area-inset-bottom)); }
  .roll-button { min-height:48px; font-size:1rem; }
  .game-dialog,.rules-dialog,.result-dialog { width:calc(100% - 20px); }
  .dialog-card,.rules-card,.result-card { max-height:calc(100dvh - 24px); overflow-y:auto; padding:22px 18px 18px; }
  .choice-button { min-height:48px; }
  .choice-button b { font-size:1rem; }
  .choice-button small { font-size:.8rem; }
  .wardrobe-dialog { width:calc(100% - 12px); }
  .wardrobe-card { height:calc(100dvh - 16px); max-height:calc(100dvh - 16px); padding:18px 12px; border-radius:18px; }
  .wardrobe-gender-section { padding:12px; }
  .wardrobe-gender { gap:10px; }
  .wardrobe-gender button { padding:10px; font-size:1rem; }
  .wardrobe-summary span { font-size:.7rem; }
  .wardrobe-summary b { font-size:.8rem; }
  .wardrobe-summary small { font-size:.7rem; }
  .wardrobe-gender-section > div:first-child b { font-size:.85rem; }
  .wardrobe-gender-section > div:first-child small { font-size:.72rem; }
  .rules-head .icon-button { width:44px; height:44px; flex:none; }
  .production-avatar-choice { height:195px; }
  .locked-outfit-card .production-avatar-choice { height:180px; }
  .locked-outfit-card .wardrobe-item-copy b { font-size:.82rem; }
  .pawn-options button { min-height:90px; padding:10px 3px; }
  .pawn-options .diamond-piece { height:54px; }
  .pawn-options b { font-size:.75rem; }
  #close-wardrobe-bottom { min-height:48px; }
}
.sound-panel{display:flex;align-items:flex-start;gap:10px;flex-wrap:wrap;margin:8px 12px 12px;position:relative;color:#ead7b0;font-size:14px}.sound-panel>button,.sound-panel summary{min-height:44px;padding:10px 14px;border:1px solid #776141;border-radius:12px;background:#23171f;color:#ebce8e;font:inherit;font-size:14px;font-weight:600;cursor:pointer}.sound-panel>button[aria-pressed="true"]{border-color:#b3985f;background:#352622}.sound-panel details{flex:1;min-width:130px}.sound-panel summary{width:fit-content}.sound-sliders{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:10px;padding:14px;border:1px solid #594332;border-radius:12px;background:#21171e}.sound-sliders label{display:block;min-width:0;font-size:14px}.sound-sliders output{float:right;color:#bbae9a}.sound-sliders input{display:block;width:100%;height:38px;accent-color:#dbb65f;cursor:pointer}.sound-panel>button:focus-visible,.sound-panel summary:focus-visible,.sound-sliders input:focus-visible{outline:3px solid #f2d690;outline-offset:3px}
.inspection-warning{width:min(440px,calc(100% - 24px));max-height:calc(100dvh - 28px);overflow:auto;margin:auto;border:1px solid #d5a467;border-radius:24px;padding:24px 22px;background:radial-gradient(ellipse at 12% 25%,#64223877,transparent 60%),radial-gradient(ellipse at 90% 40%,#173d6c88,transparent 65%),#1c111b;color:#fff1d7;text-align:center;box-shadow:0 24px 90px #000a}.inspection-warning::backdrop{background:#0b0411d9;backdrop-filter:blur(8px)}.inspection-eyebrow{font-size:14px;letter-spacing:.09em;color:#f2c16f}.inspection-beacon{position:relative;width:min(290px,65vw);aspect-ratio:1302/1208;margin:5px auto -6px;filter:drop-shadow(0 18px 18px #0008)}.inspection-beacon img{display:block;width:100%;height:100%;object-fit:contain}.inspection-light{position:absolute;top:37%;width:18%;height:18%;border-radius:50%;background:radial-gradient(circle,#fff9 0%,currentColor 20%,transparent 72%);mix-blend-mode:screen;filter:blur(2px);animation:inspection-pulse 1.6s ease-in-out infinite alternate}.inspection-light.red{left:24%;color:#ff284d;box-shadow:0 0 30px #ff264c;animation-delay:-1.6s}.inspection-light.blue{left:58%;top:40%;color:#238fff;box-shadow:0 0 30px #238fff}.inspection-warning h2{font-size:clamp(22px,5vw,28px);line-height:1.35;margin:8px 0 10px}.inspection-warning p{font-size:16px;line-height:1.6;color:#d9c9ce;margin:0 0 22px}.inspection-warning button{width:100%;min-height:48px;font-size:16px}.inspection-warning[open] .inspection-beacon{animation:inspection-rise .65s cubic-bezier(.16,.9,.3,1) both}.inspection-warning[open] .inspection-light{animation:inspection-pulse 1.6s ease-in-out infinite alternate}.inspection-warning[open] .inspection-light.red{animation-delay:-1.6s}@keyframes inspection-rise{from{opacity:0;transform:translateY(100px) scale(.35) rotate(-8deg)}to{opacity:1;transform:translateY(0) scale(1) rotate(0)}}@keyframes inspection-pulse{from{opacity:.15;transform:scale(.7)}to{opacity:.95;transform:scale(1.3)}}@media(prefers-reduced-motion:reduce){.inspection-warning[open] .inspection-beacon,.inspection-warning[open] .inspection-light{animation:none}.inspection-light{opacity:.6}}@media(max-height:650px){.inspection-warning{padding:18px}.inspection-beacon{width:min(225px,48vw)}.inspection-warning p{margin-bottom:14px}}

/* V0.49: the closed curtain waits for real audio permission. */
.opening-sequence:not(.is-playing),.opening-sequence:not(.is-playing) *,.opening-sequence:not(.is-playing) *::after{animation:none!important}
.opening-entry{position:absolute;z-index:6;bottom:max(7dvh,24px);left:50%;transform:translateX(-50%);width:min(340px,calc(100% - 44px));text-align:center}
.opening-entry[hidden]{display:none}
.opening-entry>.primary-button{width:100%;min-height:54px;font-size:18px}
.opening-entry p{margin:10px 0 4px;color:#f0d6b0;font-size:14px;line-height:1.5}
.opening-silent{min-height:44px;padding:8px 16px;border:0;background:transparent;color:#dfc4a8;font-size:14px;cursor:pointer;text-decoration:underline;text-underline-offset:4px}
.opening-sound-toggle{position:absolute;z-index:8;right:16px;top:max(16px,env(safe-area-inset-top));min-height:44px;padding:8px 14px;color:#f2d690;border:1px solid #ad8b50;border-radius:12px;background:#241015e0;cursor:pointer}
.opening-sequence:not(.is-playing)>.opening-sound-toggle{display:none}
.opening-paused,.opening-paused *,.opening-paused *::after{animation-play-state:paused!important}
@media(max-height:600px){.opening-entry{bottom:16px}.opening-title{padding-bottom:110px}.opening-title h1{font-size:clamp(32px,8vw,64px)}}
@media(prefers-reduced-motion:reduce){.opening-sequence.is-playing{animation-duration:var(--opening-duration,4.285714s)!important}.opening-sequence.is-playing .opening-curtain,.opening-sequence.is-playing .opening-fabric,.opening-sequence.is-playing .opening-valance,.opening-sequence.is-playing .opening-title{animation:none}.opening-sequence.is-playing .opening-title{opacity:1;transform:none;filter:none}}

/* Approved Faith Billionaire branding v0.69. */
.opening-title { margin-bottom:110px; }
.opening-logo { display:block; width:min(76vw,360px,48dvh); height:auto; margin:0 auto; object-fit:contain; filter:drop-shadow(0 10px 28px rgba(0,0,0,.4)); }
.visually-hidden { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
.start-logo { display:block; width:min(76vw,280px); height:auto; margin:0 auto; object-fit:contain; filter:drop-shadow(0 8px 20px rgba(0,0,0,.35)); }
.mini-logo { flex:0 0 auto; width:52px; height:52px; object-fit:contain; }
@media(max-height:600px){.opening-entry{bottom:16px}.opening-title{padding:12px 18px;margin-bottom:140px}.opening-logo{width:min(65vw,280px,calc(100dvh - 200px))}.opening-title i{margin-top:8px}}
@media(max-width:480px){.mini-logo{width:44px;height:44px}}

/* Compact wordmark: display only the approved artwork's Thai title. */
.header-wordmark { display:block; flex:0 0 auto; width:min(44vw,190px); height:auto; object-fit:contain; filter:drop-shadow(0 2px 4px rgba(0,0,0,.35)); }

/* Desktop board has room to grow horizontally; retain the portrait camera and mobile sizing. */
@media (min-width:900px) {
  .board-viewport.has-3d, .board-wrap.has-3d > .board3d-hud { max-width:760px; }
  .header-wordmark { width:220px; }
}

/* Show only the human player's compact summary on the game screen. */
#scoreboard { grid-template-columns:minmax(0,1fr); }
.player-summary { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); align-items:center; gap:7px 10px; width:100%; padding:10px 12px; border-radius:14px; }
.player-summary .player-title { min-width:0; grid-template-columns:30px minmax(0,1fr) auto; gap:7px; }
.player-summary .player-token { width:30px; height:30px; }
.player-summary .player-title b { font-size:.9rem; }
.player-summary .player-title small { font-size:.65rem; }
.player-summary .compact-level { font-size:.7rem; padding:5px 6px; }
.player-summary .money-line { min-width:0; display:flex; flex-direction:column; align-items:flex-end; gap:2px; margin:0; }
.player-summary .money-line strong { max-width:100%; overflow:visible; white-space:normal; overflow-wrap:anywhere; font-size:1.08rem; }
.player-summary .money-line small { font-size:.62rem; }
.player-summary .mini-stats { grid-column:1/-1; gap:6px; margin:0; }
.player-summary .mini-stat { display:flex; align-items:baseline; justify-content:center; flex-wrap:wrap; gap:5px; padding:6px 3px; }
.player-summary .mini-stat small { font-size:.65rem; line-height:1.25; }
.player-summary .mini-stat b { margin:0; font-size:.85rem; line-height:1.25; }
.profile-ai-status { margin:0 0 16px; border:1px solid rgba(217,173,88,.28); border-radius:12px; background:rgba(217,173,88,.04); }
.profile-ai-status > summary { padding:12px 14px; color:var(--gold-bright); font-weight:800; cursor:pointer; }
.profile-ai-status > summary span { margin-left:8px; color:var(--muted); font-size:.8rem; font-weight:400; }
.profile-ai-status > summary:focus-visible { outline:2px solid var(--gold-bright); outline-offset:2px; border-radius:12px; }
.profile-ai-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; padding:0 10px 10px; }
.profile-ai-grid .player-summary { padding:10px; }
.profile-back-human { width:100%; margin:0 0 16px; }
@media(min-width:700px) {
  #scoreboard > .player-summary { grid-template-columns:minmax(200px,1.2fr) minmax(130px,.9fr) minmax(0,1.6fr); gap:18px; padding:12px 16px; }
  #scoreboard > .player-summary .mini-stats { grid-column:auto; }
  #scoreboard > .player-summary .money-line { align-items:flex-start; }
}
