/* ============================================================
   《摩洛哥港杀人事件》 Style C · 1925 复古电影胶片实拍风
   Mobile WebView Anti-Black-Screen + Translucent Frosted Noir UI
   ============================================================ */

:root {
  --bg-deep: #070b10;
  --surface-glass: rgba(15, 21, 29, 0.76);
  --surface-glass-strong: rgba(11, 16, 23, 0.90);
  --surface-pill: rgba(20, 27, 36, 0.74);
  --surface-pill-hover: rgba(34, 45, 58, 0.88);
  --border-subtle: rgba(216, 200, 172, 0.22);
  --border-brass: rgba(212, 168, 90, 0.52);
  --text-ivory: #f3ece0;
  --text-muted: #b5bcc4;
  --accent-brass: #d4a85a;
  --accent-amber: #e6a958;
  --accent-crimson: #c94444;
  --accent-crimson-glow: rgba(190, 42, 42, 0.36);
  --accent-ok: #68b88a;
  --font-serif: "Songti SC", "Noto Serif SC", "STSong", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-ivory);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* Custom subtle dark scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: rgba(8, 12, 18, 0.4);
}
::-webkit-scrollbar-thumb {
  background: rgba(212, 168, 90, 0.32);
  border-radius: 99px;
}

.is-hidden {
  display: none !important;
}

/* Shell: centered 9:16 cinema frame on desktop, 100% fullscreen on mobile */
.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 35%, #121c27 0%, #05080c 78%);
}

.stage {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #090e15;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(216, 200, 172, 0.12);
}

@media (max-width: 540px) {
  .stage {
    max-width: 100%;
    box-shadow: none;
  }
}

/* ==================== BACKGROUND FILM LAYER ==================== */
.bg-layer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  overflow: hidden;
}

.bg-img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.75s ease, transform 4.5s ease-out;
  filter: contrast(1.04) saturate(0.95);
}

.bg-img.is-active {
  opacity: 1;
  transform: scale(1.0);
}

.bg-vignette {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 10, 15, 0.56) 0%, rgba(6, 10, 15, 0.08) 22%, rgba(6, 10, 15, 0.16) 52%, rgba(6, 10, 15, 0.88) 78%, rgba(5, 8, 12, 0.97) 100%);
}

/* ==================== CHARACTER PORTRAIT LAYER ==================== */
.portrait-layer {
  position: absolute;
  top: 64px;
  right: 16px;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.portrait-layer.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.portrait-card {
  width: 108px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(10, 14, 20, 0.85);
  border: 1px solid var(--border-brass);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
}

.portrait-card img {
  display: block;
  width: 100%;
  height: 112px;
  object-fit: cover;
  object-position: center top;
}

.portrait-name {
  padding: 4px 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--accent-brass);
  background: rgba(8, 12, 18, 0.92);
  border-top: 1px solid rgba(212, 168, 90, 0.22);
}

/* ==================== FX CANVAS & SAN OVERLAY ==================== */
.fx-canvas {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

.san-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
  box-shadow: inset 0 0 90px rgba(130, 18, 28, 0.65);
}

.san-overlay.is-low {
  opacity: 1;
  animation: sanPulse 4.2s ease-in-out infinite;
}

@keyframes sanPulse {
  0%, 100% { box-shadow: inset 0 0 70px rgba(110, 18, 28, 0.45); }
  50% { box-shadow: inset 0 0 115px rgba(155, 24, 34, 0.78); }
}

