* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --gold: #c9a84c;
  --gold-dim: #8a6d2b;
  --gold-glow: rgba(201, 168, 76, 0.15);
  --bone: #e8dcc8;
  --ash: #9a9084;
  --void: #0a0a0c;
  --deep: #111114;
  --card: #16161a;
  --ember: #c94c4c;
  --ember-dim: #8a3333;
  --heal: #4c9a5c;
  --mana: #4c6cc9;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--void);
  color: var(--bone);
  overflow-x: hidden;
  line-height: 1.7;
  min-height: 100vh;
}

.atmosphere {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(201,168,76,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(201,76,76,0.03) 0%, transparent 50%);
}

/* ===== CHARACTER CREATION ===== */

#creation-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.creation-container {
  max-width: 600px;
  width: 100%;
}

.creation-title {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--bone);
  text-align: center;
  margin-bottom: 0.5rem;
}

.creation-title span { color: var(--gold); }

.creation-subtitle {
  text-align: center;
  color: var(--ash);
  font-weight: 300;
  margin-bottom: 3rem;
  font-size: 1rem;
}

.form-group {
  margin-bottom: 2rem;
}

.form-label {
  display: block;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.name-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--deep);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 8px;
  color: var(--bone);
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  outline: none;
  transition: border-color 0.3s;
}

.name-input:focus {
  border-color: var(--gold);
}

.name-input::placeholder {
  color: var(--ash);
  opacity: 0.5;
}

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

.class-card {
  background: var(--card);
  border: 2px solid rgba(201,168,76,0.1);
  border-radius: 10px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.class-card:hover {
  border-color: rgba(201,168,76,0.3);
  transform: translateY(-2px);
}

.class-card.selected {
  border-color: var(--gold);
  background: rgba(201,168,76,0.05);
}

.class-card.selected::after {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px; bottom: -1px;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(201,168,76,0.15);
  pointer-events: none;
}

.class-icon {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  display: block;
}

.class-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--bone);
  margin-bottom: 0.25rem;
}

.class-desc {
  font-size: 0.8rem;
  color: var(--ash);
  font-weight: 300;
  line-height: 1.5;
}

.class-stats {
  margin-top: 0.75rem;
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  color: var(--gold-dim);
  line-height: 1.6;
}

.enter-btn {
  display: block;
  width: 100%;
  padding: 16px;
  margin-top: 2rem;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border: none;
  border-radius: 8px;
  color: var(--void);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
}

.enter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201,168,76,0.3);
}

.enter-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.enter-btn.loading {
  position: relative;
  color: transparent;
}

.enter-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 24px; height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid var(--void);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== GAME SCREEN ===== */

#game-screen {
  display: none;
  position: relative;
  z-index: 1;
  height: 100vh;
  overflow: hidden;
}

.game-layout {
  display: grid;
  grid-template-columns: 240px 1fr 220px;
  grid-template-rows: 1fr auto;
  height: 100vh;
  gap: 0;
}

/* Left sidebar - Character */
.char-panel {
  background: var(--deep);
  border-right: 1px solid rgba(201,168,76,0.1);
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.char-header {
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(201,168,76,0.1);
}

.char-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--gold);
}

.char-class {
  font-size: 0.8rem;
  color: var(--ash);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.char-level {
  font-size: 0.75rem;
  color: var(--gold-dim);
  margin-top: 0.25rem;
}

/* HP Bar */
.hp-section { }

.hp-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ash);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hp-bar-outer {
  width: 100%;
  height: 10px;
  background: rgba(201,76,76,0.15);
  border-radius: 5px;
  overflow: hidden;
}

.hp-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--ember), #e05555);
  border-radius: 5px;
  transition: width 0.5s ease;
}

