@font-face {
  font-family: "CWCommand";
  src: url("art/fonts/Oswald.ttf") format("truetype");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "CWReading";
  src: url("art/fonts/Oranienbaum.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #ead9b8;
  --obsidian: #0b0607;
  --obsidian-card: #120c0b;
  --velvet: #541821;
  --velvet-deep: #340c12;
  --ivory: #f3e6ca;
  --parchment: #dcc59b;
  --dim: #a8916a;
  --brass: #c29a5b;
  --brass-dark: #7d5b2d;
  --gold: #f3d698;
  --gold-bright: #fff1d5;
  --crimson: #a8333f;
  --emerald: #4e8c6a;
  --error: #e1b3a0;
  --cmd-font: "CWCommand", "Oswald", -apple-system, BlinkMacSystemFont, sans-serif;
  --read-font: "CWReading", "Oranienbaum", Georgia, "Times New Roman", serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(ellipse at 50% 42%, #190d0e 0%, #060304 100%);
  color: var(--ink);
  font-family: var(--read-font);
  height: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#theatre {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 60% 52% at 24% 48%, rgba(255, 198, 114, 0.055) 0%, transparent 72%),
    linear-gradient(180deg, #12090a 0%, #0b0607 100%);
  border: 1px solid rgba(194, 154, 91, 0.36);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(243, 214, 152, 0.08);
}

/* Frameless Circus Welt Top HUD */
.topbar {
  height: 36px;
  background: linear-gradient(180deg, rgba(11, 6, 7, 0.96) 0%, rgba(11, 6, 7, 0.78) 100%);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border-bottom: 1px solid rgba(194, 154, 91, 0.24);
  flex-shrink: 0;
  gap: 6px;
  z-index: 5;
}

.brand {
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #f2e3bf 10%, #dcc292 55%, #ad8b58 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

/* Base Circus Welt Controls (zero 2003 rounded boxes) */
button {
  font-family: var(--cmd-font);
  cursor: pointer;
  touch-action: manipulation;
  border-radius: 2px;
  border: 1px solid rgba(194, 154, 91, 0.42);
  background: linear-gradient(180deg, #1b1210 0%, #100a09 100%);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  min-height: 26px;
  white-space: nowrap;
  transition: color 0.14s, border-color 0.14s, background 0.14s, filter 0.14s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

button:hover:not(:disabled) {
  color: var(--gold-bright);
  border-color: var(--brass);
  background: linear-gradient(180deg, #2b1517 0%, #160b0c 100%);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:focus-visible {
  outline: 1.5px solid var(--gold);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.top-actions button {
  position: relative;
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 4px 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--dim);
}

.top-actions button::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 2px;
  height: 1px;
  background: var(--brass);
  opacity: 0;
  transition: opacity 0.14s;
}

.top-actions button:hover:not(:disabled),
.top-actions button:focus-visible:not(:disabled) {
  background: linear-gradient(90deg, rgba(84, 24, 33, 0.72), rgba(77, 16, 26, 0.35) 75%, transparent);
  color: var(--gold-bright);
}

.top-actions button:hover:not(:disabled)::after,
.top-actions button:focus-visible:not(:disabled)::after {
  opacity: 1;
}

/* Primary Crimson-Velvet & Framed Brass Action */
.primary-btn {
  width: 100%;
  min-height: 36px;
  font-family: var(--cmd-font);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #621721 0%, #3a0c13 100%);
  border: 1px solid #cfa560;
  border-radius: 2px;
  color: #f6e6c0;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.65),
    inset 0 0 0 1px rgba(246, 224, 172, 0.18),
    inset 0 1px 0 rgba(255, 240, 200, 0.22);
}

.primary-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #741c28 0%, #480f18 100%);
  border-color: var(--gold);
  color: var(--gold-bright);
  text-shadow: 0 0 10px rgba(242, 196, 112, 0.4);
}

.primary-btn.compact-primary {
  width: auto;
  min-width: 148px;
  padding: 5px 18px;
  min-height: 32px;
  font-size: 12px;
}

.primary-btn:disabled {
  opacity: 0.72;
  background: linear-gradient(180deg, #17100f 0%, #0f0a09 100%);
  border-color: rgba(194, 154, 91, 0.3);
  color: var(--dim);
  box-shadow: none;
}

/* Signature Circus Welt Hairline Rule Button (matches CW dialog confirm) */
.cw-rule-btn {
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, transparent, #ecd08f 16%, rgba(217, 182, 115, 0.78) 84%, transparent) top / 100% 1px no-repeat,
    linear-gradient(90deg, transparent, #ecd08f 16%, rgba(217, 182, 115, 0.78) 84%, transparent) bottom / 100% 1px no-repeat,
    radial-gradient(ellipse 64% 92% at 50% 50%, rgba(168, 52, 66, 0.34), transparent 76%);
  color: #f0dcb2;
  padding: 7px 22px;
  box-shadow: none;
}

.cw-rule-btn:hover:not(:disabled) {
  background:
    linear-gradient(90deg, transparent, #fff1d5 16%, #ecd08f 84%, transparent) top / 100% 1px no-repeat,
    linear-gradient(90deg, transparent, #fff1d5 16%, #ecd08f 84%, transparent) bottom / 100% 1px no-repeat,
    radial-gradient(ellipse 66% 94% at 50% 50%, rgba(196, 62, 78, 0.46), transparent 76%);
  color: #fffaf0;
  text-shadow: 0 0 12px rgba(242, 196, 112, 0.42);
}

/* Nine-slice leather + hammered brass surface (from panel.png) */
.cw-panel-skin {
  background: #100b09;
  border: 1px solid rgba(194, 154, 91, 0.45);
  border-image: url("art/ui/panel.webp") 32 36 32 36 fill / 14px 16px / 0 stretch;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.85);
}

.status-banner {
  background: #1c0f0e;
  color: var(--gold);
  font-family: var(--read-font);
  font-size: 11px;
  padding: 3px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(194, 154, 91, 0.34);
  flex-shrink: 0;
}

.screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen[hidden], [hidden] {
  display: none !important;
}

/* =========================
   1. CIRCUS WELT OBSIDIAN START MENU (play.weltcircus.com style)
   ========================= */
.cw-cover {
  position: relative;
  background:
    radial-gradient(ellipse 52% 68% at 24% 48%, rgba(255, 194, 110, 0.085) 0%, rgba(255, 194, 110, 0) 70%),
    radial-gradient(ellipse 68% 82% at 75% 44%, rgba(92, 22, 32, 0.14) 0%, transparent 72%),
    #0b0607;
  justify-content: center;
}

.cw-cover-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 16px 12px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  z-index: 2;
}

.cw-cover-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 6px;
}

.cw-cover-logo-en {
  font-family: var(--read-font);
  font-size: 26px;
  letter-spacing: 0.12em;
  line-height: 1.05;
  text-transform: uppercase;
  background: linear-gradient(180deg, #f7e6bf 10%, #dcc292 52%, #a8824c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.85));
}

.cover-eyebrow {
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dim);
  margin-top: 3px;
}

.cover-week-note {
  max-width: 28ch;
  margin: 6px 0 0;
  font: 400 clamp(14px, 1.4vw, 16px)/1.3 var(--read-font);
  color: var(--ink);
  text-wrap: pretty;
}

.cw-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cw-cmd,
.cw-access-cmd,
.cw-service-cmd {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  min-height: 0;
}

.cw-cmd {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  padding: 5px 10px 5px 30px;
  font-family: var(--cmd-font);
  font-weight: 200;
  font-size: 18px;
  line-height: 1.08;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: letter-spacing 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.cw-cmd::before {
  content: "";
  position: absolute;
  inset: -6% 0 -6% 10px;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 56% 80% at 32% 50%, rgba(255, 210, 146, 0.19), transparent 72%);
  transition: opacity 0.28s ease;
}

.cw-cmd-pointer {
  position: absolute;
  left: 4px;
  top: 50%;
  width: 16px;
  height: 22px;
  transform: translateY(-50%) scale(0.92);
  background: url("art/ui/pointer.webp") center / contain no-repeat;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(255, 190, 90, 0.45)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.78));
  transition: opacity 0.22s ease, transform 0.25s ease;
}

.cw-cmd-text {
  display: block;
  background: linear-gradient(180deg, #f2e3bf 8%, #dcc292 52%, #ad8b58 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  opacity: 0.74;
  filter: drop-shadow(0 1px 0 rgba(11, 6, 4, 0.9));
  transition: opacity 0.25s ease, filter 0.25s ease;
}

.cw-cmd-sub {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: none;
  color: #a39478;
  margin-top: 2px;
}

.cw-cmd:hover,
.cw-cmd:focus-visible,
.cw-cmd.is-current {
  background: transparent;
  border: 0;
  letter-spacing: 0.1em;
}

.cw-cmd:hover::before,
.cw-cmd:focus-visible::before,
.cw-cmd.is-current::before {
  opacity: 1;
}

.cw-cmd:hover .cw-cmd-pointer,
.cw-cmd:focus-visible .cw-cmd-pointer,
.cw-cmd.is-current .cw-cmd-pointer {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.cw-cmd:hover .cw-cmd-text,
.cw-cmd:focus-visible .cw-cmd-text,
.cw-cmd.is-current .cw-cmd-text {
  opacity: 1;
  filter: brightness(1.14) drop-shadow(0 1px 0 rgba(11, 6, 4, 0.9)) drop-shadow(0 0 11px rgba(255, 196, 110, 0.42));
}

.cw-star-divider {
  display: block;
  width: min(100%, 280px);
  height: 18px;
  margin: 7px 0 5px 14px;
  background: url("art/ui/divider-star.webp") center / contain no-repeat;
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.55));
}

.cw-menu-footer-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: 30px;
  gap: 2px;
}

.cw-access-cmd {
  padding: 4px 0;
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #f2e3bf 8%, #dcc292 52%, #ad8b58 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.86;
}

.cw-access-cmd:hover,
.cw-access-cmd:focus-visible {
  background: linear-gradient(180deg, #fff8e6 8%, #f6e6c0 52%, #dcc292 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(255, 196, 110, 0.42));
}

.cw-service-row {
  display: flex;
  gap: 20px;
  align-items: center;
}

.cw-service-cmd {
  padding: 4px 0;
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

.cw-service-cmd:hover,
.cw-service-cmd:focus-visible {
  background: transparent;
  border: 0;
  color: var(--gold-bright);
}

.cover-stage-wrap {
  display: none;
}

.cover-canvas-frame {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#coverCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.cover-placard-left,
.cover-placard-right {
  position: absolute;
  top: 10px;
  background: rgba(16, 11, 9, 0.88);
  color: var(--gold);
  border-bottom: 1px solid rgba(194, 154, 91, 0.45);
  padding: 3px 9px;
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cover-placard-left { left: 10px; }
.cover-placard-right { right: 10px; color: var(--parchment); }

.cover-apron {
  padding: 12px 16px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.cover-apron h1 {
  margin: 0;
  padding-bottom: 7px;
  position: relative;
  font-family: var(--cmd-font);
  font-weight: 200;
  font-size: 19px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f0dcb2;
}

.cover-apron h1::after,
.folio-header-band h2::after,
.rules-ribbon h3::after,
.overlay-card h3::after,
.card-box h2::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(181, 143, 85, 0), rgba(181, 143, 85, 0.78) 25%, rgba(181, 143, 85, 0.78) 75%, rgba(181, 143, 85, 0));
}

.cover-apron h1::before,
.folio-header-band h2::before,
.rules-ribbon h3::before,
.overlay-card h3::before,
.card-box h2::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2.5px;
  width: 5px;
  height: 5px;
  background: #c7a262;
  transform: translateX(-50%) rotate(45deg);
}

.cover-sub {
  margin: 0;
  font-family: var(--read-font);
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink);
}

.cover-week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-top: 2px;
}

.cover-day-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 3px;
  min-height: 0;
  border-radius: 2px;
  background: rgba(18, 12, 11, 0.9);
  border: 1px solid rgba(194, 154, 91, 0.28);
  color: var(--dim);
  box-shadow: none;
  font-family: var(--cmd-font);
  font-weight: 300;
}

.cover-day-pill:hover:not(:disabled) {
  background: rgba(84, 24, 33, 0.45);
  border-color: var(--brass);
  color: var(--gold-bright);
}

.cover-day-pill.is-finale .pill-mark { color: var(--gold); }

.cover-day-pill.focus {
  background: linear-gradient(180deg, rgba(94, 23, 32, 0.82), rgba(56, 12, 18, 0.92));
  border-color: var(--gold);
  color: var(--gold);
}

.cover-day-pill.cleared {
  background: rgba(24, 52, 38, 0.72);
  border-color: rgba(110, 178, 134, 0.48);
  color: #bfe6cc;
}

.cover-day-pill .pill-day {
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.cover-day-pill .pill-mark {
  font-size: 9px;
  opacity: 0.85;
  line-height: 1.1;
}

/* =========================
   2. PLAYABLE BOARD SCREEN
   ========================= */
.play-status {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 5px 8px;
  gap: 4px 8px;
  background: linear-gradient(#19110d, #0f0907);
  color: var(--ink);
  border-bottom: 1px solid var(--brass-dark);
}

#playCaseTitle {
  flex: 0 0 100%;
  margin: 0;
  color: var(--ivory);
  font: 400 16px/1.1 var(--read-font);
  overflow-wrap: anywhere;
}

.day-tag {
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timer-tag {
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--parchment);
  font-variant-numeric: tabular-nums;
}

.play-tools {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  flex-shrink: 0;
}

.play-tools button {
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.09em;
  padding: 2px 6px;
  min-height: 22px;
  background: transparent;
  border: 1px solid rgba(194, 154, 91, 0.28);
  box-shadow: none;
  color: var(--parchment);
}

.play-tools button:hover:not(:disabled) {
  background: linear-gradient(90deg, rgba(84, 24, 33, 0.72), rgba(77, 16, 26, 0.35));
  border-color: var(--brass);
  color: var(--gold-bright);
}

.stage-box {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #100905;
  overflow: hidden;
}

#boardCanvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: manipulation;
}

.stick-banner {
  position: absolute;
  right: 8px;
  bottom: 8px;
  max-width: calc(100% - 20px);
  background: #140c0b;
  color: var(--ivory);
  border: 1px solid var(--brass);
  border-radius: 2px;
  padding: 5px 10px;
  font-family: var(--read-font);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
  animation: slideStickIn 0.22s ease-out;
  z-index: 6;
}

.stick-dowel {
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  background: var(--gold);
  flex-shrink: 0;
}

@keyframes slideStickIn {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.play-workspace {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(94px, 30%) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  background: #100905;
}

.center-desk {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.clue-rail {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(194, 154, 91, 0.3);
  background: linear-gradient(165deg, #19100c, #100905 72%);
}

.suspect-list {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 6px 5px 9px;
  overflow: hidden auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--brass-dark) transparent;
}

.suspect-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--brass-dark);
  border-image: url("art/ui/panel.webp") 25 32 / 6px / 0 stretch;
  background:
    radial-gradient(ellipse at 25% 10%, #30221788, transparent 70%),
    #19110c;
  border-radius: 4px;
}

.suspect-card.victim {
  border-image: none;
  border: 1px dashed var(--brass-dark);
}

.suspect-card.placed .suspect-footer {
  color: var(--ivory);
}

.suspect-card.active,
.suspect-card.accuse-target {
  border-color: var(--brass);
  box-shadow: inset 0 0 0 1px #dcb06d65;
  background:
    radial-gradient(ellipse at 38% 10%, #781e2a, transparent 86%),
    #3b1019;
}

.token-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: 5px;
  padding: 6px 5px 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ivory);
  white-space: normal;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  touch-action: pan-y;
  cursor: grab;
}

.token-chip:hover:not(:disabled) {
  background: rgba(243, 214, 152, 0.07);
}

.token-chip:active:not(:disabled) {
  transform: none;
}

.token-chip:focus-visible,
.suspect-pin:focus-visible {
  outline-offset: -2px;
}

.accuse-target .token-chip,
.token-chip[aria-label] {
  cursor: pointer;
}

.chip-copy {
  display: contents;
}

.chip-avatar {
  position: relative;
  width: 22px;
  height: 22px;
}

.chip-sprite {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(194, 154, 91, 0.55);
}

.chip-print-window {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid var(--brass);
  border-radius: 50%;
  background: var(--ivory);
}

.chip-print-window .chip-sprite {
  position: absolute;
  max-width: none;
  border: 0;
  border-radius: 0;
}

.chip-dot {
  position: absolute;
  right: -3px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid var(--ivory);
  color: #fff;
  font: 600 9px/1 var(--cmd-font);
}

.chip-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.chip-name {
  font: 400 13px/1.1 var(--read-font);
  color: var(--gold-bright);
}

.chip-role {
  font: 11px/1.15 var(--read-font);
  color: var(--parchment);
}

.suspect-statement,
.suspect-weekly {
  grid-column: 1 / -1;
  font: 13px/1.28 var(--read-font);
  overflow-wrap: anywhere;
}

.suspect-weekly {
  padding-top: 5px;
  border-top: 1px solid rgba(194, 154, 91, 0.32);
  color: var(--gold);
}

.suspect-card.struck .suspect-statement {
  color: var(--parchment);
  text-decoration: line-through;
}

.suspect-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 0 5px 4px;
  font: 11px/1.15 var(--cmd-font);
  color: var(--parchment);
}

.suspect-pin {
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: var(--parchment);
}

.suspect-pin[aria-pressed="true"] {
  border-color: var(--gold);
  background: #2e1b0d;
  color: var(--gold-bright);
}

.board-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px;
  border-top: 1px solid #7d5b2d80;
  background: #110a07;
}

