/* ================================================================ BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

#back-to-games {
  position: fixed; top: 10px; left: 10px; z-index: 10000;
  color: var(--gold); font-family: 'Cinzel', serif; font-size: 13px;
  text-decoration: none; opacity: 0.6; transition: opacity 0.2s;
}
#back-to-games:hover { opacity: 1; }

:root {
  --bg:            #0f0d0b;
  --surface:       #1c1914;
  --surface2:      #251f18;
  --surface3:      #16130e;
  --border:        #3a2e18;
  --gold:          #c9a84c;
  --gold-light:    #e8c96a;
  --text:          #e2cfa0;
  --text-dim:      #9a8a6a;
  --trait:         #7ec87e;
  --curse:         #e07070;
  --l1-border:     #3a5c3a;
  --l2-border:     #5c3a3a;
  --l3-border:     #3a3a6e;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 15px;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ================================================================ SETUP */
#setup-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.setup-box {
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 40px 48px;
  max-width: 980px;
  width: 100%;
  text-align: center;
}

.game-title {
  font-family: 'Cinzel', serif;
  font-size: 56px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 10px;
  text-shadow: 0 0 40px rgba(201,168,76,0.35);
  margin-bottom: 6px;
}

.game-subtitle {
  color: var(--text-dim);
  font-style: italic;
  font-size: 17px;
  margin-bottom: 32px;
}

.setup-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 28px;
}

.setup-label {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--gold);
}

.player-count-btns { display: flex; gap: 8px; }

.count-btn {
  width: 42px; height: 42px;
  border: 2px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.18s;
}
.count-btn:hover, .count-btn.active {
  background: var(--gold);
  color: var(--bg);
}

#hero-selectors {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 28px;
}

.slot-label {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero-cards-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-card-option {
  width: 114px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface2);
  transition: all 0.18s;
}
.hero-card-option:hover:not(.taken)  { border-color: var(--gold); transform: translateY(-5px); }
.hero-card-option.selected           { border-color: var(--gold-light); box-shadow: 0 0 14px rgba(232,201,106,0.5); }
.hero-card-option.taken              { opacity: 0.35; cursor: default; }

.hero-card-option img { width: 100%; display: block; }

.hero-option-name {
  display: block;
  font-size: 11px;
  font-family: 'Cinzel', serif;
  color: var(--text-dim);
  text-align: center;
  padding: 4px 2px 6px;
}

.btn-primary {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--bg);
  background: var(--gold);
  border: none;
  padding: 14px 44px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
}
.btn-primary:hover:not(:disabled) { background: var(--gold-light); transform: translateY(-2px); }
.btn-primary:disabled { opacity: 0.4; cursor: default; transform: none; }

/* ================================================================ GAME */
#game-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#main-layout {
  display: flex;
  flex: 1;
  min-height: 100vh;
  align-items: flex-start;
}

/* ================================================================ BOARD */
#board-area {
  flex: 0 0 auto;
  padding: 16px 16px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#board-legend {
  display: flex;
  gap: 18px;
  margin-bottom: 8px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.5px;
  align-items: center;
  width: 100%;
}

.legend-l1 { color: #5c9c5c; }
.legend-l2 { color: #c87070; }
.legend-l3 { color: #7070c8; }

#time-indicator {
  margin-left: auto;
  font-size: 13px;
  transition: color 0.4s;
}
#time-indicator.day   { color: #f6e58d; }
#time-indicator.night { color: #7fa8e0; }

#board-grid {
  display: grid;
  grid-template-columns: repeat(10, 78px);
  grid-template-rows:    repeat(9, 78px);
  gap: 2px;
  background: #120e08;
  border: 3px solid var(--gold);
  padding: 3px;
  border-radius: 4px;
}

.tile {
  position: relative;
  width: 78px;
  height: 78px;
  overflow: hidden;
  border: 1px solid #1e180e;
}
.tile.level-1 { border-color: var(--l1-border); }
.tile.level-2 { border-color: var(--l2-border); }
.tile.level-3 { border-color: var(--l3-border); }

.tile-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile-number {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 9px;
  font-family: 'Cinzel', serif;
  color: rgba(255,255,255,0.7);
  text-shadow: 0 0 3px #000, 0 0 3px #000;
  opacity: 0.5;
  z-index: 5;
  user-select: none;
  pointer-events: none;
  line-height: 1;
}

.token-area {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.player-token {
  position: absolute;
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.95));
  transition: transform 0.25s ease;
}

.current-player-token {
  filter:
    drop-shadow(0 0 3px #ffd700)
    drop-shadow(0 0 6px rgba(255,215,0,0.5))
    drop-shadow(0 2px 5px rgba(0,0,0,0.95));
  animation: token-glow-pulse 1.5s ease-in-out infinite;
}

@keyframes token-glow-pulse {
  0%, 100% {
    filter:
      drop-shadow(0 0 2px #ffd700)
      drop-shadow(0 0 5px rgba(255,215,0,0.45))
      drop-shadow(0 2px 5px rgba(0,0,0,0.95));
  }
  50% {
    filter:
      drop-shadow(0 0 4px #ffd700)
      drop-shadow(0 0 8px rgba(255,215,0,0.6))
      drop-shadow(0 2px 5px rgba(0,0,0,0.95));
  }
}

/* ================================================================ RIGHT PANEL */
#right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 2px solid var(--border);
  min-width: 300px;
  max-width: 360px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
}

/* ================================================================ HERO PANEL (3rd column) */
#hero-panel {
  flex-shrink: 0;
  width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  border-left: 2px solid var(--border);
  background: var(--surface);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
}

#turn-banner {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 0 0 auto;
}

#turn-number {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-dim);
}

#active-player-name {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: var(--gold);
}

/* Player tabs */
#player-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-btn {
  flex: 1;
  padding: 8px 6px;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
}
.tab-btn:hover       { color: var(--text); }
.tab-btn.active      { color: var(--gold); border-bottom-color: var(--gold); }
.tab-btn.current-turn { font-weight: bold; }

/* Player stats */
#player-stats {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  min-height: 0;
}

