/* ==========================================================================
   DUSKWOOD INN - Singleplayer Stardew-Perspective Cabin Stage & HUD
   ========================================================================== */

/* Fullscreen Blackout Fade Curtain (Lobby -> Cabin Intro) */
.fade-curtain {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #000000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

.fade-curtain.active {
  opacity: 1;
  pointer-events: auto;
}

/* Main Game World Container */
.game-stage {
  position: fixed;
  inset: 0;
  z-index: 12;
  background: #060609;
  overflow: hidden;
}

#world-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* HUD Layer (Stardew Valley layout + Silver-Glass visual identity) */
.game-hud {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.65s ease;
}

.game-hud.hud-hidden {
  opacity: 0;
}

.hud-card,
.hud-clock-box,
.hud-hotbar,
.hud-energy-wrap,
.hud-dialogue {
  pointer-events: auto;
}

/* Top-Left Room & State Plaque */
.hud-top-left {
  position: fixed;
  top: 14px;
  left: 14px;
  padding: 10px 14px;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hud-room-name {
  font-family: var(--font-title);
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--text-white);
  text-shadow: 2px 2px 0 #07090d;
}

.hud-state-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 7px;
  background: rgba(34, 42, 56, 0.85);
  border: 1px solid var(--silver-mid);
  color: var(--accent-lantern);
}

.hud-diff-tag {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-muted);
}

/* Top-Right: Compact Time-Only Clock Box */
.hud-top-right {
  position: fixed;
  top: 14px;
  right: 14px;
  min-width: 176px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clock-time-display {
  width: 100%;
  font-family: var(--font-title);
  font-size: 19px;
  text-align: center;
  letter-spacing: 2px;
  padding: 6px 10px;
  color: var(--text-white);
  background: rgba(5, 7, 11, 0.72);
  border: 2px solid var(--silver-deep);
  text-shadow: 2px 2px 0 #07090d;
}

/* Floating Interaction Prompt */
.hud-prompt {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 7px 16px;
  background: rgba(8, 10, 15, 0.84);
  border: 2px solid var(--silver-bright);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--text-white);
  text-shadow: 2px 2px 0 #07090d;
  white-space: nowrap;
}

/* Atmospheric Dialogue / Examine Box */
.hud-dialogue {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: min(560px, 90vw);
  padding: 14px 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.hud-dialogue p {
  font-size: 16px;
  line-height: 1.45;
  color: var(--text-white);
  text-shadow: 1px 1px 0 #07090d;
}

.dialogue-hint {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--silver-mid);
  white-space: nowrap;
}

/* Bottom-Left Key Hints */
.hud-bottom-left {
  position: fixed;
  left: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.key-hint {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-shadow: 2px 2px 0 #07090d;
}

.key-hint kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 5px;
  margin-right: 4px;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-white);
  background: rgba(10, 12, 18, 0.82);
  border: 1px solid var(--silver-mid);
}

