/* ==========================================================================
   紙月密火 (Paper Moon Hearth) — Layered Paper-Cut Storybook Mobile Web Game
   100% Commercial-Safe SIL OFL 1.1 Fonts (Noto Serif TC / Noto Sans TC)
   ========================================================================== */

:root {
  --ink-dark: #332116;
  --ink-mid: #5b402d;
  --parchment: #efe2c6;
  --parchment-light: #f8efd9;
  --parchment-edge: #ccb488;
  --night-deep: #0b1326;
  --night-mid: #162442;
  --rust-btn: #a95b35;
  --rust-btn-dark: #7d3e20;
  --slate-btn: #546e87;
  --slate-btn-dark: #394e63;
  --gold-accent: #f3ca66;
  --crimson: #c43f34;

  /* Strictly SIL Open Font License 1.1 commercial-safe web fonts */
  --font-serif: 'Noto Serif TC', serif;
  --font-sans: 'Noto Sans TC', sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #070d1b;
  color: var(--parchment);
  font-family: var(--font-sans);
}

#workbench-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 26%, rgba(246, 206, 114, 0.16), transparent 52%),
    radial-gradient(circle at 50% 78%, rgba(235, 118, 42, 0.13), transparent 50%),
    linear-gradient(160deg, #060b18 0%, #101b33 55%, #080f1f 100%);
  z-index: 0;
}

.game-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 450px;
  height: 100dvh;
  max-height: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #101b34;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(235, 212, 168, 0.18);
}

@media (min-width: 500px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
  }
  .game-shell {
    height: min(94dvh, 880px);
    border-radius: 26px;
  }
}

/* Subtle procedural paper cardstock fiber grain */
.paper-grain-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.085;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.85'/%3E%3C/svg%3E");
}

.hidden {
  display: none !important;
}

/* Bespoke paper-cut SVG icon utilities (Zero OS Emojis!) */
.ui-ico-xxs { width: 12px; height: 12px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.ui-ico-xs  { width: 15px; height: 15px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.ui-ico-sm  { width: 17px; height: 17px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.ui-ico-md  { width: 20px; height: 20px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.ui-ico-lg  { width: 26px; height: 26px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.ui-ico-xl  { width: 34px; height: 34px; flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* ==========================================================================
   TOP HUD: Menu + Ribbon Title Banner + Tactile Paper Stopwatch
   ========================================================================== */
.top-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 10px 4px;
  pointer-events: none;
}

.top-hud > * {
  pointer-events: auto;
}

.top-left-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.paper-icon-btn {
  width: 40px;
  height: 36px;
  border: 0;
  background: transparent;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.7));
  transition: transform 0.14s ease;
}
.paper-icon-btn:active {
  transform: scale(0.92);
}

.hamburger-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 26px;
}
.hamburger-bars span {
  display: block;
  height: 4px;
  border-radius: 3px;
  background: var(--parchment);
  box-shadow: 0 1px 0 #9f8a65;
}

.paper-notebook-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px 4px 7px;
  border-radius: 10px;
  border: 1.5px solid #cab388;
  background: linear-gradient(180deg, #f5e9ce, #e0cda7);
  color: var(--ink-dark);
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 3px 0 #8d744d, 0 5px 10px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s ease;
}
.paper-notebook-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #8d744d;
}
.notebook-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notebook-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--crimson);
  color: #fff8ea;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #f7ebd0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* Layered Swallowtail Paper Ribbon Banner with subtle brass rivets */
.ribbon-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 4px;
  min-width: 0;
}

.paper-ribbon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 5px 8px rgba(4, 8, 18, 0.76));
}

.ribbon-body {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #f6ead0 0%, #e3cfa8 100%);
  border: 1.5px solid #c5ad80;
  border-radius: 4px;
  padding: 6px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), inset 0 -1px 0 rgba(135, 104, 62, 0.25);
}

.ribbon-rivet {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #d6b67c, #8c6b3b);
  opacity: 0.75;
}

.ribbon-tail {
  width: 18px;
  height: 28px;
  background: linear-gradient(180deg, #dac49b, #c2a778);
  position: relative;
  z-index: 1;
  margin-top: 6px;
}
.ribbon-tail-left {
  margin-right: -8px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 42% 50%);
}
.ribbon-tail-right {
  margin-left: -8px;
  clip-path: polygon(0 0, 100% 0, 58% 50%, 100% 100%, 0 100%);
}

.phase-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--ink-dark);
  white-space: nowrap;
}

.phase-subtitle {
  margin: 5px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: #f6e7c6;
  text-shadow: 0 2px 5px rgba(5, 9, 20, 0.95), 0 0 12px rgba(5, 9, 20, 0.85);
  text-align: center;
  max-width: 225px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tactile Circular Paper Stopwatch */
.stopwatch-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 5px 7px rgba(4, 8, 18, 0.74));
}

.stopwatch-crown {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: -4px;
  z-index: 1;
}
.stopwatch-ring {
  width: 16px;
  height: 11px;
  border-radius: 99px 99px 4px 4px;
  border: 3px solid #cbb184;
  border-bottom: 0;
}
.stopwatch-stem {
  width: 10px;
  height: 5px;
  background: #a98e62;
  border-radius: 2px;
}

.stopwatch-face {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #faf1de, #e4d0a9);
  border: 4px solid #b69767;
  box-shadow: inset 0 2px 5px rgba(60, 38, 20, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s ease;
}

.stopwatch-progress {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  transform: rotate(-90deg);
}
.sw-track {
  fill: none;
  stroke: rgba(115, 86, 52, 0.2);
  stroke-width: 4;
}
.sw-arc {
  fill: none;
  stroke: #b56c2a;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s linear, stroke 0.25s ease;
}

.timer-text {
  position: relative;
  z-index: 2;
  font-size: 15.5px;
  font-weight: 900;
  color: var(--ink-dark);
  font-variant-numeric: tabular-nums;
}

.timer-paused-pill {
  position: absolute;
  bottom: -7px;
  padding: 1px 6px;
  border-radius: 99px;
  background: #27395c;
  color: #fce8ba;
  font-size: 9px;
  font-weight: 900;
  border: 1px solid #d4be94;
}

.stopwatch-face.timer-warn { border-color: #d48224; }
.stopwatch-face.timer-warn .sw-arc { stroke: #d48224; }
.stopwatch-face.timer-urgent {
  border-color: #d13b2e;
  animation: timerShake 0.45s ease-in-out infinite;
}
.stopwatch-face.timer-urgent .sw-arc { stroke: #d13b2e; }
.stopwatch-face.timer-urgent .timer-text { color: #b8291d; }

@keyframes timerShake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-4deg) scale(1.04); }
  75% { transform: rotate(4deg) scale(1.04); }
}

/* ==========================================================================
   MAIN DIORAMA STAGE & LIVE SVG ANIMATIONS
   ========================================================================== */
.diorama-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 290px;
  overflow: hidden;
  background: #0f1a33;
}

.diorama-svg-host,
.diorama-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.stage-status-row {
  position: absolute;
  top: calc(74px + env(safe-area-inset-top));
  left: 72px;
  right: 72px;
  z-index: 12;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}

.paper-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(4px);
  box-shadow: 0 3px 8px rgba(4, 8, 18, 0.55);
}

.act-pill {
  background: rgba(20, 31, 56, 0.84);
  color: #f4e3be;
  border: 1px solid rgba(226, 203, 158, 0.48);
}

.event-pill {
  background: rgba(186, 70, 44, 0.94);
  color: #fff6e0;
  border: 1px solid #f7d99c;
  animation: chipPulse 2s ease-in-out infinite;
}

@keyframes chipPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* Compact Clue / Story Toast Strip */
.story-toast {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 13px;
  border: 1.5px solid #cab387;
  background: linear-gradient(180deg, rgba(247, 238, 215, 0.97), rgba(232, 214, 179, 0.97));
  color: var(--ink-dark);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(4, 8, 18, 0.68), inset 0 0 0 1.5px rgba(255, 252, 240, 0.5);
}