.player-header {
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.player-name-str {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.player-name {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  color: var(--gold);
}

.player-str {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-light);
}

.player-pos {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.boss-status  { font-size: 12px; color: var(--trait); margin-top: 3px; }
.boss-done    { margin-right: 6px; }

.stats-body   { display: flex; flex-direction: column; gap: 6px; }

.stat-group-title {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  margin-bottom: 3px;
}
.trait-title { color: var(--trait); }
.curse-title { color: var(--curse); }

.stat-item   { font-size: 13px; padding: 1px 0; color: var(--text); }
.trait-item  { color: var(--trait); }
.curse-item  { color: var(--curse); }
.stat-empty  { color: var(--text-dim); font-style: italic; font-size: 13px; }

/* Movement section */
#movement-section {
  border-top: 2px solid var(--border);
  padding: 10px 12px;
  background: var(--surface3);
  flex: 0 0 auto;
}

.section-header {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#flee-label {
  font-family: 'Crimson Text', serif;
  font-size: 13px;
  color: var(--curse);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

#movement-hand {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 88px;
  align-items: flex-start;
}

.move-card {
  width: 56px;
  height: 80px;
  background: var(--surface2);
  border: 2px solid var(--gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.move-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201,168,76,0.12), transparent 60%);
}
.move-card:hover {
  border-color: var(--gold-light);
  transform: translateY(-8px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.6);
}
.move-card:active { transform: translateY(-4px); }

.card-value {
  font-family: 'Cinzel', serif;
  font-size: 34px;
  font-weight: 700;
  color: var(--gold);
  user-select: none;
  position: relative;
  z-index: 1;
}

.hand-empty {
  color: var(--text-dim);
  font-style: italic;
  font-size: 13px;
  padding: 4px 0;
  align-self: center;
}

/* Log section */
#log-section {
  border-top: 2px solid var(--border);
  padding: 8px 12px 10px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  max-height: 210px;
}

#turn-log {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  flex: 1;
  min-height: 0;
}

.log-line {
  font-size: 12px;
  padding: 1px 0;
  color: var(--text);
  font-family: 'Crimson Text', serif;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  line-height: 1.4;
}
.log-header  { font-family: 'Cinzel', serif; font-size: 11px; color: var(--gold); margin-top: 4px; }
.log-win     { color: var(--trait); }
.log-lose    { color: var(--curse); }
.log-indent  { padding-left: 12px; color: var(--text-dim); }

/* Winner modal */
#winner-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: var(--surface);
  border: 3px solid var(--gold);
  border-radius: 16px;
  padding: 52px 64px;
  text-align: center;
}

.modal-box h2 {
  font-family: 'Cinzel', serif;
  font-size: 26px;
  color: var(--gold-light);
  margin-bottom: 28px;
  line-height: 1.4;
}

/* Scrollbars */
::-webkit-scrollbar              { width: 6px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: var(--border); border-radius: 3px; }
/* ================================================================ SECONDARY / TINY BUTTONS */
.btn-secondary {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--text-dim);
  background: transparent;
  border: 2px solid var(--border);
  padding: 10px 22px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
}
.btn-secondary:hover { color: var(--text); border-color: var(--text-dim); }
.btn-tiny {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  background: var(--surface3);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-tiny:hover { color: var(--text); border-color: var(--text-dim); }
.btn-equip-pack { color: var(--gold) !important; border-color: var(--gold) !important; margin-left: 6px; }
.btn-equip-pack:hover { background: rgba(232,201,106,0.15) !important; }
.btn-danger { color: var(--curse) !important; border-color: #5c2222 !important; }
.btn-danger:hover { background: rgba(224, 112, 112, 0.12) !important; border-color: var(--curse) !important; }
/* ================================================================ ABILITY PANEL */
#abilities-section {
  border-top: 2px solid var(--border);
  padding: 8px 12px;
  background: var(--surface2);
  flex: 0 0 auto;
}
#abilities-section .section-header { margin-bottom: 6px; }
#abilities-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ability-row {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
}
.ability-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.ability-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--gold);
}
.ability-label {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.5px;
}
.ability-timing {
  font-family: 'Crimson Text', serif;
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  letter-spacing: 0;
}
.ability-desc {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  margin: 3px 0 4px 22px;
  line-height: 1.4;
}
.ability-chk { flex-shrink: 0; }
.ability-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Crimson Text', serif;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 4px;
  margin-left: 22px;
  margin-top: 2px;
  cursor: pointer;
}
.ability-select:focus { outline: 1px solid var(--gold); }
.ability-instant-btn {
  font-size: 11px;
  padding: 4px 10px;
  margin-top: 4px;
}
.ability-activate-btn {
  font-size: 12px;
  padding: 6px 14px;
  margin-top: 6px;
  width: 100%;
}
.ability-instant-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 22px;
  margin-top: 4px;
}
/* ================================================================ OFFER MODAL (Chest / Shop) */
#offer-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
}
.offer-modal-content {
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 32px 36px;
  max-width: 920px;
  width: 100%;
  text-align: center;
}
.offer-title {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  color: var(--gold-light);
  margin-bottom: 6px;
  letter-spacing: 2px;
}
.offer-sub {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 16px;
}
.offer-items {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.shop-row {
  align-items: stretch;
}
.offer-item-card {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px;
  min-width: 150px;
  max-width: 190px;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
  flex: 1;
}
.offer-item-card:hover  { border-color: var(--gold); transform: translateY(-3px); }
.offer-item-card.selected { border-color: var(--gold-light); box-shadow: 0 0 14px rgba(232,201,106,0.4); background: #2a2210; }
.offer-item-slot {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.offer-item-name {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: var(--gold);
  line-height: 1.3;
  margin-bottom: 6px;
}
.offer-item-str {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}
.offer-item-tokens {
  margin-top: 6px;
  display: flex;
  justify-content: center;
  gap: 2px;
  flex-wrap: wrap;
}
.shop-section-label {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: left;
  margin-bottom: 8px;
  margin-top: 4px;
}
.shop-trade-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  max-height: 160px;
  overflow-y: auto;
  justify-content: center;
}
.shop-trade-item {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
  min-width: 80px;
  max-width: 100px;
}
.shop-trade-item:hover { border-color: var(--gold); }
.shop-trade-item.selected { border-color: var(--gold-light); background: #2a2210; }
.shop-trade-thumb {
  width: 68px;
  height: auto;
  border-radius: 4px;
  margin-bottom: 4px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.shop-trade-name {
  font-size: 10px;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}
.shop-no-items {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  padding: 12px;
}
.offer-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
/* ================================================================ INVENTORY MODAL */
#inventory-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
  padding: 20px;
}
.inventory-modal-content {
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 28px 32px;
  max-width: 580px;
  width: 100%;
}
.inv-section {
  margin-bottom: 18px;
}
.inv-section-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  margin-bottom: 10px;
}
.inv-slots-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.inv-slot {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 110px;
  max-width: 150px;
  cursor: pointer;
  transition: all 0.15s;
  flex: 1;
}
.inv-slot:hover   { border-color: var(--gold); }
.inv-selected     { border-color: var(--gold-light) !important; box-shadow: 0 0 10px rgba(232,201,106,0.35); background: #2a2210 !important; }
.inv-target {
  border-style: dashed;
  border-color: #4a3820;
  background: var(--surface3);
  opacity: 0.8;
}
.inv-target:hover { opacity: 1; border-color: var(--gold); }
.inv-slot-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.inv-slot-name {
  font-size: 13px;
  color: var(--gold);
  line-height: 1.3;
}
.inv-slot-action {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 3px;
}
.inv-slot-btns {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}
/* ================================================================ STR TOKEN BADGES */
.str-token {
  display: inline-block;
  width: 28px;
  height: 28px;
  vertical-align: middle;
  object-fit: contain;
  margin-left: 1px;
}
.token-overflow {
  font-size: 11px;
  color: var(--text-dim);
  vertical-align: middle;
  margin-left: 2px;
}

/* ================================================================ PLAYER SHEET MINI WIDGET */
#player-sheet-mini {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 150;
}

.ps-mini-content {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 8px;
  padding: 6px 12px 6px 6px;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}
.ps-mini-content:hover {
  border-color: var(--gold-light);
  box-shadow: 0 0 14px rgba(201,168,76,0.4), 0 4px 16px rgba(0,0,0,0.6);
  transform: translateY(-2px);
}

.ps-mini-hero-thumb {
  width: 38px;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.ps-mini-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ps-mini-name {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.ps-mini-str {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-light);
}

.ps-mini-hint {
  font-size: 10px;
  color: var(--text-dim);
  font-style: italic;
}

/* ================================================================ PLAYER SHEET FULL OVERLAY */
#player-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#player-sheet-panel {
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 12px;
  width: min(95vw, 1280px);
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  padding: 20px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.ps-close-btn {
  position: absolute;
  top: 14px;
  right: 18px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold);
  padding: 4px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.18s;
  text-transform: uppercase;
}
.ps-close-btn:hover { background: var(--gold); color: var(--bg); }

.ps-sheet-name {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--gold);
  letter-spacing: 2px;
}
.ps-sheet-str {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  color: var(--text);
  letter-spacing: 1px;
  margin-top: 2px;
  margin-bottom: 4px;
}

.ps-center-str {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 8px;
  cursor: help;
}

#ps-layout {
  display: flex;
  gap: 24px;
  align-items: stretch;
  justify-content: center;
}