/* Draftsman's Table Inspection Modal */
.table-preview-body {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.table-mini-stat {
  padding: 12px;
  background: rgba(7, 9, 14, 0.72);
  border: 2px solid var(--silver-deep);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.table-mini-stat span {
  font-size: 11px;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}

.table-mini-stat strong {
  font-size: 14px;
  color: var(--text-white);
}

.table-blueprint-note {
  grid-column: 1 / -1;
  padding: 14px;
  background: rgba(6, 8, 13, 0.72);
  border: 2px solid var(--silver-dark);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
  line-height: 1.5;
}

.muted-line {
  font-size: 13px;
  color: var(--silver-mid);
}

@media (max-width: 720px) {
  .hud-bottom-left {
    display: none;
  }
  .table-preview-body {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   DUSKWOOD INN - First-Person Wooden Round Table View (The Cabin Game Style)
   - Aspect-locked 16:9 viewport frame so interactive objects sit 1:1 on the wood
   - Vintage cream/parchment cards with ornate dark ink borders
   - Single 6 o'clock wooden pedestal (Graveyard top + Engraved plaque + Draw lip)
   - Curved outer-rim ribbon of played cards & fanned handheld cards at bottom
   ========================================================================== */

.table-fp-stage {
  position: fixed;
  inset: 0;
  z-index: 18;
  background: #050404;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: fpFadeIn 0.22s ease-out;
}

@keyframes fpFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Exact 16:9 stage locked to the 480x270 canvas geometry */
.fp-viewport-frame {
  position: relative;
  width: min(100vw, 177.78vh);
  height: min(100vh, 56.25vw);
  overflow: hidden;
}

#table-fp-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.fp-table-surface {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* ==================== 1. CENTER WOODEN DISC: FLUSH PARCHMENT ROOM CARDS ==================== */
.fp-wood-map-viewport {
  position: absolute;
  left: 50%;
  top: 45.2%;
  width: 49%;
  height: 46%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  overflow: hidden;
  pointer-events: auto;
  cursor: grab;
}

.fp-wood-map-viewport:active {
  cursor: grabbing;
}

.fp-map-canvas-inner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform-origin: center center;
}

/* Vintage Parchment Square Room Card sitting directly on bare oak planks */
.fp-wood-room-card {
  position: absolute;
  width: 46px;
  height: 46px;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px;
  text-align: center;
  background: linear-gradient(155deg, #f6edd6 0%, #e5d5b0 100%);
  color: #1f1610;
  border: 2px solid #2b1d13;
  outline: 1px solid #f4ebd2;
  outline-offset: -4px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.58);
  user-select: none;
}

.fp-wood-room-card.is-parlor {
  background: linear-gradient(155deg, #fff5dc 0%, #edd9aa 100%);
  border-color: #5c3a16;
  box-shadow: 0 0 10px rgba(255, 224, 145, 0.45), 0 3px 6px rgba(0, 0, 0, 0.6);
}

.fp-wood-room-card.is-cellar {
  background: linear-gradient(155deg, #f2dfd8 0%, #d9b8ad 100%);
  border-color: #6b2220;
}

.fp-parch-glyph {
  font-family: var(--font-title);
  font-size: 9px;
  color: #1c130d;
}

.fp-parch-name {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #2e2017;
  line-height: 1.05;
}

/* Placeable Room Slot Outline on Wood */
.fp-wood-room-slot {
  position: absolute;
  width: 46px;
  height: 46px;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: rgba(246, 232, 198, 0.22);
  border: 2px dashed #f5df9d;
  color: #fff8de;
  font-family: var(--font-ui);
  cursor: pointer;
  animation: pulseWoodSlot 1.1s infinite ease-in-out;
}

.fp-wood-room-slot.is-cellar-slot {
  background: rgba(235, 130, 110, 0.28);
  border-color: #ffb8a8;
}

.fp-wood-room-slot:hover {
  background: rgba(255, 236, 175, 0.46);
  transform: translate(-50%, -50%) scale(1.08);
  z-index: 4;
}

@keyframes pulseWoodSlot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 228, 145, 0.35); }
  50%      { box-shadow: 0 0 12px 2px rgba(255, 228, 145, 0.78); }
}

.fp-slot-plus {
  font-family: var(--font-title);
  font-size: 11px;
  text-shadow: 1px 1px 0 #140c08;
}

.fp-slot-mini {
  font-size: 8px;
  font-weight: 700;
  text-shadow: 1px 1px 0 #140c08;
}

/* ==================== 2. HARVESTER GROOVE TARGET (OPENING 2/2) ==================== */
.fp-harvester-groove-btn {
  pointer-events: auto;
  position: absolute;
  left: 50%;
  top: 71.5%;
  transform: translate(-50%, -50%);
  padding: 5px 11px;
  font-family: var(--font-title);
  font-size: 8px;
  letter-spacing: 1px;
  color: #ffffff;
  background: rgba(132, 24, 30, 0.94);
  border: 2px solid #ff9c9c;
  box-shadow: 0 0 16px rgba(235, 65, 65, 0.78);
  cursor: pointer;
  z-index: 8;
  animation: pulseDanger 0.9s infinite ease-in-out;
}

@keyframes pulseDanger {
  0%, 100% { box-shadow: 0 0 0 0 rgba(235, 75, 75, 0.4); }
  50%      { box-shadow: 0 0 14px 3px rgba(235, 75, 75, 0.85); }
}

/* ==================== 3. CURVED OUTER-RIM PLAYED CARDS RIBBON ==================== */
.fp-rim-cards {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.fp-rim-card {
  pointer-events: auto;
  position: absolute;
  width: clamp(36px, 5.2%, 60px);
  aspect-ratio: 3 / 3.8;
  padding: 3px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  background: linear-gradient(155deg, #f4ead1 0%, #dfd0aa 100%);
  color: #1f1610;
  border: 2px solid #261910;
  outline: 1px solid rgba(38, 25, 16, 0.55);
  outline-offset: -4px;
  box-shadow: 0 2px 0 #1f120a, 0 4px 7px rgba(0, 0, 0, 0.72);
  cursor: help;
  transition: transform 0.12s ease, z-index 0.1s;
}

.fp-rim-card.type-HEX {
  background: linear-gradient(155deg, #f5e2dc 0%, #dfc0b8 100%);
  border-color: #6b1e1e;
}

.fp-rim-card:hover {
  z-index: 12;
  filter: brightness(1.08);
}

.fp-rim-title {
  font-size: clamp(5px, 0.52vw, 7px);
  font-weight: 700;
  line-height: 1.05;
  color: #21160f;
  overflow: hidden;
  max-height: 14px;
}

.fp-rim-glyph {
  font-family: var(--font-title);
  font-size: clamp(7px, 0.85vw, 11px);
  color: #1b120c;
}

.fp-rim-type {
  font-size: clamp(5px, 0.45vw, 6px);
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #5c4430;
}

/* ==================== 4. 3D PIXEL-ART WOODEN CARD PEDESTAL (SLIGHTLY COMPACT) ==================== */
.fp-pedestal-box {
  pointer-events: auto;
  position: absolute;
  left: 50%;
  top: 78.2%;
  transform: translate(-50%, -50%) perspective(360px) rotateX(16deg);
  width: clamp(72px, 9.2%, 108px);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 7;
  image-rendering: pixelated;
  filter: drop-shadow(2px 6px 0 rgba(12, 6, 3, 0.78)) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.75));
}

/* Top 3D beveled oak frame holding the Active Clue / Graveyard card */
.fp-pedestal-top {
  width: 100%;
  aspect-ratio: 1.12 / 1;
  padding: 5px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 220, 165, 0.06) 0px, rgba(255, 220, 165, 0.06) 2px, transparent 2px, transparent 6px),
    linear-gradient(180deg, #69462b 0%, #4d311d 65%, #3a2314 100%);
  border: 2px solid #170d07;
  border-top-color: #8c623d;
  border-left-color: #755031;
  border-right-color: #26150b;
  border-bottom: 2px solid #24140a;
  box-shadow:
    inset 2px 2px 0 rgba(255, 226, 172, 0.28),
    inset -2px -2px 0 rgba(20, 10, 5, 0.65),
    3px 0 0 #26160c;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.14s ease, box-shadow 0.14s ease;
}

.fp-pedestal-top:hover {
  filter: brightness(1.12);
}

.fp-pedestal-top.tray-ready {
  box-shadow: 0 0 14px rgba(105, 228, 206, 0.65);
}

.fp-pedestal-clue {
  width: 100%;
  height: 100%;
  padding: 4px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  background: rgba(24, 15, 10, 0.55);
  border: 1px dashed rgba(212, 186, 140, 0.4);
  color: #cbb894;
}

.fp-pedestal-clue.has-active-clue {
  background: linear-gradient(155deg, #f6eed8 0%, #e4d4ae 100%);
  border: 2px solid #241810;
  outline: 1px solid rgba(36, 24, 16, 0.5);
  outline-offset: -4px;
  color: #1c130d;
}

.fp-pedestal-empty {
  margin: auto;
  font-family: var(--font-title);
  font-size: clamp(6px, 0.58vw, 8px);
  letter-spacing: 0.8px;
  color: #bda882;
}

.fp-ped-card-title {
  font-size: clamp(6px, 0.58vw, 8px);
  font-weight: 700;
  line-height: 1.05;
  color: #1f140d;
}

.fp-ped-card-glyph {
  font-family: var(--font-title);
  font-size: clamp(11px, 1.3vw, 17px);
  color: #18100a;
}

.fp-ped-card-sub {
  font-size: clamp(5px, 0.48vw, 7px);
  font-weight: 700;
  color: #5c432e;
}

/* Front 3D extruded wooden plinth face engraved with "It is Your Turn" */
.fp-pedestal-plaque {
  width: 100%;
  padding: 4px 3px 6px;
  text-align: center;
  font-family: var(--font-ui);
  font-size: clamp(8px, 0.78vw, 11px);
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #ebd3a6;
  text-shadow: 1px 1px 0 #120904;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.10) 0px, rgba(0, 0, 0, 0.10) 2px, transparent 2px, transparent 6px),
    linear-gradient(180deg, #4f331e 0%, #362013 60%, #21120a 100%);
  border-left: 2px solid #593922;
  border-right: 2px solid #170d06;
  border-bottom: 3px solid #120904;
  box-shadow:
    inset 0 2px 0 rgba(255, 224, 170, 0.18),
    inset 0 -2px 0 rgba(0, 0, 0, 0.58),
    3px 2px 0 #1a0f08;
}

/* Bottom Protruding Draw Slot Card peeking cleanly out of the 3D wooden slot */
.fp-pedestal-draw-slot {
  width: 80%;
  padding: 3px 5px 4px;
  margin-top: -1px;
  font-family: var(--font-title);
  font-size: clamp(5.5px, 0.54vw, 7.5px);
  letter-spacing: 0.6px;
  color: #21150d;
  background: linear-gradient(180deg, #dfd0aa 0%, #f7eed6 45%, #cbb68a 100%);
  border: 2px solid #24170e;
  border-top: 2px solid #140b05;
  box-shadow:
    0 2px 0 #4a3520,
    2px 4px 0 rgba(14, 8, 4, 0.75);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.fp-pedestal-draw-slot:hover {
  transform: translateY(3px);
  filter: brightness(1.06);
}

.fp-pedestal-draw-slot.draw-ready {
  box-shadow: 0 0 14px rgba(255, 224, 130, 0.85), 0 4px 8px rgba(0, 0, 0, 0.8);
  animation: drawPulse 1.15s infinite ease-in-out;
}

.fp-pedestal-draw-slot.draw-dim {
  opacity: 0.62;
  filter: saturate(0.5);
}

@keyframes drawPulse {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(3px); }
}

/* ==================== MINIMAL NON-INTRUSIVE CORNER HUD ==================== */
.fp-minimal-tl {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 26;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
}

.fp-status-strip,
.fp-map-mini-tools {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 5px 10px;
  background: rgba(10, 11, 15, 0.78);
  border: 2px solid var(--silver-mid);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.65);
}

.fp-step-tag {
  font-family: var(--font-title);
  font-size: 9px;
  padding: 3px 6px;
  background: rgba(45, 55, 72, 0.9);
  border: 1px solid var(--silver-bright);
  color: var(--accent-lantern);
}

.fp-step-tag.tag-danger {
  background: rgba(132, 24, 30, 0.94);
  border-color: #ff9c9c;
  color: #ffffff;
}

.fp-time-chip {
  font-family: var(--font-title);
  font-size: 11px;
  color: var(--text-white);
}

.fp-harv-chip {
  font-size: 12px;
  font-weight: 700;
  color: #f09c9c;
  padding-left: 7px;
  border-left: 1px solid var(--silver-dark);
}

.fp-sub-instruction {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #f5ebd4;
  text-shadow: 2px 2px 0 #07090d;
  padding-left: 2px;
}

.fp-map-mini-tools {
  padding: 3px 7px;
  gap: 5px;
  font-family: var(--font-title);
  font-size: 8px;
  color: var(--silver-bright);
}

.fp-mini-tool-btn {
  padding: 2px 6px;
  font-family: var(--font-title);
  font-size: 8px;
  color: var(--text-white);
  background: rgba(20, 25, 34, 0.9);
  border: 1px solid var(--silver-mid);
  cursor: pointer;
}

.fp-mini-tool-btn:hover {
  border-color: var(--accent-lantern);
}

/* Bottom-Left Compact Seated Survivor Badge */
.fp-corner-bl {
  position: fixed;
  left: 12px;
  bottom: 10px;
  z-index: 26;
}

.fp-player-seat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
}

.fp-player-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.fp-seat-label {
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--accent-lantern);
}

.fp-player-meta strong {
  font-size: 14px;
  letter-spacing: 1px;
}

/* Bottom-Right Minimal Keybind Prompts (Just like image_03c256.jpg!) */
.fp-corner-br {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 26;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.fp-key-prompt-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #f5ebd6;
  background: rgba(8, 8, 10, 0.62);
  border: 1px solid rgba(188, 198, 212, 0.45);
  text-shadow: 2px 2px 0 #070606;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.fp-key-prompt-btn:hover {
  border-color: var(--accent-lantern);
  background: rgba(24, 20, 16, 0.85);
}

.fp-key-prompt-btn kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-family: var(--font-title);
  font-size: 10px;
  color: #ffffff;
  background: rgba(18, 16, 15, 0.92);
  border: 2px solid var(--silver-mid);
}

/* ==================== FANNED VINTAGE PARCHMENT HAND AT BOTTOM CENTER ==================== */
.fp-hand-dock {
  position: fixed;
  left: 50%;
  bottom: -14px;
  transform: translateX(-50%);
  z-index: 27;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.fp-play-bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: rgba(10, 12, 16, 0.92);
  border: 2px solid var(--silver-mid);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.78);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}

.fp-hand-fan {
  pointer-events: auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 18px 10px;
}

/* Authentic Cream/Parchment Tarot-Style Hand Card (like image_03c23c & image_03c277) */
.fp-parchment-hand-card {
  position: relative;
  width: 112px;
  height: 148px;
  margin: 0 -10px;
  padding: 5px;
  background: linear-gradient(160deg, #f5ebd2 0%, #e5d4ab 58%, #cfb98b 100%);
  color: #1e150e;
  border: 2px solid #1e140c;
  box-shadow:
    inset 0 0 0 1px rgba(255, 250, 232, 0.75),
    0 10px 22px rgba(0, 0, 0, 0.82);
  font-family: var(--font-ui);
  cursor: pointer;
  transform-origin: bottom center;
  transform: translateY(var(--fan-y, 0px)) rotate(var(--fan-rot, 0deg));
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.14s ease;
}

.fp-parchment-hand-card:hover {
  transform: translateY(-42px) rotate(0deg) scale(1.1);
  z-index: 15;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.92), 0 0 14px rgba(255, 224, 150, 0.45);
}