.hp-bar-inner.healthy { background: linear-gradient(90deg, var(--heal), #5cb86c); }
.hp-bar-inner.wounded { background: linear-gradient(90deg, #c9a84c, #e0a535); }
.hp-bar-inner.critical { background: linear-gradient(90deg, var(--ember), #e05555); }

/* XP Bar */
.xp-bar-outer {
  width: 100%;
  height: 4px;
  background: rgba(76,108,201,0.15);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.xp-bar-inner {
  height: 100%;
  background: var(--mana);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.stat-item {
  background: var(--card);
  border-radius: 6px;
  padding: 6px 8px;
  text-align: center;
}

.stat-abbr {
  font-size: 0.65rem;
  color: var(--ash);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stat-value {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--bone);
}

.stat-mod {
  font-size: 0.65rem;
  color: var(--gold-dim);
}

/* Combat stats */
.combat-stats {
  display: flex;
  gap: 8px;
}

.combat-stat {
  flex: 1;
  background: var(--card);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
}

.combat-stat-label {
  font-size: 0.6rem;
  color: var(--ash);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.combat-stat-value {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gold);
}

/* Enemy display */
.enemy-panel {
  background: rgba(201,76,76,0.08);
  border: 1px solid rgba(201,76,76,0.2);
  border-radius: 8px;
  padding: 10px;
  display: none;
}

.enemy-panel.active { display: block; }

.enemy-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ember);
  margin-bottom: 4px;
}

.enemy-hp-bar {
  width: 100%;
  height: 6px;
  background: rgba(201,76,76,0.15);
  border-radius: 3px;
  overflow: hidden;
}

.enemy-hp-inner {
  height: 100%;
  background: var(--ember);
  border-radius: 3px;
  transition: width 0.3s;
}

.enemy-stats-line {
  font-size: 0.7rem;
  color: var(--ash);
  margin-top: 4px;
}

/* ===== NARRATIVE PANEL (Center) ===== */

.narrative-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--void);
}

.narrative-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem;
  scroll-behavior: smooth;
}

.narrative-scroll::-webkit-scrollbar {
  width: 4px;
}

.narrative-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.narrative-scroll::-webkit-scrollbar-thumb {
  background: var(--gold-dim);
  border-radius: 2px;
}

/* Log entries */
.log-entry {
  margin-bottom: 1.5rem;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.log-narration {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--bone);
}

.log-action {
  color: var(--gold);
  font-style: italic;
  padding-left: 1rem;
  border-left: 2px solid var(--gold-dim);
  margin: 0.75rem 0;
}

.log-action::before {
  content: '> ';
  color: var(--gold-dim);
}

/* Dice roll display */
.roll-display {
  margin: 0.75rem 0;
  padding: 8px 14px;
  background: var(--deep);
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

.roll-display.success {
  border-left-color: var(--heal);
}

.roll-display.failure {
  border-left-color: var(--ember);
}

.roll-label {
  color: var(--ash);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.roll-result {
  color: var(--bone);
  margin-top: 2px;
}

.roll-result .natural {
  color: var(--gold);
  font-weight: bold;
}

.roll-result .modifier {
  color: var(--ash);
}

.roll-result .total {
  font-weight: bold;
}

.roll-result .success-text {
  color: var(--heal);
  font-weight: bold;
}

.roll-result .failure-text {
  color: var(--ember);
  font-weight: bold;
}

/* Effects display */
.effects-display {
  margin: 0.5rem 0;
  font-size: 0.8rem;
}

.effect-item {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  margin-right: 6px;
  margin-bottom: 4px;
  font-weight: 500;
}

.effect-damage {
  background: rgba(201,76,76,0.15);
  color: var(--ember);
}

.effect-heal {
  background: rgba(76,154,92,0.15);
  color: var(--heal);
}

.effect-gold {
  background: rgba(201,168,76,0.15);
  color: var(--gold);
}

.effect-xp {
  background: rgba(76,108,201,0.15);
  color: var(--mana);
}

.effect-item-add {
  background: rgba(201,168,76,0.1);
  color: var(--gold-dim);
}

.effect-kill {
  background: rgba(201,76,76,0.1);
  color: var(--ember-dim);
}

.effect-level-up {
  background: rgba(201,168,76,0.2);
  color: var(--gold);
  font-weight: 700;
  font-family: 'Cinzel', serif;
  padding: 4px 14px;
  font-size: 0.9rem;
}

/* Death display */
.log-death {
  text-align: center;
  padding: 2rem;
  margin: 2rem 0;
  border: 1px solid rgba(201,76,76,0.3);
  border-radius: 12px;
  background: rgba(201,76,76,0.05);
}

.death-skull {
  font-size: 3rem;
  margin-bottom: 1rem;
  filter: grayscale(0.3);
}

.death-title {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--ember);
  margin-bottom: 0.5rem;
}

.death-epitaph {
  font-style: italic;
  color: var(--ash);
  font-size: 1rem;
  line-height: 1.8;
  max-width: 500px;
  margin: 0 auto 1.5rem;
}

.death-stats {
  font-size: 0.8rem;
  color: var(--gold-dim);
  margin-bottom: 1.5rem;
}

.death-stats span {
  margin: 0 8px;
}

.new-run-btn {
  display: inline-block;
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border: none;
  border-radius: 6px;
  color: var(--void);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.new-run-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201,168,76,0.3);
}

/* Choices */
.choices-container {
  padding: 1rem 2rem 0.5rem;
  border-top: 1px solid rgba(201,168,76,0.08);
  background: var(--void);
}

.choices-label {
  font-size: 0.7rem;
  color: var(--ash);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

.choices-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice-btn {
  padding: 8px 16px;
  background: var(--card);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 6px;
  color: var(--bone);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.choice-btn:hover {
  border-color: var(--gold);
  background: rgba(201,168,76,0.08);
  color: var(--gold);
}

/* Action input */
.action-bar {
  padding: 0.75rem 2rem 1rem;
  background: var(--deep);
  border-top: 1px solid rgba(201,168,76,0.1);
  grid-column: 2;
}

.action-input-wrapper {
  display: flex;
  gap: 8px;
}

.action-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 8px;
  color: var(--bone);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s;
}

.action-input:focus {
  border-color: var(--gold);
}

.action-input::placeholder {
  color: var(--ash);
  opacity: 0.5;
}

.action-input:disabled {
  opacity: 0.4;
}

.action-send {
  padding: 12px 20px;
  background: var(--gold);
  border: none;
  border-radius: 8px;
  color: var(--void);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.action-send:hover {
  background: #d4b455;
}

.action-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Loading indicator */
.thinking-indicator {
  display: none;
  padding: 1rem 0;
  text-align: center;
}

.thinking-indicator.active {
  display: block;
}

.thinking-dots {
  display: inline-flex;
  gap: 6px;
}

.thinking-dots span {
  width: 8px;
  height: 8px;
  background: var(--gold-dim);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}

.thinking-text {
  font-size: 0.75rem;
  color: var(--ash);
  margin-top: 6px;
  font-style: italic;
}

/* ===== RIGHT SIDEBAR - INVENTORY ===== */

.inv-panel {
  background: var(--deep);
  border-left: 1px solid rgba(201,168,76,0.1);
  padding: 1.25rem;
  overflow-y: auto;
  grid-row: 1 / 3;
}

.inv-title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  text-align: center;
}

.inv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inv-item {
  background: var(--card);
  border: 1px solid rgba(201,168,76,0.08);
  border-radius: 6px;
  padding: 8px 10px;
  transition: border-color 0.2s;
}

.inv-item:hover {
  border-color: rgba(201,168,76,0.2);
}

.inv-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inv-item-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--bone);
}

.inv-item-badge {
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.inv-item-badge.equipped {
  background: rgba(201,168,76,0.15);
  color: var(--gold);
}

.inv-item-badge.consumable {
  background: rgba(76,154,92,0.15);
  color: var(--heal);
}

.inv-item-desc {
  font-size: 0.72rem;
  color: var(--ash);
  margin-top: 2px;
  line-height: 1.4;
}

.inv-item-stats {
  font-size: 0.68rem;
  color: var(--gold-dim);
  font-family: 'Courier New', monospace;
  margin-top: 2px;
}

.inv-empty {
  text-align: center;
  color: var(--ash);
  opacity: 0.5;
  font-size: 0.8rem;
  font-style: italic;
  padding: 2rem 0;
}

/* ===== DEATH OVERLAY ===== */

#death-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(10,10,12,0.95);
  z-index: 100;
  justify-content: center;
  align-items: center;
  animation: fadeIn 1s ease;
}

#death-overlay.active {
  display: flex;
}

.death-content {
  text-align: center;
  max-width: 550px;
  padding: 3rem;
}

.death-content .death-skull {
  font-size: 5rem;
  margin-bottom: 1.5rem;
}

.death-content .death-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.death-content .death-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.death-content .death-epitaph {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  line-height: 1.9;
}

.death-content .death-stats {
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.death-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.death-buttons .new-run-btn {
  padding: 14px 36px;
}

.leaderboard-btn {
  display: inline-block;
  padding: 14px 36px;
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  color: var(--gold-dim);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.leaderboard-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ===== LEADERBOARD ===== */

#leaderboard-screen {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 3rem 2rem;
}

#leaderboard-screen.active {
  display: block;
}

.leaderboard-container {
  max-width: 700px;
  margin: 0 auto;
}

.leaderboard-title {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 2rem;
  color: var(--bone);
  text-align: center;
  margin-bottom: 0.5rem;
}

.leaderboard-subtitle {
  text-align: center;
  color: var(--ash);
  margin-bottom: 2.5rem;
  font-size: 0.9rem;
}

.leaderboard-entry {
  background: var(--card);
  border: 1px solid rgba(201,168,76,0.08);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.2s;
}

.leaderboard-entry:hover {
  border-color: rgba(201,168,76,0.2);
}

.leaderboard-rank {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--gold-dim);
  min-width: 36px;
  text-align: center;
}