.stage.is-shaking {
  animation: stageShake 0.42s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes stageShake {
  10%, 90% { transform: translate3d(-3px, 1px, 0); }
  20%, 80% { transform: translate3d(5px, -2px, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 2px, 0); }
  40%, 60% { transform: translate3d(6px, -1px, 0); }
}

/* ==================== TOP FLOATING HUD ==================== */
.hud-bar {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  left: 12px;
  z-index: 15;
}

.hud-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  font-size: 13px;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.hud-date {
  color: var(--accent-brass);
  font-weight: 600;
  white-space: nowrap;
}

.hud-dot {
  color: rgba(255, 255, 255, 0.35);
}

.hud-loc {
  color: var(--text-ivory);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.hud-stat {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.hud-stat strong {
  color: var(--text-ivory);
  font-weight: 600;
  margin-left: 2px;
}

.hud-san.is-danger strong {
  color: var(--accent-crimson);
}

.hud-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-ivory);
  font-size: 14px;
  padding: 2px 4px;
  cursor: pointer;
  line-height: 1;
}

/* ==================== COMBAT / ACT 3 BANNER ==================== */
.combat-banner {
  position: absolute;
  top: calc(56px + env(safe-area-inset-top, 0px));
  left: 14px;
  right: 14px;
  z-index: 14;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(88, 16, 20, 0.82);
  border: 1px solid rgba(220, 82, 82, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12px;
  color: #ffe3e3;
  text-align: center;
}

/* ==================== TOAST ==================== */
.toast {
  position: absolute;
  top: calc(60px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  max-width: 88%;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(15, 22, 31, 0.92);
  border: 1px solid var(--border-brass);
  color: var(--accent-amber);
  font-size: 13px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* ==================== SCREENS ==================== */
.screen {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

/* Cover */
.screen-cover {
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px calc(26px + env(safe-area-inset-bottom, 0px));
  justify-content: space-between;
}

.cover-top-tag {
  align-self: center;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(10, 15, 22, 0.66);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent-brass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cover-spacer {
  flex: 1;
}

.cover-body {
  text-align: center;
}

.cover-eyebrow {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: rgba(212, 168, 90, 0.82);
}

.cover-title {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #f8f2e6;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.85);
}

.cover-sub {
  margin: 0 auto 24px;
  max-width: 340px;
  font-size: 13.5px;
  line-height: 1.7;
  color: rgba(235, 228, 214, 0.88);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.cover-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Buttons (Style C Sleek Frosted Pill) */
.pill-btn {
  width: 100%;
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--surface-pill);
  border: 1px solid var(--border-subtle);
  color: var(--text-ivory);
  font-size: 14.5px;
  font-family: var(--font-sans);
  letter-spacing: 0.04em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
  text-align: center;
}

.pill-btn:hover {
  background: var(--surface-pill-hover);
  border-color: var(--border-brass);
}

.pill-btn:active {
  transform: scale(0.985);
}

.pill-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.pill-btn-primary {
  background: linear-gradient(135deg, rgba(168, 122, 54, 0.88), rgba(118, 78, 32, 0.92));
  border-color: rgba(236, 196, 120, 0.65);
  color: #fffaf0;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.pill-btn-primary:hover {
  background: linear-gradient(135deg, rgba(188, 138, 64, 0.95), rgba(136, 90, 38, 0.96));
}

.pill-btn-ghost {
  background: rgba(12, 18, 26, 0.55);
  color: var(--text-muted);
}

/* ==================== CHARACTER CREATION & ENDING SHEET ==================== */
.screen-chargen,
.screen-ending {
  padding: calc(16px + env(safe-area-inset-top, 0px)) 14px calc(16px + env(safe-area-inset-bottom, 0px));
  justify-content: center;
}

.sheet-panel {
  display: flex;
  flex-direction: column;
  max-height: 100%;
  padding: 18px 16px;
  border-radius: 18px;
  background: var(--surface-glass-strong);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.72);
  overflow-y: auto;
}

.sheet-kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent-brass);
}

.sheet-title {
  margin: 6px 0 8px;
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--text-ivory);
}

.sheet-desc {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

.class-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.class-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(22, 30, 40, 0.72);
  border: 1px solid rgba(216, 200, 172, 0.18);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  text-align: left;
}

.class-card.is-selected {
  background: rgba(44, 38, 28, 0.82);
  border-color: var(--accent-brass);
  box-shadow: 0 0 0 1px rgba(212, 168, 90, 0.35);
}

.class-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}

.class-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: #faf3e4;
}

.class-vitals {
  font-size: 12px;
  color: var(--accent-brass);
}

