/* Dice Dungeon Delver — 16-Bit Gothic Roguelike Dice Deckbuilder Styles */
:root {
  --bg-deep: #0b0812;
  --panel-dark: rgba(16, 12, 26, 0.92);
  --wood-rim: #4a2a16;
  --wood-hi: #7c4a26;
  --gold: #facc15;
  --gold-dim: #ca8a04;
  --felt-dark: #0c3322;
  --felt-mid: #134a31;
  --crimson: #ef4444;
  --crimson-hi: #f43f5e;
  --cyan: #38bdf8;
  --emerald: #22c55e;
  --violet: #a855f7;
  --text: #f8fafc;
  --muted: #94a3b8;
  --font-pixel: 'Press Start 2P', 'Silkscreen', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100dvh;
  background: radial-gradient(circle at 50% 0%, #1d142c 0%, #0b0812 68%);
  color: var(--text);
  font-family: var(--font-ui);
  overflow-x: hidden;
  user-select: none;
}

.pixel-font {
  font-family: var(--font-pixel);
}

#app {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 6px 10px 52px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 100dvh;
}

/* Challenge Banner */
.challenge-banner {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.28), rgba(250, 204, 21, 0.22));
  border: 2px solid var(--gold);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  color: #fef08a;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.25);
}

.hidden {
  display: none !important;
}

/* Top HUD Bar */
.top-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: linear-gradient(180deg, rgba(28, 20, 44, 0.96), rgba(14, 10, 24, 0.96));
  border: 2px solid #4c3b69;
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  flex-wrap: wrap;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(10, 8, 18, 0.85);
  border: 1.5px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.hud-pill.floor-pill {
  border-color: var(--gold-dim);
  color: var(--gold);
  font-family: var(--font-pixel);
  font-size: 10px;
}

.hud-pill.hp-pill {
  border-color: rgba(239, 68, 68, 0.55);
  color: #fca5a5;
}

.hud-pill.block-pill {
  border-color: rgba(56, 189, 248, 0.55);
  color: #93c5fd;
}

.hud-pill.gold-pill {
  border-color: rgba(250, 204, 21, 0.55);
  color: #fde047;
}

.hud-pill.hands-pill {
  border-color: rgba(168, 85, 247, 0.6);
  color: #e9d5ff;
}

.hud-pill.daily-pill {
  border-color: #22d3ee;
  background: rgba(8, 51, 68, 0.7);
  color: #67e8f9;
  font-size: 11px;
}

.icon-btn {
  background: rgba(30, 23, 48, 0.95);
  color: var(--text);
  border: 1.5px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.12s, background 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.icon-btn:hover {
  border-color: var(--gold);
  background: rgba(55, 42, 85, 0.95);
}

.icon-btn:active {
  transform: scale(0.95);
}

/* Torchlit Dungeon Arena */
.arena-wrap {
  position: relative;
  width: 100%;
  height: 272px;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid var(--wood-hi);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.65), inset 0 0 18px rgba(0, 0, 0, 0.7);
  background: #120e1b;
}

#arenaCanvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}

/* Floating Monster HUD Overlay inside Arena */
.enemy-hud-top {
  position: absolute;
  top: 7px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.enemy-nameplate {
  background: rgba(11, 8, 20, 0.84);
  border: 2px solid rgba(250, 204, 21, 0.55);
  border-radius: 8px;
  padding: 5px 10px;
  min-width: 180px;
  max-width: 64%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
}

.enemy-name {
  font-family: var(--font-pixel);
  font-size: 10.5px;
  color: #fef08a;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.enemy-sub {
  font-size: 10.5px;
  color: #cbd5e1;
  font-weight: 700;
  margin-top: 2px;
}

.enemy-hp-track {
  margin-top: 5px;
  height: 13px;
  background: #1f1018;
  border: 1.5px solid #52202e;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.enemy-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #dc2626, #f43f5e, #fb923c);
  transition: width 0.25s ease-out;
  width: 100%;
}

.enemy-hp-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 2px #000;
}

