/* The body is the single design-space container, including body-mounted overlays. */
html { min-height: 100%; background:
  radial-gradient(circle at 12% 18%, rgba(255, 67, 154, 0.34), transparent 34rem),
  radial-gradient(circle at 72% 6%, rgba(141, 92, 255, 0.28), transparent 30rem),
  radial-gradient(circle at 78% 88%, rgba(240, 212, 137, 0.10), transparent 24rem),
  linear-gradient(135deg, #1b101d 0%, #31172e 38%, #140f17 100%); }
body[data-layout-desktop="1"] {
  position: absolute;
  width: 1440px;
  height: 900px;
  min-height: 900px;
  contain: layout;
  background: transparent;
  overflow: visible;
}
body[data-layout-desktop="1"] .app { height: 720px; }
.host-panel { position: relative; }
body[data-layout-desktop="1"] .hostess-stage {
  width: 100%;
  height: 656px;
  interpolate-size: allow-keywords;
  left: 0;
  top: 0;
  transition: width 500ms ease, height 500ms ease, left 500ms ease, top 500ms ease;
}
body[data-layout-desktop="1"] .board-panel { transition: opacity 500ms ease, translate 500ms ease; }
/* Hiding the ending dock must not let Grid grow the gameplay portrait. */
body[data-layout-desktop="1"][data-ending-scene="true"] .hostess-stage { height: 656px; transition: none; }
body[data-layout-reduced="1"] .hostess-stage,
body[data-layout-reduced="1"] .board-panel { transition-duration: 0ms; }

body[data-layout-resizing="1"] .hostess-stage,
body[data-layout-resizing="1"] .board-panel { transition: none; }



/* Resolve viewport-based dimensions at the 1440 x 900 design viewport before zoom. */
body[data-layout-desktop="1"] { min-height: 900px; }
body[data-layout-desktop="1"] .cg-loading-title { font-size: clamp(1.18rem, 57.6px, 1.46rem); }
body[data-layout-desktop="1"] .player-damage-flash { width: min(835.2px, 760px); }
body[data-layout-desktop="1"] .content-event-copy { padding: clamp(14px, 28.8px, 24px); }
body[data-layout-desktop="1"] .content-event-copy p { font-size: clamp(1rem, 24.48px, 1.2rem); }
body[data-layout-desktop="1"] .content-event-heartbeat span { width: min(633.6px, 360px); }
body[data-layout-desktop="1"] .content-event-scent span { font-size: clamp(2rem, 72px, 4.4rem); }
body[data-layout-desktop="1"] .app { height: min(720px, 900px); }
body[data-layout-desktop="1"] .losing-pressure-sigil { font-size: clamp(0.92rem, 30.96px, 1.18rem); }
body[data-layout-desktop="1"] .losing-pressure-board-row { font-size: clamp(1.2rem, 43.2px, 2.65rem); }
body[data-layout-desktop="1"] .damage-spark { font-size: clamp(1.25rem, 43.2px, 2.35rem); }
body[data-layout-desktop="1"] .qa-panel { width: min(420px, calc(1440px - 32px)); height: min(784px, calc(900px - 32px)); }
body[data-layout-desktop="1"] .board-panel { --board-stage-width: clamp(620px, calc((min(720px, 900px) - 74px) * 0.9 + 80px), 670px); }
body[data-layout-desktop="1"] .clock-time { font-size: clamp(1.28rem, 34.56px, 1.72rem); }
body[data-layout-desktop="1"] .board-shell { grid-template-columns: clamp(34px, 38.88px, 40px) minmax(0, auto) clamp(34px, 38.88px, 40px); }
body[data-layout-desktop="1"] .checkmate-banner strong { font-size: clamp(2rem, 100.8px, 4.1rem); }
body[data-layout-desktop="1"] .checkmate-banner span { font-size: clamp(0.82rem, 31.68px, 1rem); }
body[data-layout-desktop="1"] .victory-banner strong { font-size: clamp(2rem, 100.8px, 4rem); }
body[data-layout-desktop="1"] .victory-banner span { font-size: clamp(0.82rem, 31.68px, 1rem); }
body[data-layout-desktop="1"] .board.cheat-declaring::after { font-size: clamp(1.28rem, 69.12px, 2.6rem); }
body[data-layout-desktop="1"] .choice-overlay { padding-bottom: clamp(20px, 45px, 52px); }
body[data-layout-desktop="1"] .service-offer-chooser { width: min(330px, calc(1440px - 24px)); }
body[data-layout-desktop="1"] .wager-settlement-amount { font-size: clamp(22px, 57.6px, 34px); }
body[data-layout-desktop="1"] .wager-mind-overlay { width:1440px; height:900px; }
body[data-layout-desktop="1"] .defeat-declaration-panel { padding:clamp(12px,50.4px,28px); }


/* The title holds the existing intro image at its first frame. */
body[data-title-screen="1"] :is(.ending-card,.pacing-ending,.defeat-declaration,.wager-bankruptcy-taunt,.fetish-item-shop,.wager-dock,.wager-portrait-controls,.wager-winnings-hover,.wager-shop-trigger,.portrait-callout,.dialogue-box,.onboarding-cue,.onboarding-piece) { visibility:hidden!important;pointer-events:none!important; }
body[data-title-screen="1"] .hostess-stage { cursor:pointer; }
.intro-title { position:absolute;inset:0;z-index:70;pointer-events:none;color:#f4e7d5; }
.intro-title-language { position:absolute;right:12px;bottom:22px;font:11px Georgia,serif;color:#c6b5ad;opacity:.65;pointer-events:auto; }
.intro-title-language button { padding:8px 3px;border:0;background:transparent;color:inherit;font:inherit;cursor:pointer; }
.intro-title-language button:focus-visible { outline:1px solid #d6a6b8; }
.intro-title::before { content:"";position:absolute;left:40%;top:28%;width:20%;height:30%;border-radius:40%;box-shadow:0 0 22px #e8c9a51a;animation:titleDoorPulse 5s ease-in-out infinite; }
body[data-layout-reduced="1"] .intro-title::before { animation:none; }

@keyframes titleCredit { from { opacity:0; } to { opacity:1; } }
@keyframes titleDoorPulse { 0%,100% { opacity:.15; } 50% { opacity:.65; } }

/* All title art uses one 720 x 680 origin, displayed at exactly half size. */
body[data-title-screen="1"] .board-panel { pointer-events:none!important; }
body[data-title-screen="1"] .wager-board-lock { display:grid; }
body[data-title-screen="1"] :is(.wager-board-lock,.wager-board-lock *) { animation:none!important; }
.title-logo { position:absolute;left:50%;top:42.8%;width:360px;height:340px;transform:translateX(-50%);pointer-events:none; }
.title-layer { position:absolute;inset:0;width:100%;height:100%;pointer-events:none;transform-origin:50% 45%; }
.title-grid { animation:titleGrid .6s ease-out both; }
.title-ring { overflow:visible; }
.title-ring circle { fill:none;stroke:#d1a0b1;stroke-width:5;stroke-dasharray:1;animation:titleRing .7s .3s ease-out both; }
.title-ring circle + circle { stroke:#f5e8d5;stroke-width:3; }
.title-col-zixuan { animation:titleDrop .25s .7s ease-out both; }
.title-de { animation:titleDrop .25s .95s ease-out both; }
.title-col-baibei { animation:titleSlam .35s 1.1s ease-out both; }
.title-col-xiangqi { animation:titleDrop .25s 1.4s ease-out both; }
.title-piece { animation:titlePiece .4s 1.4s ease-out both; }
.title-subtitle { animation:titleWrite .8s 1.8s steps(14,end) both; }
.title-sheen { position:absolute;inset:0;pointer-events:none;mask:url('../content-assets/title-v1/col-baibei.png') center/100% 100%; }
.local-file .title-sheen { display:none;mask:none; }
.title-sheen::after { content:"";position:absolute;inset:-20% -100%;background:linear-gradient(110deg,transparent 46%,#fff0da 50%,transparent 54%);animation:titleSheen 6s 2.6s infinite;opacity:0; }
.title-complete .title-layer { animation:none;opacity:1;transform:none;clip-path:none; }
.title-complete .title-ring circle { animation:none;stroke-dashoffset:0; }
body[data-layout-reduced="1"] .title-layer,body[data-layout-reduced="1"] .title-ring circle { animation:none;opacity:1;transform:none;clip-path:none;stroke-dashoffset:0; }
body[data-layout-reduced="1"] .title-sheen { display:none; }
@keyframes titleGrid { from { clip-path:inset(48% 48%);opacity:0; } to { clip-path:inset(0);opacity:1; } }
@keyframes titleRing { from { stroke-dashoffset:1; } to { stroke-dashoffset:0; } }
@keyframes titleDrop { from { opacity:0;transform:translateY(-8px); } to { opacity:1;transform:none; } }
@keyframes titleSlam { 0% { opacity:0;transform:scale(1.15); } 75% { opacity:1;transform:translateY(2px); } 100% { opacity:1;transform:none; } }
@keyframes titlePiece { from { opacity:0;transform:translateX(6px) rotate(8deg); } to { opacity:1;transform:none; } }
@keyframes titleWrite { from { clip-path:inset(0 100% 0 0); } to { clip-path:inset(0); } }
@keyframes titleSheen { 0%,75%,100% { transform:translateX(-30%);opacity:0; } 80% { opacity:.18; } 94% { transform:translateX(30%);opacity:.18; } 95% { opacity:0; } }

body.cg-preloading .intro-title :is(.title-layer,.title-ring circle,.title-sheen::after) { animation-play-state:paused; }

/* Exit holds the same shot until the final handoff; all timings start on input. */
.intro-title.leaving::before { animation:titleDoorOpen 400ms 500ms ease-in-out both;opacity:0;left:18%;top:44%;width:64%;height:34%;background:radial-gradient(ellipse,#ffe3b6 0%,#ffe3b600 70%);box-shadow:none; }
.intro-title.leaving .title-sheen { display:none; }
.intro-title.leaving .intro-title-language { opacity:0;transition:opacity 250ms ease; }
.intro-title.leaving .title-col-baibei { animation:titleExitPress 180ms ease-out both,titleExitLift 300ms 280ms ease-in both; }
.intro-title.leaving .title-subtitle { animation:titleWrite 250ms 90ms steps(14,end) reverse both; }
.intro-title.leaving .title-col-zixuan { animation:titleExitLift 300ms 120ms ease-in both; }
.intro-title.leaving .title-de { animation:titleExitLift 300ms 200ms ease-in both; }
.intro-title.leaving .title-col-xiangqi { animation:titleExitLift 300ms 360ms ease-in both; }
.intro-title.leaving .title-piece { animation:titleExitPiece 300ms 360ms ease-in both; }
.intro-title.leaving .title-ring circle { animation:titleRing 400ms 200ms ease-in reverse both; }
.intro-title.leaving .title-grid { animation:titleGrid 400ms 200ms ease-in reverse both; }
.intro-title.leaving.exit-reduced { opacity:0;transition:opacity 250ms linear; }
.intro-title.leaving.exit-reduced::before { animation:none;opacity:0; }
.intro-title.leaving.exit-reduced .title-layer,
.intro-title.leaving.exit-reduced .title-ring circle { animation:none;transform:none;clip-path:none;stroke-dashoffset:0;opacity:1; }
@keyframes titleExitPress { 0%,100% { transform:scale(1); } 50% { transform:scale(.96); } }
@keyframes titleExitLift { from { opacity:1;translate:0 0; } to { opacity:0;translate:0 -12px; } }
@keyframes titleExitPiece { from { opacity:1;transform:none; } to { opacity:0;transform:translateX(6px); } }
@keyframes titleDoorOpen { 0%,100% { opacity:0; } 50% { opacity:.16; } }

/* Accusation scene supplies viewport rects. Convert to the body's design space once. */
body[data-layout-desktop="1"] .accusation-replay {
  left: calc(var(--replay-left) / var(--layout-scale) - var(--layout-origin-x));
  top: calc(var(--replay-top) / var(--layout-scale) - var(--layout-origin-y));
  width: calc(var(--replay-width) / var(--layout-scale));
  height: calc(var(--replay-height) / var(--layout-scale));
}
body[data-layout-desktop="1"] .accusation-board-focus {
  left: calc((var(--focus-left) + 7px) / var(--layout-scale) - var(--layout-origin-x));
  top: calc((var(--focus-top) + 7px) / var(--layout-scale) - var(--layout-origin-y));
  width: calc((var(--focus-width) - 14px) / var(--layout-scale));
  height: calc((var(--focus-height) - 14px) / var(--layout-scale));
  animation: none;
}
body[data-layout-desktop="1"] :is(.accusation-anchor, .accusation-aura) {
  left: calc(var(--accusation-x) / var(--layout-scale) - var(--layout-origin-x));
  top: calc(var(--accusation-y) / var(--layout-scale) - var(--layout-origin-y));
}

/* Result FX is attached to body and receives viewport anchors, like the carousel. */
body[data-layout-desktop="1"] .accusation-result-fx {
  --result-x: calc(var(--fx-x) / var(--layout-scale) - var(--layout-origin-x));
  --result-y: calc(var(--fx-y) / var(--layout-scale) - var(--layout-origin-y));
}
body[data-layout-desktop="1"] .accusation-result-fx:not(.failure):not(.unavailable) {
  background: radial-gradient(ellipse at var(--result-x) var(--result-y), #d7a94c33, transparent 60%), radial-gradient(ellipse, transparent 25%, #140a0fb3 100%), #08060c66;
}
body[data-layout-desktop="1"] .accusation-result-fx :is(svg, .accusation-result-ring, i) {
  left: var(--result-x);
  top: var(--result-y);
}
body[data-layout-desktop="1"] .accusation-result-fx.failure {
  background: radial-gradient(ellipse at var(--result-x) var(--result-y), #ff3b8538, transparent 62%), radial-gradient(ellipse, transparent 20%, #590e38b3 100%), #08060c66;
}

/* Desktop language feedback shares the dock's brass focus treatment. */
body[data-layout-desktop="1"] .intro-title-language { opacity:1; }
body[data-layout-desktop="1"] .intro-title-language button {
  border-radius:4px;color:#c6b5ad;cursor:pointer;
  transition:background-color 100ms ease,color 100ms ease,transform 100ms ease;
}
body[data-layout-desktop="1"] .intro-title-language button:hover { background:#ecd4a51f;color:#ffe4b7; }
body[data-layout-desktop="1"] .intro-title-language button[aria-pressed="true"] { color:#ecd4a5;background:#d8bb8126; }
body[data-layout-desktop="1"] .intro-title-language button.is-pressed { background:#171018;box-shadow:inset 0 2px 4px #0009; }
body[data-layout-desktop="1"] .intro-title-language:not([data-reduced-motion="1"]) button.is-pressed { transform:scale(.94); }
body[data-layout-desktop="1"] .intro-title-language[data-reduced-motion="1"] button { transition:none; }
body[data-layout-desktop="1"] .intro-title-language button:focus-visible { outline:2px solid #d8bb81;outline-offset:2px; }

.public-version { position:absolute;right:12px;bottom:5px;font:10px Georgia,serif;color:#cbb78c;opacity:.8;pointer-events:none; }

/* Keep reset beside language, below the logo and above the release label. */
.intro-title-language { display:flex;align-items:center;gap:2px;max-width:calc(100% - 24px); }
.intro-title-language [data-title-reset] { margin-left:10px;white-space:nowrap; }
.intro-title-language [data-title-reset][data-reset-status="confirm"],
body[data-layout-desktop="1"] .intro-title-language [data-title-reset][data-reset-status="confirm"] { color:#ffe4b7;background:#ecd4a526; }

/* The short mobile portrait reserves a clear strip for title controls. */
body:not([data-layout-desktop="1"]) .title-logo { top:12px;height:min(340px,calc(100% - 72px));width:auto;max-width:calc(100% - 24px);aspect-ratio:18 / 17; }