.fp-parchment-hand-card.selected {
  transform: translateY(-48px) rotate(0deg) scale(1.12);
  z-index: 16;
  border-color: #f7c36a;
  box-shadow:
    0 0 0 2px #1c120a,
    0 0 22px rgba(247, 195, 106, 0.78),
    0 16px 32px rgba(0, 0, 0, 0.9);
}

.fp-parchment-hand-card.mandatory-active {
  border-color: #c93b32;
  box-shadow: 0 0 20px rgba(235, 85, 70, 0.72), 0 12px 24px rgba(0, 0, 0, 0.88);
}

.fp-parchment-hand-card.card-locked {
  opacity: 0.56;
  filter: sepia(0.35) brightness(0.76);
}

.fp-parchment-hand-card.card-locked:hover {
  transform: translateY(-10px) rotate(var(--fan-rot, 0deg));
}

.fp-parchment-hand-card.modal-card-flat {
  margin: 0;
  transform: none;
}

.fp-parchment-hand-card.modal-card-flat:hover {
  transform: translateY(-6px);
}

/* Inner Ornate Ink Border Frame */
.fp-parch-inner {
  width: 100%;
  height: 100%;
  padding: 5px 4px;
  border: 2px solid #2b1d12;
  outline: 1px solid rgba(43, 29, 18, 0.45);
  outline-offset: -4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  gap: 3px;
}

.fp-parch-type {
  font-family: var(--font-title);
  font-size: 6px;
  letter-spacing: 0.7px;
  padding: 2px 5px;
  color: #f6eed8;
  background: #2b1d12;
}

.fp-parchment-hand-card.type-BLUEPRINT .fp-parch-type { background: #2c4a6e; }
.fp-parchment-hand-card.type-OMEN      .fp-parch-type { background: #1e574f; }
.fp-parchment-hand-card.type-CHIME     .fp-parch-type { background: #6e521e; }
.fp-parchment-hand-card.type-WARD      .fp-parch-type { background: #245c36; }
.fp-parchment-hand-card.type-HEX       .fp-parch-type { background: #7a2024; }

.fp-parch-forced {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.7px;
  padding: 1px 5px;
  color: #fff6d4;
  background: #8f221e;
  border: 1px solid #f7c36a;
}

.fp-parch-title {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.08;
  color: #1b110a;
}

.fp-parch-emblem {
  font-family: var(--font-title);
  font-size: 17px;
  color: #21150c;
  text-shadow: 1px 1px 0 rgba(255, 248, 224, 0.7);
}

.fp-parch-desc {
  font-size: 9px;
  font-weight: 600;
  line-height: 1.15;
  color: #3d2b1d;
}

/* ==================== TOAST, RIM TOOLTIP & MODALS ==================== */
.fp-table-toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-white);
  background: rgba(12, 10, 10, 0.92);
  border: 2px solid var(--accent-lantern);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.8);
  text-align: center;
  max-width: min(560px, 88vw);
  pointer-events: none;
}

.fp-table-toast.toast-danger {
  border-color: #ef5b5b;
  background: rgba(44, 10, 14, 0.94);
}

.fp-rim-tooltip {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 30;
  width: min(290px, 42vw);
  padding: 10px 12px;
  background: rgba(12, 10, 12, 0.92);
  border: 2px solid var(--silver-mid);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.82);
  pointer-events: none;
}

.fp-rim-tooltip strong {
  font-size: 14px;
  color: #f7e4b2;
}

.fp-tt-tag {
  margin-left: 6px;
  font-family: var(--font-title);
  font-size: 7px;
  padding: 2px 5px;
  background: #2b1d12;
  color: #ffffff;
}

.fp-rim-tooltip p {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.fp-drawn-spotlight,
.fp-tray-modal {
  position: fixed;
  inset: 0;
  z-index: 34;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 5, 8, 0.74);
  backdrop-filter: blur(3px);
}

.fp-drawn-box {
  width: min(370px, 90vw);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.fp-drawn-header {
  font-family: var(--font-title);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--accent-lantern);
}

.fp-drawn-card {
  width: 152px;
  min-height: 192px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(155deg, #f5ebd2 0%, #dfc998 100%);
  color: #1c120a;
  border: 3px solid #24170e;
  outline: 2px solid rgba(36, 23, 14, 0.55);
  outline-offset: -7px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.85);
}

.fp-drawn-card.type-HEX {
  background: linear-gradient(155deg, #f5ded8 0%, #d8b2a8 100%);
  border-color: #8c1e1e;
  box-shadow: 0 0 26px rgba(224, 82, 82, 0.55);
}

.fp-drawn-msg {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted);
}

.fp-tray-modal-box {
  width: min(560px, 92vw);
  display: flex;
  flex-direction: column;
}

.fp-tray-list {
  padding: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  min-height: 160px;
}

@media (max-width: 780px) {
  .fp-corner-bl {
    display: none;
  }
  .fp-parchment-hand-card {
    width: 92px;
    height: 124px;
  }
}

/* Smooth Card Deal Pop-In Animation */
@keyframes cardDealIn {
  from {
    opacity: 0;
    transform: translateY(48px) rotate(var(--fan-rot, 0deg)) scale(0.86);
  }
  to {
    opacity: 1;
    transform: translateY(var(--fan-y, 0px)) rotate(var(--fan-rot, 0deg)) scale(1);
  }
}

.fp-parchment-hand-card.card-just-dealt {
  animation: cardDealIn 0.22s ease-out;
}

/* Extended lower hit-box on lifted selected cards so fast double-clicks never slip off */
.fp-parchment-hand-card.selected::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -52px;
  height: 52px;
}

/* ==================== ROOM DIRECTION FLOORPLAN & DOORWAY CUTOUTS ==================== */
.fp-flicker-veil {
  position: fixed;
  inset: 0;
  z-index: 22;
  background: #030204;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.04s linear;
}

/* Open Doorway Cutouts on Placed Room Cards on the Wooden Table */
.fp-wood-room-card {
  border-width: 3px;
  outline: none;
}

.tile-door-gap {
  position: absolute;
  background: #f0e3c2;
  z-index: 2;
}

.fp-wood-room-card.is-parlor .tile-door-gap {
  background: #fff3d4;
}

.fp-wood-room-card.is-cellar .tile-door-gap {
  background: #e8cbc0;
}

.tile-door-gap.gap-n {
  top: -3px;
  left: 50%;
  width: 14px;
  height: 5px;
  transform: translateX(-50%);
  border-bottom: 2px solid #1f7a5a;
}

.tile-door-gap.gap-s {
  bottom: -3px;
  left: 50%;
  width: 14px;
  height: 5px;
  transform: translateX(-50%);
  border-top: 2px solid #1f7a5a;
}

.tile-door-gap.gap-w {
  left: -3px;
  top: 50%;
  width: 5px;
  height: 14px;
  transform: translateY(-50%);
  border-right: 2px solid #1f7a5a;
}

.tile-door-gap.gap-e {
  right: -3px;
  top: 50%;
  width: 5px;
  height: 14px;
  transform: translateY(-50%);
  border-left: 2px solid #1f7a5a;
}

/* Placeable Slots: Matched (green/gold with live door preview) vs Needs Rotate */
.fp-wood-room-slot.slot-matched {
  border: 2px solid #7be89b;
  background: rgba(123, 232, 155, 0.22);
  padding: 0;
}

.fp-wood-room-slot.slot-needs-rotate {
  border: 2px dashed rgba(245, 210, 130, 0.72);
  background: rgba(245, 210, 130, 0.14);
  animation: none;
}

.fp-wood-room-slot.slot-needs-rotate:hover {
  border-color: #ffe391;
  background: rgba(245, 210, 130, 0.34);
}