.enemy-intent-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.intent-badge {
  background: rgba(127, 29, 29, 0.9);
  border: 2px solid #fca5a5;
  color: #fff;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.poison-badge {
  background: rgba(20, 83, 45, 0.92);
  border: 1.5px solid #4ade80;
  color: #bbf7d0;
  border-radius: 8px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.curse-bar {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(24, 8, 34, 0.9);
  border: 1.5px solid #f43f5e;
  color: #fda4af;
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 94%;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

/* Equipped Relics Strip (Balatro Jokers!) */
.relics-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(17, 12, 28, 0.92);
  border: 2px solid #3f305b;
  border-radius: 10px;
  padding: 5px 8px;
  min-height: 46px;
  overflow-x: auto;
}

.relics-label {
  font-family: var(--font-pixel);
  font-size: 8.5px;
  color: #c4b5fd;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 2px;
}

.relics-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.relic-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(180deg, #271b40, #171028);
  border: 2px solid #6d4aff;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s;
}

.relic-chip.rarity-rare {
  border-color: #f43f5e;
  background: linear-gradient(180deg, #3b1328, #1c0a16);
}

.relic-chip.rarity-uncommon {
  border-color: #38bdf8;
  background: linear-gradient(180deg, #132c45, #0b1829);
}

.relic-chip.empty-slot {
  border: 1.5px dashed rgba(148, 163, 184, 0.25);
  background: rgba(15, 11, 24, 0.5);
  color: rgba(148, 163, 184, 0.45);
  font-size: 10px;
  cursor: default;
}

.relic-chip.popping {
  transform: translateY(-6px) scale(1.14);
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.85);
  z-index: 4;
}

.relic-pop-tag {
  position: absolute;
  top: -19px;
  left: 50%;
  transform: translateX(-50%);
  background: #facc15;
  color: #140a1f;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

/* Carved Mahogany & Dark-Emerald Felt Dice Table */
.felt-table {
  position: relative;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(25, 96, 62, 0.88) 0%, rgba(11, 48, 32, 0.96) 72%, rgba(7, 30, 20, 0.99) 100%);
  border: 4px solid var(--wood-hi);
  outline: 2px solid #241208;
  border-radius: 14px;
  padding: 10px 12px 12px;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.68),
    inset 0 0 0 2px rgba(250, 204, 21, 0.24),
    inset 0 0 36px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Balatro-Style Live BASE × MULT = DMG Scoreboard */
.combo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(10, 14, 18, 0.84);
  border: 2px solid rgba(250, 204, 21, 0.45);
  border-radius: 10px;
  padding: 7px 12px;
  flex-wrap: wrap;
}

.combo-hand-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 130px;
}

.combo-hand-name {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: #fde047;
  text-shadow: 0 2px 0 #1a0f08;
}

.cascade-ticker {
  font-size: 11px;
  font-weight: 800;
  color: #7dd3fc;
  min-height: 15px;
}

.formula-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-pixel);
}

.chip-box {
  background: linear-gradient(180deg, #1d4ed8, #1e3a8a);
  border: 2px solid #60a5fa;
  border-radius: 8px;
  padding: 5px 10px;
  color: #ffffff;
  font-size: 13px;
  min-width: 64px;
  text-align: center;
  transition: transform 0.1s;
}

.mult-box {
  background: linear-gradient(180deg, #dc2626, #991b1b);
  border: 2px solid #fb7185;
  border-radius: 8px;
  padding: 5px 10px;
  color: #ffffff;
  font-size: 13px;
  min-width: 58px;
  text-align: center;
  transition: transform 0.1s;
}

.total-box {
  background: linear-gradient(180deg, #eab308, #b45309);
  border: 2px solid #fef08a;
  border-radius: 8px;
  padding: 5px 11px;
  color: #160c02;
  font-size: 14px;
  min-width: 82px;
  text-align: center;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.35);
  transition: transform 0.1s;
}

.formula-op {
  font-size: 12px;
  color: #fde047;
  font-weight: 900;
}

.pop-bump {
  transform: scale(1.18) !important;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.85) !important;
}

/* 5-Die Interactive Tray */
.dice-tray {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.die-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px 5px;
  border-radius: 12px;
  background: rgba(7, 25, 17, 0.72);
  border: 2px solid rgba(148, 163, 184, 0.24);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s, box-shadow 0.12s, background 0.12s;
  color: var(--text);
}

.die-card:hover {
  transform: translateY(-3px);
  border-color: rgba(250, 204, 21, 0.65);
}

.die-card.scored {
  background: rgba(34, 84, 55, 0.82);
  border-color: rgba(250, 204, 21, 0.65);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.22);
}

