/* Crate Game — UI */

:root {
  --bg: #0f0e14;
  --bg-card: #1a1822;
  --border: #2d2a38;
  --text: #e8e4f0;
  --text-dim: #8a8498;
  --accent: #c9a227;
  --accent-glow: rgba(201, 162, 39, 0.35);
  --wood: #8b6914;
  --wood-dark: #5c4810;
  --iron: #6b7280;
  --iron-dark: #374151;
  --gold: #d4af37;
  --gold-dark: #9a7b0a;
  --font-title: "Righteous", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  padding: 2rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.title {
  font-family: var(--font-title);
  font-size: clamp(2rem, 6vw, 3rem);
  margin: 0 0 0.25rem;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--gold) 0%, var(--accent) 50%, #e8c547 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0;
  max-width: 560px;
  margin-inline: auto;
}

/* Turn bar */
.turn-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%;
  max-width: 560px;
}

.turn-label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.turn-name {
  font-weight: 600;
  color: var(--accent);
  flex: 1;
}

.turn-end {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  background: var(--border);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.turn-end:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* Two characters */
.characters-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  width: 100%;
  max-width: 900px;
  margin-top: 1.5rem;
}

.character-column {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.character-name-title {
  margin-bottom: 0.5rem;
}

.character-column .panel-hint {
  margin-bottom: 0.35rem;
}

.character-column .equipped-slots {
  margin-bottom: 0.75rem;
}

.inv-hint {
  margin-top: 0.5rem;
}

.character-column .inventory-list {
  min-height: 60px;
}

/* Equipped section (legacy / shared styles) */
.equipped-section {
  width: 100%;
  max-width: 560px;
  margin-bottom: 2rem;
}

.panel-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  margin: 0 0 0.25rem;
  color: var(--text);
}

.panel-title .slot-count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-dim);
}

.panel-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0 0 0.75rem;
}

.equipped-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.equipped-slot {
  min-height: 88px;
  padding: 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.35rem;
}