/* Top-Down Room Direction SVG inside Hand Cards, Spotlight & Ghost Slots */
.fp-room-dir-wrap {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fp-room-dir-wrap.spotlight-dir {
  width: 96px;
  height: 96px;
}

.room-dir-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.fp-wood-room-slot .room-dir-svg {
  width: 42px;
  height: 42px;
}

.fp-parch-shape-tag {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #1f5c43;
}

/* ==================== ANTIQUE PORTRAIT INSPECTION MODAL ==================== */
.painting-modal-shell {
  width: min(500px, 92vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popModal 0.16s ease-out;
}

.painting-modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: radial-gradient(circle at 50% 35%, rgba(42, 30, 22, 0.55), rgba(6, 7, 10, 0.92));
}

/* Ornate antique gilded wood portrait frame */
.painting-gilt-frame {
  position: relative;
  max-width: 100%;
  padding: 10px;
  background: linear-gradient(145deg, #9c7b3c 0%, #5c421d 45%, #b5914a 75%, #3d2a12 100%);
  border: 3px solid #24160a;
  box-shadow:
    inset 0 0 0 2px #d9ba71,
    inset 0 0 12px rgba(0, 0, 0, 0.85),
    0 12px 28px rgba(0, 0, 0, 0.85);
}

.painting-gilt-frame img {
  display: block;
  max-width: min(340px, 76vw);
  max-height: 46vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #14100d;
  filter: sepia(0.22) contrast(1.08) brightness(0.92);
  border: 2px solid #1b1109;
}

.painting-oil-vignette {
  position: absolute;
  inset: 10px;
  pointer-events: none;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.72);
}

/* Corrupted Portrait Omen visual state — cold, deadpan Uncanny Valley stillness (NO blood/gore!) */
.painting-gilt-frame.is-corrupted {
  border-color: #241911;
  box-shadow:
    inset 0 0 0 2px #a69573,
    inset 0 0 22px rgba(0, 0, 0, 0.85),
    0 14px 32px rgba(0, 0, 0, 0.94);
}

.painting-gilt-frame.is-corrupted img {
  filter: contrast(1.14) saturate(0.76) sepia(0.18) brightness(0.92);
}

@keyframes corruptTwitch {
  0%, 92%, 100% { transform: translate(0, 0); }
  94% { transform: translate(-2px, 1px); }
  96% { transform: translate(2px, -1px); }
  98% { transform: translate(-1px, 0); }
}

.painting-plaque {
  width: 100%;
  padding: 10px 14px;
  background: rgba(8, 10, 14, 0.78);
  border: 2px solid var(--silver-deep);
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: center;
}

.painting-artist {
  font-family: var(--font-title);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--accent-lantern);
}

.painting-note {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted);
}

/* ==========================================================================
   DUSKWOOD INN - Authentic Vintage Weathered Cabin Game Manual ([B])
   Styled 1:1 after the reference pages:
   - Speckled antique cream parchment with aged brown border vignette & crease
   - Vintage typewriter body font ('Special Elite') & antique serif titles
   - Feathered wood-table groove vignettes, ornate cornered clue cards,
     painterly crimson ink circles/X & forked scroll-ribbon exit banners
   ========================================================================== */

.fb-shell {
  width: min(980px, 95vw);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: popModal 0.16s ease-out;
}

.fb-top-tabs {
  width: 96%;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  padding-left: 16px;
  z-index: 2;
}