.board-actions button {
  flex: 1;
  min-height: 32px;
  padding-inline: 5px;
  border: 1px solid var(--brass-dark);
  border-image: url("art/ui/panel.webp") 25 32 / 6px / 0 stretch;
  background: linear-gradient(#25190f, #130c08);
}

.board-actions .action-check {
  flex: 1 0 100%;
  min-height: 34px;
  color: var(--gold-bright);
  background: linear-gradient(#711d2b, #380e16);
}

.board-actions .action-check:hover:not(:disabled) {
  background: linear-gradient(#892c3a, #4d1420);
}

.board-actions .action-check:disabled {
  opacity: 1;
  color: var(--parchment);
}

#btnCross[aria-pressed="true"] {
  border-color: var(--gold);
  background: var(--velvet);
  color: var(--gold-bright);
}

/* =========================
   3. DOSSIER FOLIO SCREENS (Circus Welt Dark Leather + Brass)
   ========================= */
.panel {
  padding: 4px 6px;
  overflow-y: auto;
  align-items: center;
  background:
    radial-gradient(ellipse 62% 52% at 50% 35%, rgba(84, 24, 33, 0.2) 0%, transparent 72%),
    #0b0607;
}

.folio-sheet {
  width: 100%;
  max-width: 600px;
  margin: auto 0;
  background: #100b09;
  border: 1px solid rgba(194, 154, 91, 0.45);
  border-image: url("art/ui/panel.webp") 32 36 32 36 fill / 12px 14px / 0 stretch;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.85);
}

.folio-sheet-narrow {
  max-width: 500px;
}

.folio-header-band {
  padding-bottom: 2px;
}

.folio-header-band h2,
.card-box h2 {
  position: relative;
  margin: 0 0 3px;
  padding-bottom: 4px;
  font-family: var(--cmd-font);
  font-weight: 200;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f0dcb2;
}

.folio-header-band p {
  margin: 0;
  font-family: var(--read-font);
  font-size: 11.5px;
  line-height: 1.22;
  color: var(--dim);
}

.status-note {
  margin-top: 5px;
  padding: 4px 8px;
  border-radius: 2px;
  background: rgba(104, 24, 34, 0.25);
  border: 1px solid rgba(201, 147, 75, 0.34);
  color: var(--error);
  font-family: var(--read-font);
  font-size: 12px;
}

.card-box {
  background: rgba(18, 12, 11, 0.9);
  border: 1px solid rgba(194, 154, 91, 0.3);
  border-radius: 2px;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 12.5px;
}

.card-box h3 {
  margin: 0 0 4px;
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.card-box p { margin: 2px 0; line-height: 1.34; font-family: var(--read-font); }

.about-crest {
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  text-align: center;
  margin-bottom: 4px;
}

.about-card h2 {
  text-align: center;
}

.day-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.day-item {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(18, 12, 11, 0.92);
  border: 1px solid rgba(194, 154, 91, 0.3);
  border-radius: 2px;
  padding: 4px 7px;
  font-size: 11px;
}

.day-item.is-cleared {
  border-color: rgba(114, 178, 134, 0.45);
  background: rgba(20, 34, 26, 0.85);
}

.day-item.is-locked {
  opacity: 0.56;
}

.day-seal {
  min-width: 26px;
  height: 20px;
  padding: 0 4px;
  border-radius: 2px;
  background: #17100e;
  border: 1px solid rgba(194, 154, 91, 0.48);
  color: var(--gold);
  font-family: var(--cmd-font);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.day-item.is-cleared .day-seal {
  background: #1a3326;
  border-color: rgba(128, 198, 148, 0.55);
  color: #dff4e6;
}

.day-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.day-item-info strong {
  font-family: var(--read-font);
  font-size: 12px;
  line-height: 1.15;
  color: var(--ivory);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-item-info small {
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 9.5px;
  line-height: 1.15;
  letter-spacing: 0.05em;
  color: var(--dim);
}

.row-btn {
  flex-shrink: 0;
  font-size: 10px;
  min-height: 22px;
  padding: 2px 8px;
}

.row-btn.active-row-btn {
  background: linear-gradient(180deg, #621721 0%, #3a0c13 100%);
  border-color: var(--brass);
  color: var(--gold-bright);
}

.dossier-pill {
  flex-shrink: 0;
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
  border: 1px solid transparent;
}

.dossier-pill.earned {
  background: rgba(34, 72, 50, 0.45);
  border-color: rgba(114, 178, 134, 0.45);
  color: #bfe6cc;
}

.dossier-pill.borrowed {
  background: rgba(122, 82, 35, 0.25);
  border-color: rgba(194, 154, 91, 0.45);
  color: var(--gold);
}

.dossier-pill.missing {
  color: var(--dim);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding-top: 3px;
}

.panel-actions button {
  min-height: 29px;
  padding: 4px 13px;
}

.stamp-card { position: relative; }

.guilty-seal {
  display: inline-block;
  border: 1px solid var(--crimson);
  color: var(--gold);
  background: rgba(104, 24, 34, 0.35);
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 10px;
  letter-spacing: 0.14em;
  padding: 1px 7px;
  border-radius: 2px;
  margin-bottom: 3px;
}

.meta-line {
  font-family: var(--cmd-font);
  font-weight: 300;
  letter-spacing: 0.05em;
  color: #bfe6cc;
}

.poll-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 4px;
  margin-top: 4px;
}

.poll-btn {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 4px 7px;
  min-height: 24px;
  font-family: var(--read-font);
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 11.5px;
}

.poll-btn.voted {
  background: linear-gradient(90deg, rgba(104, 24, 34, 0.85), rgba(62, 13, 20, 0.9));
  border-color: var(--gold);
  color: var(--gold-bright);
}

.maker-load-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 5px;
}

.maker-load-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--read-font);
  font-size: 12px;
  padding: 4px 7px;
  border: 1px solid rgba(194, 154, 91, 0.36);
  border-radius: 2px;
  background: #17100e;
  color: var(--ink);
}

.paper-rule {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(181, 143, 85, 0.55) 25%, rgba(181, 143, 85, 0.55) 75%, transparent);
  margin: 8px 0;
}