/* ---- Left column (movement + pack + minions) ---- */
#ps-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 170px;
  flex-shrink: 0;
  min-width: 0;
}

.ps-area-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Movement piles */
.ps-piles-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.ps-pile-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.ps-pile-card {
  width: 58px;
  height: 82px;
  border: 2px solid var(--gold);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
  background: var(--surface2);
  position: relative;
}

.ps-pile-facedown {
  background: repeating-linear-gradient(
    135deg,
    #1a140c,
    #1a140c 5px,
    #241c10 5px,
    #241c10 10px
  );
}
/* Stacked shadow effect */
.ps-pile-facedown::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  box-shadow: 3px 3px 0 #0d0b07, 6px 6px 0 #0a0806;
  z-index: -1;
}

.ps-pile-empty {
  background: var(--surface3);
  border-style: dashed;
  border-color: var(--border);
  color: var(--text-dim);
  font-size: 22px;
}

.ps-pile-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  border-radius: 4px;
  image-rendering: auto;
  image-rendering: smooth;
}

.ps-pile-label {
  font-size: 9px;
  color: var(--text-dim);
  font-family: 'Cinzel', serif;
  letter-spacing: 1px;
  text-align: center;
  text-transform: uppercase;
}

/* Hero card */
.ps-hero-card-img {
  width: 210px;
  height: auto;
  border: 2px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 0 24px rgba(201,168,76,0.25), 0 4px 20px rgba(0,0,0,0.6);
  cursor: zoom-in;
  transition: transform 0.15s;
  image-rendering: auto;
  image-rendering: smooth;
}
.ps-hero-card-img:hover { transform: scale(1.03); }

.ps-hero-card-placeholder {
  width: 210px;
  height: 290px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-family: 'Cinzel', serif;
  font-size: 13px;
}

/* Pack */
.ps-pack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

/* ---- Center column: hero top (clickable), traits-left + curses-right below ---- */
#ps-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

#ps-hero-area {
  display: flex;
  justify-content: center;
}

/* Row that holds traits (left half) and curses (right half) side by side */
#ps-traits-curses-row {
  display: flex;
  gap: 16px;
  width: 100%;
  align-items: flex-start;
}

#ps-traits-col {
  flex: 1;
  min-width: 0;
}

#ps-curses-col {
  flex: 1;
  min-width: 0;
}

/* ---- Right column (equipment grid) ---- */
#ps-right {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

/* ================================================================ MOVEMENT CARDS (CSS-generated) */
.mv-card {
  width: 68px;
  height: 96px;
  border: 2px solid var(--gold);
  border-radius: 8px;
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  user-select: none;
}
.mv-card:hover {
  border-color: var(--gold-light);
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}
.mv-card.mv-selected {
  border-color: var(--gold-light);
  box-shadow: 0 0 14px rgba(232,201,106,0.6);
  transform: translateY(-6px);
}
.mv-card-small {
  width: 52px;
  height: 72px;
  cursor: default;
}
.mv-card-small:hover {
  transform: none;
  box-shadow: none;
}
.mv-card-small .mv-card-number {
  font-size: 26px;
}
.mv-card-small .mv-card-label {
  font-size: 7px;
  letter-spacing: 1px;
}
.mv-card-small .mv-card-img {
  image-rendering: auto;
  image-rendering: smooth;
  object-fit: fill;
}
.mv-card-number {
  font-family: 'Cinzel', serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.mv-card-label {
  font-family: 'Cinzel', serif;
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 4px;
}
.mv-card-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  border-radius: 6px;
  display: block;
  image-rendering: smooth;
}