.fb-tab-btn {
  padding: 5px 12px 4px;
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  color: #dfd2ba;
  background: linear-gradient(180deg, #4b3525 0%, #332216 100%);
  border: 1.5px solid #180f08;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.fb-tab-btn:hover {
  background: #61442e;
  color: #fffaf0;
}

.fb-tab-btn.active {
  background: #f5efe2;
  color: #1f150e;
  padding-bottom: 6px;
  margin-bottom: -2px;
}

.fb-tab-btn.is-clues-tab {
  background: linear-gradient(180deg, #6b2222 0%, #4d1616 100%);
  color: #ffe2dc;
}

.fb-tab-btn.is-clues-tab.active {
  background: #f5efe2;
  color: #6b1515;
}

.fb-close-x {
  margin-left: auto;
  width: 30px;
  height: 26px;
  font-family: "Special Elite", monospace;
  font-size: 13px;
  font-weight: 700;
  color: #f4ebd8;
  background: #4a1a1a;
  border: 1.5px solid #1b0c0c;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  cursor: pointer;
}

.fb-close-x:hover {
  background: #782626;
}

.fb-leather-cover {
  width: 100%;
  padding: 8px 11px 11px;
  background: linear-gradient(145deg, #523b2a 0%, #332217 48%, #21150d 100%);
  border: 2px solid #120b06;
  border-radius: 7px;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 194, 0.22),
    0 22px 54px rgba(0, 0, 0, 0.90);
}

.fb-spread {
  display: grid;
  grid-template-columns: 1fr 14px 1fr;
  height: min(610px, 80vh);
  background: #ece3d1;
  border: 1.5px solid #6b543b;
  border-radius: 3px;
  box-shadow:
    inset 0 0 26px rgba(92, 64, 34, 0.36),
    0 3px 10px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.fb-page {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 26px 10px;
  color: #1c140e;
  font-family: "Special Elite", "Courier New", Georgia, serif;
  overflow-y: auto;
}

.fb-page-left {
  background-color: #f4eee1;
  background-image:
    radial-gradient(circle at 22% 30%, rgba(162, 132, 92, 0.09) 1px, transparent 1.5px),
    radial-gradient(circle at 74% 68%, rgba(135, 102, 66, 0.11) 1px, transparent 1.8px),
    radial-gradient(circle at 46% 84%, rgba(120, 88, 52, 0.09) 1.2px, transparent 2px),
    radial-gradient(ellipse at 50% 50%, rgba(255, 253, 246, 0.52) 48%, rgba(178, 146, 106, 0.30) 92%, rgba(112, 80, 48, 0.48) 100%),
    linear-gradient(to right, rgba(126, 94, 58, 0.30) 0%, transparent 12%, transparent 86%, rgba(88, 62, 36, 0.34) 100%);
  background-size: 56px 56px, 78px 78px, 92px 92px, 100% 100%, 100% 100%;
  box-shadow: inset 6px 0 18px rgba(96, 68, 38, 0.24), inset 0 6px 16px rgba(96, 68, 38, 0.18), inset 0 -8px 18px rgba(96, 68, 38, 0.24);
}

.fb-page-right {
  background-color: #f4eee1;
  background-image:
    radial-gradient(circle at 30% 24%, rgba(162, 132, 92, 0.09) 1px, transparent 1.5px),
    radial-gradient(circle at 68% 72%, rgba(135, 102, 66, 0.11) 1px, transparent 1.8px),
    radial-gradient(circle at 52% 16%, rgba(120, 88, 52, 0.09) 1.2px, transparent 2px),
    radial-gradient(ellipse at 50% 50%, rgba(255, 253, 246, 0.52) 48%, rgba(178, 146, 106, 0.30) 92%, rgba(112, 80, 48, 0.48) 100%),
    linear-gradient(to left, rgba(126, 94, 58, 0.30) 0%, transparent 12%, transparent 86%, rgba(88, 62, 36, 0.34) 100%);
  background-size: 56px 56px, 78px 78px, 92px 92px, 100% 100%, 100% 100%;
  box-shadow: inset -6px 0 18px rgba(96, 68, 38, 0.24), inset 0 6px 16px rgba(96, 68, 38, 0.18), inset 0 -8px 18px rgba(96, 68, 38, 0.24);
}

.fb-crease {
  background: linear-gradient(
    to right,
    rgba(130, 98, 62, 0.22) 0%,
    rgba(68, 46, 26, 0.56) 44%,
    rgba(32, 20, 10, 0.78) 50%,
    rgba(68, 46, 26, 0.56) 56%,
    rgba(130, 98, 62, 0.22) 100%
  );
}

.fb-page-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fb-header {
  text-align: center;
  margin-bottom: 2px;
}

.fb-heading {
  font-family: "IM Fell English SC", Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #1c140e;
  line-height: 1.05;
}

.fb-flourish-svg {
  width: min(225px, 82%);
  height: 20px;
  display: block;
  margin: -2px auto 0;
}

.fb-cover-page {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.fb-cover-logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: "IM Fell English SC", Georgia, serif;
  color: #1a120d;
  letter-spacing: 1px;
}

.fb-logo-small {
  font-size: 27px;
  font-style: italic;
  transform: scaleY(1.22);
}

.fb-logo-mid {
  font-size: 29px;
  transform: scaleY(1.22);
}

.fb-cover-sub {
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 24px;
  letter-spacing: 0.5px;
  color: #1a120d;
  margin-top: 2px;
}

.fb-cover-art {
  width: 86px;
  height: 112px;
  margin-top: 6px;
}

.fb-cover-runner-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.fb-toc-list {
  margin: auto 10px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.fb-toc-row {
  display: flex;
  align-items: baseline;
  width: 100%;
  background: transparent;
  border: none;
  padding: 2px 4px;
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 18px;
  color: #1c140e;
  cursor: pointer;
  text-align: left;
  transition: color 0.12s ease, transform 0.1s ease;
}

.fb-toc-row:hover {
  color: #6b1414;
  transform: translateX(3px);
}

.fb-toc-dots {
  flex: 1 1 auto;
  border-bottom: 2.5px dotted #2a2017;
  margin: 0 5px;
  transform: translateY(-3px);
}

.fb-toc-num {
  font-weight: 700;
}

.fb-lead {
  font-size: 17px;
  line-height: 1.38;
  color: #1c140e;
}

.fb-ink-red {
  color: #541212;
  font-weight: 700;
}

.fb-bullet {
  font-size: 16.5px;
  line-height: 1.34;
  color: #1c140e;
}

.fb-sub-red {
  font-size: 18px;
  font-weight: 700;
  color: #541212;
  margin-bottom: 2px;
  line-height: 1.22;
}

.fb-desc {
  font-size: 14.5px;
  line-height: 1.35;
  color: #241b13;
  padding-left: 10px;
}

.fb-crimson-rule {
  font-size: 14.5px;
  font-weight: 700;
  color: #571414;
  text-align: center;
  margin: 4px 0;
}

.fb-crimson-footnote {
  margin-top: auto;
  padding-top: 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: #571414;
}

.fb-howto-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 4px 0 6px;
}

.fb-howto-card-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.fb-ornate-mini-card {
  position: relative;
  width: 98px;
  height: 108px;
  padding: 12px 8px 10px;
  background: linear-gradient(160deg, #f7f1e1 0%, #e5d7b8 100%);
  box-shadow: 0 3px 7px rgba(45, 28, 12, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
}

.fb-ornate-mini-card.is-event-sample {
  width: 118px;
  height: 112px;
  background: linear-gradient(160deg, #f6efe0 0%, #e4d4b4 100%);
}

.fb-card-frame-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.fb-omc-head {
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 9px;
  font-weight: 700;
  color: #241911;
  line-height: 1.05;
  z-index: 1;
}

.fb-omc-head.is-red {
  color: #5e1414;
  font-size: 10px;
}

.fb-omc-body {
  font-family: "Special Elite", monospace;
  font-size: 8.5px;
  line-height: 1.25;
  color: #382a1e;
  z-index: 1;
}

.fb-omc-badge {
  font-family: "IM Fell English SC", serif;
  font-size: 12px;
  font-weight: 700;
  color: #241911;
  border: 1px solid #382a1e;
  border-radius: 50%;
  padding: 2px 6px;
  z-index: 1;
}

.fb-omc-art {
  width: 60px;
  height: 60px;
  z-index: 1;
}

.fb-omc-room-svg {
  width: 60px;
  height: 60px;
  z-index: 1;
}

.fb-howto-card-cap {
  font-size: 14.5px;
  line-height: 1.15;
  color: #1c140e;
}

.fb-howto-event-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 4px 0;
}

.fb-death-warn-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.fb-clock-sketch {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.fb-death-warn-text {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  color: #4f1313;
}

.fb-stagger-stack {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 10px;
}

.fb-stagger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.fb-stagger-row.compact-gap {
  gap: 10px;
  margin: 4px 0;
}

.fb-feathered-photo {
  flex: 0 0 154px;
  height: 106px;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  -webkit-mask-image: radial-gradient(ellipse 92% 88% at 50% 50%, #000 72%, transparent 100%);
  mask-image: radial-gradient(ellipse 92% 88% at 50% 50%, #000 72%, transparent 100%);
}

.fb-photo-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.fb-clue-grid-row {
  display: grid;
  gap: 7px;
  justify-content: center;
}

.fb-clue-grid-row.row-3 {
  grid-template-columns: repeat(3, 102px);
}

.fb-clue-grid-row.row-4 {
  grid-template-columns: repeat(4, 1fr);
}

.fb-clue-card {
  position: relative;
  height: 102px;
  padding: 10px 6px 8px;
  background: linear-gradient(160deg, #faf5e8 0%, #ede3ce 100%);
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  cursor: pointer;
  overflow: visible;
  transition: transform 0.1s ease;
}

.fb-clue-card:hover {
  transform: translateY(-2px);
}

.fb-clue-card-title {
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1.05;
  color: #1c140e;
  z-index: 1;
}

.fb-clue-card-art {
  width: 60px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.fb-ink-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.fb-ink-circle {
  position: absolute;
  inset: -10px;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 4;
}

.fb-brush-circle-svg,
.fb-brush-x-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 1px rgba(100, 18, 18, 0.35));
}

.fb-clue-card.is-circled .fb-ink-circle {
  opacity: 1;
  transform: scale(1);
}

.fb-ink-x {
  position: absolute;
  inset: -6px;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 4;
}

.fb-clue-card.is-crossed .fb-ink-x {
  opacity: 1;
  transform: scale(1);
}

.fb-exit-title {
  margin-top: 8px;
  text-align: center;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #1c140e;
}

.fb-rooms-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 14px;
  margin-top: 4px;
}

.fb-room-col {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
}

.fb-room-ribbon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 92%;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.1s ease;
}

.fb-room-ribbon:hover {
  transform: scale(1.03);
}

.fb-ribbon-body {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  padding: 3.5px 8px;
  background: linear-gradient(180deg, #faf5e7 0%, #ede3cc 100%);
  border: 1.2px solid #594633;
  box-shadow: 0 1px 2px rgba(45, 28, 12, 0.18);
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #18110b;
  white-space: nowrap;
}

.fb-ribbon-tail {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 18px;
  margin-top: 4px;
  background: #dfd3ba;
  border-top: 1px solid #6b5640;
  border-bottom: 1px solid #6b5640;
  flex-shrink: 0;
}

.fb-ribbon-tail.left {
  margin-right: -4px;
  border-left: 1px solid #6b5640;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 38% 50%);
}

.fb-ribbon-tail.right {
  margin-left: -4px;
  border-right: 1px solid #6b5640;
  clip-path: polygon(0 0, 100% 0, 62% 50%, 100% 100%, 0 100%);
}

.fb-room-ribbon.is-eliminated {
  opacity: 0.22;
}

.fb-room-ribbon.is-pinned .fb-ribbon-body {
  border: 1.8px solid #751818;
  color: #5c1010;
  background: linear-gradient(180deg, #fff9ea 0%, #f5e2ba 100%);
}

.fb-clue-doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
}

.fb-doc-text {
  flex: 1 1 auto;
}

.fb-doc-art {
  flex: 0 0 84px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fb-doc-art.tilt-right {
  transform: rotate(10deg);
}

.fb-doc-art.is-portrait-art {
  flex: 0 0 96px;
  height: 96px;
}

.fb-tips-stack {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 10px;
  padding: 4px 2px;
}

.fb-page-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
}

.fb-page-footer.left {
  justify-content: flex-start;
}

.fb-page-footer.right {
  justify-content: flex-end;
}

.fb-page-num {
  font-family: "Special Elite", Georgia, serif;
  font-size: 18px;
  color: #1c140e;
}

.fb-turn-btn {
  width: 30px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, opacity 0.12s ease;
}

.fb-arrow-svg {
  width: 24px;
  height: 17px;
  fill: #615548;
  stroke: #241a12;
  stroke-width: 1.8;
}

.fb-turn-btn:hover:not(.is-disabled) .fb-arrow-svg {
  fill: #7d2420;
}

.fb-turn-btn:hover:not(.is-disabled) {
  transform: scale(1.1);
}

.fb-turn-btn.is-disabled {
  opacity: 0.34;
  cursor: default;
}

.fb-clear-inline {
  margin-left: auto;
  padding: 2px 7px;
  font-family: "Special Elite", monospace;
  font-size: 11px;
  color: #631919;
  background: rgba(110, 24, 24, 0.08);
  border: 1px dashed rgba(110, 24, 24, 0.45);
  cursor: pointer;
}

.fb-clear-inline:hover {
  background: rgba(110, 24, 24, 0.18);
}

@media (max-width: 780px) {
  .fb-spread {
    grid-template-columns: 1fr;
    height: 82vh;
    overflow-y: auto;
  }
  .fb-crease {
    display: none;
  }
  .fb-clue-grid-row.row-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==================== FOCUSED CLOSE-UP CLUE INSPECTION MODAL ==================== */
.clue-inspect-shell {
  width: min(500px, 92vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popModal 0.16s ease-out;
}

.clue-inspect-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: radial-gradient(circle at 50% 35%, rgba(44, 34, 24, 0.55), rgba(6, 7, 10, 0.94));
}

.clue-focus-frame {
  width: min(360px, 82vw);
  aspect-ratio: 320 / 260;
  padding: 6px;
  background: #24160c;
  border: 3px solid var(--silver-mid);
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.85),
    0 12px 28px rgba(0, 0, 0, 0.88);
  overflow: hidden;
}

.ci-focus-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Smooth pendulum sway & floating chair hover inside close-up focus view */
.ci-pendulum {
  transform-origin: 160px 162px;
  animation: ciPendulumSwing 2.2s ease-in-out infinite;
}

@keyframes ciPendulumSwing {
  0%, 100% { transform: rotate(-9deg); }
  50%      { transform: rotate(9deg); }
}

.ci-float-chair {
  animation: ciChairFloat 3.0s ease-in-out infinite;
}

@keyframes ciChairFloat {
  0%, 100% { transform: translate(160px, 126px) rotate(-16deg); }
  50%      { transform: translate(160px, 117px) rotate(-13deg); }
}

/* Slow uncanny breathing zoom when inspecting a Corrupted Uncanny Portrait */
.painting-gilt-frame.is-corrupted img {
  animation: uncannyBreath 5.5s ease-in-out infinite;
}

@keyframes uncannyBreath {
  0%, 100% { transform: scale(1.0); }
  50%      { transform: scale(1.035); }
}

/* ==================== EVENT MONSTER PORTRAIT IN DRAWN SPOTLIGHT ==================== */
.fp-monster-thumb {
  width: 82px;
  height: 82px;
  border: 2px solid #4d1919;
  background: #0d0a0c;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.78);
  overflow: hidden;
}

.ev-monster-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.fp-monster-pill {
  font-family: var(--font-title);
  font-size: 6px;
  letter-spacing: 0.5px;
  padding: 2px 5px;
  color: #ffe6dc;
  background: #6b1a1e;
  border: 1px solid #2b0d0f;
  line-height: 1.3;
}

/* ==================== VINTAGE DRAWN CARD FULL-FOCUS VIEW (image_71b117 & image_71b137) ==================== */
#fp-drawn-spotlight {
  background: radial-gradient(
    ellipse at center,
    rgba(8, 6, 5, 0.34) 22%,
    rgba(3, 2, 2, 0.78) 100%
  );
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.fp-drawn-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: fpFadeIn 0.16s ease-out;
}

/* Ornate Square-ish Antique Parchment Card (shared by Spotlight & Flying Card!) */
.fp-vintage-card {
  position: relative;
  width: min(410px, 88vw);
  min-height: 392px;
  padding: 28px 34px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  color: #19120d;
  background-color: #f4eee1;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(145, 112, 74, 0.10) 1px, transparent 1.8px),
    radial-gradient(circle at 78% 72%, rgba(125, 92, 56, 0.11) 1px, transparent 2px),
    radial-gradient(ellipse at 50% 48%, rgba(255, 253, 248, 0.62) 44%, rgba(196, 168, 128, 0.34) 88%, rgba(132, 98, 62, 0.52) 100%);
  background-size: 64px 64px, 86px 86px, 100% 100%;
  border-radius: 6px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.88),
    0 0 28px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  user-select: none;
}

.fp-vintage-card.type-HEX {
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.92),
    0 0 32px rgba(110, 22, 22, 0.36);
}

.vc-frame-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.vc-inner {
  position: relative;
  z-index: 3;
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.vc-top-orn-svg {
  width: min(250px, 84%);
  height: 40px;
  display: block;
}

.vc-title {
  font-family: "IM Fell English SC", Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 3.2vw, 31px);
  font-weight: 700;
  letter-spacing: 1.4px;
  line-height: 1.04;
  color: #261b12;
  text-shadow: 0 1px 0 rgba(255, 250, 236, 0.7);
}

.vc-title.is-crimson {
  color: #542822;
}

.vc-divider-svg {
  width: min(220px, 78%);
  height: 11px;
  display: block;
  margin: -2px 0 4px;
}

.vc-content {
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 2px 6px;
}

.vc-text-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vc-body-p {
  font-family: "IM Fell English SC", "Special Elite", Georgia, serif;
  font-size: clamp(14.5px, 1.8vw, 17px);
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: 0.45px;
  color: #1c150f;
}

.vc-warn-line {
  margin-top: 6px;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: clamp(14.5px, 1.8vw, 17px);
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #21160f;
}

.vc-monster-foot {
  font-family: "Special Elite", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #6b221e;
  margin-top: -2px;
}

.vc-visual-box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.vc-visual-box.is-room {
  width: 112px;
  height: 112px;
}

.vc-visual-box.is-clue {
  width: 96px;
  height: 98px;
}

.vc-medallion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  height: 78px;
  padding: 0 12px;
  border-radius: 50%;
  border: 2.5px solid #2b1e14;
  background: radial-gradient(circle, #fbf6e8 0%, #e5d6b6 100%);
  box-shadow: inset 0 0 0 3px #f4eee1, inset 0 0 0 4.5px #4a3524;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  color: #24170e;
}

.vc-bot-orn-svg {
  width: min(220px, 78%);
  height: 30px;
  display: block;
  margin-top: 2px;
}

/* Top-Right Status Icon Badge (e.g., Crossed-Out Golden Lantern matching image_71b117.jpg!) */
.vc-corner-badge {
  position: absolute;
  top: 34px;
  right: 40px;
  width: 36px;
  height: 40px;
  z-index: 4;
  pointer-events: none;
}

.vc-corner-badge svg {
  width: 100%;
  height: 100%;
  display: block;
}

.vc-corner-pill {
  position: absolute;
  top: 36px;
  right: 38px;
  z-index: 4;
  padding: 2px 7px;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #2b1d12;
  border: 1.5px solid #3d2c1e;
  background: rgba(247, 238, 214, 0.88);
  pointer-events: none;
}

.vc-corner-pill.is-ward {
  color: #1c4a2b;
  border-color: #1c4a2b;
}

.vc-corner-pill.is-room {
  color: #233f5e;
  border-color: #233f5e;
}

/* Clean, discreet floating continue button right beneath the parchment card */
.fp-drawn-continue-btn {
  padding: 8px 20px;
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: #f4ebd6;
  background: rgba(14, 11, 9, 0.80);
  border: 1.5px solid rgba(224, 206, 170, 0.62);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.78);
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}

.fp-drawn-continue-btn:hover {
  background: rgba(34, 25, 18, 0.94);
  border-color: #f7e4b4;
  transform: translateY(-1px);
}

/* Flying Card (Pedestal -> Center -> Hand/Rim) uses the exact same Vintage Parchment styling */
.fp-draw-flyer {
  position: fixed;
  z-index: 38;
  pointer-events: none;
  will-change: left, top, transform, opacity;
}

/* ==================== RAGGED BLACK INK-SMUDGE EVENT BANNER (image_715645 & 7159c8) ==================== */
.ev-smudge-banner {
  position: fixed;
  top: 9%;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, 94vw);
  z-index: 32;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  animation: fpFadeIn 0.25s ease-out;
}

.ev-smudge-bg {
  position: absolute;
  inset: -16px -34px -18px -34px;
  width: calc(100% + 68px);
  height: calc(100% + 34px);
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.92));
  pointer-events: none;
}