.ai-note {
  font-family: var(--read-font);
  font-size: 11.5px;
  color: var(--dim);
}

/* =========================
   4. OVERLAYS & RULES MODAL (.cw-menu-dialog authentic skin)
   ========================= */
.stage-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 4, 5, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  z-index: 10;
}

.stage-overlay.global-modal {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  z-index: 50;
  backdrop-filter: blur(2.5px);
}

.stage-overlay.global-modal::backdrop { background: transparent; }

.overlay-card {
  width: 100%;
  max-width: 350px;
  max-height: calc(100% - 8px);
  overflow-y: auto;
  background: #100b09;
  border: 1px solid rgba(194, 154, 91, 0.45);
  border-image: url("art/ui/panel.webp") 32 36 32 36 fill / 12px 14px / 0 stretch;
  padding: 9px 11px;
  color: var(--ink);
  font-size: 11.5px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.9);
}

.rules-modal-card {
  max-width: 530px;
  padding: 10px 12px;
}

.rules-case-note {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 13px;
  line-height: 1.25;
}

.overlay-head,
.rules-ribbon {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  margin-bottom: 7px;
}

.rules-ribbon h3,
.overlay-card h3 {
  position: relative;
  flex: 1;
  margin: 0;
  padding-bottom: 6px;
  font-family: var(--cmd-font);
  font-weight: 200;
  font-size: 16.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f0dcb2;
}