.mv-curse-badge {
  background: #b22;
  color: #fff;
  font-weight: bold;
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 10px;
  align-self: center;
  margin-right: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.mv-card-curse-banner {
  position: absolute;
  top: 2px;
  left: 2px;
  background: rgba(180, 30, 30, 0.85);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 3px;
  cursor: pointer;
  z-index: 2;
}
.mv-hare-asterisk {
  position: absolute;
  top: -4px;
  right: 2px;
  font-size: 20px;
  font-weight: 700;
  color: #e8c96a;
  text-shadow: 0 0 6px rgba(0,0,0,0.9);
  pointer-events: none;
}
.mv-hare-note {
  background: #7b4a1a;
  font-size: 10px;
  padding: 2px 8px;
}

/* ================================================================ FIGHT INTRO CINEMATIC */
.fight-intro-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  overflow: hidden;
  z-index: 1;
}
.fight-intro-hero, .fight-intro-monster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s ease;
  opacity: 1;
}
.fight-intro-vs {
  font-family: 'Cinzel', serif;
  font-size: 72px;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(201,168,76,0.6), 0 4px 20px rgba(0,0,0,0.8);
  letter-spacing: 8px;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s ease;
  opacity: 1;
  flex-shrink: 0;
}
.fight-intro-name {
  font-family: 'Cinzel', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--gold-light);
  text-shadow: 0 0 16px rgba(201,168,76,0.4);
  text-align: center;
  letter-spacing: 2px;
}
.fight-intro-card {
  max-height: 640px;
  width: auto;
  border: 2px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 0 24px rgba(201,168,76,0.3), 0 8px 32px rgba(0,0,0,0.6);
}
/* Off-screen positions */
.fight-intro-offscreen-left {
  transform: translate(-120vw, 60vh);
  opacity: 0;
}
.fight-intro-offscreen-top {
  transform: translateY(-120vh);
  opacity: 0;
}
.fight-intro-offscreen-right {
  transform: translate(120vw, 60vh);
  opacity: 0;
}
/* Animate to center */
.fight-intro-animate-in {
  transform: translate(0, 0) !important;
  opacity: 1 !important;
}
.fight-intro-continue {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}
.fight-intro-continue .btn-primary {
  font-size: 18px;
  padding: 12px 36px;
}

/* ================================================================ FLED SCREEN */
.fled-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 48px 32px;
  text-align: center;
}
.fled-title {
  font-family: 'Cinzel', serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(201,168,76,0.5);
  margin-bottom: 16px;
}
.fled-msg {
  font-size: 18px;
  color: var(--text-dim);
}
.flee-move-notice {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.flee-move-box {
  background: var(--surface2);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 32px 48px;
  text-align: center;
  min-width: 280px;
}
.flee-move-title {
  font-family: 'Cinzel', serif;
  font-size: 26px;
  color: var(--gold);
  margin-bottom: 8px;
}
.flee-move-sub {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

/* ================================================================ MINION POOL */
.ps-minion-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
/* Minion card slots reuse the .ps-slot sizing; width set via grid cell */
.ps-minion-slot {
  width: 80px;
  aspect-ratio: 5 / 7;
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 6px 4px 5px;
  gap: 3px;
  transition: box-shadow 0.18s;
}
.ps-minion-slot.ps-minion-empty {
  border: 2px dashed var(--border);
  background: var(--surface3);
}
.ps-minion-slot.ps-minion-filled {
  border: 2px solid var(--trait);
  background: var(--surface2);
  box-shadow: inset 0 0 12px rgba(126,200,126,0.08);
}
.ps-minion-slot .ps-slot-label { font-family: 'Cinzel', serif; font-size: 9px; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; }
.ps-minion-slot.ps-minion-filled .ps-slot-label { color: var(--trait); }
.ps-minion-slot-name { font-size: 10px; color: var(--text); text-align: center; line-height: 1.2; word-break: break-word; }
.ps-minion-slot-str { font-family: 'Cinzel', serif; font-size: 10px; color: var(--trait); margin-top: auto; }

/* ================================================================ MAIN HERO CARD (hero panel, 3rd column) */
#main-hero-card {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}
#main-hero-card img {
  width: 160px;
  height: auto;
  border: 2px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 0 18px rgba(201,168,76,0.2), 0 4px 16px rgba(0,0,0,0.5);
  cursor: zoom-in;
  transition: transform 0.15s;
}
#main-hero-card img:hover { transform: scale(1.05); }

/* ================================================================ CHARLIE WORK MODAL */
#charlie-work-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#charlie-work-modal .modal-box {
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 32px 40px;
  max-width: 420px;
  text-align: center;
}
#charlie-work-modal .modal-title {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  color: var(--gold);
  margin-bottom: 12px;
}
#charlie-work-modal .modal-desc {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 24px;
}
#charlie-work-modal .modal-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* ================================================================ RAKE IT IN MODAL */
#rake-it-in-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 3050;
  display: flex;
  align-items: center;
  justify-content: center;
}
#rake-it-in-modal .modal-box {
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 28px 36px;
  text-align: center;
}
#rake-it-in-modal .modal-title {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  color: var(--gold);
  margin-bottom: 10px;
}
#rake-it-in-modal .modal-desc {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 14px;
}
#rake-it-in-modal .modal-section-label {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 6px;
}
.rake-equip-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 6px;
  transition: border-color 0.15s;
}
.rake-equip-btn:hover { border-color: var(--gold); }
.rake-equip-btn.rake-selected { border-color: var(--gold); background: rgba(255,215,0,0.12); }
.rake-item-thumb {
  width: 80px;
  border-radius: 4px;
  object-fit: cover;
}
.rake-item-name {
  font-size: 11px;
  color: var(--text);
  margin-top: 4px;
  text-align: center;
  max-width: 90px;
  word-break: break-word;
}
.rake-section-label {
  color: var(--text-dim);
  font-size: 13px;
  margin: 12px 0 6px;
}
.rake-items-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
#rake-it-in-modal .modal-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 20px;
}
.rake-draw-item {
  pointer-events: none;
  opacity: 0.85;
}
.rake-draw-icon {
  width: 80px;
  height: 112px;
  border-radius: 6px;
  background: rgba(255,215,0,0.12);
  border: 2px dashed var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--gold);
  font-family: 'Cinzel', serif;
}