.ev-smudge-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 22px 44px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ev-smudge-subtag {
  font-family: "Special Elite", monospace;
  font-size: 11px;
  letter-spacing: 2.2px;
  color: #cbbba0;
  text-shadow: 0 2px 6px #000000;
}

.ev-smudge-text {
  font-family: "IM Fell English SC", "Special Elite", Georgia, serif;
  font-size: clamp(20px, 2.7vw, 31px);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: 1.4px;
  color: #f7f4ec;
  white-space: pre-line;
  text-shadow:
    0 2px 0 #050406,
    0 0 14px rgba(0, 0, 0, 0.96);
}

.ev-smudge-banner.is-danger .ev-smudge-text {
  color: #ffb8b8;
}

.ev-smudge-banner.is-success .ev-smudge-text {
  color: #d8f5df;
}

.ev-smudge-count {
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  color: #b7bec7;
  line-height: 1;
  text-shadow: 0 2px 8px #000000;
}

.ev-smudge-choices {
  position: relative;
  z-index: 3;
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  pointer-events: auto;
}

.ev-choice-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: "Special Elite", "Courier New", monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #f5efe2;
  background: rgba(14, 11, 16, 0.92);
  border: 2px solid #968773;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.85);
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.14s ease, background-color 0.14s ease;
}

.ev-choice-btn kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-family: var(--font-title);
  font-size: 9px;
  color: #ffffff;
  background: #241b16;
  border: 1.5px solid #cbb99a;
}

.ev-choice-btn.is-true:hover {
  border-color: #ff8e8e;
  background: rgba(84, 18, 22, 0.94);
  transform: translateY(-2px);
}

.ev-choice-btn.is-false:hover {
  border-color: #9be8b8;
  background: rgba(18, 56, 36, 0.94);
  transform: translateY(-2px);
}

/* Brief Jumpscare Flash on Cutting Corners Failure */
.ev-jumpscare-flash {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 2, 4, 0.88);
  pointer-events: none;
  animation: jsShake 0.14s infinite;
}

.ev-jumpscare-svg {
  width: min(440px, 84vw);
  height: min(440px, 84vw);
}

@keyframes jsShake {
  0%   { transform: translate(-4px, 2px) scale(1.02); }
  50%  { transform: translate(4px, -3px) scale(1.06); }
  100% { transform: translate(-2px, 3px) scale(1.03); }
}

/* ==================== SHUFFLE CARD: UNDER-THE-TABLE HAND (EXACT CABIN GAME POV!) ==================== */
.fp-hand-fan.is-taken {
  transform: translateY(-96px) scale(0.76);
  opacity: 0;
  transition: transform 0.44s cubic-bezier(0.55, 0.06, 0.68, 0.19), opacity 0.32s ease-in;
}

.fp-hand-fan.is-receiving {
  transform: translateY(-76px) scale(0.84);
  opacity: 0;
  transition: none;
}

.fp-shuffle-overlay {
  position: fixed;
  inset: 0;
  z-index: 36;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: radial-gradient(circle at 50% 82%, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.12));
}

.fp-shuffle-label {
  margin-top: 8vh;
  padding: 7px 18px;
  font-family: "IM Fell English SC", "Special Elite", Georgia, serif;
  font-size: clamp(15px, 2.0vw, 21px);
  letter-spacing: 1.6px;
  color: #f5ebd4;
  background: rgba(8, 6, 8, 0.84);
  border: 1.5px solid rgba(210, 188, 146, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85);
}

/* Clipping window starts RIGHT underneath the bottom wooden rim of the round table (~74vh)
   so the hand physically emerges OUT from beneath the table edge and drags cards back UP under it! */
.fp-shuffle-under-clip {
  position: fixed;
  left: 50%;
  top: 72vh;
  bottom: 0;
  width: min(460px, 96vw);
  transform: translateX(-50%);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  pointer-events: none;
}