.icon-close-btn {
  min-width: 26px;
  min-height: 24px;
  padding: 0 6px;
  font-size: 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--dim);
}

.icon-close-btn:hover {
  color: var(--gold-bright);
  background: rgba(84, 24, 33, 0.5);
}

.rules-visual-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.rule-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 12, 11, 0.88);
  border: 1px solid rgba(194, 154, 91, 0.24);
  border-radius: 2px;
  padding: 5px 7px;
}

.rule-copy {
  flex: 1;
  min-width: 0;
}

.rule-copy > strong {
  display: block;
  font-family: var(--cmd-font);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1px;
}

.rule-copy p strong {
  color: var(--ivory);
  font-weight: 600;
}

.rule-copy p {
  margin: 0;
  font-family: var(--read-font);
  font-size: 11.5px;
  line-height: 1.24;
  color: var(--ink);
}

.rule-thumb {
  flex-shrink: 0;
  width: 52px;
  height: 42px;
  border-radius: 2px;
  background: #1a110f;
  border: 1px solid rgba(194, 154, 91, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
}

.rule-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5px;
  background: #2e1d19;
}

.rule-mini-grid span {
  background: #b68754;
  border-radius: 1px;
  font-size: 8px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1c100a;
  font-weight: 700;
}

.rule-mini-grid span.hl { background: #74323b; color: var(--ivory); }
.rule-mini-grid span.cross { color: #f6b3a7; }

.rule-pair { gap: 2px; }
.rule-pair > span { position: relative; width: 21px; height: 21px; display: inline-flex; align-items: center; justify-content: center; }
.rule-pair > span.plus { width: auto; font-size: 8.5px; font-weight: 700; color: var(--gold); }
.rule-pair img { width: 19px; height: 19px; object-fit: contain; display: block; }
.rule-pair .badge-good img { border: 1px dashed var(--gold); border-radius: 2px; }
.rule-pair .badge-victim img, .rule-pair .badge-killer img { border-radius: 50%; }
.rule-pair i {
  position: absolute; right: -2px; bottom: -2px; font-style: normal; font-size: 7.5px; font-weight: 700;
  width: 11px; height: 11px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; border: 1px solid var(--ivory);
}
.rule-pair .badge-bad i { background: var(--crimson); }
.rule-pair .badge-good i { background: var(--emerald); }
.rule-pair .badge-victim i { background: #3b2619; }
.rule-pair .badge-killer i { background: var(--crimson); }

.rule-wall-demo { flex-direction: column; justify-content: space-around; padding: 4px 5px; }
.rule-wall-demo .w-top, .rule-wall-demo .w-bot { width: 100%; display: flex; align-items: center; justify-content: space-between; font-size: 9px; font-weight: 700; }
.rule-wall-demo .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); border: 1px solid var(--ivory); }
.rule-wall-demo .wall-bar { width: 12px; height: 4px; background: var(--ivory); border: 1px solid #000; }
.rule-wall-demo .door-gap { width: 12px; height: 3px; border-bottom: 2px dashed var(--gold); }
.rule-wall-demo .cross { color: #ff9c9c; }
.rule-wall-demo .ok { color: #8ff0b3; }

.weekly-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.weekly-item {
  background: rgba(18, 12, 11, 0.92);
  border: 1px solid rgba(194, 154, 91, 0.34);
  border-radius: 2px;
  padding: 5px 8px;
  font-family: var(--read-font);
  font-size: 12px;
  color: var(--ink);
}

.weekly-item.missing {
  opacity: 0.56;
  border-style: dashed;
}

.drag-ghost {
  position: absolute;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 90;
  border-radius: 50%;
  border: 2px solid var(--gold);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.78);
  overflow: hidden;
}

.drag-ghost img { width: 100%; height: 100%; object-fit: cover; display: block; }
.drag-ghost .chip-print-window { border: 0; }
.drag-ghost .drag-badge {
  position: absolute; right: 1px; bottom: 1px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--crimson); color: var(--ivory); border: 1px solid var(--ivory);
  font-family: var(--cmd-font); font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

.result-columns,
.maker-columns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-col,
.maker-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* =========================
   RESPONSIVE BREAKPOINTS (Mobile 320px -> 512px -> 1440px Desktop)
   ========================= */
@media (min-width: 580px) {
  .rules-visual-grid {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .rule-tile {
    padding: 7px 9px;
  }
}

@media (min-width: 540px) {
  .play-status { flex-wrap: nowrap; min-height: 34px; }
  #playCaseTitle {
    flex: 0 1 auto;
    min-width: 0;
    margin-right: 5px;
    font-size: clamp(16px, 2.4vw, 28px);
  }
  .day-tag, .timer-tag { flex: 0 0 auto; }
  .day-tag { max-width: 16ch; }
  .play-workspace {
    grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
  }

  .suspect-list { gap: 8px; padding: 8px 10px 10px; }
  .token-chip {
    grid-template-columns: 32% minmax(0, 1fr);
    min-height: clamp(105px, 21vh, 186px);
    gap: 9px;
    padding: 9px 11px 24px 15px;
  }
  .suspect-card.active::before {
    content: "";
    position: absolute;
    inset: 8px auto auto 5px;
    width: 12px;
    height: 17px;
    background: url("art/ui/pointer.webp") center / contain no-repeat;
    pointer-events: none;
  }
  .chip-avatar {
    justify-self: center;
    width: min(100%, 110px);
    height: auto;
    aspect-ratio: 1;
  }
  .chip-copy { display: grid; gap: 5px; }
  .chip-name { font-size: clamp(19px, 2.35vw, 33px); }
  .chip-role { font-size: 12px; }
  .suspect-statement, .suspect-weekly {
    font-size: clamp(14px, 1.46vw, 21px);
  }
  .suspect-footer {
    position: absolute;
    right: 8px;
    bottom: 5px;
    gap: 6px;
    padding: 0;
    font-size: 12px;
  }
  .board-actions { flex-wrap: nowrap; padding: 8px 10px; }
  .board-actions button {
    flex: 0 0 auto;
    min-height: 37px;
    padding-inline: clamp(6px, 1vw, 16px);
    font: 400 clamp(13px, 1.55vw, 21px)/1.1 var(--read-font);
    text-transform: none;
    letter-spacing: normal;
  }
  .board-actions .action-check { flex: 1; }
}

@media (min-width: 780px) {
  .cw-cover {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    align-items: stretch;
  }

  .cw-cover-column {
    align-items: flex-start;
    max-width: none;
    margin: 0;
    padding: clamp(14px, 3vh, 34px) clamp(18px, 3vw, 42px);
  }

  .cw-cover-head {
    align-items: flex-start;
    text-align: left;
    padding-left: 26px;
    margin-bottom: clamp(8px, 2vh, 22px);
  }

  .cw-cover-logo-en {
    font-size: clamp(28px, 3.6vh, 42px);
  }

  .cw-cmd {
    min-height: clamp(36px, 5.4vh, 52px);
    padding: clamp(5px, 0.9vh, 10px) 10px clamp(5px, 0.9vh, 10px) 38px;
    font-size: clamp(19px, 3vh, 28px);
  }

  .cw-cmd-pointer {
    left: 6px;
    width: clamp(16px, 2.2vh, 22px);
    height: clamp(22px, 3vh, 30px);
  }

  .cw-star-divider {
    width: clamp(210px, 24vw, 310px);
    height: clamp(18px, 2.4vh, 24px);
    margin: clamp(8px, 1.5vh, 16px) 0 clamp(6px, 1vh, 12px) 18px;
  }

  .cw-menu-footer-nav {
    padding-left: 38px;
  }

  .cw-access-cmd {
    font-size: clamp(15px, 2.2vh, 20px);
  }

  .cw-service-cmd {
    font-size: clamp(11px, 1.5vh, 13.5px);
  }

  .cover-stage-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: clamp(12px, 2.2vh, 24px) clamp(18px, 2.8vw, 34px) clamp(14px, 2.4vh, 26px) 8px;
    min-width: 0;
    min-height: 0;
  }

  .cover-apron {
    padding: 12px 16px 14px;
    gap: 6px;
  }

  .cover-apron h1 {
    font-size: clamp(18px, 2vw, 24px);
  }

  .cover-sub {
    font-size: clamp(13px, 1.35vw, 15px);
  }

  .folio-sheet-wide {
    max-width: min(1060px, 94vw);
    padding: 18px 22px;
    gap: 12px;
    border-image-width: 16px 18px;
  }

  .folio-header-band h2,
  .card-box h2 {
    margin: 0 0 6px;
    padding-bottom: 6px;
    font-size: 19px;
  }

  .folio-header-band p {
    font-size: 13.5px;
  }

  .day-item {
    padding: 6px 9px;
    gap: 9px;
  }

  .day-seal {
    min-width: 30px;
    height: 24px;
    font-size: 10px;
  }

  .day-item-info strong {
    font-size: 14.5px;
  }

  .day-item-info small {
    font-size: 10.5px;
  }

  .day-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  #casesList.day-grid .day-item:last-child {
    grid-column: 1 / -1;
    border-color: rgba(194, 154, 91, 0.52);
    background: linear-gradient(180deg, rgba(64, 18, 25, 0.45) 0%, rgba(18, 12, 11, 0.92) 100%);
  }

  .result-columns {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 12px;
    align-items: start;
  }

  .maker-columns {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 12px;
    align-items: start;
  }

  .folio-sheet-narrow {
    max-width: min(640px, 92vw);
    padding: 20px 26px;
  }

  .rules-modal-card {
    max-width: min(720px, 92vw);
    padding: 18px 22px;
  }

  .overlay-card h3,
  .rules-ribbon h3 {
    font-size: 19px;
  }

  .rule-copy p {
    font-size: 13px;
    line-height: 1.34;
  }

  .rule-thumb {
    width: 68px;
    height: 52px;
  }
}

@media (min-width: 960px) {
  .play-status { min-height: 38px; padding-inline: 14px; }
  .play-tools button { padding: 3px 9px; font-size: 11px; }
}

@media (min-width: 960px) and (min-height: 680px) {
  .topbar { height: 42px; padding: 0 20px; }
  .brand { font-size: 15px; }
  .top-actions { gap: 6px; }
  .top-actions button { font-size: 12.5px; padding: 5px 10px; }
  .play-status { min-height: 42px; }
  .day-tag { font-size: 13.5px; }
  .board-actions .action-check { min-height: 42px; }
}

@media (max-width: 639px) {
  .topbar { height: 36px; padding: 0 6px; }
  .brand { font-size: 11.5px; letter-spacing: 0.1em; }
  .top-actions button { font-size: 10px; padding: 2px 5px; min-height: 23px; letter-spacing: 0.06em; }
}

@media (max-width: 420px) {
  .chip-meta { display: contents; }
  .chip-role { grid-column: 1 / -1; }
}

@media (max-width: 345px) {
  .brand { font-size: 10.5px; }
  .top-actions { gap: 1px; }
  .top-actions button { font-size: 9px; padding: 2px 3.5px; }
  .cw-cover-column { padding: 8px 12px 10px; }
  .cw-cmd { min-height: 34px; font-size: 16.5px; padding: 4px 6px 4px 26px; }
  .token-chip { column-gap: 4px; }
  .chip-avatar { width: 20px; height: 20px; }
  .chip-name { font-size: 12.5px; }
  .rule-thumb { width: 46px; height: 38px; }
}

/* Community catalog and the case editor share the archive's folio. */
.community-sheet { gap: 10px; }

.community-toolbar,
.community-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.community-toolbar { justify-content: space-between; }

.community-grid {
  display: grid;
  gap: 10px;
}

.community-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 12px 14px;
  overflow-wrap: anywhere;
}