/* ================================================================ OCCUPIED SLOT MODAL */
#occupied-slot-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 3100;
  display: flex;
  align-items: center;
  justify-content: center;
}
#occupied-slot-modal .modal-box {
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 28px 36px;
  max-width: 700px;
  width: 100%;
  text-align: center;
}
.occupied-slot-cards {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 32px;
  margin: 16px 0 24px;
}
.occupied-slot-card-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.occupied-slot-card-label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: 'Cinzel', serif;
}
.occupied-slot-card-img {
  width: 200px;
  height: auto;
  border-radius: 8px;
  border: 2px solid var(--border);
  cursor: pointer;
}
.occupied-slot-arrow {
  font-size: 28px;
  color: var(--gold);
  padding-bottom: 16px;
}
#occupied-slot-modal .modal-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  color: var(--gold);
  margin-bottom: 10px;
}
#occupied-slot-modal .modal-desc {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 20px;
}
#occupied-slot-modal .modal-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ================================================================ BATTLE SCREEN GEAR SECTION */
#battle-player-gear {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.battle-gear-label {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.battle-gear-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.battle-gear-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text);
}
.battle-trait-list, .battle-curse-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.battle-trait-tag {
  background: rgba(126,200,126,0.15);
  border: 1px solid var(--trait);
  color: var(--trait);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 11px;
}
.battle-curse-tag {
  background: rgba(224,112,112,0.12);
  border: 1px solid var(--curse);
  color: var(--curse);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 11px;
}

/* Equipment grid: 3-col flex rows */
.ps-equip-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ps-equip-row {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
}

.ps-equip-cell {
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- Card slots (equip + pack) ---- */
.ps-slot {
  width: 100%;
  aspect-ratio: 5 / 7;
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 7px 5px 6px;
  gap: 4px;
  transition: box-shadow 0.18s;
}

/* Pack slots are slightly narrower (grid handles width) */
.ps-pack-grid .ps-slot {
  aspect-ratio: 5 / 7;
}

.ps-slot-empty {
  border: 2px dashed var(--border);
  background: var(--surface3);
}

/* Drag & drop visual feedback */
.ps-dragging { opacity: 0.5; }
.ps-drag-over { outline: 2px solid var(--gold); outline-offset: -2px; }
.ps-slot[draggable="true"] { cursor: grab; }
.ps-slot[draggable="true"]:active { cursor: grabbing; }

/* Disabled slot — shown when a hero has no access to this equipment type (e.g. Gregory's chest) */
.ps-slot-disabled {
  border: 2px dashed rgba(200,60,60,0.45);
  background: var(--surface3);
  position: relative;
  opacity: 0.6;
  pointer-events: none;
}
.ps-slot-disabled::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom right,
      transparent calc(50% - 1px),
      rgba(200,60,60,0.55) calc(50% - 1px),
      rgba(200,60,60,0.55) calc(50% + 1px),
      transparent calc(50% + 1px)),
    linear-gradient(to bottom left,
      transparent calc(50% - 1px),
      rgba(200,60,60,0.55) calc(50% - 1px),
      rgba(200,60,60,0.55) calc(50% + 1px),
      transparent calc(50% + 1px));
  border-radius: 6px;
  pointer-events: none;
}

/* Ghost slot — a transparent copy of a 2H weapon shown in the off-hand, for display only */
.ps-slot-ghost {
  border: 2px solid var(--gold);
  background: var(--surface2);
  opacity: 0.55;
  pointer-events: none;
  cursor: default;
}

.ps-slot-filled {
  border: 2px solid var(--gold);
  background: var(--surface2);
  box-shadow: inset 0 0 14px rgba(201,168,76,0.06);
}

.ps-slot-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  text-align: center;
  line-height: 1.2;
}

.ps-slot-title-above {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  text-align: center;
  line-height: 1.2;
  margin-bottom: 3px;
}

.ps-slot-filled .ps-slot-label {
  color: var(--gold);
}

.ps-slot-divider {
  width: 60%;
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

.ps-slot-name {
  font-size: 12px;
  color: var(--text);
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
}

.ps-slot-sub {
  font-size: 11px;
  color: var(--gold-light);
  text-align: center;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  margin-top: auto;
}

/* ================================================================ VIEW SHEET BUTTON */
#view-sheet-row {
  padding: 6px 12px;
  border-top: 1px solid var(--border);
  flex: 0 0 auto;
  text-align: center;
}
.btn-view-sheet {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold);
  padding: 5px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s;
  text-transform: uppercase;
  width: 100%;
}
.btn-view-sheet:hover {
  background: var(--gold);
  color: var(--bg);
}

/* ================================================================ MOVE CARD IMAGE */
.move-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  position: relative;
  z-index: 1;
}

/* ================================================================ DIRECTION MODAL */
#direction-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 550;
  padding: 20px;
}
.direction-modal-content {
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 28px 36px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.direction-btns {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 18px;
}
.direction-btn {
  min-width: 120px;
  font-size: 14px;
  padding: 12px 20px;
}

/* ================================================================ CARD PREVIEW TOOLTIP */
#card-preview-tooltip {
  position: fixed;
  z-index: 2000;
  pointer-events: none;
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.8);
}
#card-preview-tooltip img {
  display: block;
  width: 340px;
  height: auto;
  border-radius: 4px;
}

/* ================================================================ CARD IMAGE EQUIPMENT SLOTS */
.ps-slot-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
  display: block;
  image-rendering: auto;
  image-rendering: smooth;
}
.ps-slot.ps-slot-card {
  padding: 0;
  overflow: hidden;
  position: relative;
}
.ps-slot-card .ps-slot-label {
  position: absolute;
  top: 3px;
  left: 0;
  right: 0;
  text-align: center;
  text-shadow: 0 1px 4px #000, 0 0 8px #000;
  z-index: 2;
  color: rgba(255,255,255,0.8);
}

/* ================================================================ TRAITS / CURSES ON PLAYER SHEET */
#ps-tc-area {
  width: 100%;
  text-align: center;
}
#ps-traits-curses {
  display: flex;
  flex-direction: row;
  gap: 16px;
  justify-content: center;
  width: 100%;
}
.ps-tc-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.ps-tc-label-trait { color: var(--trait); }
.ps-tc-label-curse { color: var(--curse); }