.die-card.locked {
  border-color: var(--gold);
  background: rgba(66, 48, 10, 0.72);
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(250, 204, 21, 0.32);
}

.die-card.curse-locked {
  border-color: #f43f5e;
  background: rgba(88, 14, 34, 0.76);
  cursor: not-allowed;
}

.die-card.scroll-target {
  border-color: #38bdf8;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.85);
  animation: pulseTarget 0.7s infinite alternate;
}

@keyframes pulseTarget {
  from { transform: translateY(-2px) scale(1); }
  to { transform: translateY(-5px) scale(1.04); }
}

.die-card.cascading {
  transform: translateY(-9px) scale(1.1);
  border-color: #ffffff;
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.95);
  z-index: 3;
}

.die-canvas {
  width: 64px;
  height: 64px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  image-rendering: pixelated;
  display: block;
}

.die-card.rolling .die-canvas {
  animation: dieTumble 0.24s linear infinite;
}

@keyframes dieTumble {
  0% { transform: rotate(-9deg) scale(0.95); }
  50% { transform: rotate(9deg) scale(1.06); }
  100% { transform: rotate(-9deg) scale(0.95); }
}

.die-type-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #e2e8f0;
  white-space: nowrap;
}

.die-status {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #94a3b8;
  white-space: nowrap;
}

.die-card.locked .die-status {
  background: var(--gold);
  color: #160c02;
}

.die-card.curse-locked .die-status {
  background: #f43f5e;
  color: #fff;
}