.fp-shuffle-arm-wrap {
  position: relative;
  width: 176px;
  height: 215px;
  transform: translateY(-220px);
  transition: transform 0.44s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Stage 1: Pixel-art monster hand reaches DOWNWARD out from under the table over player's cards! */
.fp-shuffle-overlay.stage-reach .fp-shuffle-arm-wrap {
  transform: translateY(-14px);
}

/* Stage 2: Hand clamps onto player's cards & pulls them UP underneath the wooden table rim! */
.fp-shuffle-overlay.stage-pull .fp-shuffle-arm-wrap {
  transform: translateY(-218px);
  transition: transform 0.48s cubic-bezier(0.55, 0.06, 0.68, 0.19);
}

/* Stage 3: Hand reaches BACK OUT from under table sliding fresh cards! */
.fp-shuffle-overlay.stage-return .fp-shuffle-arm-wrap {
  transform: translateY(-12px);
  transition: transform 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Stage 4: Releases new cards into player's hand & retracts back under the table rim! */
.fp-shuffle-overlay.stage-retract .fp-shuffle-arm-wrap {
  transform: translateY(-230px);
  transition: transform 0.40s ease-in;
}

.fp-shuffle-shadows-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  z-index: 3;
  pointer-events: none;
}

.fp-shuffle-hand-img {
  position: relative;
  z-index: 4;
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.92));
}

/* Fanned parchment cards held right UNDER the curling pixel-art fingers! */
.fp-shuffle-grip-cards {
  position: absolute;
  top: 118px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 2;
}

.sh-grip-card {
  width: 82px;
  height: 112px;
  margin: 0 -22px;
  padding: 6px 5px;
  background: linear-gradient(155deg, #f5ebd2 0%, #dfc99a 65%, #c7ae7c 100%);
  border: 2px solid #1e130c;
  outline: 1px solid rgba(30, 19, 12, 0.55);
  outline-offset: -5px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.88);
  transform: rotate(var(--gr, 0deg)) translateY(var(--gy, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  color: #1f140d;
  font-family: "IM Fell English SC", Georgia, serif;
}

.sh-grip-card-title {
  font-size: 8px;
  font-weight: 700;
  line-height: 1.1;
  color: #21150d;
}

.sh-grip-card-glyph {
  font-family: var(--font-title);
  font-size: 14px;
  color: #1c120b;
}

.sh-grip-card.is-fresh {
  background: linear-gradient(155deg, #fff7e0 0%, #ecd6a4 65%, #d4ba82 100%);
  box-shadow: 0 0 18px rgba(247, 210, 130, 0.48), 0 10px 22px rgba(0, 0, 0, 0.88);
}

/* ==================== THE THIEF: SPINNING WHEEL MODAL ==================== */
.fp-thief-box {
  width: min(440px, 92vw);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.fp-thief-header {
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #f5dfb0;
  text-shadow: 0 2px 6px #000000;
}

.fp-thief-wheel-stage {
  position: relative;
  width: min(290px, 72vw);
  height: min(290px, 72vw);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fp-thief-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 24px solid #ffdf80;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.95));
  z-index: 4;
}

.fp-thief-rotor {
  width: 100%;
  height: 100%;
  will-change: transform;
}

.thief-wheel-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.88));
}

.fp-thief-result {
  min-height: 44px;
  font-family: "Special Elite", monospace;
  font-size: 13.5px;
  line-height: 1.45;
  color: #e8dcc4;
}

.fp-thief-result strong {
  color: #ffe294;
  font-size: 15px;
}

/* ==================== THE NEIGHBOR: 1ST-PERSON GRIM REAPER BARGAIN (image_7c2580.jpg) ==================== */
.nb-fp-backdrop {
  position: fixed;
  inset: 0;
  z-index: 38;
  background: #04060a;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fpFadeIn 0.3s ease-out;
}

.nb-fp-scene {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.nb-reaper-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.nb-reaper-body {
  transform-origin: 480px 300px;
  animation: nbReaperBreathe 5.2s ease-in-out infinite;
}

@keyframes nbReaperBreathe {
  0%, 100% { transform: translateY(0px) scale(1.0); }
  50%      { transform: translateY(5px) scale(1.015); }
}

.nb-fp-ui-layer {
  position: relative;
  z-index: 4;
  width: 100%;
  height: 100%;
  padding: 28px 20px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.nb-top-title {
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: clamp(20px, 2.8vw, 30px);
  letter-spacing: 3px;
  color: #dfd4be;
  text-shadow: 0 3px 12px #000000;
  opacity: 0.88;
}

.nb-choice-row {
  margin-top: auto;
  margin-bottom: clamp(185px, 28vh, 265px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(14px, 2.4vw, 28px);
  width: min(920px, 95vw);
}

/* Ornate Golden-Amber Bargain Card matching image_7c2580.jpg 1:1! */
.nb-option-card {
  position: relative;
  width: clamp(210px, 26vw, 268px);
  min-height: 236px;
  padding: 34px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  text-align: center;
  background: linear-gradient(160deg, #e5b750 0%, #c8912e 55%, #b27b20 100%);
  border: none;
  border-radius: 6px;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.92),
    inset 0 0 28px rgba(102, 62, 10, 0.42);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.nb-option-card:hover {
  transform: translateY(-10px) scale(1.035);
  filter: brightness(1.08);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.95),
    0 0 28px rgba(255, 212, 102, 0.55),
    inset 0 0 24px rgba(120, 74, 12, 0.35);
}

.nb-card-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.nb-opt-key {
  position: absolute;
  top: 16px;
  left: 20px;
  font-family: var(--font-title);
  font-size: 9px;
  color: #4a2d08;
  opacity: 0.72;
}

.nb-opt-title {
  position: relative;
  z-index: 2;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: clamp(19px, 2.2vw, 23px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.9px;
  color: #8f6318;
  text-shadow:
    0 1px 0 rgba(255, 240, 190, 0.65),
    0 -1px 1px rgba(48, 28, 4, 0.68);
}

.nb-opt-desc {
  position: relative;
  z-index: 2;
  font-family: "IM Fell English SC", "Special Elite", Georgia, serif;
  font-size: clamp(13.5px, 1.5vw, 15.5px);
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: 0.5px;
  color: #fffaf0;
  text-shadow: 0 2px 4px rgba(34, 18, 4, 0.85);
}

.nb-bottom-whisper {
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: clamp(22px, 3.2vw, 34px);
  letter-spacing: 1.4px;
  color: #f5f2ea;
  text-transform: lowercase;
  text-shadow:
    0 3px 0 #040304,
    0 0 18px rgba(0, 0, 0, 0.96);
}

/* ==================== THE ATTIC: RITUAL HUD STRIP ==================== */
.attic-hud-bar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  min-width: min(440px, 88vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  pointer-events: none;
  background: rgba(8, 10, 16, 0.86);
  border-color: #9bb8d4;
}

.attic-hud-progress {
  font-family: var(--font-title);
  font-size: 10px;
  letter-spacing: 1.4px;
  color: #ffe094;
  text-shadow: 2px 2px 0 #05060a;
}

.attic-hud-held {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.9px;
  color: #dce9f7;
}

.attic-hud-notice {
  margin-top: 2px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.7px;
  color: #ffb8b8;
  text-shadow: 1px 1px 0 #05060a;
}

/* ==================== PIXEL-ART GRIM REAPER & MIDNIGHT ENDGAME CUTSCENES ==================== */
.nb-reaper-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 48%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.eg-cutscene-stage {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: #030306;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fpFadeIn 0.55s ease-out;
}

.eg-cutscene-canvas {
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.eg-lose-overlay {
  position: fixed;
  inset: 0;
  z-index: 46;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 2, 4, 0.72);
  animation: fpFadeIn 0.8s ease-out;
}

.eg-lose-box {
  width: min(440px, 92vw);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  border-color: #a83238;
}

.eg-lose-title {
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: clamp(32px, 4.8vw, 46px);
  font-weight: 700;
  letter-spacing: 4px;
  color: #e6454d;
  text-shadow: 0 3px 0 #080203, 0 0 18px rgba(210, 32, 42, 0.65);
}

.eg-lose-sub {
  font-family: "Special Elite", monospace;
  font-size: 14px;
  color: #e6d5d0;
  letter-spacing: 0.8px;
}

.eg-true-room {
  width: 100%;
  padding: 9px 12px;
  background: rgba(16, 8, 10, 0.85);
  border: 1.5px solid #8a4a4e;
  font-family: var(--font-title);
  font-size: 10px;
  letter-spacing: 1px;
  color: #ffe294;
}

.eg-credits-backdrop {
  position: fixed;
  inset: 0;
  z-index: 48;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 25%, rgba(44, 58, 74, 0.92), rgba(8, 12, 18, 0.98));
  animation: fpFadeIn 0.9s ease-out;
}

.eg-credits-box {
  width: min(580px, 94vw);
  max-height: 92vh;
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  border-color: #f0d38b;
}

.eg-credits-badge {
  font-family: var(--font-title);
  font-size: 10px;
  letter-spacing: 1.6px;
  color: #8df2a8;
  text-shadow: 2px 2px 0 #07090d;
}

.eg-credits-title {
  font-family: var(--font-title);
  font-size: clamp(22px, 3.6vw, 34px);
  letter-spacing: 3px;
  color: #fff6dc;
  text-shadow: 0 4px 0 #080a0e;
}

.eg-credits-stats {
  width: 100%;
  padding: 8px 14px;
  background: rgba(8, 12, 18, 0.78);
  border: 1.5px solid var(--silver-dark);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.eg-credits-stats strong {
  color: #ffe08a;
}

.eg-credits-scroll-frame {
  width: 100%;
  height: min(260px, 38vh);
  overflow: hidden;
  position: relative;
  background: rgba(5, 8, 13, 0.72);
  border: 2px solid var(--silver-deep);
  padding: 16px;
}

.eg-credits-roll {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: egCreditsRoll 26s linear infinite;
}

@keyframes egCreditsRoll {
  0%   { transform: translateY(180px); }
  100% { transform: translateY(-100%); }
}

.eg-cr-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.eg-cr-group span {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--silver-mid);
}

.eg-cr-group strong {
  font-family: "Special Elite", monospace;
  font-size: 14px;
  line-height: 1.5;
  color: #fff7e2;
}

/* ==================== THE BASEMENT: FIRST-PERSON FUSE / BREAKER BOX MODAL ==================== */
.bm-breaker-shell {
  width: min(470px, 92vw);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-color: #c75b5b;
  animation: popModal 0.14s ease-out;
}

.bm-breaker-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: radial-gradient(circle at 50% 35%, rgba(34, 24, 26, 0.72), rgba(6, 7, 10, 0.96));
}

.bm-breaker-frame {
  width: min(340px, 82vw);
  aspect-ratio: 320 / 240;
  border: 3px solid var(--silver-dark);
  background: #121418;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.85), 0 10px 24px rgba(0, 0, 0, 0.85);
}

.bm-fp-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.bm-spark-arcs {
  animation: bmSparkBlink 0.24s infinite alternate;
}

@keyframes bmSparkBlink {
  from { opacity: 0.25; }
  to   { opacity: 1.0; }
}

.bm-progress-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bm-progress-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-title);
  font-size: 9px;
  letter-spacing: 1.2px;
  color: #f0e4cc;
}

.bm-progress-track {
  width: 100%;
  height: 18px;
  padding: 2px;
  background: rgba(6, 8, 12, 0.92);
  border: 2px solid var(--silver-mid);
}

.bm-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #d93b3b 0%, #f59c38 55%, #f7d463 100%);
  transition: width 0.05s linear;
}