.ps-tc-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 30px;
}
.ps-tc-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
}
.ps-tc-card.is-trait { color: var(--trait); border-color: #3a5c3a; }
.ps-tc-card.is-curse { color: var(--curse); border-color: #5c3a3a; }
.ps-tc-card:hover { z-index: 10; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
/* Cards stack vertically with a small gap — no overlap */
.ps-tc-card.ps-tc-expanded {
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
  transform: translateY(-4px);
}

/* ================================================================ BATTLE OVERLAY */
#battle-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.battle-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.35);
}
.battle-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
  max-width: 1100px;
  max-height: 96vh;
  width: 100%;
  padding: 20px 16px;
  overflow-y: auto;
  overflow-x: hidden;
}
.battle-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  max-height: 96vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}
.battle-left-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 200px;
  flex-shrink: 0;
  max-height: 96vh;
  overflow-y: auto;
}
.battle-left-section-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.battle-left-card-slot {
  width: 100%;
  aspect-ratio: 5 / 7;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s;
  position: relative;
  margin-bottom: 4px;
}
.battle-left-card-slot:hover { transform: scale(1.04); box-shadow: 0 4px 14px rgba(0,0,0,0.6); }
.battle-left-card-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.battle-left-item-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  font-size: 8px;
  color: #fff;
  text-align: center;
  padding: 2px 3px;
  line-height: 1.2;
}
.battle-left-tag {
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 10px;
  cursor: default;
  transition: background 0.15s;
}
.battle-left-tag.is-trait {
  background: rgba(126,200,126,0.15);
  border: 1px solid var(--trait);
  color: var(--trait);
}
.battle-left-tag.is-curse {
  background: rgba(224,112,112,0.12);
  border: 1px solid var(--curse);
  color: var(--curse);
}

/* Battle equipment grid — mirrors player-sheet layout but smaller */
.battle-equip-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}
.battle-equip-row {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
}
.battle-equip-cell {
  width: 58px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}
.battle-equip-slot {
  width: 54px;
  aspect-ratio: 5 / 7;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform 0.13s, box-shadow 0.13s;
}
.battle-equip-slot.is-empty {
  border-style: dashed;
  opacity: 0.25;
  cursor: default;
}
.battle-equip-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.battle-equip-slot.has-card-preview:hover {
  transform: scale(1.08);
  box-shadow: 0 3px 12px rgba(0,0,0,0.65);
  z-index: 2;
}

.battle-title {
  font-family: 'Cinzel', serif;
  font-size: 28px;
  color: var(--gold-light);
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(0,0,0,0.8);
}
.battle-arena {
  display: flex;
  gap: 32px;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-left: 0;
}
.battle-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 180px;
}
.battle-card-img {
  width: 210px;
  height: auto;
  border: 2px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.7);
  cursor: pointer;
  transition: transform 0.15s;
}
.battle-card-img:hover { transform: scale(1.04); }
.battle-name {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  color: var(--gold);
  letter-spacing: 1px;
}
.battle-str {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-light);
}
.battle-vs {
  font-family: 'Cinzel', serif;
  font-size: 36px;
  color: var(--curse);
  text-shadow: 0 0 12px rgba(224,112,112,0.5);
}
.battle-consumables {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.battle-consumable {
  background: var(--surface2);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 6px 14px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  color: var(--gold);
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.5px;
}
.battle-consumable:hover {
  background: var(--gold);
  color: var(--bg);
  transform: translateY(-2px);
}
.battle-consumable.used {
  opacity: 0.35;
  pointer-events: none;
  text-decoration: line-through;
}
.battle-actions {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}
.battle-result {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  letter-spacing: 2px;
  text-shadow: 0 0 16px rgba(0,0,0,0.6);
  margin-top: 4px;
}
.battle-result.won  { color: var(--trait); }
.battle-result.lost { color: var(--curse); }

/* ================================================================ PRE-FIGHT CONSUMABLE SECTION */
.prefight-consumables-section {
  width: 100%;
  max-width: 640px;
  margin: 6px auto 0;
  background: rgba(0,0,0,0.45);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}
.prefight-consumables-title {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 6px;
  opacity: 0.85;
}
.prefight-consumables-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.prefight-no-consumables {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  text-align: center;
  padding: 4px 0;
}
.prefight-consumable {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
}
.prefight-consumable-img {
  width: 40px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border);
}
.prefight-consumable-info {
  flex: 1;
}
.prefight-consumable-name {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  color: var(--gold);
}
.prefight-consumable-bonus {
  font-size: 11px;
  color: var(--trait);
  margin-top: 2px;
}
.btn-use-consumable {
  background: transparent;
  border: 1px solid var(--trait);
  color: var(--trait);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-use-consumable:hover {
  background: rgba(120,200,80,0.18);
}
.btn-use-consumable-ow {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  margin-left: 6px;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-use-consumable-ow:hover {
  background: rgba(200,160,58,0.18);
}

/* ============================================================ CONSUMABLE CLICKABLE (overworld pack) */
.consumable-clickable {
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.15s, box-shadow 0.15s;
}
.consumable-clickable:hover {
  background: rgba(201,168,76,0.12);
  box-shadow: 0 0 0 1px var(--gold);
}

/* ============================================================ CONSUMABLE MODAL */
.consumable-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.80);
  z-index: 3200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.consumable-modal-box {
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 30px 36px;
  max-width: 680px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.consumable-modal-title {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  color: var(--gold-light);
  letter-spacing: 2px;
}
.consumable-modal-card-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.consumable-modal-card-img {
  width: 160px;
  height: auto;
  border: 2px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.consumable-modal-msg {
  font-size: 14px;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.5;
  max-width: 380px;
}
.consumable-modal-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================ CONSUMABLE RESULT */
.consumable-result-name {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  letter-spacing: 1px;
}
.consumable-result-name.result-trait { color: var(--trait); }
.consumable-result-name.result-curse { color: var(--curse); }
.consumable-result-desc {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.5;
  max-width: 360px;
}
.consumable-result-from {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  opacity: 0.7;
}

/* ============================================================ BYSTANDER PHASE SCREEN */
.bystander-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  width: 100%;
  max-width: 480px;
}
.bystander-token {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
  flex-shrink: 0;
}
.bystander-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bystander-name {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  color: var(--gold);
  letter-spacing: 1px;
}
.bystander-subtitle {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}

/* ============================================================ BOSS DESCRIPTION */
.battle-boss-desc {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  max-width: 520px;
  margin: -6px auto 8px;
  font-style: italic;
  line-height: 1.4;
}

/* ============================================================ TRAIT/CURSE TOOLTIP */
.tc-tooltip {
  position: fixed;
  z-index: 800;
  background: rgba(18, 22, 30, 0.97);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 10px 14px;
  max-width: 280px;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.7);
}
.tc-tooltip.hidden { display: none; }
.tc-tooltip-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}
.tc-tooltip-desc {
  font-size: 12px;
  color: #ccc;
  line-height: 1.5;
}