.class-skills {
  font-size: 12px;
  color: #d6dde5;
  margin-bottom: 4px;
}

.class-perk {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

.sheet-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

/* ==================== MAIN GAMEPLAY BOTTOM UI ==================== */
.screen-play {
  padding: 0 14px calc(12px + env(safe-area-inset-bottom, 0px));
  justify-content: flex-end;
}

.play-spacer {
  flex: 1;
  min-height: 20px;
}

.play-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 66%;
}

.narrative-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(10, 15, 22, 0.70) 0%, rgba(9, 13, 19, 0.86) 100%);
  border: 1px solid rgba(216, 200, 172, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-height: 215px;
  overflow-y: auto;
}

.speaker-tag {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(212, 168, 90, 0.18);
  border: 1px solid rgba(212, 168, 90, 0.42);
  color: var(--accent-brass);
  font-size: 11.5px;
  letter-spacing: 0.06em;
}

.narrative-text {
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--text-ivory);
  white-space: pre-line;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

.narrative-text .clue-hl {
  color: var(--accent-amber);
  font-weight: 600;
}

.narrative-text .danger-hl {
  color: #ff7b7b;
  font-weight: 600;
}

.choices-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 215px;
  overflow-y: auto;
}

.choice-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--surface-pill);
  border: 1px solid var(--border-subtle);
  color: var(--text-ivory);
  font-size: 13.5px;
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.1s ease;
}

.choice-btn:hover {
  background: var(--surface-pill-hover);
  border-color: var(--border-brass);
}

.choice-btn:active {
  transform: scale(0.985);
}

.choice-btn.is-primary {
  border-color: rgba(212, 168, 90, 0.58);
  background: rgba(40, 34, 24, 0.80);
}

.choice-btn.is-danger {
  border-color: rgba(215, 78, 78, 0.58);
  background: rgba(54, 18, 22, 0.80);
}

.choice-tag {
  flex-shrink: 0;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(212, 168, 90, 0.16);
  color: var(--accent-brass);
  border: 1px solid rgba(212, 168, 90, 0.32);
}

.choice-tag.tag-done {
  background: rgba(104, 184, 138, 0.16);
  color: var(--accent-ok);
  border-color: rgba(104, 184, 138, 0.35);
}

/* Quick Bottom Dock */
.quick-dock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.dock-btn {
  position: relative;
  padding: 9px 6px;
  border-radius: 12px;
  background: rgba(12, 17, 24, 0.82);
  border: 1px solid rgba(216, 200, 172, 0.20);
  color: var(--text-ivory);
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.dock-btn:hover {
  border-color: var(--border-brass);
  background: rgba(26, 35, 46, 0.88);
}

.dock-badge {
  position: absolute;
  top: -5px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent-crimson);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* ==================== MODALS ==================== */
.modal {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(4, 7, 11, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: var(--surface-glass-strong);
  border: 1px solid var(--border-brass);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(216, 200, 172, 0.16);
}

.modal-header h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--accent-brass);
  letter-spacing: 0.05em;
}

.modal-close-inline {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-ivory);
  font-size: 12px;
  cursor: pointer;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(10, 14, 20, 0.82);
  border: 1px solid var(--border-brass);
  color: var(--text-ivory);
  font-size: 15px;
  cursor: pointer;
}

/* Tabs */
.tab-bar {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(6, 10, 15, 0.6);
  border-bottom: 1px solid rgba(216, 200, 172, 0.12);
}

.tab-btn {
  flex: 1;
  padding: 7px 6px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}

.tab-btn.is-active {
  background: rgba(212, 168, 90, 0.18);
  border-color: rgba(212, 168, 90, 0.48);
  color: var(--accent-amber);
  font-weight: 600;
}

/* ==================== PROPHECY PARCHMENT MODAL ==================== */
.parchment-modal {
  padding: 0;
  background: #1a140d;
}

.parchment-frame {
  position: relative;
  width: 100%;
  min-height: 460px;
  overflow-y: auto;
}

.parchment-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.86) contrast(1.06);
}