.community-card h3 {
  margin: 0;
  color: var(--gold-bright);
  font-weight: 400;
  font-size: clamp(16px, 2.2vw, 21px);
  letter-spacing: 0.02em;
  text-transform: none;
}

.community-story {
  flex: 1;
  white-space: pre-line;
  font-size: 15px;
}

.community-note {
  color: var(--dim);
  margin: 0;
  line-height: 1.35;
}

.community-form {
  display: grid;
  min-width: 0;
  gap: 7px;
  padding: 12px 14px;
}

.community-form label {
  font-size: 13px;
  color: var(--gold);
}

.community-form :is(input, textarea),
.community-link {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--brass);
  border-radius: 2px;
  padding: 7px 9px;
  background: #100b09;
  color: var(--ink);
  font: 16px var(--read-font);
}

.community-form textarea { resize: vertical; }

.community-form :is(input, textarea):focus-visible,
.community-link:focus-visible {
  outline: 1.5px solid var(--gold);
  outline-offset: 2px;
}

#makerPublishStatus:empty { display: none; }

.community-confirm {
  border-top: 1px solid var(--brass);
  padding-top: 7px;
  overflow-wrap: anywhere;
}

.community-confirm .community-actions { margin-top: 7px; }
.community-footer { justify-content: center; }