.prism-tag {
  position: absolute;
  top: 3px;
  right: 4px;
  background: linear-gradient(90deg, #06b6d4, #a855f7);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Action Controls & Scrolls Row */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.scrolls-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.scroll-btn {
  background: linear-gradient(180deg, #1e293b, #0f172a);
  border: 2px solid #38bdf8;
  color: #e0f2fe;
  border-radius: 9px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.1s, box-shadow 0.12s;
}

.scroll-btn:hover {
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

.scroll-btn.active {
  background: #0284c7;
  border-color: #fef08a;
  color: #fff;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.65);
}

.scroll-empty {
  font-size: 11px;
  color: rgba(203, 213, 225, 0.6);
  font-weight: 700;
}

.main-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.btn {
  border: none;
  border-radius: 10px;
  font-family: var(--font-pixel);
  font-size: 11px;
  padding: 11px 16px;
  cursor: pointer;
  transition: transform 0.1s, filter 0.12s, box-shadow 0.12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: translateY(2px) scale(0.98);
}

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

.btn-reroll {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  border: 2px solid #93c5fd;
  box-shadow: 0 4px 0 #1e3a8a, 0 6px 14px rgba(37, 99, 235, 0.35);
}

.btn-reroll:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn-strike {
  background: linear-gradient(180deg, #facc15 0%, #f97316 55%, #dc2626 100%);
  color: #160903;
  border: 2px solid #fef08a;
  box-shadow: 0 4px 0 #7f1d1d, 0 6px 20px rgba(249, 115, 22, 0.55);
  font-size: 12px;
  padding: 11px 20px;
}

.btn-strike:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 4px 0 #7f1d1d, 0 0 24px rgba(250, 204, 21, 0.75);
}

.btn-secondary {
  background: linear-gradient(180deg, #334155, #1e293b);
  color: #f8fafc;
  border: 2px solid #64748b;
  box-shadow: 0 3px 0 #0f172a;
}

.btn-daily {
  background: linear-gradient(180deg, #06b6d4, #0e7490);
  color: #ffffff;
  border: 2px solid #67e8f9;
  box-shadow: 0 4px 0 #164e63;
}

.btn-vault {
  background: linear-gradient(180deg, #9333ea, #6b21a8);
  color: #ffffff;
  border: 2px solid #d8b4fe;
  box-shadow: 0 4px 0 #3b0764;
}

/* Modals (Title, Tavern Shop, Vault of Fate, Leaderboard, Run Summary, Hand Guide) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 4, 14, 0.84);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 12px 54px;
}

.modal-card {
  width: 100%;
  max-width: 680px;
  max-height: calc(100dvh - 68px);
  overflow-y: auto;
  background: linear-gradient(180deg, #1b132e 0%, #100b1d 100%);
  border: 3px solid var(--gold);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(250, 204, 21, 0.16);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1.5px solid rgba(250, 204, 21, 0.28);
  padding-bottom: 8px;
}

.modal-title {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--gold);
  line-height: 1.35;
}

.title-hero {
  text-align: center;
  padding: 6px 0 4px;
}

.title-logo {
  font-family: var(--font-pixel);
  font-size: 22px;
  line-height: 1.35;
  color: #fef08a;
  text-shadow: 0 4px 0 #7c2d12, 0 0 22px rgba(250, 204, 21, 0.45);
  margin: 0 0 8px;
}

.title-tagline {
  font-size: 13px;
  color: #cbd5e1;
  font-weight: 700;
  margin: 0 auto 10px;
  max-width: 520px;
}

.title-stats-strip {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.title-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.title-actions .btn-full {
  grid-column: 1 / -1;
  padding: 14px 20px;
  font-size: 13px;
}

.daily-card-box {
  background: rgba(8, 51, 68, 0.55);
  border: 1.5px solid #22d3ee;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12px;
  color: #cffafe;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* Tavern Shop Grid */
.shop-section-title {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: #fde047;
  margin: 2px 0 6px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 8px;
}

.shop-item {
  background: rgba(24, 18, 42, 0.94);
  border: 2px solid #4c3b69;
  border-radius: 11px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 7px;
}

.shop-item.sold,
.shop-item.maxed {
  opacity: 0.42;
}

.shop-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-weight: 900;
  font-size: 12.5px;
  color: #f8fafc;
}

.shop-item-desc {
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.35;
}

.shop-buy-btn {
  width: 100%;
  background: linear-gradient(180deg, #eab308, #ca8a04);
  color: #160c02;
  border: 1.5px solid #fef08a;
  border-radius: 8px;
  padding: 6px 8px;
  font-weight: 900;
  font-size: 11.5px;
  cursor: pointer;
}

.shop-buy-btn:disabled {
  background: #334155;
  border-color: #475569;
  color: #94a3b8;
  cursor: not-allowed;
}

/* Die Forge Slot Picker */
.slot-picker-box {
  background: rgba(8, 36, 26, 0.92);
  border: 2px solid var(--gold);
  border-radius: 10px;
  padding: 10px;
}

.slot-picker-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.slot-pick-btn {
  background: rgba(15, 23, 42, 0.9);
  border: 2px solid #38bdf8;
  border-radius: 9px;
  padding: 7px 4px;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 3px;
  min-width: 0;
  line-height: 1.25;
  transition: transform 0.1s, border-color 0.12s, background 0.12s, box-shadow 0.12s;
}

.slot-pick-btn:hover:not(:disabled) {
  border-color: var(--gold);
  background: rgba(30, 58, 138, 0.6);
  transform: translateY(-2px);
}

.slot-pick-btn.is-standard {
  border-color: #34d399;
  background: rgba(6, 78, 59, 0.58);
  box-shadow: inset 0 0 12px rgba(52, 211, 153, 0.18);
}

.slot-pick-btn.is-standard:hover:not(:disabled) {
  border-color: #6ee7b7;
  background: rgba(16, 118, 86, 0.75);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.35);
}

.slot-pick-btn.is-replace {
  border-color: #f59e0b;
  background: rgba(120, 53, 15, 0.45);
}

.slot-pick-btn.is-replace:hover:not(:disabled) {
  border-color: #fde047;
  background: rgba(146, 64, 14, 0.65);
}

.slot-pick-btn.is-same,
.slot-pick-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  border-color: #475569;
  background: rgba(15, 23, 42, 0.55);
  color: #94a3b8;
  box-shadow: none;
  transform: none;
}

.slot-pick-num {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: #cbd5e1;
}

.slot-pick-cur {
  font-size: 10.5px;
  font-weight: 900;
  color: #f8fafc;
}

.slot-pick-sub {
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.slot-pick-btn.is-standard .slot-pick-sub {
  color: #6ee7b7;
}

.slot-pick-btn.is-replace .slot-pick-sub {
  color: #fcd34d;
}

.slot-pick-btn.is-same .slot-pick-sub {
  color: #94a3b8;
}

/* Vault of Fate & Cliffhanger */
.cliffhanger-box {
  background: linear-gradient(90deg, rgba(147, 51, 234, 0.26), rgba(56, 189, 248, 0.18));
  border: 1.5px solid #c084fc;
  border-radius: 10px;
  padding: 9px 12px;
}

.cliff-bar-track {
  height: 10px;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid rgba(192, 132, 252, 0.45);
}

.cliff-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #facc15);
  transition: width 0.3s ease;
}

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

.stat-box {
  background: rgba(15, 11, 28, 0.9);
  border: 1.5px solid #3f305b;
  border-radius: 10px;
  padding: 8px 10px;
}

.stat-k {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 700;
}

.stat-v {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--gold);
  margin-top: 4px;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.lb-table th, .lb-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.lb-table th {
  color: #fde047;
  font-size: 11px;
}

.lb-submit-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.lb-input {
  flex: 1;
  background: #0f172a;
  border: 2px solid #475569;
  border-radius: 8px;
  padding: 8px 10px;
  color: #fff;
  font-weight: 800;
  font-size: 12.5px;
}

.hand-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px;
}

.hand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 800;
}

.toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  background: #140c24;
  border: 2px solid var(--gold);
  color: #fef08a;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

/* Mobile 390x844 Polish — Zero Horizontal Overflow! */
@media (max-width: 600px) {
  #app {
    padding: 4px 6px 56px;
    gap: 5px;
  }

  .top-hud {
    padding: 5px 6px;
    gap: 4px;
  }

  .hud-pill {
    padding: 3px 6px;
    font-size: 11px;
  }

  .hud-pill.floor-pill {
    font-size: 8.5px;
  }

  .icon-btn {
    padding: 4px 6px;
    font-size: 11px;
  }

  .arena-wrap {
    height: 204px;
  }

  .relics-strip {
    padding: 4px 6px;
    gap: 4px;
    min-height: 38px;
  }

  .relics-label {
    font-size: 7.5px;
  }

  .relic-chip {
    padding: 3px 5px;
    font-size: 9.5px;
  }

  .relic-chip.empty-slot {
    padding: 3px 4px;
    font-size: 8.5px;
  }

  .enemy-nameplate {
    min-width: 145px;
    padding: 4px 7px;
  }

  .enemy-name {
    font-size: 8.5px;
  }

  .intent-badge {
    font-size: 10px;
    padding: 3px 6px;
  }

  .felt-table {
    padding: 8px 7px 9px;
    gap: 7px;
  }

  .combo-banner {
    padding: 6px 8px;
    gap: 5px;
  }

  .combo-hand-name {
    font-size: 9.5px;
  }

  .chip-box, .mult-box, .total-box {
    font-size: 10.5px;
    padding: 4px 6px;
    min-width: 44px;
  }

  .dice-tray {
    gap: 5px;
  }

  .die-card {
    padding: 4px 2px 4px;
    border-radius: 9px;
  }

  .die-type-label {
    font-size: 8.5px;
  }

  .die-status {
    font-size: 8px;
    padding: 1px 4px;
  }

  .controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .main-actions {
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 6px;
  }

  .btn {
    font-size: 10px;
    padding: 11px 8px;
  }

  .btn-strike {
    font-size: 11px;
    padding: 11px 10px;
  }

  .title-logo {
    font-size: 16px;
  }

  .title-actions {
    grid-template-columns: 1fr;
  }

  .modal-card {
    padding: 13px 12px;
  }

  .slot-picker-box {
    padding: 8px 7px;
  }

  .slot-picker-row {
    gap: 4px;
  }

  .slot-pick-btn {
    padding: 6px 2px;
    font-size: 9px;
    gap: 2px;
  }

  .slot-pick-num {
    font-size: 8px;
  }

  .slot-pick-cur {
    font-size: 9px;
  }

  .slot-pick-sub {
    font-size: 8px;
  }
}