.parchment-content {
  position: relative;
  z-index: 2;
  padding: 36px 26px 30px;
  background: radial-gradient(circle at center, rgba(235, 215, 175, 0.58) 0%, rgba(30, 20, 12, 0.55) 100%);
}

.parchment-header {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: #4f1812;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(90, 28, 22, 0.35);
}

.prophecy-verse {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(244, 232, 205, 0.78);
  border-left: 3px solid #7e1919;
  color: #2c1410;
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 1.85;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.prophecy-verse .verse-tag {
  display: block;
  font-size: 11px;
  font-family: var(--font-sans);
  color: #7e1919;
  margin-bottom: 4px;
  letter-spacing: 0.08em;
}

/* ==================== INTERACTIVE 3-MAP MODAL ==================== */
.map-viewport {
  position: relative;
  width: 100%;
  height: 410px;
  background: #0d1520;
  overflow: hidden;
}

.map-bg-img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.76) contrast(1.06);
}

.map-pins {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(11, 17, 24, 0.88);
  border: 1px solid rgba(216, 200, 172, 0.42);
  color: var(--text-ivory);
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.65);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.map-pin:hover {
  transform: translate(-50%, -50%) scale(1.06);
  border-color: var(--accent-brass);
}

.map-pin.is-here {
  border-color: var(--accent-brass);
  background: rgba(64, 46, 20, 0.94);
  color: #fff6e0;
}

.map-pin.is-locked {
  opacity: 0.46;
  cursor: not-allowed;
}

.pin-status {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  flex-shrink: 0;
}

.pin-status.st-unread {
  background: #e24b4b;
  box-shadow: 0 0 8px rgba(226, 75, 75, 0.9);
}

.pin-status.st-done {
  background: var(--accent-ok);
}

.pin-status.st-here {
  background: var(--accent-amber);
}

.map-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 9px 12px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid rgba(216, 200, 172, 0.14);
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-right: 4px;
  vertical-align: middle;
}

.dot-unread { background: #e24b4b; }
.dot-done { background: var(--accent-ok); }
.dot-here { background: var(--accent-amber); }

/* ==================== NOTES & DOSSIERS ==================== */
.notes-body {
  padding: 12px 14px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clue-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(20, 28, 38, 0.78);
  border: 1px solid rgba(216, 200, 172, 0.16);
}

.clue-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-amber);
  margin-bottom: 4px;
}

.clue-item-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: #d6dde5;
}

.npc-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(20, 28, 38, 0.78);
  border: 1px solid rgba(216, 200, 172, 0.16);
}

.npc-card img {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--border-brass);
  flex-shrink: 0;
}

.npc-info h4 {
  margin: 0 0 3px;
  font-size: 14px;
  color: var(--text-ivory);
}

.npc-role {
  font-size: 11px;
  color: var(--accent-brass);
  margin-bottom: 4px;
}