.community-toolbar button,
.community-actions button,
#btnResultDiscuss,
#btnResultCommunity {
  min-height: 44px;
  max-width: 100%;
  white-space: normal;
}

.community-actions button[aria-pressed="true"] {
  color: var(--gold-bright);
  border-color: var(--brass);
  background: linear-gradient(180deg, #621721, #3a0c13);
}

@media (min-width: 700px) {
  .community-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .community-card:only-child { grid-column: 1 / -1; }
}

.maker-sheet {
  gap: 9px;
  margin: 0;
}

.maker-heading,
.maker-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.maker-heading { justify-content: space-between; }
.maker-heading h2 { flex: 1; }

.maker-steps button { min-height: 36px; }
.maker-steps [aria-pressed="true"],
.maker-hero[aria-pressed="true"] {
  border-color: var(--brass);
  background: linear-gradient(180deg, #621721, #3a0c13);
  color: var(--gold-bright);
}

.maker-controls {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.maker-controls label,
.maker-clues label {
  color: var(--gold);
  font-size: 13px;
}

.maker-controls select,
.maker-clues textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--brass);
  border-radius: 2px;
  padding: 7px 8px;
  background: #100b09;
  color: var(--ink);
  font: 16px var(--read-font);
}

.maker-controls :is(select, textarea):focus-visible {
  outline: 1.5px solid var(--gold);
  outline-offset: 2px;
}

.maker-cast {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
  gap: 6px;
}

.maker-hero {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: start;
  gap: 0 4px;
  min-height: 44px;
  min-width: 0;
  padding: 3px;
  letter-spacing: 0;
  text-transform: none;
}

.maker-hero > span:nth-child(2) {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.maker-hero small { color: var(--gold); }

.maker-portrait {
  grid-row: span 2;
  width: 28px;
  aspect-ratio: 1;
  border-radius: 50%;
  outline: 1px solid var(--brass);
  background-position: center;
  background-size: cover;
}

.maker-board {
  width: 100%;
  height: clamp(255px, 75vw, 350px);
  position: relative;
  border: 1px solid rgba(194, 154, 91, 0.44);
  overflow: hidden;
}

#makerCanvas,
#makerCells {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#makerCells button {
  position: absolute;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#makerCells button:is(:hover, :focus-visible) {
  background: rgba(255, 216, 128, 0.2);
  outline: 2px solid var(--gold-bright);
  outline-offset: -2px;
}

#makerCells button:active { transform: none; }

.maker-clues,
.maker-clue-field {
  display: grid;
  gap: 5px;
}

.maker-clue-field { min-width: 0; }
.maker-clues textarea { resize: vertical; }

.maker-legacy {
  color: var(--dim);
  font-size: 13px;
}

.maker-legacy summary { cursor: pointer; }

@media (max-width: 480px) {
  .maker-cast { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 800px) {
  .maker-clues { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.play-workspace { grid-template-rows: auto auto minmax(0, 1fr); }
.play-status { grid-row: 1; }
.clue-rail, .center-desk { grid-row: 3; min-height: 0; }
.clue-rail { grid-column: 1; }
.center-desk { grid-column: 2; }

.play-case-note {
  grid-row: 2;
  grid-column: 1 / -1;
  margin: 0;
  padding: 4px 8px;
  border-bottom: 1px solid var(--brass-dark);
  color: var(--gold-bright);
  background: #22150d;
  font: 13px/1.25 var(--read-font);
}

.board-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.board-grid:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: -3px;
}

.clue-comparison {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 5px;
  padding: 5px;
}

.compared-clue {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--brass-dark);
  background: #19110c;
}

.compared-clue select {
  width: 100%;
  min-height: 34px;
  padding: 4px;
  border: 0;
  border-bottom: 1px solid var(--brass-dark);
  border-radius: 0;
  background: #311a13;
  color: var(--gold-bright);
  color-scheme: dark;
  font: 16px var(--read-font);
}

.compared-clue-text {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 5px;
  color: var(--ivory);
}

.compared-clue-text p { margin: 0; font-size: 14px; }
.compared-clue-text p + p { margin-top: 5px; }

.hint-card {
  flex: none;
  margin: 4px 6px 0;
  padding: 0 6px 5px;
  border: 1px solid var(--brass);
  background: #271b10;
  color: var(--ivory);
}

.hint-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  color: var(--gold-bright);
  font: 600 14px var(--read-font);
}

.hint-head button {
  min-width: 30px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#hintText {
  max-height: 4.9em;
  margin: 0;
  overflow: auto;
  overscroll-behavior: contain;
  font: 14px/1.22 var(--read-font);
}

.compared-clue :is(select, .compared-clue-text):focus-visible,
#hintText:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: -2px;
}