.bm-progress-fill.is-done {
  background: linear-gradient(90deg, #2fb861 0%, #72f59d 100%);
}

.bm-repair-hint {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #ffd89b;
  text-align: center;
}

/* ==================== THE NEIGHBOR: BOTTOM INK-SMUDGE DIALOGUE & 3D CARD FLIP ==================== */
.nb-bottom-smudge {
  position: relative;
  width: min(740px, 94vw);
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 36px 12px;
  margin-top: 6px;
}

.nb-smudge-bg {
  position: absolute;
  inset: -12px -28px -12px -28px;
  width: calc(100% + 56px);
  height: calc(100% + 24px);
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.95));
  pointer-events: none;
}

.nb-bottom-text {
  position: relative;
  z-index: 2;
  font-family: "IM Fell English SC", "Special Elite", Georgia, serif;
  font-size: clamp(22px, 3.1vw, 35px);
  font-weight: 600;
  letter-spacing: 1.5px;
  color: #f6f3eb;
  text-align: center;
  min-height: 1.2em;
  text-shadow:
    0 2px 0 #040305,
    0 0 18px rgba(0, 0, 0, 0.98);
}

.nb-skip-hint {
  position: relative;
  z-index: 2;
  margin-top: 4px;
  font-family: "Special Elite", monospace;
  font-size: 11px;
  letter-spacing: 1.4px;
  color: rgba(212, 200, 182, 0.72);
}

/* Override 3-card bargain row for smooth 3D deal & flip straight out of The Neighbor's hands! */
.nb-option-card {
  padding: 0;
  background: transparent;
  box-shadow: none;
  perspective: 1100px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-90px) scale(0.28);
  transition:
    transform 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.34s ease;
}

.nb-option-card.nb-slot-0 {
  transform: translate(185px, 145px) scale(0.22) rotate(-16deg);
}

.nb-option-card.nb-slot-1 {
  transform: translate(0px, 155px) scale(0.22);
}

.nb-option-card.nb-slot-2 {
  transform: translate(-185px, 145px) scale(0.22) rotate(16deg);
}

.nb-option-card.is-dealt {
  opacity: 1;
  transform: translate(0, 0) scale(1) rotate(0deg);
}

.nb-option-card.is-flipped {
  pointer-events: auto;
}

.nb-option-card.is-flipped:hover {
  transform: translateY(-10px) scale(1.04);
  filter: brightness(1.07);
}

.nb-card-3d-inner {
  position: relative;
  width: 100%;
  min-height: 236px;
  transform-style: preserve-3d;
  transform: rotateY(180deg);
  transition: transform 0.62s cubic-bezier(0.22, 0.85, 0.32, 1);
}

.nb-option-card.is-flipped .nb-card-3d-inner {
  transform: rotateY(0deg);
}

.nb-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.nb-card-back {
  transform: rotateY(180deg);
  justify-content: center;
  background: linear-gradient(155deg, #2b1d11 0%, #170f09 55%, #26180d 100%);
  border: 3px solid #c99a3e;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.92), inset 0 0 24px rgba(0, 0, 0, 0.8);
}

.nb-back-svg {
  width: 82%;
  height: 82%;
  display: block;
}

.nb-card-front {
  padding: 34px 24px 28px;
  gap: 16px;
  text-align: center;
  background: linear-gradient(160deg, #e5b750 0%, #c8912e 55%, #b27b20 100%);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.92),
    inset 0 0 28px rgba(102, 62, 10, 0.42);
}

.nb-option-card.is-flipped:hover .nb-card-front {
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.95),
    0 0 28px rgba(255, 212, 102, 0.55),
    inset 0 0 24px rgba(120, 74, 12, 0.35);
}

/* ==================== THE KNIGHT: DINING TABLE 3-LIGHT TACTICAL MAP MODAL ==================== */
.kn-table-shell {
  width: min(500px, 94vw);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-color: #c9a452;
  animation: popModal 0.14s ease-out;
}

.kn-table-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: radial-gradient(circle at 50% 45%, #5c3d26 0%, #3b2516 58%, #1d120a 100%);
}

.kn-map-timer {
  font-family: var(--font-title);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #ffe391;
  text-shadow: 2px 2px 0 #120a06;
}

.kn-map-arena {
  position: relative;
  width: min(360px, 84vw);
  height: min(320px, 50vh);
  border-radius: 50%;
  background: radial-gradient(circle, #755134 0%, #593b24 68%, #362213 100%);
  border: 4px solid #2b180d;
  box-shadow:
    inset 0 0 28px rgba(0, 0, 0, 0.72),
    0 10px 26px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}

.kn-map-tile {
  position: absolute;
  transform: translate(-50%, -50%);
  background: linear-gradient(155deg, #f5ebd2 0%, #dfc998 100%);
  border: 2px solid #26180f;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.58);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 3px 2px;
  text-align: center;
}

.kn-map-tile.is-player-room {
  border-color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.55), 0 3px 8px rgba(0, 0, 0, 0.7);
}

.kn-tile-lbl {
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 700;
  color: #21150d;
  line-height: 1;
}

.kn-door {
  position: absolute;
  background: #f5ebd2;
}
.kn-door.d-n { top: -3px; left: 50%; width: 12px; height: 4px; transform: translateX(-50%); }
.kn-door.d-s { bottom: -3px; left: 50%; width: 12px; height: 4px; transform: translateX(-50%); }
.kn-door.d-w { left: -3px; top: 50%; width: 4px; height: 12px; transform: translateY(-50%); }
.kn-door.d-e { right: -3px; top: 50%; width: 4px; height: 12px; transform: translateY(-50%); }

.kn-orb-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-bottom: 2px;
}

.kn-orb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 900;
  color: #07140b;
  animation: knOrbPulse 1.1s infinite ease-in-out;
}

.kn-orb.is-red {
  background: #ff3b3b;
  box-shadow: 0 0 10px 3px rgba(255, 59, 59, 0.85);
}

.kn-orb.is-blue {
  background: #3ea6ff;
  box-shadow: 0 0 10px 3px rgba(62, 166, 255, 0.85);
}

.kn-orb.is-green {
  background: #4df278;
  box-shadow: 0 0 10px 3px rgba(77, 242, 120, 0.85);
}

.kn-orb.is-you {
  width: 7px;
  height: 7px;
  background: #ffffff;
  border: 1.5px solid #181412;
  box-shadow: 0 0 6px #ffffff;
  animation: none;
}

@keyframes knOrbPulse {
  0%, 100% { transform: scale(0.92); opacity: 0.85; }
  50%      { transform: scale(1.18); opacity: 1.0; }
}

.kn-map-legend {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(10, 8, 8, 0.78);
  border: 1.5px solid var(--silver-dark);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.7px;
}

.kn-leg-red   { color: #ff6b6b; }
.kn-leg-blue  { color: #75c2ff; }
.kn-leg-green { color: #78f59a; }