.leaderboard-entry:nth-child(1) .leaderboard-rank { color: var(--gold); font-size: 1.4rem; }
.leaderboard-entry:nth-child(2) .leaderboard-rank { color: #c0c0c0; }
.leaderboard-entry:nth-child(3) .leaderboard-rank { color: #cd7f32; }

.leaderboard-info {
  flex: 1;
}

.leaderboard-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--bone);
  font-size: 0.95rem;
}

.leaderboard-class {
  font-size: 0.75rem;
  color: var(--ash);
}

.leaderboard-epitaph {
  font-size: 0.78rem;
  color: var(--ash);
  font-style: italic;
  margin-top: 4px;
  line-height: 1.4;
}

.leaderboard-meta {
  text-align: right;
  font-size: 0.75rem;
  color: var(--gold-dim);
  font-family: 'Courier New', monospace;
  white-space: nowrap;
}

.back-btn {
  display: block;
  margin: 2rem auto 0;
  padding: 12px 32px;
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: 6px;
  color: var(--gold-dim);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.back-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.leaderboard-empty {
  text-align: center;
  color: var(--ash);
  font-style: italic;
  padding: 3rem;
}

/* ===== PREMIUM CLASSES ===== */

.premium-label-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  background: rgba(147, 51, 234, 0.15);
  color: #a78bfa;
  padding: 2px 10px;
  border-radius: 12px;
  margin-left: 8px;
  letter-spacing: 0.05em;
  text-transform: none;
  vertical-align: middle;
}