.npc-desc {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.skill-chip {
  display: flex;
  justify-content: space-between;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(22, 31, 42, 0.8);
  border: 1px solid rgba(216, 200, 172, 0.16);
  font-size: 12.5px;
}

.skill-chip strong {
  color: var(--accent-brass);
}

/* ==================== DEDUCTION BOARDS ==================== */
.deduce-body {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
}

.deduce-intro {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

.deduce-slots {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.deduce-slot {
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(16, 22, 30, 0.85);
  border: 1px dashed rgba(212, 168, 90, 0.42);
  font-size: 12.5px;
  color: var(--text-muted);
}

.deduce-slot.is-filled {
  border-style: solid;
  border-color: var(--accent-brass);
  color: var(--accent-amber);
  background: rgba(45, 36, 22, 0.72);
}

.evidence-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.ev-chip {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(24, 33, 44, 0.88);
  border: 1px solid rgba(216, 200, 172, 0.24);
  color: var(--text-ivory);
  font-size: 12px;
  cursor: pointer;
}

.ev-chip.is-picked {
  background: rgba(212, 168, 90, 0.24);
  border-color: var(--accent-brass);
  color: #fff3d6;
}

.deduce-solved-box {
  padding: 14px;
  border-radius: 12px;
  background: rgba(24, 54, 38, 0.55);
  border: 1px solid rgba(104, 184, 138, 0.55);
  color: #daf5e5;
  font-size: 13px;
  line-height: 1.68;
}

/* Case 2 Room Comparison Board */
.room-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.room-col {
  padding: 10px;
  border-radius: 12px;
  background: rgba(18, 25, 34, 0.85);
  border: 1px solid rgba(216, 200, 172, 0.2);
}

.room-col h4 {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--accent-brass);
  text-align: center;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(216, 200, 172, 0.14);
}

.contra-btn {
  display: block;
  width: 100%;
  margin-bottom: 7px;
  padding: 8px 9px;
  border-radius: 9px;
  background: rgba(28, 38, 50, 0.82);
  border: 1px solid rgba(216, 200, 172, 0.2);
  color: var(--text-ivory);
  font-size: 11.5px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}

.contra-btn.is-marked {
  background: rgba(168, 46, 46, 0.38);
  border-color: #e46b6b;
  color: #ffecec;
}

.contra-btn.is-locked {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ==================== BRASS D100 DICE ROLLER ==================== */
.dice-modal {
  padding: 22px 18px;
  text-align: center;
  max-width: 340px;
}

.dice-skill-title {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--accent-brass);
  margin-bottom: 4px;
}

.dice-target-line {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.brass-die-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.brass-die {
  width: 94px;
  height: 94px;
  border-radius: 22px;
  transform: rotate(45deg);
  background: radial-gradient(circle at 30% 30%, #e7c278 0%, #9b7031 55%, #4b3314 100%);
  border: 2px solid #f4d896;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7), inset 0 0 16px rgba(255, 240, 195, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brass-die.is-rolling {
  animation: dieSpin 0.28s linear infinite;
}

@keyframes dieSpin {
  0% { transform: rotate(45deg) scale(1); }
  50% { transform: rotate(225deg) scale(1.06); }
  100% { transform: rotate(405deg) scale(1); }
}

.dice-number {
  transform: rotate(-45deg);
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  color: #1f1306;
  text-shadow: 0 1px 1px rgba(255, 242, 200, 0.7);
}

.dice-grade {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-ivory);
}

.dice-grade.grade-ok { color: var(--accent-ok); }
.dice-grade.grade-crit { color: #ffd970; }
.dice-grade.grade-fail { color: #e86b6b; }

.dice-note {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.dice-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==================== ACT 3 GUARD ALLOCATION ==================== */
.guards-modal {
  padding-bottom: 14px;
}

.guards-desc {
  margin: 12px 16px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

.guards-alloc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px;
  margin-bottom: 12px;
}

.guard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(20, 29, 40, 0.85);
  border: 1px solid rgba(216, 200, 172, 0.18);
}

.guard-row-info strong {
  display: block;
  font-size: 13.5px;
  color: var(--text-ivory);
}

.guard-row-info span {
  font-size: 11.5px;
  color: var(--text-muted);
}

.guard-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(212, 168, 90, 0.2);
  border: 1px solid var(--border-brass);
  color: var(--text-ivory);
  font-size: 16px;
  cursor: pointer;
}

.guards-remain {
  text-align: center;
  font-size: 13px;
  color: var(--accent-amber);
  margin-bottom: 10px;
}

.guards-modal .sheet-footer {
  padding: 0 16px;
}

/* ==================== ENDING PANEL ==================== */
.ending-title {
  margin: 8px 0 12px;
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--accent-brass);
  text-align: center;
}

.ending-summary {
  font-size: 14px;
  line-height: 1.78;
  color: var(--text-ivory);
  white-space: pre-line;
  margin-bottom: 16px;
}

.ending-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.ending-stat-box {
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(22, 30, 40, 0.82);
  border: 1px solid rgba(216, 200, 172, 0.16);
  font-size: 12px;
  color: var(--text-muted);
}

.ending-stat-box strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  color: var(--accent-amber);
}