.story-toast.toast-pop {
  animation: toastPop 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes toastPop {
  0% { transform: translateY(8px) scale(0.97); opacity: 0.7; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.story-toast-badge {
  flex-shrink: 0;
  padding: 3px 7px;
  border-radius: 7px;
  background: #2f4269;
  color: #fdf0d2;
  font-size: 10.5px;
  font-weight: 900;
  max-width: 102px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-toast-text {
  flex: 1;
  font-size: 11.8px;
  line-height: 1.32;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-toast-chevron {
  color: #8b6a46;
  font-size: 14px;
  font-weight: 900;
}

/* ---------- LIVE SVG PAPER-CUT ANIMATIONS ---------- */
.cloud-drift-slow { animation: cloudDrift 16s ease-in-out infinite alternate; }
.cloud-drift-rev { animation: cloudDriftRev 19s ease-in-out infinite alternate; }
@keyframes cloudDrift { from { transform: translateX(-6px); } to { transform: translateX(10px); } }
@keyframes cloudDriftRev { from { transform: translateX(8px); } to { transform: translateX(-8px); } }

.tree-sway-left,
.tree-sway-right {
  transform-origin: top center;
  animation: treeSway 7s ease-in-out infinite alternate;
}
@keyframes treeSway { from { transform: rotate(-0.8deg); } to { transform: rotate(0.9deg); } }

.flame-outer { transform-origin: 0px 0px; animation: flameFlicker 1.3s ease-in-out infinite alternate; }
.flame-mid { transform-origin: 0px 0px; animation: flameFlicker 0.95s ease-in-out infinite alternate-reverse; }
.flame-inner { transform-origin: 0px 0px; animation: flameFlicker 0.72s ease-in-out infinite alternate; }
.fire-aura-pulse { animation: auraPulse 1.6s ease-in-out infinite alternate; }
.diorama-svg.is-fire-flare .campfire-group { filter: drop-shadow(0 0 22px rgba(255, 200, 75, 0.95)); }
.diorama-svg.is-fire-flare .flame-outer { transform: scale(1.26, 1.34); }
@keyframes flameFlicker {
  0% { transform: scale(0.96, 0.95) skewX(-2deg); }
  50% { transform: scale(1.04, 1.06) skewX(2deg); }
  100% { transform: scale(0.98, 1.02) skewX(-1deg); }
}
@keyframes auraPulse { from { opacity: 0.24; } to { opacity: 0.44; } }

.ember { animation: emberFloat 2.4s ease-out infinite; }
.ember-2 { animation-delay: 0.7s; }
.ember-3 { animation-delay: 1.4s; }
.ember-4 { animation-delay: 1.9s; }
@keyframes emberFloat {
  0% { transform: translateY(0) scale(1); opacity: 0.95; }
  100% { transform: translateY(-56px) translateX(6px) scale(0.2); opacity: 0; }
}

/* Independent Characters (with smooth seat-swap transition!) */
.diorama-char {
  cursor: pointer;
  outline: none;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.diorama-char .char-select-ring { opacity: 0; transition: opacity 0.2s ease; }
.diorama-char.is-selected .char-select-ring { opacity: 1; animation: ringPulse 1.3s ease-in-out infinite; }
.diorama-char .char-figure-wrap { transition: filter 0.2s ease; }
.diorama-char:hover .char-figure-wrap,
.diorama-char.is-selected .char-figure-wrap {
  filter: drop-shadow(0 0 8px rgba(255, 224, 128, 0.75)) drop-shadow(0 4px 3px rgba(0, 0, 0, 0.75));
}
.diorama-char.is-selected .char-suspect-pin { animation: pinPulseScale 0.9s ease-in-out infinite alternate; }
.diorama-char.is-cat-daze .char-art-slot { animation: happyBob 1.1s ease-in-out infinite alternate; }
.diorama-char.is-panicked .char-art-slot { animation: panicJitter 0.35s ease-in-out infinite; }

@keyframes ringPulse { 0%, 100% { stroke-opacity: 0.65; } 50% { stroke-opacity: 1; } }
@keyframes pinPulseScale {
  from { filter: brightness(1); }
  to { filter: brightness(1.16) drop-shadow(0 0 5px rgba(255, 224, 128, 0.85)); }
}
@keyframes happyBob { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@keyframes panicJitter { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(2px); } }

/* Looming Monster Shadow */
.looming-shadow-monster { transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease; }
.looming-shadow-monster.shadow-erupt path { opacity: 0.92 !important; fill: #090a14 !important; filter: none; }

/* DARK STORM CLOUDS */
.event-clouds-group { pointer-events: none; }
.storm-dim-veil { opacity: 0; transition: opacity 0.9s ease; }
.storm-lightning-flash { opacity: 0; }
.storm-cloud-left { transform: translateX(-270px); transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1); }
.storm-cloud-right { transform: translateX(270px); transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1); }
.diorama-svg.is-dark-clouds .storm-dim-veil { opacity: 0.44; }
.diorama-svg.is-dark-clouds .storm-cloud-left { transform: translateX(6px); }
.diorama-svg.is-dark-clouds .storm-cloud-right { transform: translateX(-6px); }
.diorama-svg.is-dark-clouds .storm-lightning-flash { animation: lightningBlink 6.5s ease-in-out infinite; }
@keyframes lightningBlink {
  0%, 88%, 92%, 100% { opacity: 0; }
  89% { opacity: 0.24; }
  90.5% { opacity: 0.06; }
  91.2% { opacity: 0.18; }
}

/* CRIMSON ECLIPSE EVENT */
.eclipse-disc { transition: transform 1.2s ease, opacity 0.9s ease; }
.eclipse-wash { opacity: 0; transition: opacity 1s ease; }
.diorama-svg.is-eclipse .eclipse-disc { transform: translateX(-84px); opacity: 0.88; }
.diorama-svg.is-eclipse .eclipse-wash { opacity: 0.24; }

/* CAT & RACCOON ANIMATION */
.event-cat, #event-raccoon-group { cursor: pointer; }
.cat-tail { transform-origin: 12px -4px; animation: tailSwish 1.1s ease-in-out infinite alternate; }
.cat-meow-bubble { animation: meowFloat 1.5s ease-in-out infinite alternate; }
@keyframes tailSwish { from { transform: rotate(-10deg); } to { transform: rotate(14deg); } }
@keyframes meowFloat { from { transform: translate(-8px, -40px); } to { transform: translate(-8px, -45px); } }

/* WIND, SMOKE, OWL, BELL, FIREFLY, RAIN */
.leaf-spin { animation: leafBlow 3.2s linear infinite; }
.leaf-2 { animation-delay: 1s; }
.leaf-3 { animation-delay: 2s; }
@keyframes leafBlow {
  0% { transform: translate(-120px, -20px) rotate(0deg); opacity: 0; }
  20% { opacity: 0.95; }
  100% { transform: translate(160px, 40px) rotate(360deg); opacity: 0; }
}

.smoke-puff { animation: smokeRise 2.8s ease-out infinite; }
.smoke-2 { animation-delay: 0.9s; }
.smoke-3 { animation-delay: 1.7s; }
@keyframes smokeRise {
  0% { transform: translateY(20px) scale(0.75); opacity: 0.65; }
  100% { transform: translateY(-48px) scale(1.3); opacity: 0; }
}

.owl-glide { animation: owlSwoop 4.5s ease-in-out infinite alternate; }
@keyframes owlSwoop {
  from { transform: translate(-55px, -8px) rotate(-5deg); }
  to { transform: translate(55px, 6px) rotate(5deg); }
}

.bell-ring { transform-origin: 0 0; animation: bellRipple 2s ease-out infinite; }
.bell-ring-2 { animation-delay: 0.8s; }
@keyframes bellRipple { 0% { transform: scale(0.4); opacity: 0.9; } 100% { transform: scale(2.3); opacity: 0; } }

.ff-dot { animation: fireflyDance 3s ease-in-out infinite alternate; }
.ff-2 { animation-delay: 0.4s; } .ff-3 { animation-delay: 0.9s; }
.ff-4 { animation-delay: 1.3s; } .ff-5 { animation-delay: 1.8s; }
.ff-6 { animation-delay: 0.6s; } .ff-7 { animation-delay: 1.5s; }
@keyframes fireflyDance {
  0% { transform: translate(-8px, 6px) scale(0.7); opacity: 0.4; }
  50% { transform: translate(6px, -10px) scale(1.18); opacity: 1; }
  100% { transform: translate(10px, 4px) scale(0.8); opacity: 0.5; }
}

.rain-fall-layer { animation: rainFall 0.85s linear infinite; }
@keyframes rainFall {
  0% { transform: translate(14px, -36px); opacity: 0.25; }
  50% { opacity: 0.72; }
  100% { transform: translate(-18px, 54px); opacity: 0.1; }
}

/* ORIGAMI FROGS & METEOR SHOWER ANIMATIONS */
.event-frogs { cursor: pointer; }
.frog-1 { animation: frogHop 1.3s ease-in-out infinite; }
.frog-2 { animation: frogHop 1.5s ease-in-out 0.45s infinite; }
@keyframes frogHop {
  0%, 100% { transform: translate(148px, 378px); }
  40% { transform: translate(154px, 360px); }
}
.frog-2 { animation-name: frogHop2; }
@keyframes frogHop2 {
  0%, 100% { transform: translate(268px, 382px) scale(0.88); }
  45% { transform: translate(260px, 364px) scale(0.88); }
}

.meteor-streak { animation: meteorFly 2.4s ease-out infinite; }
.meteor-2 { animation-delay: 0.85s; }
.meteor-3 { animation-delay: 1.6s; }
@keyframes meteorFly {
  0% { transform: translate(-48px, -32px); opacity: 0; }
  18% { opacity: 1; }
  75% { opacity: 0.85; }
  100% { transform: translate(62px, 40px); opacity: 0; }
}


/* ---------- SCENE POLISH: stars, lanterns, fog, firelight, cast shadows ---------- */
.twinkle { animation: twinkle 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.twinkle-big { animation-name: twinkleBig; animation-duration: 3.6s; }
@keyframes twinkle { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@keyframes twinkleBig { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

.paper-lantern { transform-box: view-box; transform-origin: 0 0; animation: lanternSway 3.8s ease-in-out infinite alternate; }
@keyframes lanternSway { from { transform: rotate(-3deg); } to { transform: rotate(3.5deg); } }
.lantern-glow { animation: lanternGlow 2.2s ease-in-out infinite alternate; }
@keyframes lanternGlow { from { opacity: 0.65; } to { opacity: 1; } }

.window-flicker { animation: windowFlicker 5s steps(1, end) infinite; }
.window-flicker-2 { animation-delay: 2.3s; }
@keyframes windowFlicker { 0%, 100% { opacity: 1; } 47% { opacity: 0.82; } 49% { opacity: 1; } 83% { opacity: 0.9; } }

.chimney-smoke { animation: chimneySmoke 5s ease-in-out infinite alternate; }
@keyframes chimneySmoke { from { transform: translate(0, 2px); opacity: 0.7; } to { transform: translate(4px, -6px); opacity: 1; } }

.fog-band { animation: fogDrift 22s ease-in-out infinite alternate; }
@keyframes fogDrift { from { transform: translateX(-40px); } to { transform: translateX(30px); } }

.fire-light-pool { transform-box: fill-box; transform-origin: center; animation: poolBreath 2.4s ease-in-out infinite alternate; }
@keyframes poolBreath { from { opacity: 0.86; transform: scale(0.97); } to { opacity: 1; transform: scale(1.03); } }
.fire-air-glow { mix-blend-mode: screen; animation: airGlow 1.9s ease-in-out infinite alternate; }
@keyframes airGlow { 0% { opacity: 0.55; } 45% { opacity: 0.72; } 100% { opacity: 0.6; } }
.diorama-svg.is-fire-flare .fire-air-glow { opacity: 1; animation: none; }
.diorama-svg.is-fire-flare .fire-light-pool { opacity: 1; }
.coal-bed { animation: coalPulse 1.4s ease-in-out infinite alternate; }
@keyframes coalPulse { from { opacity: 0.7; } to { opacity: 1; } }
.ember-5 { animation-delay: 0.35s; }
.ember-6 { animation-delay: 1.1s; }
.ember-7 { animation-delay: 2.1s; }

.char-rim { opacity: 0.85; pointer-events: none; }
.char-cast-shadow { transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1); }
.shadow-skew { transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1); }
.char-cast-shadow .shadow-claw { opacity: 0; transition: opacity 0.25s ease; }
.char-cast-shadow .shadow-figure { transition: opacity 0.25s ease; }
.char-cast-shadow.is-claw .shadow-claw { opacity: 0.95; }
.char-cast-shadow.is-claw .shadow-figure { opacity: 0; }

.diorama-char .char-figure-wrap { transition: filter 0.2s ease, opacity 0.3s ease; }
.diorama-char.is-ruled-out .char-figure-wrap { opacity: 0.5; }
.diorama-char.is-ruled-out .char-rim { opacity: 0.2; }
.diorama-char.is-ruled-out.is-selected .char-figure-wrap { opacity: 0.85; }
.diorama-char.is-silenced .char-art-slot { animation: silencedShiver 2.4s ease-in-out infinite; }
@keyframes silencedShiver { 0%, 100% { transform: translateX(0); } 8% { transform: translateX(-1px); } 16% { transform: translateX(1px); } 24% { transform: translateX(0); } }
.diorama-svg.is-final-vote .fire-air-glow { opacity: 0.4; }

/* Card-play FX */
.fx-ring { animation: fxRing 0.9s ease-out forwards; transform-box: fill-box; transform-origin: center; }
.fx-ring-2 { animation-delay: 0.12s; opacity: 0; }
@keyframes fxRing { 0% { transform: scale(0.3); opacity: 1; } 100% { transform: scale(2.6); opacity: 0; } }
.fx-bit { animation: fxBit 1.1s cubic-bezier(0.2, 0.8, 0.3, 1) forwards; transform-box: fill-box; transform-origin: center; }
@keyframes fxBit {
  0% { transform: translate(0, 0) rotate(0deg) scale(0.6); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--tx), calc(var(--ty) + 18px)) rotate(var(--rot)) scale(1); opacity: 0; }
}
.fx-beam { animation: fxBeam 1.6s ease-out forwards; }
@keyframes fxBeam { 0% { stroke-dashoffset: 60; opacity: 0; } 15% { opacity: 1; } 75% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.fx-beam-node { animation: fxNode 1.6s ease-out forwards; transform-box: fill-box; transform-origin: center; }
@keyframes fxNode { 0% { transform: scale(0); opacity: 0; } 20% { transform: scale(1.4); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
.fx-stamp > g { animation: fxStamp 2.1s cubic-bezier(0.2, 1.4, 0.4, 1) forwards; transform-box: fill-box; transform-origin: center; }
@keyframes fxStamp {
  0% { transform: rotate(-12deg) scale(2.4); opacity: 0; }
  18% { transform: rotate(-12deg) scale(1); opacity: 1; }
  82% { transform: rotate(-12deg) scale(1); opacity: 1; }
  100% { transform: rotate(-12deg) scale(0.9); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .twinkle, .paper-lantern, .fog-band, .fire-air-glow, .fire-light-pool, .window-flicker, .chimney-smoke,
  .cloud-drift-slow, .cloud-drift-rev, .tree-sway-left, .tree-sway-right { animation: none !important; }
}

/* ==========================================================================
   BOTTOM PLAY DECK — FIXED SPACING SO LIFTED CARDS NEVER COVER .action-hint!
   ========================================================================== */
.bottom-deck-area {
  position: relative;
  z-index: 18;
  background: linear-gradient(180deg, #0d1629 0%, #14223d 18%, #0e182d 100%);
  border-top: 2px solid rgba(214, 189, 145, 0.32);
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.action-hint {
  position: relative;
  z-index: 6;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #f0dfb9;
  padding: 2px 8px 4px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Generous top padding guarantees selected lifted card NEVER touches .action-hint! */
.hand-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
  min-height: 122px;
  padding: 15px 4px 4px;
}

.paper-action-card {
  position: relative;
  flex: 1 1 0;
  max-width: 118px;
  height: 102px;
  padding: 5px 5px 6px;
  border-radius: 12px;
  border: 2px solid #c9b289;
  background: linear-gradient(180deg, #f8edd6 0%, #e7d4b0 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 251, 240, 0.65),
    0 5px 0 #8a7351,
    0 8px 16px rgba(3, 6, 14, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transform: rotate(var(--card-angle, 0deg));
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.paper-action-card:active {
  transform: rotate(0deg) translateY(-3px) scale(0.98);
}

/* Smooth controlled lift (-8px) cleanly stays inside hand-container's 15px top clearance! */
.paper-action-card.is-selected {
  transform: rotate(0deg) translateY(-8px) scale(1.03);
  border-color: #ffd76a;
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 251, 240, 0.78),
    0 7px 0 #8a6424,
    0 12px 20px rgba(255, 200, 74, 0.35),
    0 0 0 2px #ffd76a;
  z-index: 4;
}

.paper-action-card.is-special {
  background: linear-gradient(180deg, #fff5d6 0%, #f5cf84 100%);
  border-color: #e07b2e;
}

.card-header-ribbon {
  width: 100%;
  padding: 3px 2px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--card-accent), var(--card-accent-dark));
  color: #fff8ea;
  font-size: 12.2px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.card-art-well {
  position: relative;
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-art-svg {
  width: 54px;
  height: 46px;
  filter: drop-shadow(0 2px 2px rgba(45, 28, 16, 0.24));
}

.card-cloud-warn {
  position: absolute;
  top: -3px;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 9px;
  font-weight: 900;
  background: rgba(24, 34, 60, 0.92);
  color: #ffe28a;
  padding: 1px 5px;
  border-radius: 5px;
}

.card-caption {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-mid);
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.final-vote-banner {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid #e0a748;
  background: linear-gradient(180deg, #3a2326, #281920);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}
.fv-icon { display: flex; align-items: center; }
.fv-copy { display: flex; flex-direction: column; gap: 3px; }
.fv-copy strong { font-family: var(--font-serif); font-size: 15px; color: #ffe294; }
.fv-copy span { font-size: 12px; color: #f2dfc0; }

/* Bottom Dock: Left Portrait Roster Strip + Right Twin Action Buttons */
.bottom-dock {
  display: flex;
  align-items: stretch;
  gap: 8px;
  height: 102px;
  margin-top: 2px;
}

.roster-dock {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}

.roster-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 3px 2px;
  width: 100%;
  scrollbar-width: none;
}
.roster-strip::-webkit-scrollbar { display: none; }

.roster-card {
  flex: 0 0 74px;
  scroll-snap-align: center;
  padding: 4px 4px 5px;
  border-radius: 10px;
  border: 2px solid #cbb488;
  background: linear-gradient(180deg, #f5e8ce, #e2cfa9);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 238, 0.5), 0 3px 0 #7c6748, 0 4px 10px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.roster-card.is-selected {
  border-color: #ffd76a;
  transform: translateY(-3px);
  box-shadow: 0 5px 0 #8a6424, 0 0 0 2px rgba(255, 215, 106, 0.65);
}

.roster-avatar {
  width: 60px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid #594433;
}
.portrait-svg { width: 100%; height: 100%; display: block; }

.roster-name {
  font-size: 11px;
  font-weight: 900;
  color: var(--ink-dark);
  line-height: 1.1;
}

.roster-status {
  width: 100%;
  padding: 2px 3px;
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #fff8ea;
  background: #4e637a;
  white-space: nowrap;
  overflow: hidden;
}
.roster-status.status-checked { background: #587c4b; }
.roster-status.status-clear { background: #3f7848; }
.roster-status.status-danger { background: #b83d32; }
.roster-status.status-cat { background: #c96f28; }
.roster-status.status-warn { background: #6b497a; }

/* Right Twin Chunky Layered Paper Buttons */
.action-buttons-dock {
  flex: 0 0 108px;
  padding: 6px;
  border-radius: 14px;
  background: #1a2842;
  border: 1.5px solid rgba(208, 184, 140, 0.35);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.chunky-paper-btn {
  width: 100%;
  padding: 3px;
  border-radius: 10px;
  border: 0;
  background: var(--parchment);
  box-shadow: 0 4px 0 #7b6647, 0 5px 10px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.18s ease, box-shadow 0.12s ease;
}
.chunky-paper-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #7b6647;
}
.chunky-paper-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chunky-paper-btn .btn-inner {
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 7px 8px;
  border-radius: 7px;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #fff8eb;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.btn-primary .btn-inner { background: linear-gradient(180deg, #ba673d 0%, var(--rust-btn) 65%, var(--rust-btn-dark) 100%); }
.btn-primary.is-final-btn .btn-inner { background: linear-gradient(180deg, #db493b 0%, #b32d22 100%); }
.btn-primary:not(:disabled) { animation: readyPulse 1.8s ease-in-out infinite; }
@keyframes readyPulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.09); } }

.btn-secondary .btn-inner { background: linear-gradient(180deg, #64819c 0%, var(--slate-btn) 65%, var(--slate-btn-dark) 100%); }
.btn-danger-outline .btn-inner { background: linear-gradient(180deg, #9d3f35 0%, #762921 100%); }
.btn-gold-wide .btn-inner { background: linear-gradient(180deg, #cf8928 0%, #9b5d14 100%); padding: 10px 14px; }

/* ==========================================================================
   OVERLAYS & MODALS
   ========================================================================== */
.overlay-modal {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(8, 13, 26, 0.78);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.start-overlay {
  background: radial-gradient(circle at 50% 35%, rgba(18, 28, 52, 0.45), rgba(8, 13, 26, 0.88));
}

.start-card {
  width: 100%;
  max-width: 356px;
  max-height: 96%;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 20px 18px 16px;
  border-radius: 22px;
  border: 2.5px solid #d4bd91;
  background: linear-gradient(180deg, rgba(248, 238, 215, 0.98), rgba(232, 214, 178, 0.98));
  color: var(--ink-dark);
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.72), inset 0 0 0 4px rgba(176, 144, 96, 0.25);
}

.start-emblem { width: 112px; height: 90px; margin: -6px auto 2px; filter: drop-shadow(0 6px 10px rgba(60, 30, 10, 0.25)); }
.start-emblem-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.emb-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flameFlicker 1.1s ease-in-out infinite alternate; }

.start-kicker { font-size: 11.5px; font-weight: 900; letter-spacing: 0.16em; color: #8c472d; }
.start-title { margin: 4px 0 6px; font-family: var(--font-serif); font-size: 35px; font-weight: 900; letter-spacing: 0.08em; color: #2c1a10; }
.start-tagline { margin: 0 0 11px; font-size: 12.2px; line-height: 1.45; font-weight: 700; color: #543b2a; }

/* 3 Playable Night Modes Selector on Start Screen */
.mode-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 13px;
  text-align: left;
}
.mode-card {
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 2px solid #cbb387;
  background: rgba(252, 245, 228, 0.78);
  color: var(--ink-dark);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform 0.14s ease, border-color 0.16s ease, background 0.16s ease;
}
.mode-card.is-active {
  border-color: #b8562b;
  background: #fff6e0;
  box-shadow: 0 3px 0 #a96d38, 0 0 0 1.5px rgba(204, 114, 52, 0.35);
}
.mode-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mode-card-top strong { font-family: var(--font-serif); font-size: 13.5px; }
.mode-badge {
  margin-left: auto;
  padding: 1.5px 7px;
  border-radius: 99px;
  background: #33476b;
  color: #fff6df;
  font-size: 9.8px;
  font-weight: 900;
}
.mode-card.is-active .mode-badge { background: #b84a2d; }
.mode-card small { font-size: 10.8px; color: #634632; font-weight: 700; padding-left: 23px; }

.start-cta .btn-inner { padding: 11px 16px; font-size: 15.5px; }
.start-sub-actions { margin-top: 11px; display: flex; justify-content: center; gap: 16px; }
.link-paper-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: #5e3e29;
  font-size: 12.5px;
  font-weight: 900;
  cursor: pointer;
  padding: 4px 6px;
}

.paper-card-modal {
  width: 100%;
  max-width: 380px;
  max-height: 88dvh;
  padding: 18px 16px;
  border-radius: 20px;
  border: 2.5px solid #cab388;
  background: linear-gradient(180deg, #f8edd6, #e7d5b2);
  color: var(--ink-dark);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.72), inset 0 0 0 3px rgba(255, 250, 238, 0.45);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

/* Unexpected Event Modal with bespoke Paper-Cut Medallion (Zero Emoji!) */
.event-card-modal { text-align: center; animation: toastPop 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.modal-ribbon {
  display: inline-block;
  align-self: center;
  padding: 4px 14px;
  border-radius: 99px;
  background: #b64336;
  color: #fff7e6;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.event-art-medallion {
  display: flex;
  justify-content: center;
  margin: 2px 0;
}
.event-art-ring {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fcf4e0, #e3cea6);
  border: 3px solid #c4a876;
  box-shadow: inset 0 2px 6px rgba(60, 38, 20, 0.2), 0 6px 14px rgba(32, 18, 10, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}
.event-art-svg {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 3px 3px rgba(38, 22, 10, 0.25));
}

.modal-title { margin: 0; font-family: var(--font-serif); font-size: 21px; font-weight: 900; }
.modal-desc { margin: 0; font-size: 13.2px; line-height: 1.5; color: #4d3525; font-weight: 500; }
.event-impact-box {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(34, 52, 84, 0.09);
  border: 1.5px dashed #7b6346;
  font-size: 12.4px;
  line-height: 1.48;
  text-align: left;
  color: #2e1d13;
}
.impact-head {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: 2px;
  color: #9e431a;
}

.modal-header-row { display: flex; align-items: center; justify-content: space-between; }
.modal-title-sm {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-serif);
  font-size: 17.5px;
  font-weight: 900;
}
.close-x-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1.5px solid #b59d74;
  background: #ead9b8;
  color: var(--ink-dark);
  font-weight: 900;
  cursor: pointer;
}

/* Notebook */
.notebook-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.nb-tab {
  padding: 7px 10px;
  border-radius: 10px;
  border: 1.5px solid #bfa77c;
  background: #e5d4b1;
  color: #5c4230;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
}
.nb-tab.active { background: #2b3f63; border-color: #2b3f63; color: #fff6e0; }

.nb-panel { flex: 1 1 auto; overflow-y: auto; max-height: 50dvh; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.clue-entry { padding: 9px 11px; border-radius: 11px; background: #fbf3e2; border: 1.5px solid #d4be96; }
.clue-entry.clue-event { background: #fff0e2; border-color: #d98e54; }
.clue-entry-head { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; font-size: 12.5px; }
.clue-act-tag { padding: 1px 6px; border-radius: 5px; background: #3b4f73; color: #fff5dd; font-size: 10px; font-weight: 900; }
.clue-entry p { margin: 0; font-size: 12.2px; line-height: 1.45; color: #463122; }

.nb-suspect-row { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; background: #fbf3e2; border: 1.5px solid #d4be96; }
.nb-suspect-avatar { flex: 0 0 48px; height: 48px; border-radius: 9px; overflow: hidden; border: 1.5px solid #6b533e; }
.nb-suspect-info { flex: 1; min-width: 0; }
.nb-suspect-title { display: flex; align-items: baseline; gap: 6px; font-size: 13px; }
.nb-suspect-title small { font-size: 10.5px; color: #775a42; }
.nb-trait-pills { display: flex; flex-wrap: wrap; gap: 3px; margin: 4px 0; }
.nb-trait-pills span { padding: 1px 5px; border-radius: 5px; background: #eadac0; font-size: 9.8px; font-weight: 700; color: #4a3525; }
.nb-suspect-meta { font-size: 10.5px; color: #7f4438; font-weight: 700; }
.mark-cycle-btn {
  flex: 0 0 76px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1.5px solid #bfa77c;
  background: #efe2c6;
  font-size: 10.5px;
  font-weight: 900;
  color: #3d281a;
  cursor: pointer;
}
.mark-cycle-btn.mark-clear { background: #dcecd9; border-color: #4e7c48; color: #285224; }
.mark-cycle-btn.mark-doubt { background: #fbeec7; border-color: #c98f29; color: #754e0f; }
.mark-cycle-btn.mark-prime { background: #f8d4cf; border-color: #c43f34; color: #8c2017; }
.notebook-footer { display: flex; gap: 8px; }

/* Menu How-To & Commercial License Note */
.howto-steps { display: flex; flex-direction: column; gap: 8px; }
.howto-step { display: flex; gap: 9px; padding: 8px 10px; border-radius: 12px; background: #fbf3e2; border: 1.5px solid #d5be94; }
.step-num {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 50%;
  background: #a95b35;
  color: #fff8e6;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
}
.howto-step b { font-size: 12.5px; display: block; margin-bottom: 2px; }
.howto-step p { margin: 0; font-size: 11.4px; line-height: 1.42; color: #523b2a; }
.license-note {
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(45, 72, 62, 0.1);
  border: 1px solid rgba(56, 98, 82, 0.32);
  font-size: 10.5px;
  line-height: 1.4;
  color: #365044;
  font-weight: 700;
}
.menu-controls { display: flex; flex-direction: column; gap: 7px; }

/* Reveal Overlay */
.reveal-stage-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 24px 20px;
  border-radius: 22px;
  border: 3px solid #f2ca68;
  background: radial-gradient(circle at 50% 35%, #38283e, #151b30);
  color: #fff6e0;
  text-align: center;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.85);
  animation: toastPop 0.4s ease;
}
.reveal-stage-card.reveal-win { border-color: #ffd966; box-shadow: 0 0 42px rgba(255, 184, 62, 0.45); }
.reveal-kicker { font-size: 14px; font-weight: 900; color: #ffd970; letter-spacing: 0.08em; }
.reveal-portrait-box { width: 124px; height: 162px; margin: 10px auto 6px; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.7)); }
.full-char-svg { width: 100%; height: 100%; }
.reveal-name { margin: 4px 0 8px; font-family: var(--font-serif); font-size: 22px; }
.reveal-quote { margin: 0; font-size: 13.5px; line-height: 1.5; color: #f4e2c2; }

/* ==========================================================================
   SUPERCHARGED ROAST SHARE CARD MODAL
   ========================================================================== */
.result-scroll-wrap {
  width: 100%;
  max-width: 396px;
  max-height: 94dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 2px 10px;
}

.sc-paper-card {
  position: relative;
  padding: 11px 12px;
  border-radius: 18px;
  border: 2.5px solid #cab388;
  background: linear-gradient(180deg, #f9f0db 0%, #ead8b5 100%);
  color: var(--ink-dark);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.72), inset 0 0 0 4px rgba(176, 146, 98, 0.22);
  overflow: hidden;
}

.sc-masthead {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 900;
  color: #77593e;
  border-top: 2.5px solid #3c2719;
  border-bottom: 1px solid #c5ae84;
  padding: 3px 2px;
  margin-bottom: 6px;
}

.sc-stamp {
  position: absolute;
  top: 34px;
  right: 10px;
  padding: 2px 8px;
  border: 3px solid var(--stamp-col, #b64336);
  border-radius: 8px;
  color: var(--stamp-col, #b64336);
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 900;
  transform: rotate(-13deg);
  background: rgba(249, 240, 219, 0.92);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
  z-index: 2;
}

.sc-title-box { padding: 7px 10px; border-radius: 11px; background: #365642; color: #fff7e6; margin-bottom: 6px; }
.sc-lose .sc-title-box { background: #673642; }
.sc-title-label { font-size: 9.8px; color: #f9dd96; font-weight: 700; }
.sc-badge-title { margin: 2px 0 0; font-family: var(--font-serif); font-size: 15.5px; line-height: 1.24; padding-right: 88px; }

.sc-duel-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.sc-mini-card {
  flex: 1;
  padding: 5px;
  border-radius: 11px;
  background: #fcf5e6;
  border: 1.5px solid #cbb488;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.sc-mini-tag { font-size: 9.5px; font-weight: 900; color: #fff8ea; padding: 1px 8px; border-radius: 99px; }
.tag-green { background: #4c7c48; }
.tag-red { background: #b84235; }
.tag-plum { background: #6b497d; }
.sc-mini-avatar { width: 46px; height: 46px; border-radius: 9px; overflow: hidden; border: 1.5px solid #6b533e; }
.sc-mini-name { font-size: 12px; font-weight: 900; }
.sc-duel-icon { display: flex; align-items: center; justify-content: center; }

.sc-headline-box { padding: 6px 9px; border-radius: 10px; background: #e6d4b0; border: 1.5px solid #c4ab7e; margin-bottom: 6px; }
.sc-headline-kicker { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 900; color: #9b372b; margin-bottom: 2px; }
.sc-headline-text { margin: 0; font-family: var(--font-serif); font-size: 12px; line-height: 1.38; font-weight: 700; color: #291a10; }

/* 3-Meter Roast Report Bars */
.sc-meters-box {
  padding: 6px 8px;
  border-radius: 10px;
  background: #fbf3e2;
  border: 1px solid #d4be96;
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sc-meter-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}
.sc-meter-label { font-weight: 900; color: #432d1f; }
.sc-meter-bar { height: 7px; border-radius: 99px; background: #e2d1b2; overflow: hidden; }
.sc-meter-fill { height: 100%; border-radius: 99px; }
.sc-meter-val { font-weight: 700; color: #6b4b34; font-size: 9.8px; white-space: nowrap; }

.sc-quotes-box {
  padding: 6px 8px;
  border-radius: 10px;
  background: #fcf5e6;
  border: 1px dashed #b99f72;
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sc-quotes-box p { margin: 0; font-size: 11px; line-height: 1.34; }
.sc-quote-cat { display: flex; align-items: flex-start; gap: 4px; color: #9e4b14; font-weight: 700; }
.sc-quote-tip { color: #2d5748; font-weight: 700; }

.sc-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.sc-stat { padding: 5px 7px; border-radius: 9px; background: #213252; color: #fff6e0; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.sc-stat small { font-size: 9.8px; color: #d6c198; }
.sc-stat b { font-size: 11.5px; text-align: center; }

.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.truth-details { border-radius: 13px; background: rgba(244, 232, 206, 0.94); color: var(--ink-dark); border: 1.5px solid #cab388; padding: 7px 11px; }
.truth-details summary { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 900; cursor: pointer; list-style: none; }
.truth-roster-list { margin-top: 7px; display: flex; flex-direction: column; gap: 6px; }
.truth-item { padding: 6px 8px; border-radius: 9px; background: #fcf4e3; border: 1px solid #d5be96; }
.truth-item-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-bottom: 2px; }
.truth-item p { margin: 0; font-size: 11px; color: #543c2b; }
.truth-pill { font-size: 9.8px; font-weight: 900; padding: 2px 7px; border-radius: 99px; color: #fff8ea; }
.pill-culprit { background: #b83b2e; }
.pill-accomplice { background: #6b497d; }
.pill-secret { background: #b87822; }
.pill-honest { background: #4a6b52; }

/* New Achievement Celebration Strip on Result Screen */
.sc-new-ach {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 10px;
  background: linear-gradient(90deg, #fae8b4, #f5d687);
  border: 1.5px solid #c48d2c;
  color: #4a2a0e;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 6px;
}

/* ==========================================================================
   ALMANAC & ACHIEVEMENTS GALLERY MODAL
   ========================================================================== */
.almanac-summary-bar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px;
  border-radius: 10px;
  background: #233454;
  color: #f4e3be;
  font-size: 11px;
  text-align: center;
}
.almanac-summary-bar b { color: #ffd970; }

.almanac-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.alm-tab {
  padding: 6px 4px;
  border-radius: 9px;
  border: 1.5px solid #bfa77c;
  background: #e5d4b1;
  color: #5c4230;
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
}
.alm-tab.active { background: #2b3f63; border-color: #2b3f63; color: #fff6e0; }

.alm-panel {
  flex: 1 1 auto;
  overflow-y: auto;
  max-height: 48dvh;
  padding-right: 2px;
}

.alm-char-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.alm-char-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 11px;
  background: #fbf3e2;
  border: 1.5px solid #d4be96;
}
.alm-char-card.is-locked {
  opacity: 0.72;
  background: #e9dcc2;
}
.alm-char-card.is-locked .alm-char-avatar {
  filter: brightness(0.18) contrast(1.2);
}
.alm-char-avatar {
  flex: 0 0 50px;
  height: 50px;
  border-radius: 9px;
  overflow: hidden;
  border: 1.5px solid #6b533e;
}
.alm-char-meta { flex: 1; min-width: 0; }
.alm-char-meta strong { font-size: 13px; margin-right: 5px; }
.alm-char-meta small { font-size: 10.5px; color: #7c5c42; font-weight: 700; }
.alm-char-meta p { margin: 2px 0 0; font-size: 11px; line-height: 1.38; color: #4f3726; }

.alm-event-list,
.alm-ach-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.alm-event-row,
.alm-ach-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 11px;
  background: #fbf3e2;
  border: 1.5px solid #d4be96;
}
.alm-event-row.is-locked,
.alm-ach-row.is-locked {
  opacity: 0.68;
  background: #e8dbc0;
}
.alm-event-row.is-locked .alm-ev-ico,
.alm-ach-row.is-locked .alm-ach-ico {
  filter: grayscale(1) brightness(0.45);
}
.alm-ev-ico,
.alm-ach-ico {
  flex: 0 0 38px;
  height: 38px;
  border-radius: 50%;
  background: #efe0c0;
  border: 1.5px solid #bfa77c;
  display: flex;
  align-items: center;
  justify-content: center;
}
.alm-ev-body,
.alm-ach-info { flex: 1; min-width: 0; }
.alm-ev-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 12.2px; }
.alm-ev-head span { font-size: 10px; font-weight: 900; color: #8c4d2d; white-space: nowrap; }
.alm-ev-body p { margin: 2px 0 0; font-size: 11px; line-height: 1.38; color: #523b2a; }
.alm-ach-info strong { display: block; font-size: 12.2px; }
.alm-ach-info small { font-size: 10.8px; color: #5e4430; }
.alm-ach-status {
  font-size: 10px;
  font-weight: 900;
  padding: 3px 7px;
  border-radius: 99px;
  background: #cbb68f;
  color: #4a3524;
  white-space: nowrap;
}
.alm-ach-row.is-unlocked .alm-ach-status {
  background: #4e7c48;
  color: #fff8e6;
}

.alm-titles-box {
  padding: 8px 9px;
  border-radius: 11px;
  background: #f5e6c8;
  border: 1.5px dashed #b99e70;
  margin-bottom: 8px;
}
.alm-sec-label { font-size: 11px; font-weight: 900; color: #6e4527; margin-bottom: 5px; }
.alm-title-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.alm-title-chip {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 8px;
  background: #fdf6e6;
  border: 1.5px solid #b64336;
  color: #362216;
}

.sys-toast {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  padding: 8px 14px;
  border-radius: 99px;
  background: rgba(24, 34, 58, 0.95);
  color: #fff5da;
  border: 1.5px solid #e6cb94;
  font-size: 12.2px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.65);
}


/* ==========================================================================
   EXPANSION UI: clue slip · act banner · night moves · deduction board · final picks · stars
   ========================================================================== */
.paper-notebook-btn.nb-pulse { animation: nbPulse 0.7s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes nbPulse { 0% { transform: scale(1); } 35% { transform: scale(1.22) rotate(-4deg); } 100% { transform: scale(1); } }

/* Hand: deal-in + corner tag */
.paper-action-card.is-dealing { animation: cardDeal 0.42s cubic-bezier(0.2, 1.1, 0.4, 1) backwards; animation-delay: var(--deal-delay, 0ms); }
@keyframes cardDeal { from { transform: translateY(26px) rotate(calc(var(--card-angle, 0deg) * 3)) scale(0.9); opacity: 0; } }
.paper-action-card::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 9px;
  border: 1px dashed rgba(139, 110, 74, 0.35);
  pointer-events: none;
}
.card-corner-tag {
  position: absolute;
  top: -7px;
  left: -5px;
  z-index: 3;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 900;
  color: #fff7e6;
  background: var(--card-accent-dark, #5b402d);
  border: 1px solid rgba(255, 245, 220, 0.7);
  transform: rotate(-8deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}
.card-flying { transition: none !important; animation: none !important; }
.hand-container.is-final { padding-top: 6px; min-height: 0; }

/* ---------- Act transition ribbon ---------- */
.act-banner {
  position: absolute;
  inset: 0;
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, rgba(5, 9, 20, 0.15), rgba(5, 9, 20, 0.62));
  opacity: 0;
}
.act-banner.is-playing { animation: bannerVeil 1.55s ease forwards; }
@keyframes bannerVeil { 0% { opacity: 0; } 14% { opacity: 1; } 82% { opacity: 1; } 100% { opacity: 0; } }
.act-banner-ribbon { display: flex; align-items: center; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.6)); }
.act-banner.is-playing .act-banner-ribbon { animation: bannerSweep 1.55s cubic-bezier(0.2, 0.9, 0.3, 1) forwards; }
@keyframes bannerSweep {
  0% { transform: translateX(-120%) rotate(-4deg); }
  22% { transform: translateX(0) rotate(-1.5deg); }
  80% { transform: translateX(0) rotate(-1.5deg); }
  100% { transform: translateX(130%) rotate(2deg); }
}
.act-banner-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 34px 12px;
  background: linear-gradient(180deg, #f8ecd0 0%, #e4cfa4 100%);
  border: 2px solid #b8955f;
  border-radius: 6px;
  box-shadow: inset 0 0 0 3px rgba(255, 252, 240, 0.55), inset 0 -3px 0 rgba(140, 104, 60, 0.25);
}
.act-banner-body small { font-size: 12px; font-weight: 900; letter-spacing: 0.3em; color: #9b4a2c; }
.act-banner-body strong { font-family: var(--font-serif); font-size: 30px; font-weight: 900; letter-spacing: 0.12em; color: #2c1a10; line-height: 1.15; }
.act-banner-tail { width: 30px; height: 46px; margin-top: 14px; background: linear-gradient(180deg, #d9c08f, #b8955f); }
.act-banner-tail-l { margin-right: -10px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 40% 50%); }
.act-banner-tail-r { margin-left: -10px; clip-path: polygon(0 0, 100% 0, 60% 50%, 100% 100%, 0 100%); }

/* ---------- Clue slip ---------- */
.clue-slip {
  position: absolute;
  inset: 0;
  z-index: 22;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 10px 10px;
  background: linear-gradient(180deg, rgba(5, 9, 20, 0) 30%, rgba(5, 9, 20, 0.55) 100%);
  animation: slipVeil 0.3s ease;
}
@keyframes slipVeil { from { opacity: 0; } }
.clue-slip-card {
  --slip-accent: #b64336;
  position: relative;
  width: 100%;
  max-width: 410px;
  max-height: 86%;
  overflow-y: auto;
  padding: 14px 14px 12px;
  border-radius: 6px 6px 14px 14px;
  color: var(--ink-dark);
  background:
    repeating-linear-gradient(180deg, transparent 0 21px, rgba(120, 150, 190, 0.16) 21px 22px),
    linear-gradient(180deg, #fbf3df 0%, #efdfbd 100%);
  border: 1.5px solid #cbb185;
  border-top: 5px solid var(--slip-accent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.65), inset 0 0 0 3px rgba(255, 252, 240, 0.4);
  transform-origin: 50% 100%;
  animation: slipIn 0.48s cubic-bezier(0.2, 1.25, 0.35, 1);
}
@keyframes slipIn { from { transform: translateY(70%) rotate(3deg) scale(0.92); opacity: 0; } }
.clue-slip.is-leaving { animation: slipVeilOut 0.26s ease forwards; }
.clue-slip.is-leaving .clue-slip-card { animation: slipOut 0.26s cubic-bezier(0.5, 0, 0.8, 0.4) forwards; }
@keyframes slipVeilOut { to { opacity: 0; } }
@keyframes slipOut { to { transform: translate(-38%, -120%) rotate(-14deg) scale(0.25); opacity: 0; } }
.slip-tape {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 74px;
  height: 20px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(246, 230, 186, 0.78);
  border-left: 2px dashed rgba(180, 150, 100, 0.4);
  border-right: 2px dashed rgba(180, 150, 100, 0.4);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}
.slip-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; padding-right: 58px; }
.slip-card-art {
  flex: 0 0 48px;
  height: 44px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fffaf0;
  border: 2px solid var(--slip-accent, #b64336);
}
.slip-card-art .card-art-svg { width: 40px; height: 34px; }
.slip-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.slip-titles small { font-size: 10.5px; font-weight: 900; color: var(--slip-accent, #9b372b); letter-spacing: 0.04em; }
.slip-titles strong { font-family: var(--font-serif); font-size: 19px; font-weight: 900; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slip-titles small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slip-portrait {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #5b402d;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  transform: rotate(3deg);
}
.slip-text { margin: 0; font-size: 14px; line-height: 1.6; font-weight: 700; color: #33211a; }
.slip-stamp {
  position: relative;
  flex: 0 0 auto;
  max-width: 120px;
  padding: 2px 8px;
  white-space: nowrap;
  border: 2.6px solid currentColor;
  border-radius: 7px;
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 900;
  transform: rotate(-8deg);
  background: rgba(255, 250, 238, 0.85);
  animation: stampThump 0.5s 0.18s cubic-bezier(0.2, 1.6, 0.4, 1) backwards;
}
@keyframes stampThump { from { transform: rotate(-8deg) scale(2.2); opacity: 0; } }
.stamp-alarm { color: #c0392b; }
.stamp-clear { color: #3e7a3f; }
.stamp-secret { color: #b8782a; }
.stamp-testimony { color: #2f4b78; }
.stamp-fog { color: #6b7280; }
.stamp-warn { color: #7a4a8c; }
.stamp-framed { color: #6e5a44; }
.slip-notes { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 2px; }
.slip-notes:empty { display: none; }
.slip-notes-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 900;
  color: #6b4b34;
  margin-right: 2px;
}
.slip-note {
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 99px;
  background: #fff8e8;
  border: 1.5px solid #c9b088;
  color: #4a3424;
}
.note-hot { border-color: #c0392b; color: #9b2b20; background: #fde9e4; }
.note-cool { border-color: #4e7c48; color: #2f5a2c; background: #e8f3e3; }
.note-liar { border-color: #7a4a8c; color: #5c2f6e; background: #f1e6f7; }
.note-framed { border-color: #7a6650; color: #5a4632; background: #efe6da; }
.slip-ok { margin-top: 10px; }
.slip-ok .btn-inner { padding: 9px 10px; font-size: 14.5px; }

/* ---------- Night move block in event modal ---------- */
.night-move-box {
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #2a2236, #1c1828);
  color: #efe2cc;
  border: 1.5px solid #6b4f82;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45);
  animation: toastPop 0.45s 0.25s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.nm-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.nm-head span { font-size: 10.5px; font-weight: 900; color: #c9a6e8; letter-spacing: 0.06em; }
.nm-head strong { margin-left: auto; font-family: var(--font-serif); font-size: 15px; color: #ffd9a0; }
.night-move-box p { margin: 0; font-size: 12.2px; line-height: 1.5; }
.event-card-modal { max-height: 92dvh; overflow-y: auto; }

/* ---------- Deduction board ---------- */
.notebook-tabs { grid-template-columns: repeat(3, 1fr); }
.nb-tab { padding: 7px 4px; }
.board-intro {
  font-size: 11.4px;
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: 10px;
  background: #23324f;
  color: #f1e3c4;
}
.board-intro b { color: #ffd56e; }
.board-traits { display: flex; flex-direction: column; gap: 7px; }
.board-trait-row { padding: 7px 8px; border-radius: 11px; background: #fbf3e2; border: 1.5px solid #d4be96; }
.board-trait-row.has-conflict { border-color: #c0392b; box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.12); }
.bt-label { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 5px; }
.bt-label strong { font-size: 12.5px; }
.bt-conflict {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 900;
  color: #fff6ea;
  background: #c0392b;
  padding: 1px 7px;
  border-radius: 99px;
  animation: chipPulse 1.6s ease-in-out infinite;
}
.bt-options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bt-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 6px 7px;
  border-radius: 9px;
  border: 1.5px solid #c9b18a;
  background: #f3e6c9;
  color: #3d281a;
  text-align: left;
  cursor: pointer;
  min-height: 52px;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.bt-opt:active { transform: scale(0.97); }
.bt-opt.is-active { background: #2b3f63; border-color: #2b3f63; color: #fff6e0; box-shadow: 0 3px 0 #18253d; }
.bt-opt-label { font-size: 12.5px; font-weight: 900; }
.bt-sources { display: flex; flex-wrap: wrap; gap: 3px; }
.bt-src { font-size: 9.8px; font-weight: 900; padding: 1px 6px; border-radius: 99px; background: #fff9ea; color: #4a3525; border: 1px solid #c9b18a; }
.bt-src.src-event { border: 1.5px solid #d69b2d; background: #fff2cc; color: #7a4d0d; }
.bt-src.src-liar { text-decoration: line-through; color: #9b2b20; border-color: #c0392b; background: #fde9e4; }
.bt-src.src-stale { opacity: 0.5; }
.bt-opt.is-active .bt-src { background: rgba(255, 246, 224, 0.15); color: #fff0d0; border-color: rgba(255, 240, 208, 0.45); }
.bt-opt.is-active .bt-src.src-event { border-color: #ffd36b; color: #ffe39a; }
.bt-opt.is-active .bt-src.src-liar { color: #ffb4a8; border-color: #ff8a78; }
.bt-none { font-size: 9.8px; color: #9a8166; font-weight: 700; }
.bt-opt.is-active .bt-none { color: #c9bfae; }

.board-cands { padding: 8px; border-radius: 12px; background: #efe1c2; border: 1.5px solid #cdb68b; }
.bc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; font-size: 11.5px; font-weight: 900; color: #4a3424; }
.bc-head b { color: #b64336; font-size: 14px; }
.bc-head > span { margin-right: auto; }
.bc-toggle, .bc-reset {
  font-size: 10px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1.5px solid #9a8060;
  background: #f8eed8;
  color: #4a3424;
  cursor: pointer;
}
.bc-toggle.on { background: #4e7c48; border-color: #4e7c48; color: #fff8e6; }
.bc-grid { display: flex; flex-direction: column; gap: 5px; }
.bc-card {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border-radius: 10px;
  background: #fbf3e2;
  border: 1.5px solid #d4be96;
  transition: opacity 0.2s ease;
}
.bc-card.is-match { border-color: #d69b2d; box-shadow: 0 0 0 2px rgba(214, 155, 45, 0.2); }
.bc-card.is-out { opacity: 0.5; }
.bc-avatar { flex: 0 0 38px; height: 38px; border-radius: 8px; overflow: hidden; border: 1.5px solid #6b533e; }
.bc-meta { flex: 1; min-width: 0; }
.bc-name { display: flex; align-items: baseline; gap: 5px; font-size: 12.5px; }
.bc-name small { font-size: 9.6px; color: #7c5c42; font-weight: 700; white-space: nowrap; }
.bc-chips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.ev-chip { font-size: 9.6px; font-weight: 900; padding: 1px 6px; border-radius: 99px; color: #fff8ea; }
.ev-hot { background: #c0392b; }
.ev-liar { background: #7a4a8c; }
.ev-cool { background: #4e7c48; }
.ev-framed { background: #7a6650; }
.ev-secret { background: #b8782a; }
.ev-soft { background: #e3d3b2; color: #4a3424; }
.ev-soft-hot { background: #f2d2c9; color: #8c2b20; }
.ev-none { font-size: 9.6px; color: #9a8166; font-weight: 700; }
.bc-verdict { font-size: 10.5px; font-weight: 900; padding: 2px 7px; border-radius: 6px; background: #2b3f63; color: #fff3d8; }
.bc-card.is-out .bc-verdict { background: #8f7d66; }
.board-pairs { padding: 7px 9px; border-radius: 11px; background: #fbf3e2; border: 1.5px dashed #b99f72; display: flex; flex-direction: column; gap: 4px; }
.bp-title { font-size: 11px; font-weight: 900; color: #6e4527; }
.bp-row { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.bp-row span { font-size: 9.6px; font-weight: 900; padding: 1px 6px; border-radius: 5px; background: #e6d4b0; color: #5c4230; }
.bp-row em { font-style: normal; font-weight: 900; margin-left: auto; }
.bp-row.hot em { color: #b8342a; }
.bp-row.cool em { color: #3e7a3f; }
.nb-said { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; font-size: 10px; margin: 2px 0; color: #4a3525; }
.nb-said b { font-size: 10px; }
.nb-said span { padding: 1px 5px; border-radius: 5px; background: #e8f0fa; border: 1px solid #a9bcd8; font-weight: 700; }
.nb-said span.said-stale { opacity: 0.5; }
.clue-entry.clue-night { background: #ece4f2; border-color: #8e6aa6; }

/* ---------- Roster extras ---------- */
.roster-card.is-ruled-out { opacity: 0.55; }
.roster-card.is-ruled-out .roster-avatar { filter: grayscale(0.7); }
.roster-status.status-mute { background: #5b5f6e; }
.roster-status.status-liar { background: #7a4a8c; }
.roster-status.status-framed { background: #7a6650; }

/* ---------- Final vote panel ---------- */
.final-vote-panel {
  width: 100%;
  padding: 9px 11px;
  border-radius: 14px;
  border: 2px solid #e0a748;
  background: linear-gradient(180deg, #3a2326, #251820);
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), inset 0 0 22px rgba(224, 120, 60, 0.12);
}
.fv-top { display: flex; align-items: center; gap: 10px; }
.fv-bonus-row { display: flex; align-items: center; gap: 7px; }
.fv-bonus-label { flex: 0 0 auto; font-size: 10.5px; font-weight: 900; color: #f6d9a8; white-space: nowrap; }
.fv-bonus-picks { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.fv-pick {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #6b5546;
  background: #222;
  cursor: pointer;
  opacity: 0.78;
  transition: transform 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}
.fv-pick.is-on { border-color: #ffd76a; opacity: 1; transform: translateY(-2px); box-shadow: 0 0 0 2px rgba(255, 215, 106, 0.35); }

/* ---------- Result stars ---------- */
.sc-stars-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-bottom: 5px; }
.sc-star {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 3px 5px;
  border-radius: 10px;
  background: #e7d8b9;
  border: 1.5px solid #cbb488;
  color: #8f7c62;
  text-align: center;
}
.sc-star-glyph { font-size: 25px; line-height: 1; color: #c9b896; }
.sc-star small { font-size: 9.2px; font-weight: 900; line-height: 1.2; }
.sc-star.got { background: #fff2c8; border-color: #d69b2d; color: #6b4210; }
.sc-star.got .sc-star-glyph {
  color: #f0b429;
  text-shadow: 0 2px 0 #a8650d, 0 0 10px rgba(255, 196, 60, 0.6);
  animation: starPop 0.55s var(--star-delay, 0.2s) cubic-bezier(0.2, 1.7, 0.4, 1) backwards;
}
@keyframes starPop { from { transform: scale(0) rotate(-90deg); opacity: 0; } }
.sc-bonus-report { display: flex; flex-wrap: wrap; gap: 4px 8px; justify-content: center; margin-bottom: 6px; font-size: 10.4px; font-weight: 900; }
.sc-bonus-report .right { color: #3e7a3f; }
.sc-bonus-report .wrong { color: #9b372b; }
.sc-daily-line { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 10.5px; font-weight: 900; color: #2f4b78; margin-bottom: 6px; }

/* ---------- Mode selector status ---------- */
.mode-status { display: inline-flex; align-items: center; gap: 1px; font-size: 9.6px; font-weight: 900; padding: 1px 6px; border-radius: 99px; white-space: nowrap; }
.mode-status.best { background: #fff1c9; color: #7a4d0d; border: 1px solid #e0b354; }
.mode-status.fresh { background: #e4ecf7; color: #2f4b78; border: 1px solid #a9bcd8; }
.mode-status.won { background: #e3f1df; color: #2f5a2c; border: 1px solid #8fbf88; }
.mode-status.lost { background: #f6e0dc; color: #8c2b20; border: 1px solid #d79a8e; }
.mini-star { color: #cbbd9f; font-size: 10px; }
.mini-star.on { color: #f0a92a; }
.mode-card.is-daily { background: linear-gradient(90deg, rgba(255, 244, 214, 0.9), rgba(236, 243, 252, 0.9)); }
.mode-card.is-daily.is-active { background: linear-gradient(90deg, #fff4d6, #eaf1fb); }
.mode-card-top .mode-badge { margin-left: 0; }
.mode-card-top strong { margin-right: auto; }
.alm-caught { display: inline-block; margin-top: 3px; font-size: 9.8px; font-weight: 900; color: #9b372b; background: #fbe4df; padding: 1px 6px; border-radius: 99px; }

/* Compact screens (iPhone SE / shorter desktop height) */
@media (max-height: 700px) {
  .phase-title { font-size: 15px; }
  .stopwatch-face { width: 50px; height: 50px; }
  .timer-text { font-size: 14px; }
  .hand-container { min-height: 108px; padding-top: 13px; }
  .paper-action-card { height: 92px; }
  .card-art-well { height: 39px; }
  .card-art-svg { width: 46px; height: 39px; }
  .bottom-dock { height: 92px; }
  .roster-avatar { height: 41px; }
  .sc-paper-card { padding: 10px; }
  .sc-badge-title { font-size: 15px; }
  .sc-mini-avatar { width: 42px; height: 42px; }
  .sc-headline-text { font-size: 11.8px; line-height: 1.35; }
  .sc-quotes-box p { font-size: 10.8px; line-height: 1.32; }
  .chunky-paper-btn .btn-inner { padding: 6px 8px; font-size: 13px; }
  .slip-text { font-size: 13px; line-height: 1.5; }
  .act-banner-body strong { font-size: 26px; }
  .start-emblem { width: 92px; height: 74px; }
}