.premium-label-badge.unlocked {
  background: rgba(76, 154, 92, 0.15);
  color: var(--heal);
}

.premium-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(147, 51, 234, 0.2);
}

.premium-card:hover {
  border-color: rgba(147, 51, 234, 0.4);
}

.premium-card.selected {
  border-color: #a78bfa;
  background: rgba(147, 51, 234, 0.05);
}

.premium-card.selected::after {
  box-shadow: 0 0 20px rgba(147, 51, 234, 0.2);
}

.premium-card.locked {
  cursor: pointer;
}

.premium-card.locked .class-desc,
.premium-card.locked .class-stats {
  filter: blur(1px);
  opacity: 0.6;
}

.premium-lock-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 12, 0.7);
  z-index: 2;
  border-radius: 8px;
  backdrop-filter: blur(2px);
  gap: 6px;
  transition: all 0.3s;
}

.premium-card:hover .premium-lock-overlay {
  background: rgba(10, 10, 12, 0.5);
}

.premium-lock-overlay .lock-icon {
  font-size: 2rem;
}

.premium-lock-overlay .lock-text {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: #a78bfa;
  letter-spacing: 0.05em;
}

.premium-card.unlocked .premium-lock-overlay {
  display: none;
}

.premium-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.55rem;
  font-weight: 600;
  color: #a78bfa;
  background: rgba(147, 51, 234, 0.15);
  padding: 2px 8px;
  border-radius: 8px;
  letter-spacing: 0.08em;
}