.equipped-slot.empty {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.equipped-slot.filled .equipped-slot-tier {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #fff;
}

.equipped-slot-name {
  font-size: 0.85rem;
  line-height: 1.2;
  word-break: break-word;
}

.equipped-slot-desc {
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.2;
  display: block;
  max-height: 2.4em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.equipped-slot-stats {
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.2;
}

.equipped-slot-unequip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  margin-top: 0.25rem;
  transition: background 0.2s, color 0.2s;
}

.equipped-slot-unequip:hover {
  background: var(--border);
  color: var(--text);
}

/* Crates row */
.crates {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
}

.crate {
  --crate-size: 140px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.crate:hover {
  transform: scale(1.05);
}

.crate:active {
  transform: scale(0.98);
}

.crate:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 8px;
}

/* Crate visual — CSS “crate” box */
.crate-visual {
  width: var(--crate-size);
  height: var(--crate-size);
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: visible;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.crate:hover .crate-visual {
  transform: translateY(-4px);
}

.crate-body {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  border: 3px solid currentColor;
  background: currentColor;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
}

.crate-lid {
  position: absolute;
  top: -6px;
  left: 4px;
  right: 4px;
  height: 14px;
  border-radius: 4px 4px 0 0;
  border: 2px solid currentColor;
  background: currentColor;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.2);
}

.crate-label {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: rgba(0,0,0,0.5);
  text-shadow: 0 1px 0 rgba(255,255,255,0.2);
}

.crate-wood .crate-body,
.crate-wood .crate-lid { color: var(--wood); border-color: var(--wood-dark); }
.crate-wood .crate-body { background: linear-gradient(145deg, #a07818 0%, var(--wood) 40%, var(--wood-dark) 100%); }
.crate-wood:hover .crate-visual { box-shadow: 0 12px 28px rgba(139, 105, 20, 0.4); }

.crate-iron .crate-body,
.crate-iron .crate-lid { color: var(--iron); border-color: var(--iron-dark); }
.crate-iron .crate-body { background: linear-gradient(145deg, #7c8494 0%, var(--iron) 40%, var(--iron-dark) 100%); }
.crate-iron:hover .crate-visual { box-shadow: 0 12px 28px rgba(107, 114, 128, 0.45); }

.crate-gold .crate-body,
.crate-gold .crate-lid { color: var(--gold); border-color: var(--gold-dark); }
.crate-gold .crate-body { background: linear-gradient(145deg, #e8c547 0%, var(--gold) 40%, var(--gold-dark) 100%); }
.crate-gold:hover .crate-visual { box-shadow: 0 12px 32px var(--accent-glow); }

.crate-name {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Inventory section */
.inventory-section {
  width: 100%;
  max-width: 560px;
  margin-top: 2rem;
}

.inventory-list {
  min-height: 80px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
}

.inventory-empty {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 1rem;
  text-align: center;
}

.inventory-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.5rem 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.35rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.inventory-row:last-child {
  margin-bottom: 0;
}

.inventory-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.inventory-row-tier {
  flex-shrink: 0;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
}

.inventory-row-name {
  flex: 1 1 8ch;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: break-word;
}

.inventory-row-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  flex: 0 0 100%;
  width: 100%;
  order: 1;
  margin-top: 0.15rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: break-word;
}

.inventory-row-stats {
  font-size: 0.75rem;
  color: var(--text-dim);
  flex-shrink: 0;
  text-align: right;
}

.inventory-row-equip {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  background: var(--border);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.inventory-row-equip:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* Result overlay */
.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.result-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.result-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
}

.result-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 48px rgba(0,0,0,0.5);
  animation: resultIn 0.4s ease;
}

@keyframes resultIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.result-crate-preview {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  border-radius: 8px;
  border: 2px solid var(--border);
}

.result-crate-preview.wood { background: linear-gradient(145deg, #a07818, var(--wood)); }
.result-crate-preview.iron { background: linear-gradient(145deg, #7c8494, var(--iron)); }
.result-crate-preview.gold { background: linear-gradient(145deg, #e8c547, var(--gold)); }

.result-phase.hidden {
  display: none !important;
}

.result-hint {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0 0 0.75rem;
}

.result-choices {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.result-choice-btn {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 0.6rem 1rem;
  text-align: left;
  background: var(--border);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.result-choice-btn:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.result-choice-btn.result-choice-blind {
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
  min-width: 3rem;
}

.result-item-stats {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.result-stat {
  padding: 0.25rem 0.5rem;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
}

.result-stat.none {
  font-style: italic;
}

.result-item-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin: 0 0 1rem;
  font-style: italic;
}

.result-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--text-dim);
  margin: 0 0 0.5rem;
}

.result-item {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.3;
  word-break: break-word;
}

.result-tier {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 1rem;
}

.result-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.result-retain {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 0.6rem 1.25rem;
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.result-retain:hover {
  background: var(--border);
  color: var(--text);
}

.result-retain:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.result-recycle {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 0.6rem 1.25rem;
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.result-recycle:hover {
  background: var(--border);
  color: var(--text);
}

.result-close {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.65rem 1.25rem;
  background: var(--border);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.result-close:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.result-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Adventure & Encounter section */
.adventure-section {
  width: 100%;
  max-width: 900px;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stage-block {
  margin-bottom: 1.25rem;
}

.stage-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.stage-name-input {
  font-family: var(--font-mono);
  font-size: 1rem;
  width: 100%;
  max-width: 320px;
  padding: 0.5rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.stage-desc-input {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  resize: vertical;
  min-height: 60px;
}

.monster-block {
  margin-bottom: 1.5rem;
}

.monster-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.monster-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.monster-empty {
  color: var(--text-dim);
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.monster-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.monster-presets-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-right: 0.25rem;
}

.monster-preset-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  background: var(--border);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.monster-preset-btn:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.monster-stats.hp-low .monster-hp-fill { background: #e65100; }
.monster-stats.hp-down .monster-hp-fill { background: #b71c1c; }

.monster-name {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.monster-hp {
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.monster-hp input {
  width: 3rem;
  padding: 0.2rem 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  text-align: center;
}

.monster-hp-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.monster-hp-fill {
  display: block;
  height: 100%;
  background: #4caf50;
  border-radius: 3px;
  transition: width 0.2s ease;
}

.monster-ac {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.monster-clear-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.monster-clear-btn:hover {
  background: var(--border);
  color: var(--text);
}

.monster-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.monster-attacks-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-right: 0.25rem;
}

.encounter-btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.45rem 0.85rem;
  background: var(--border);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.encounter-btn:hover:not(:disabled) {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

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

.encounter-attack-monster {
  background: #1b5e20;
  border-color: #2e7d32;
  color: #fff;
}

.encounter-attack-monster:hover:not(:disabled) {
  background: #2e7d32;
  filter: brightness(1.1);
}

/* Players & Battle (inside adventure) */
.battle-section {
  width: 100%;
  max-width: 900px;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.players-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.player-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.player-name-wrap {
  margin: 0 0 0.75rem;
}

.player-name-input {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  width: 100%;
}

.player-name-input:focus {
  outline: none;
  border-color: var(--accent);
}

.player-hp-wrap {
  margin-bottom: 0.75rem;
}

.player-hp-wrap.hp-low .player-hp-fill { background: #e65100; }
.player-hp-wrap.hp-down .player-hp-fill { background: #b71c1c; }

.player-hp-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  display: block;
  margin-bottom: 0.25rem;
}

.player-hp-inputs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.35rem;
}

.player-hp-current,
.player-hp-max {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  width: 3.5rem;
  padding: 0.3rem 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  text-align: center;
}

.player-hp-sep {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.player-hp-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.player-hp-fill {
  display: block;
  height: 100%;
  background: #4caf50;
  border-radius: 3px;
  transition: width 0.2s ease;
}

.player-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.75rem;
}

.player-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.player-stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.player-stat-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.player-stat-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  background: var(--border);
  color: var(--text);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: background 0.2s;
}

.player-stat-btn:hover {
  background: var(--accent);
  color: var(--bg);
}

.player-stat-input {
  width: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.2rem 0.25rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  text-align: center;
}

.player-attack-btn {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  width: 100%;
  background: #b71c1c;
  color: #fff;
  border: 1px solid #8b0000;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: filter 0.2s, background 0.2s;
}

.player-attack-btn:hover:not(:disabled) {
  filter: brightness(1.15);
  background: #c62828;
}

.player-attack-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.encounter-options {
  margin-bottom: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.encounter-option-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.25rem;
  cursor: pointer;
}

.encounter-option-label input[type="checkbox"] {
  margin-right: 0.5rem;
}

.encounter-option-hint {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.8rem;
}

.narrative-tone-input {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  width: 100%;
  max-width: 320px;
  padding: 0.4rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  margin-top: 0.25rem;
}

.battle-log-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

.battle-log-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.battle-log {
  max-height: 180px;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-dim);
}

.battle-log-empty {
  margin: 0;
  color: var(--text-dim);
  font-style: italic;
}

.battle-log-entry {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.battle-log-entry:last-child {
  border-bottom: none;
}

.battle-log-entry-narrative {
  font-style: italic;
  color: var(--text-body);
  padding-left: 0.5rem;
  border-left: 3px solid var(--accent, #7c9);
}

.battle-log-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.battle-log-hint code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

@media (max-width: 520px) {
  .crates { gap: 1.5rem; }
  .crate { --crate-size: 120px; }
  .players-row { grid-template-columns: 1fr; }
  .player-stats { grid-template-columns: 1fr; }
  .characters-section { grid-template-columns: 1fr; }
}