.rotate-prompt {
  display: none;
  flex: 1;
  place-content: center;
  padding: 16px;
  gap: 8px;
  text-align: center;
  background: linear-gradient(165deg, #25160d, #100905 72%);
  color: var(--parchment);
}

.rotate-prompt h2 { margin: 0; color: var(--gold-bright); font: 26px/1.15 var(--read-font); }
.rotate-prompt p { margin: 0; }

@media (orientation: portrait) {
  .rotate-prompt { display: grid; }
  .play-workspace { display: none; }
}
.share-fallback { display: grid; gap: 5px; }
.share-fallback textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--brass);
  background: #100b09;
  color: var(--ink);
  padding: 7px;
  font: 14px var(--read-font);
}

@media (orientation: landscape) and (max-height: 440px) {
  .cw-cover {
    display: grid;
    grid-template-columns: minmax(240px, 44%) minmax(0, 1fr);
  }
  .cw-cover-column { padding: 6px 10px; }
  .cw-cover-logo-en { font-size: 24px; }
  .cw-cover-head { margin-bottom: 5px; }
  .cover-week-note { margin-top: 4px; font-size: 13px; }
  .cw-cmd { min-height: 29px; padding-block: 3px; font-size: 16px; }
  .cw-star-divider { height: 12px; margin-block: 4px; }
  .cw-menu-footer-nav { flex-direction: row; flex-wrap: wrap; gap: 2px 10px; }
  .cw-access-cmd { font-size: 12px; }
  .cover-stage-wrap {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 6px;
    padding: 7px;
  }
  .cover-apron { padding: 6px 8px; gap: 4px; }

  .topbar { height: 30px; }
  .play-workspace { grid-template-columns: minmax(0, 41%) minmax(0, 1fr); }
  .play-workspace:has(.clue-comparison:not([hidden])) { grid-template-columns: minmax(0, 48%) minmax(0, 1fr); }
  .play-status { flex-wrap: nowrap; gap: 3px 6px; min-height: 29px; padding: 2px 6px; }
  #playCaseTitle { flex: 0 1 auto; min-width: 0; font-size: clamp(14px, 2.5vw, 17px); }
  .play-tools button { min-height: 24px; }
  .play-tools #btnCompareClues { min-height: 30px; }
  .play-case-note { grid-column: 1; font-size: 13px; }
  .center-desk { grid-row: 2 / 4; }
  .suspect-list { gap: 4px; padding: 4px 6px; }

  .suspect-card .token-chip {
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 45px;
    gap: 6px;
    padding: 5px 8px;
  }
  .suspect-card .chip-avatar { width: 32px; height: 32px; }
  .suspect-card .chip-name { font-size: 16px; }
  .suspect-card .suspect-statement, .suspect-card .suspect-weekly { font-size: 14px; }
  .suspect-card .suspect-footer { position: static; padding: 0 5px 4px; }
  .suspect-card.active::before { display: none; }
  .suspect-pin { min-width: 30px; min-height: 30px; }

  .board-actions { flex-wrap: nowrap; padding: 3px 5px; gap: 3px; }
  .board-actions button { flex: 0 1 auto; min-width: 0; min-height: 33px; padding-inline: 6px; letter-spacing: 0.02em; }
  .board-actions .action-check { flex: 1 1 0; white-space: normal; }
}
.feed-page {
  background: #11090a;
}