/* Premium Purchase Modal */
#premium-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(10, 10, 12, 0.92);
  z-index: 200;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

#premium-modal.active {
  display: flex;
}

.premium-modal-content {
  text-align: center;
  max-width: 420px;
  padding: 2.5rem;
  background: var(--deep);
  border: 1px solid rgba(147, 51, 234, 0.3);
  border-radius: 16px;
  box-shadow: 0 0 60px rgba(147, 51, 234, 0.1);
}

.premium-modal-skull {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.premium-modal-title {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 1.4rem;
  color: #a78bfa;
  margin-bottom: 1.25rem;
}

.premium-modal-classes {
  display: flex;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.premium-modal-class {
  flex: 1;
  background: var(--card);
  border: 1px solid rgba(147, 51, 234, 0.15);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.premium-modal-class .class-icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.premium-modal-class strong {
  display: block;
  font-family: 'Cinzel', serif;
  color: var(--bone);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.premium-modal-class div {
  font-size: 0.72rem;
  color: var(--ash);
  line-height: 1.4;
}

.premium-modal-price {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: 1.25rem;
}

.premium-buy-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.premium-buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(147, 51, 234, 0.3);
}

.premium-cancel-btn {
  background: none;
  border: none;
  color: var(--ash);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 8px 16px;
  transition: color 0.2s;
}

.premium-cancel-btn:hover {
  color: var(--bone);
}

/* ===== MOBILE ===== */

@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .char-panel {
    border-right: none;
    border-bottom: 1px solid rgba(201,168,76,0.1);
    padding: 0.75rem 1rem;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    max-height: none;
    overflow: visible;
  }

  .char-header {
    border-bottom: none;
    padding-bottom: 0;
    text-align: left;
  }

  .hp-section { flex: 1; min-width: 120px; }

  .stats-grid {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
  }

  .stat-item { padding: 4px 8px; }

  .combat-stats { gap: 4px; }

  .enemy-panel { width: 100%; }

  .inv-panel {
    display: none;
    border-left: none;
    border-top: 1px solid rgba(201,168,76,0.1);
    grid-row: auto;
  }

  .narrative-scroll { padding: 1rem; }

  .action-bar {
    grid-column: 1;
    padding: 0.5rem 1rem 0.75rem;
  }

  .choices-container { padding: 0.5rem 1rem; }

  .class-grid { grid-template-columns: 1fr; }

  .premium-modal-classes {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .creation-container { padding: 0 0.5rem; }
  .class-stats { display: none; }
  .stats-grid { display: none; }
}