/* ============================================================ GAIN MODAL */
#gain-modal {
  position: fixed;
  inset: 0;
  z-index: 450;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.72);
}
#gain-modal.hidden { display: none; }
#gain-modal-content {
  background: var(--card-bg, #1a1e28);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 28px;
  max-width: 780px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.8);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 20px 24px;
  align-items: start;
}
#gain-modal-video {
  grid-column: 1;
  grid-row: 1;
  max-width: 280px;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 0 24px rgba(0,0,0,0.7);
  justify-self: center;
  align-self: center;
  display: block;
}
#gain-modal-right {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}
#gain-modal-monster-card img {
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
  max-width: 130px;
  display: block;
}
#gain-modal-continue {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  align-self: center;
}
.gain-modal-item {
  width: 100%;
  padding: 14px 20px;
  border-radius: 8px;
}
.gain-modal-item.is-trait {
  background: rgba(80, 200, 80, 0.12);
  border: 1px solid var(--trait, #5cb85c);
}
.gain-modal-item.is-curse {
  background: rgba(200, 60, 60, 0.12);
  border: 1px solid var(--curse, #d9534f);
}
.gain-modal-type {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted, #888);
  margin-bottom: 4px;
}
.gain-modal-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}
.gain-modal-desc {
  font-size: 13px;
  color: #ccc;
  line-height: 1.5;
  font-style: italic;
}

/* ============================================================ DECK VIEWER MODAL */
#deck-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.78);
}
#deck-viewer-modal.hidden { display: none; }
#deck-viewer-panel {
  background: var(--card-bg, #1a1e28);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 20px 24px;
  max-width: 680px;
  width: 94vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.8);
}
#deck-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#deck-viewer-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
}
#deck-viewer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  overflow-y: auto;
  justify-content: center;
  padding: 4px 0;
}
.dv-card-img {
  width: 90px;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border, #333);
  cursor: default;
}
.dv-empty {
  color: var(--muted, #888);
  font-style: italic;
  padding: 20px;
}
.btn-fight {
  font-size: 16px;
  padding: 10px 32px;
  letter-spacing: 1px;
}
.billfold-flee-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.55);
  border: 1.5px solid #c8a03a;
  border-radius: 10px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.billfold-flee-box:hover { background: rgba(200,160,58,0.18); }
.flee-token-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.8));
}
.btn-flee {
  background: none;
  border: none;
  color: #f0c060;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
}
.btn-flee:hover { text-decoration: underline; }
.btn-flee-swiftness {
  background: rgba(100,200,100,0.12);
  border: 1px solid #5cb85c;
  border-radius: 6px;
  color: #8de88d;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: bold;
  padding: 8px 16px;
}
.btn-flee-swiftness:hover { background: rgba(100,200,100,0.22); }

/* ================================================================ OPTIONS BUTTON */
#options-btn {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 900;
  background: rgba(20,16,10,0.72);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 26px;
  width: 48px;
  height: 48px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
#options-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(20,16,10,0.92);
}

/* ================================================================ OPTIONS MODAL */
#options-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.80);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 950;
}
.options-modal-content {
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 32px 40px;
  min-width: 340px;
  text-align: center;
}
.options-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
}
.options-label {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  min-width: 110px;
  text-align: right;
}
.vol-slider {
  flex: 1;
  accent-color: var(--gold);
  height: 6px;
  cursor: pointer;
}
.vol-val {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  color: var(--gold);
  min-width: 28px;
  text-align: left;
}

/* ================================================================ OFFER ITEM IMAGE */
.offer-item-img {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  display: block;
  transition: transform 0.15s;
}
.offer-item-img:hover { transform: scale(1.03); }

/* ================================================================ CARD ZOOM LIGHTBOX */
#card-zoom-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
}
#card-zoom-modal img {
  max-height: 90vh;
  max-width: 90vw;
  border-radius: 12px;
  box-shadow: 0 0 60px rgba(0,0,0,0.9);
}

/* ============================================================ PLACEMENT MODE */
#ps-placement-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(201,168,76,0.12);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--gold-light);
  gap: 12px;
}
#ps-placement-banner strong { color: var(--gold); }
.ps-discard-btn {
  flex-shrink: 0;
  font-size: 11px;
  padding: 4px 12px;
  border-color: var(--curse);
  color: var(--curse);
}
.ps-discard-btn:hover { background: rgba(224,112,112,0.18); }

.ps-slot-placement-target {
  border-color: var(--gold) !important;
  border-style: dashed !important;
  cursor: pointer;
  animation: ps-pulse 1.3s ease-in-out infinite;
}
.ps-slot-placement-target:hover {
  background: rgba(201,168,76,0.18) !important;
  transform: scale(1.04);
  transition: transform 0.12s, background 0.12s;
}
@keyframes ps-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,168,76,0.0); }
  50%       { box-shadow: 0 0 0 4px rgba(201,168,76,0.35); }
}

/* ============================================================ CARD CONTEXT MENU */
#card-context-menu {
  position: fixed;
  z-index: 3000;
  background: var(--surface2, #1a1e28);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 4px 0;
  min-width: 150px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.85);
  user-select: none;
}
#card-context-menu.hidden { display: none; }
.ctx-menu-item {
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text, #ccc);
  transition: background 0.12s, color 0.12s;
}
.ctx-menu-item:hover {
  background: rgba(201,168,76,0.15);
  color: var(--gold-light);
}
.ctx-danger {
  color: var(--curse, #e07070);
}
.ctx-danger:hover {
  background: rgba(224,112,112,0.15);
  color: var(--curse, #e07070);
}

/* ============================================================ CARD PREVIEW TOOLTIP */
#card-preview-tooltip {
  position: fixed;
  z-index: 2000;
  pointer-events: none;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
}
#card-preview-tooltip img {
  width: 340px;
  height: auto;
  border-radius: 8px;
  display: block;
}
#card-preview-tooltip.hidden { display: none; }