.feed-card {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  width: 100%;
  height: 100%;
  padding: 14px clamp(16px, 5vw, 52px);
  overflow: hidden;
  border: 1px solid var(--brass-dark);
  background: radial-gradient(ellipse at 15% 50%, #321618, #100809 75%);
}

.feed-art {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: -2;
  width: min(65%, 550px);
  height: 100%;
  object-fit: cover;
  object-position: 55% 45%;
}

.feed-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, transparent 22%, #160a0af5 42%, #160a0a30 100%);
}

.feed-copy { max-width: min(100%, 460px); }
.feed-copy h1 {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  color: var(--gold-bright);
  font: 400 clamp(24px, 5vw, 38px)/1.04 var(--read-font);
}

.feed-copy p { max-width: 36ch; margin: 6px 0 12px; color: var(--ivory); }
.feed-copy #btnFeedPlay { min-width: 104px; min-height: 44px; }
.feed-copy #feedStatus { margin: 5px 0 0; font-size: 13px; }

@media (max-width: 420px) {
  .feed-card::before { background: linear-gradient(90deg, #180b0af5 36%, #160a0a65 100%); }
}

.case-save-status {
  margin: 0;
  padding: 4px 8px;
  border-top: 1px solid var(--brass-dark);
  color: var(--ivory);
  background: #271b10;
  font: 13px/1.25 var(--read-font);
}