/* ============================================================ MYSTERY EVENT — FULL SCREEN */
.mystery-fullscreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}
.mystery-fs-inner {
  position: relative;
  max-width: 600px;
  width: 90%;
  background: rgba(20, 16, 12, 0.92);
  border: 2px solid var(--gold);
  border-radius: 16px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 0 60px rgba(201,168,76,0.25);
  animation: mysteryFadeIn 0.4s ease;
  max-height: 85vh;
  overflow-y: auto;
}
@keyframes mysteryFadeIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.mystery-fs-title {
  font-size: 1.8em;
  color: var(--gold-light);
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  margin-bottom: 6px;
}
.mystery-fs-desc {
  color: var(--text-dim);
  font-size: 1.05em;
  font-style: italic;
  margin-bottom: 16px;
}
.mystery-fs-img {
  width: 100%;
  max-width: 220px;
  max-height: 300px;
  object-fit: contain;
  border-radius: 10px;
  margin: 8px auto 14px;
  display: block;
  border: 1px solid var(--border);
}
.mystery-fs-body { margin-top: 12px; }
.mystery-speech-bubble {
  background: rgba(30, 26, 22, 0.85);
  border: 2px solid var(--gold);
  border-radius: 16px;
  padding: 14px 20px;
  margin: 14px auto;
  max-width: 400px;
  text-align: center;
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  font-size: 1em;
  font-style: italic;
  position: relative;
}
.mystery-info {
  color: var(--text);
  margin-bottom: 14px;
  font-size: 1.05em;
}
.mystery-section-label {
  font-family: 'Cinzel', serif;
  font-size: 0.85em;
  color: var(--gold);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 12px 0 6px;
}
.mystery-outcome-text {
  color: var(--gold-light);
  font-size: 1.2em;
  margin: 16px 0;
  font-weight: bold;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
.mystery-item-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
}
.mystery-selectable-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 10px;
  min-width: 90px;
  max-width: 120px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  background: rgba(30, 26, 22, 0.7);
}
.mystery-selectable-item:hover {
  border-color: var(--gold);
  background: rgba(201,168,76,0.12);
}
.mystery-selectable-item.selected {
  border-color: var(--gold-light);
  background: rgba(201,168,76,0.25);
  box-shadow: 0 0 12px rgba(201,168,76,0.3);
}
.mystery-item-thumb {
  width: 70px;
  height: auto;
  border-radius: 4px;
  margin-bottom: 4px;
}
.mystery-item-label {
  font-size: 0.82em;
  color: var(--text);
  word-break: break-word;
  text-align: center;
}
.mystery-btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.mystery-spin-btn {
  font-size: 1.15em;
  padding: 12px 36px;
}
.mystery-result-text {
  font-size: 1.2em;
  color: var(--gold-light);
  margin: 20px 0;
  font-weight: bold;
}
/* Fairy King reveal flash */
.fk-reveal-flash {
  animation: fkFlash 0.6s ease;
}
@keyframes fkFlash {
  0%   { opacity: 0; transform: scale(1.1); filter: brightness(3); }
  50%  { opacity: 1; filter: brightness(2); }
  100% { opacity: 1; transform: scale(1); filter: brightness(1); }
}

/* ================================================================ PROFILE SCREEN */
#profile-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.menu-heading {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  color: var(--gold);
  margin-bottom: 18px;
}
.profile-input {
  display: block;
  margin: 0 auto 14px;
  width: 280px;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  font-family: 'Crimson Text', serif;
  font-size: 16px;
  text-align: center;
}
.profile-input:focus {
  outline: none;
  border-color: var(--gold);
}
.btn-profile {
  display: block;
  width: 280px;
  margin: 0 auto 8px;
  padding: 12px 0;
  border: 2px solid var(--gold);
  border-radius: 8px;
  background: transparent;
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.18s;
}
.btn-profile:hover {
  background: var(--gold);
  color: var(--bg);
}

/* ================================================================ MAIN MENU */
#main-menu-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.main-menu-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.btn-menu {
  width: 280px;
  padding: 14px 0;
  font-size: 18px;
  letter-spacing: 1px;
}

/* ================================================================ IN-GAME SIDE BUTTONS */
#game-side-buttons {
  position: fixed;
  top: 68px;
  right: 14px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#saveload-btn, #achievements-btn-ingame {
  background: rgba(20,16,10,0.72);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 22px;
  width: 48px;
  height: 48px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
#saveload-btn:hover, #achievements-btn-ingame:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(20,16,10,0.92);
}

/* ================================================================ SAVE/LOAD MODAL */
#saveload-modal, #menu-load-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.80);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 960;
}
.saveload-modal-content {
  max-width: 480px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
}
.saveload-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}
.saveload-tab {
  padding: 8px 24px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-family: 'Cinzel', serif;
  cursor: pointer;
  transition: all 0.18s;
}
.saveload-tab.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.1);
}
.save-slot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 6px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  cursor: pointer;
  transition: border-color 0.15s;
}
.save-slot:hover { border-color: var(--gold); }
.save-slot.selected { border-color: var(--gold); background: rgba(201,168,76,0.08); }
.slot-label {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  color: var(--gold);
  min-width: 56px;
}
.slot-info {
  flex: 1;
  color: var(--text);
  font-size: 14px;
}
.slot-info.slot-empty { color: var(--text-dim); font-style: italic; }
.slot-time { color: var(--text-dim); font-size: 12px; }
.saveload-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

/* ================================================================ OVERWRITE MODAL */
#overwrite-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 970;
}

/* ================================================================ ACHIEVEMENTS MODAL */
#achievements-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.80);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 960;
}
.achievements-modal-content {
  max-width: 520px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
}
.achievement-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 4px;
  border-radius: 6px;
  background: var(--surface2);
}
.achievement-row.achieved { background: rgba(126,200,126,0.08); }
.achievement-check { font-size: 18px; }
.achievement-desc {
  font-size: 14px;
  color: var(--text);
}
.achievement-row.achieved .achievement-desc { color: var(--trait); }

/* ================================================================ ACHIEVEMENT POPUP */
#achievement-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}
.achievement-popup-content {
  background: var(--surface);
  border: 3px solid var(--gold);
  border-radius: 16px;
  padding: 32px 40px;
  text-align: center;
  max-width: 420px;
  animation: achievePop 0.4s ease;
}
@keyframes achievePop {
  0%   { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.achievement-popup-icon { font-size: 48px; margin-bottom: 8px; }
.achievement-popup-title {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  color: var(--gold);
  margin-bottom: 8px;
}
.achievement-popup-name {
  font-size: 16px;
  color: var(--trait);
  margin-bottom: 20px;
}
