/* ═══════════════════════════════════════════════
   COZYDUNGEON — TAVERN STYLE
   Estética: madera oscura, luz de vela, ámbar cálido
   Fonts: Cinzel Decorative (títulos) + Crimson Pro (body)
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Cinzel:wght@400;500;600&family=IM+Fell+English:ital@0;1&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

:root {
  /* Madera y piedra */
  --wood-dark:     #2a1f14;
  --wood-mid:      #3d2e1e;
  --wood-light:    #5a4230;
  --wood-planks:   #4a3525;
  --stone:         #3a3028;
  --stone-light:   #524840;

  /* Superficies */
  --surface:       #3d2e1e;
  --surface2:      #4a3828;
  --surface3:      #584438;
  --panel-bg:      #2e2218;
  --panel-border:  #6a5040;

  /* Ámbar y fuego */
  --amber:         #e8a030;
  --amber-bright:  #f5c050;
  --amber-dim:     #b07820;
  --amber-glow:    #ff9010;
  --candle:        #ffcc66;
  --flame:         #ff6620;
  --ember:         #cc4410;

  /* Texto */
  --text:          #f0e0c0;
  --text-bright:   #fdf0d8;
  --text-dim:      #b09060;
  --text-muted:    #806840;
  --ink:           #1a1008;

  /* Acento rojo taberna */
  --crimson:       #8b2020;
  --crimson-bright:#c03030;

  /* Verde musgo */
  --moss:          #3a5030;
  --moss-bright:   #508040;

  /* HP */
  --hp-green:      #4a8a3a;
  --hp-yellow:     #9a8020;
  --hp-red:        #8a2020;

  /* Tipografía */
  --font-title:    'Cinzel Decorative', serif;
  --font-heading:  'Cinzel', serif;
  --font-body:     'Crimson Pro', serif;
  --font-fell:     'IM Fell English', serif;

  --radius:        4px;
  --radius-lg:     8px;
  --shadow-candle: 0 0 30px rgba(232, 160, 48, 0.2);
  --shadow-wood:   0 4px 20px rgba(0,0,0,0.6);
  --shadow-deep:   0 8px 40px rgba(0,0,0,0.8);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--wood-dark);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--wood-dark); }
::-webkit-scrollbar-thumb { background: var(--wood-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--amber-dim); }

/* ─── WOOD TEXTURE OVERLAY ─── */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    repeating-linear-gradient(
      92deg,
      transparent 0px,
      rgba(0,0,0,0.03) 1px,
      transparent 2px,
      transparent 40px
    ),
    repeating-linear-gradient(
      178deg,
      transparent 0px,
      rgba(255,200,100,0.015) 1px,
      transparent 2px,
      transparent 80px
    );
}

/* ─── VIGNETTE ─── */
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at center,
    transparent 45%,
    rgba(20, 10, 5, 0.55) 100%
  );
}

/* ═══════════════════════════════════════════════
   LANDING PAGE
   ═══════════════════════════════════════════════ */

.landing-page {
  background:
    radial-gradient(ellipse 70% 50% at 50% 10%, rgba(180,100,20,0.18) 0%, transparent 65%),
    radial-gradient(ellipse 50% 60% at 15% 90%, rgba(100,50,10,0.2) 0%, transparent 55%),
    linear-gradient(160deg, #2a1f14 0%, #1e1608 50%, #2a1a0e 100%);
  min-height: 100vh;
}

#particles {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
}

/* Floating embers / runes */
.rune-field {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.rune {
  position: absolute;
  font-family: var(--font-body);
  opacity: 0.12;
  animation: runeFloat linear infinite;
  user-select: none;
}
.r1 { font-size: 3rem;   left:  5%; top: 12%; animation-duration: 28s; color: var(--amber-dim); }
.r2 { font-size: 2rem;   left: 18%; top: 72%; animation-duration: 35s; animation-delay: -5s; color: var(--candle); }
.r3 { font-size: 4rem;   left: 82%; top: 10%; animation-duration: 22s; animation-delay: -10s; color: var(--amber); }
.r4 { font-size: 2.5rem; left: 88%; top: 65%; animation-duration: 40s; animation-delay: -3s;  color: var(--amber-dim); }
.r5 { font-size: 3rem;   left: 52%; top:  6%; animation-duration: 30s; animation-delay: -8s;  color: var(--candle); }
.r6 { font-size: 1.8rem; left: 32%; top: 88%; animation-duration: 25s; animation-delay: -15s; color: var(--amber); }
.r7 { font-size: 3.5rem; left: 68%; top: 48%; animation-duration: 38s; animation-delay: -20s; color: var(--amber-dim); }
.r8 { font-size: 2.5rem; left:  7%; top: 48%; animation-duration: 32s; animation-delay: -12s; color: var(--candle); }

@keyframes runeFloat {
  0%   { transform: translateY(0) rotate(0deg);    opacity: 0; }
  10%  { opacity: 0.12; }
  90%  { opacity: 0.12; }
  100% { transform: translateY(-40px) rotate(12deg); opacity: 0; }
}

.landing-main {
  position: relative; z-index: 2;
  max-width: 860px; margin: 0 auto;
  padding: 4rem 2rem 3rem;
  display: flex; flex-direction: column; align-items: center; gap: 2.8rem;
}

/* — Header — */
.landing-header { text-align: center; }

.emblem {
  width: 96px; height: 96px; margin: 0 auto 1.4rem;
  animation: emblemPulse 4s ease-in-out infinite;
}
.emblem svg,
.landing-logo {
  width: 100%; height: 100%;
}
.landing-logo {
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(232,160,48,0.55));
}
@keyframes emblemPulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(232,160,48,0.4)); }
  50%       { filter: drop-shadow(0 0 26px rgba(255,160,30,0.85)); }
}

.title-main {
  font-family: var(--font-title);
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 900;
  letter-spacing: 0.07em;
  background: linear-gradient(180deg, var(--candle) 0%, var(--amber) 45%, var(--amber-dim) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.4rem;
  animation: titleReveal 1.2s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes titleReveal {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.title-sub {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.2rem;
  animation: titleReveal 1.2s 0.2s cubic-bezier(0.16,1,0.3,1) both;
}

.title-rule {
  display: flex; align-items: center; gap: 0.8rem; justify-content: center;
  animation: titleReveal 1.2s 0.35s cubic-bezier(0.16,1,0.3,1) both;
}
.title-rule span:not(.diamond) {
  display: block; width: 90px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--amber-dim), transparent);
}
.diamond { color: var(--amber); font-size: 0.7rem; }

/* — Upload intro — */
.upload-intro {
  text-align: center;
  font-family: var(--font-fell);
  font-style: italic;
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 2rem;
  animation: titleReveal 1.2s 0.5s cubic-bezier(0.16,1,0.3,1) both;
}

/* — Upload Grid — */
.upload-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem;
  width: 100%;
}
@media (max-width: 680px) { .upload-grid { grid-template-columns: 1fr; } }

.upload-card {
  position: relative; overflow: hidden;
  background: linear-gradient(145deg, var(--surface2) 0%, var(--surface) 100%);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.4rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
  animation: cardReveal 0.8s cubic-bezier(0.16,1,0.3,1) both;
  /* Subtle wood grain top highlight */
  box-shadow: inset 0 1px 0 rgba(255,200,100,0.08), var(--shadow-wood);
}
.upload-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(232,160,48,0.1) 0%, transparent 65%);
  opacity: 0; transition: opacity 0.3s;
}
.upload-card:hover::before { opacity: 1; }
.upload-card:hover {
  border-color: var(--amber-dim);
  box-shadow: inset 0 1px 0 rgba(255,200,100,0.1), var(--shadow-candle), var(--shadow-wood);
  transform: translateY(-3px);
}
.upload-card.has-file {
  border-color: var(--amber);
  box-shadow: inset 0 1px 0 rgba(255,200,100,0.15), 0 0 20px rgba(232,160,48,0.35), var(--shadow-wood);
}
#card-adventure { animation-delay: 0.55s; }
#card-sheet     { animation-delay: 0.7s; }
#card-image     { animation-delay: 0.85s; }

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

.upload-icon { font-size: 2.2rem; margin-bottom: 0.8rem; }

.upload-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.4rem;
  cursor: pointer;
}

.upload-hint {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  line-height: 1.45;
}

.upload-card input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

.file-chosen {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: var(--font-heading);
  margin-top: 0.5rem;
  transition: color 0.3s;
  word-break: break-all;
}
.has-file .file-chosen { color: var(--amber); }

/* — Init Button — */
.init-action {
  margin-top: 2rem; text-align: center;
  animation: titleReveal 1s 1s cubic-bezier(0.16,1,0.3,1) both;
}

.btn-summon {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1rem 3rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(135deg, var(--candle) 0%, var(--amber) 50%, var(--amber-dim) 100%);
  border: none; border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.3s;
  box-shadow: 0 4px 24px rgba(232,160,48,0.45), inset 0 1px 0 rgba(255,255,255,0.25);
  overflow: hidden;
}
.btn-summon:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(255,160,30,0.65), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn-summon:active { transform: translateY(0); }
.btn-summon:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.28) 0%, transparent 70%);
  opacity: 0; transition: opacity 0.3s;
}
.btn-summon:hover .btn-glow { opacity: 1; }

.init-status {
  margin-top: 1rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  min-height: 1.4em;
}
.init-status.success { color: var(--amber-bright); }
.init-status.error   { color: var(--crimson-bright); }
.init-status.loading { color: var(--text-dim); }

/* — Footer — */
.landing-footer {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

/* ═══════════════════════════════════════════════
   GAME PAGE
   ═══════════════════════════════════════════════ */

.game-page {
  background: var(--wood-dark);
  height: 100vh; overflow: hidden;
  display: flex; flex-direction: column;
}

/* ─── TOPBAR ─── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 1.2rem;
  background: linear-gradient(90deg, var(--wood-dark) 0%, var(--stone) 50%, var(--wood-dark) 100%);
  border-bottom: 2px solid var(--wood-light);
  box-shadow: 0 2px 16px rgba(0,0,0,0.6), inset 0 -1px 0 rgba(232,160,48,0.15);
  z-index: 10; position: relative;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  min-height: 32px;
}

.topbar-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-title);
  font-size: 1rem;
  letter-spacing: 0.1em;
  line-height: 1;
}

.topbar-logo-text {
  background: linear-gradient(90deg, var(--candle), var(--amber));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topbar-logo-icon {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(232,160,48,0.45));
}

.pc-vitals {
  display: flex; align-items: center; gap: 2rem;
}

.vital-block { text-align: center; }

.vital-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1px;
}

.vital-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--amber);
  font-weight: 600;
}

.hp-bar-wrap {
  width: 84px; height: 5px;
  background: rgba(0,0,0,0.4);
  border-radius: 3px; overflow: hidden;
  margin-top: 3px;
  border: 1px solid rgba(0,0,0,0.3);
}
.hp-bar {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--hp-green), #6ab050);
  border-radius: 3px;
  transition: width 0.5s ease, background 0.5s ease;
}
.hp-bar.warning { background: linear-gradient(90deg, var(--hp-yellow), #c8a030); }
.hp-bar.danger  { background: linear-gradient(90deg, var(--hp-red), var(--crimson-bright)); }

#combat-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--panel-border);
  transition: all 0.3s;
}
#combat-badge.in-combat {
  color: #ff8060;
  border-color: var(--crimson);
  background: rgba(139,32,32,0.3);
  animation: combatPulse 2s ease-in-out infinite;
}
@keyframes combatPulse {
  0%, 100% { box-shadow: none; }
  50%       { box-shadow: 0 0 10px rgba(192,48,48,0.5); }
}

.topbar-right { display: flex; align-items: center; gap: 0.5rem; }

.topbar-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: linear-gradient(160deg, var(--surface3) 0%, var(--surface) 100%);
  border: 1px solid var(--wood-light);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 1rem; cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.topbar-btn svg {
  width: 17px; height: 17px;
  flex-shrink: 0;
  pointer-events: none;
}
.topbar-btn:hover {
  background: linear-gradient(160deg, var(--stone-light) 0%, var(--stone) 100%);
  border-color: var(--amber-dim);
  color: var(--amber);
  box-shadow: 0 3px 12px rgba(232,160,48,0.28), inset 0 1px 0 rgba(255,255,255,0.06);
  transform: translateY(-1px);
}
.topbar-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0,0,0,0.5), inset 0 1px 0 rgba(0,0,0,0.1);
}

/* ─── CONDITIONS BAR ─── */
.conditions-bar {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  padding: 0.25rem 1.2rem;
  background: var(--stone);
  border-bottom: 1px solid var(--wood-light);
  min-height: 0; flex-shrink: 0;
}
.condition-tag {
  font-family: var(--font-heading);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  background: rgba(139,32,32,0.35);
  border: 1px solid var(--crimson);
  border-radius: 2px;
  color: #ff9090;
}

/* ─── GAME LAYOUT ─── */
.game-layout {
  display: grid;
  grid-template-columns: 300px 1fr 230px;
  flex: 1; overflow: hidden;
}
@media (max-width: 1100px) {
  .game-layout { grid-template-columns: 260px 1fr; }
  .panel-notes { display: none; }
}
@media (max-width: 720px) {
  .game-layout { grid-template-columns: 1fr; }
  .panel-scene { display: none; }
}

/* ─── PANEL SCENE ─── */
.panel-scene {
  background: var(--panel-bg);
  border-right: 2px solid var(--wood-light);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: inset -4px 0 12px rgba(0,0,0,0.3);
}

.scene-frame {
  flex: 1; position: relative; overflow: hidden;
  background: #1a1008;
}

.scene-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(60,35,10,0.7) 0%, #1a1008 100%);
}
.scene-placeholder-inner {
  text-align: center; color: var(--text-muted); padding: 1rem;
}
.scene-rune {
  font-size: 4rem; color: var(--amber-dim); opacity: 0.35;
  margin-bottom: 0.8rem;
  animation: runeGlow 3s ease-in-out infinite;
}
@keyframes runeGlow {
  0%, 100% { opacity: 0.25; }
  50%       { opacity: 0.55; }
}
.scene-placeholder-inner p {
  font-family: var(--font-fell);
  font-style: italic;
  font-size: 0.85rem;
  line-height: 1.65;
}

.scene-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  animation: sceneFadeIn 0.9s ease-out;
}
@keyframes sceneFadeIn {
  from { opacity: 0; transform: scale(1.05); }
  to   { opacity: 1; transform: scale(1); }
}

/* Warm candlelight vignette over image */
.scene-frame::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    linear-gradient(to bottom, rgba(20,10,5,0.5) 0%, transparent 25%, transparent 70%, rgba(15,8,3,0.7) 100%),
    linear-gradient(to right, rgba(20,10,5,0.35) 0%, transparent 20%, transparent 80%, rgba(20,10,5,0.35) 100%);
}

.scene-loading {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(20,12,5,0.85);
  gap: 1rem;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--amber-dim);
}

.spell-spinner {
  width: 46px; height: 46px;
  border: 2px solid var(--wood-light);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
  position: relative;
}
.spell-spinner::after {
  content: '✦';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--amber-dim);
  animation: spin 2.4s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }

.scene-btn-row {
  padding: 0.6rem;
  background: var(--stone);
  border-top: 1px solid var(--wood-light);
  display: flex; justify-content: center;
}

.btn-scene {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  background: var(--surface);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-scene:hover { border-color: var(--amber-dim); color: var(--amber); }

/* ─── PANEL CHAT ─── */
.panel-chat {
  display: flex; flex-direction: column; overflow: hidden;
  background:
    radial-gradient(ellipse 100% 40% at 50% 0%, rgba(80,50,15,0.25) 0%, transparent 55%),
    var(--wood-mid);
  border-left: 1px solid var(--wood-planks);
  border-right: 1px solid var(--wood-planks);
}

.chat-scroll {
  flex: 1; overflow-y: auto;
  padding: 1.5rem 1.2rem;
  scroll-behavior: smooth;
}

.chat-messages {
  display: flex; flex-direction: column; gap: 1.2rem;
  max-width: 780px; margin: 0 auto;
}

.chat-welcome {
  text-align: center; padding: 3rem 1rem;
}
.welcome-rune {
  font-size: 3rem; color: var(--amber-dim); opacity: 0.45;
  margin-bottom: 1rem;
}
.welcome-text {
  font-family: var(--font-fell);
  font-style: italic;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.85;
}

/* — Chat Bubbles — */
.msg {
  display: flex; gap: 0.8rem; align-items: flex-start;
  animation: msgReveal 0.35s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes msgReveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg-avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  border: 1px solid var(--panel-border);
  background: var(--stone);
}

.msg.dm .msg-avatar {
  background: linear-gradient(135deg, var(--stone), var(--wood-light));
  border-color: var(--amber-dim);
}

.msg.player .msg-avatar {
  background: linear-gradient(135deg, var(--stone), var(--moss));
  border-color: var(--moss-bright);
}

.msg-avatar--img {
  padding: 0;
  overflow: hidden;
  background: none;
}

.msg-avatar--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.msg.player { flex-direction: row-reverse; }

.msg-body { flex: 1; max-width: 86%; }

.msg-label {
  font-family: var(--font-heading);
  font-size: 0.63rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.msg.dm     .msg-label { color: var(--amber-dim); }
.msg.player .msg-label { color: var(--moss-bright); text-align: right; }

.msg-bubble {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  line-height: 1.78;
}

/* DM bubble — like a tavern notice board / parchment */
.msg.dm .msg-bubble {
  background: linear-gradient(150deg, #4a3828 0%, #3d2e1e 100%);
  border: 1px solid var(--panel-border);
  border-top-left-radius: 2px;
  color: var(--text-bright);
  box-shadow: inset 0 1px 0 rgba(255,200,80,0.07), var(--shadow-wood);
}
.msg.dm .msg-bubble strong,
.msg.dm .msg-bubble b {
  color: var(--amber-bright);
  font-family: var(--font-heading);
  font-size: 0.95em;
}
.msg.dm .msg-bubble em,
.msg.dm .msg-bubble i {
  color: var(--text-dim);
  font-family: var(--font-fell);
}

/* Player bubble */
.msg.player .msg-bubble {
  background: linear-gradient(150deg, rgba(58,80,48,0.45) 0%, rgba(40,55,30,0.5) 100%);
  border: 1px solid rgba(80,128,64,0.4);
  border-top-right-radius: 2px;
  color: var(--text);
  text-align: right;
}

/* Streaming cursor */
.msg-bubble.streaming::after {
  content: '▋';
  color: var(--amber);
  animation: blink 0.75s step-end infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

/* Roll result */
.msg.roll .msg-avatar {
  background: linear-gradient(135deg, var(--stone), rgba(90,42,0,0.6));
  border-color: var(--amber-dim);
}
.msg.roll .msg-bubble {
  background: linear-gradient(150deg, rgba(70,45,10,0.6), rgba(90,55,10,0.5));
  border: 1px solid var(--amber-dim);
  color: var(--amber-bright);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  letter-spacing: 0.05em;
}

/* ─── DICE TOAST ─── */
.dice-toast {
  position: absolute; bottom: 165px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--surface2), var(--surface3));
  border: 1px solid var(--amber);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.4rem;
  font-family: var(--font-heading);
  color: var(--amber-bright);
  font-size: 1.1rem;
  box-shadow: 0 0 24px rgba(232,160,48,0.4), var(--shadow-deep);
  z-index: 20;
  animation: toastIn 0.4s cubic-bezier(0.16,1,0.3,1);
  white-space: nowrap;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(0.88); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ─── CHAT INPUT AREA ─── */
.chat-input-area {
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, transparent, var(--stone));
  border-top: 2px solid var(--wood-light);
  flex-shrink: 0;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.4);
}

.input-row {
  display: flex; gap: 0.6rem; align-items: flex-end;
  margin-bottom: 0.55rem;
}

.chat-textarea {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  color: var(--text-bright);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.6rem 0.85rem;
  resize: none;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
  max-height: 120px;
}
.chat-textarea:focus {
  outline: none;
  border-color: var(--amber-dim);
  box-shadow: 0 0 0 2px rgba(232,160,48,0.18);
}
.chat-textarea::placeholder { color: var(--text-muted); font-style: italic; }

.btn-send {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--amber-bright) 0%, var(--amber) 100%);
  border: none; border-radius: var(--radius);
  color: var(--ink); font-size: 1.1rem;
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 10px rgba(232,160,48,0.4);
}
.btn-send:hover { transform: scale(1.06); box-shadow: 0 4px 18px rgba(255,170,30,0.6); }
.btn-send:active { transform: scale(0.95); }
.btn-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.input-tools {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
}

.dice-cluster { display: flex; align-items: center; gap: 0.4rem; position: relative; }

.dice-input {
  width: 116px;
  background: var(--surface);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 0.83rem;
  padding: 0.32rem 0.55rem;
  letter-spacing: 0.05em;
}
.dice-input:focus { outline: none; border-color: var(--amber-dim); }

/* ── Dice help button ── */
.dice-help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: 1.25px solid var(--panel-border);
  border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s, border-color 0.2s;
}
.dice-help-btn:hover {
  color: var(--amber);
  border-color: var(--amber-dim);
}
.dice-help-btn svg { width: 14px; height: 14px; }

/* ── Dice help popover ── */
.dice-help-popover {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  z-index: 200;
  min-width: 260px;
  max-width: 320px;
  background: var(--surface2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.5;
}
.dice-help-popover p { margin: 0 0 0.4rem; }
.dice-help-popover p:last-child { margin-bottom: 0; }
.dice-help-popover code {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  color: var(--amber);
  background: rgba(0,0,0,0.3);
  padding: 0.05em 0.3em;
  border-radius: 3px;
}
.dice-help-title {
  font-family: var(--font-title);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.55rem !important;
}
.dice-help-note {
  margin-top: 0.5rem !important;
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* ── Multi-roll row ── */
.multi-roll-row { margin-bottom: 0.2rem; }
.multi-roll-row:last-child { margin-bottom: 0; }

.dice-select {
  background: var(--surface);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--font-heading);
  font-size: 0.74rem;
  padding: 0.32rem 0.4rem;
  cursor: pointer;
}
.dice-select:focus { outline: none; border-color: var(--amber-dim); }

.btn-dice {
  font-family: var(--font-heading);
  font-size: 0.73rem;
  letter-spacing: 0.1em;
  padding: 0.32rem 0.8rem;
  background: var(--surface2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  color: var(--amber);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-dice:hover { border-color: var(--amber); background: var(--wood-light); }


.audio-cluster { display: flex; align-items: center; gap: 0.5rem; }

.btn-mic {
  width: 34px; height: 34px;
  background: var(--surface2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  color: var(--text);
}
.btn-mic:hover { border-color: var(--amber-dim); }
.btn-mic.recording {
  background: rgba(139,32,32,0.35);
  border-color: var(--crimson-bright);
  animation: recordPulse 1s ease-in-out infinite;
}
@keyframes recordPulse {
  0%, 100% { box-shadow: none; }
  50%       { box-shadow: 0 0 10px rgba(192,48,48,0.5); }
}

.mic-status {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  min-width: 80px;
}

/* ─── PANEL NOTES ─── */
.panel-notes {
  background: var(--panel-bg);
  border-left: 2px solid var(--wood-light);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: inset 4px 0 12px rgba(0,0,0,0.25);
}

.notes-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--wood-light);
  background: var(--stone);
}
.notes-title {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber-dim);
}

.notes-body {
  flex: 1; overflow-y: auto;
  padding: 1rem;
}

.notes-empty {
  font-family: var(--font-fell);
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.75;
}

.notes-body ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.notes-body li {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
  padding: 0.3rem 0 0.3rem 1rem;
  border-bottom: 1px solid rgba(90,66,40,0.4);
  position: relative;
}
.notes-body li::before {
  content: '◆';
  position: absolute; left: 0;
  color: var(--amber-dim);
  font-size: 0.52rem;
  top: 0.5rem;
}

/* ─── MARKDOWN IN CHAT ─── */
.msg-bubble p { margin-bottom: 0.6em; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble ul, .msg-bubble ol { padding-left: 1.2rem; margin-bottom: 0.6em; }
.msg-bubble li { margin-bottom: 0.2em; }
.msg-bubble hr { border: none; border-top: 1px solid var(--panel-border); margin: 0.8em 0; }
.msg-bubble code {
  font-family: monospace;
  background: rgba(0,0,0,0.3);
  padding: 0.1em 0.3em;
  border-radius: 2px;
  font-size: 0.88em;
  color: var(--amber);
}

/* ─── LOADING STATE ─── */
.sending .btn-send { opacity: 0.4; pointer-events: none; }
.sending .chat-textarea { opacity: 0.75; }

/* ─── UTILITY ─── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ═══════════════════════════════════════════════
   JOURNAL MODAL
   ═══════════════════════════════════════════════ */

.journal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 8, 3, 0.75);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.journal-overlay.open {
  opacity: 1; pointer-events: all;
}

.journal-modal {
  width: min(480px, 90vw);
  max-height: 75vh;
  background: linear-gradient(160deg, var(--surface2) 0%, var(--panel-bg) 100%);
  border: 2px solid var(--wood-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 60px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,200,80,0.08);
  display: flex; flex-direction: column;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1);
  overflow: hidden;
}
.journal-overlay.open .journal-modal {
  transform: translateY(0) scale(1);
}

.journal-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.1rem;
  background: var(--stone);
  border-bottom: 1px solid var(--wood-light);
  flex-shrink: 0;
}

.journal-modal-title {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
}

.journal-close-btn {
  width: 28px; height: 28px;
  background: transparent;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.8rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.journal-close-btn:hover {
  border-color: var(--amber-dim);
  color: var(--amber);
}

.journal-modal-body {
  flex: 1; overflow-y: auto;
  padding: 1.2rem 1.3rem;
}

/* ─── OBJECTIVES SECTION ─── */
.journal-objectives {
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--wood-light);
}

.journal-objectives-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.6rem;
}

.journal-objectives-title,
.journal-section-title {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}

.journal-score {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: #f6df9a;
  background: rgba(255,200,80,0.08);
  border: 1px solid rgba(255,200,80,0.2);
  border-radius: var(--radius);
  padding: 0.15rem 0.5rem;
}

.journal-modal-body .journal-objectives-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 0.35rem;
}

.journal-modal-body .journal-objective-item {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text);
  padding: 0.25rem 0;
  border-bottom: 0;
  position: static;
}

.journal-modal-body .journal-objective-item::before {
  content: none;
}

.journal-modal-body .journal-objective-icon {
  flex-shrink: 0;
  font-size: 0.75rem;
  width: 1rem; text-align: center;
  color: #6dbf67;
}

.journal-summary-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.journal-summary {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text);
}

.journal-summary p {
  margin: 0 0 0.75rem;
}

.journal-summary p:last-child {
  margin-bottom: 0;
}

.journal-summary ul,
.journal-summary ol {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}

.journal-summary li {
  margin-bottom: 0.28rem;
}


/* ─── OBJECTIVE TOAST ─── */
#objective-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(2rem);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, var(--surface3), var(--surface2));
  border: 1px solid rgba(255, 200, 80, 0.35);
  border-radius: 0.6rem;
  padding: 0.85rem 1.4rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.6), 0 0 12px rgba(232,160,48,0.15);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-bright);
  max-width: min(420px, 90vw);
  text-align: center;
  pointer-events: none;
}

#objective-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.objective-toast-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.objective-toast-list {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.88rem;
  color: var(--amber-dim);
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════════════
   SHEET MODAL
   ═══════════════════════════════════════════════ */

.sheet-modal {
  width: min(620px, 92vw);
  max-height: 82vh;
}

.sheet-modal-body {
  flex: 1; overflow-y: auto;
  padding: 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Stats en vivo */
.sheet-live-stats {
  background: linear-gradient(135deg, var(--stone) 0%, var(--wood-mid) 100%);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 0.3rem;
  box-shadow: inset 0 1px 0 rgba(232,160,48,0.08);
  display: flex;
  flex-direction: row;
  gap: 0;
  overflow: hidden;
  flex-shrink: 0;
}
.sheet-stats-col {
  flex: 1;
  min-width: 0;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sheet-stat-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.sheet-stat-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 90px;
}

.sheet-stat-label {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--amber-dim);
}

.sheet-stat-value {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-bright);
}

.sheet-stat-value.in-combat {
  color: var(--crimson-bright);
}

.sheet-conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

/* Separador con texto */
.sheet-divider[hidden] { display: none; }
.sheet-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.sheet-divider::before,
.sheet-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--panel-border);
}

/* Retrato en la ficha (columna izquierda dentro de sheet-live-stats) */
.sheet-portrait-wrap {
  width: 90px;
  flex-shrink: 0;
  border-right: 1px solid var(--panel-border);
  align-self: stretch;
  position: relative;
}
.sheet-portrait-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.sheet-portrait-clickable {
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.sheet-portrait-clickable:hover { opacity: 0.85; }

/* Lightbox retrato */
.portrait-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: fadeIn 0.18s ease;
}
.portrait-lightbox[hidden] { display: none; }
.portrait-lightbox-img {
  max-width: min(480px, 90vw);
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}

/* Contenedor ficha formateada */
.sheet-text {
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.sheet-section-title {
  font-family: var(--font-title);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0.9rem 0 0.3rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--panel-border);
}
.sheet-section-title:first-child { margin-top: 0; }
.sheet-subsection {
  font-family: var(--font-title);
  font-size: 0.75rem;
  color: var(--amber-dim);
  margin: 0.5rem 0 0.2rem;
  letter-spacing: 0.05em;
}
.sheet-row {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.18rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.sheet-key {
  font-size: 0.75rem;
  color: var(--amber-dim);
  min-width: 7rem;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}
.sheet-val {
  font-size: 0.85rem;
  color: var(--text);
  flex: 1;
}
.sheet-line {
  font-size: 0.85rem;
  color: var(--text-dim, var(--text));
  padding: 0.15rem 0;
}
.sheet-spacer { height: 0.3rem; }
.sheet-loading { color: var(--text-dim); font-style: italic; }


/* ═══════════════════════════════════════════════
   LAYOUT — 2 columns, responsive
   ═══════════════════════════════════════════════ */

.game-layout {
  grid-template-columns: 40% 60%;
}

/* Tablet */
@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 45% 55%;
  }
}

/* Mobile: apila imagen encima del chat */
@media (max-width: 600px) {
  .game-page {
    height: auto;
    min-height: 100dvh;
    overflow-y: auto;
  }
  .game-layout {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .panel-scene {
    display: flex;
    height: 55vw;
    min-height: 180px;
    max-height: 260px;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 2px solid var(--wood-light);
  }
  .panel-chat {
    flex: 1;
    min-height: 0;
  }
  .chat-scroll {
    max-height: 42vh;
  }
  /* Topbar compacto */
  .topbar {
    flex-wrap: wrap;
    padding: 0.4rem 0.7rem;
    gap: 0.25rem;
  }
  .topbar-center {
    order: 3;
    width: 100%;
    padding-top: 0.25rem;
    border-top: 1px solid var(--panel-border);
  }
  .pc-vitals {
    gap: 1rem;
    justify-content: center;
  }
  .hp-bar-wrap { width: 55px; }
  .vital-value { font-size: 0.82rem; }
  /* Input tools en móvil */
  .input-tools {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
}

/* ── Usage Modal ──────────────────────────────────────────── */
.usage-modal { max-width: 420px; }

.world-modal {
  width: min(1100px, 94vw);
  height: 84vh;
  max-height: 84vh;
}

.world-modal-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.world-nav-panel {
  overflow-y: auto;
  border-right: 1px solid rgba(180, 140, 60, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 216, 122, 0.05), rgba(0, 0, 0, 0)),
    rgba(16, 11, 7, 0.34);
  padding: 1rem 0.8rem 1.1rem;
}

.world-nav-empty {
  margin: 0;
  color: var(--gold-dim);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.world-content-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.world-content-header {
  padding: 1rem 1.35rem 0.85rem;
  border-bottom: 1px solid rgba(180, 140, 60, 0.14);
  background: rgba(255, 214, 122, 0.035);
}

.world-tools-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 0.8rem;
}

.world-search-toggle {
  border: 1px solid rgba(214, 181, 117, 0.2);
  background: rgba(255, 215, 130, 0.05);
  color: var(--gold);
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-title);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.world-search-toggle[aria-expanded="true"] {
  background: rgba(214, 181, 117, 0.12);
  color: var(--parchment);
}

.world-search-panel[hidden] {
  display: none;
}

.world-search-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.world-search-input {
  flex: 1;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid rgba(214, 181, 117, 0.2);
  background: rgba(21, 14, 9, 0.72);
  color: var(--parchment);
  padding: 0.72rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.96rem;
  outline: none;
}

.world-search-input::placeholder {
  color: rgba(232, 216, 189, 0.52);
}

.world-search-input:focus {
  border-color: rgba(214, 181, 117, 0.46);
  box-shadow: 0 0 0 3px rgba(214, 181, 117, 0.08);
}

.world-search-btn {
  border: 1px solid rgba(214, 181, 117, 0.24);
  background: linear-gradient(180deg, rgba(214, 181, 117, 0.18), rgba(214, 181, 117, 0.08));
  color: var(--parchment);
  border-radius: 10px;
  padding: 0.72rem 0.95rem;
  font-family: var(--font-title);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.world-search-results {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.95rem;
  max-height: 220px;
  overflow-y: auto;
}

.world-search-results[hidden] {
  display: none;
}

.world-search-result {
  width: 100%;
  border: 1px solid rgba(214, 181, 117, 0.14);
  border-radius: 12px;
  background: rgba(255, 215, 130, 0.04);
  padding: 0.72rem 0.82rem;
  text-align: left;
  color: var(--parchment);
  cursor: pointer;
}

.world-search-result:hover {
  background: rgba(255, 215, 130, 0.08);
  border-color: rgba(214, 181, 117, 0.26);
}

.world-search-result-title {
  display: block;
  margin-bottom: 0.22rem;
  font-family: var(--font-title);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold);
}

.world-search-result-snippet {
  display: block;
  font-family: var(--font-body);
  font-size: 0.94rem;
  line-height: 1.45;
  color: rgba(234, 223, 201, 0.92);
}

.world-page-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  color: var(--parchment);
}

.world-content-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.2rem 1.35rem 1.4rem;
}

.world-lore-content {
  color: var(--parchment);
  line-height: 1.72;
  font-family: var(--font-body);
  font-size: 1rem;
}

.world-lore-content p {
  margin: 0 0 1rem;
}

.world-lore-content strong {
  color: var(--gold);
}

.world-lore-content h1,
.world-lore-content h2,
.world-lore-content h3 {
  margin: 1.35rem 0 0.85rem;
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
  color: var(--gold);
}

.world-lore-content h1:first-child,
.world-lore-content h2:first-child,
.world-lore-content h3:first-child {
  margin-top: 0;
}

.world-lore-content h1 {
  font-size: 1.5rem;
  line-height: 1.2;
  text-shadow: 0 1px 10px rgba(255, 210, 120, 0.14);
}

.world-lore-content h2 {
  font-size: 1.2rem;
  line-height: 1.25;
  color: var(--amber);
}

.world-lore-content h3 {
  font-size: 1rem;
  line-height: 1.3;
  color: var(--gold-dim);
}

.world-lore-content ul,
.world-lore-content ol {
  margin: 0 0 1rem 1.2rem;
  padding: 0;
}

.world-lore-content li {
  margin-bottom: 0.35rem;
}

.world-lore-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  color: #f6dca3;
  background: rgba(255, 222, 160, 0.08);
  border: 1px solid rgba(255, 222, 160, 0.12);
  border-radius: 6px;
  padding: 0.08em 0.35em;
}

.world-tree-group {
  margin-bottom: 0.45rem;
}

.world-tree-folder {
  margin-bottom: 0.3rem;
  border: 1px solid rgba(198, 154, 75, 0.12);
  border-radius: 10px;
  background: rgba(255, 214, 122, 0.025);
}

.world-tree-folder > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.65rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--gold-dim);
  font-family: var(--font-title);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.world-tree-folder > summary::-webkit-details-marker {
  display: none;
}

.world-tree-folder > summary::before {
  content: "▸";
  transition: transform 0.18s ease;
  color: var(--amber);
}

.world-tree-folder[open] > summary::before {
  transform: rotate(90deg);
}

.world-tree-folder-children {
  padding: 0 0.4rem 0.45rem 0.95rem;
}

.world-page-btn {
  width: 100%;
  margin: 0 0 0.34rem;
  border: 1px solid rgba(212, 172, 100, 0.12);
  border-radius: 9px;
  background: rgba(255, 215, 130, 0.03);
  color: var(--parchment);
  text-align: left;
  padding: 0.62rem 0.72rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.world-page-btn:hover {
  background: rgba(255, 215, 130, 0.07);
  border-color: rgba(212, 172, 100, 0.24);
  transform: translateX(2px);
}

.world-page-btn.active {
  background: rgba(214, 181, 117, 0.12);
  border-color: rgba(214, 181, 117, 0.34);
  color: var(--gold);
}

@media (max-width: 860px) {
  .world-modal {
    width: min(96vw, 96vw);
    height: 88vh;
    max-height: 88vh;
  }

  .world-modal-body {
    grid-template-columns: 1fr;
    min-height: auto;
    max-height: none;
  }

  .world-nav-panel {
    max-height: 30vh;
    border-right: 0;
    border-bottom: 1px solid rgba(180, 140, 60, 0.18);
  }

  .world-content-body {
    min-height: 36vh;
  }
}

.usage-setting-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.1rem;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(0,0,0,0.2);
}

.usage-setting-label {
  font-family: var(--font-title);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
  white-space: nowrap;
}

.usage-setting-wrap {
  flex: 1;
}

.usage-setting-select {
  font-size: 0.8rem;
  padding: 0.3rem 1.8rem 0.3rem 0.6rem;
}

.usage-setting-warn {
  margin: 0;
  padding: 0.4rem 1.1rem;
  font-size: 0.72rem;
  color: var(--amber);
  background: rgba(245,158,11,0.08);
  border-bottom: 1px solid var(--panel-border);
}

.usage-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.usage-item {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
}

.usage-item-title {
  font-family: var(--font-title);
  font-size: 0.72rem;
  color: var(--amber-bright);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.usage-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-dim);
  padding: 0.1rem 0;
}

.usage-item-row span:last-child {
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.usage-item-cost {
  margin-top: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--panel-border);
}

.usage-item-cost span:last-child {
  color: var(--amber-bright);
  font-weight: 600;
}

.usage-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.85rem;
  background: rgba(212,175,55,0.08);
  border: 1px solid var(--amber-dim);
  border-radius: 6px;
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--text-main);
}

.usage-total span:last-child {
  font-size: 1.2rem;
  color: var(--amber-bright);
  font-weight: 700;
}

/* ─────────────────────────────────────────────
   LOGIN PAGE
   ───────────────────────────────────────────── */

.login-fields {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  max-width: 420px;
  margin: 0 auto 2rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.login-input {
  background: rgba(10, 6, 2, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.login-input::placeholder {
  color: var(--text-dim);
  font-style: italic;
}

.login-input:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 2px rgba(212,175,55,0.15);
}

.login-error {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  background: rgba(180, 50, 30, 0.18);
  border: 1px solid rgba(200, 70, 50, 0.45);
  border-radius: 6px;
  color: #e07060;
  font-family: var(--font-body);
  font-size: 0.92rem;
  animation: fadeIn 0.3s ease;
}

.error-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════
   ADVENTURE SELECTOR — Landing page
   ═══════════════════════════════════════════════════════ */

/* ── Step labels ── */
.selector-step {
  margin-bottom: 1.8rem;
}

.step-label {
  display: block;
  font-family: var(--font-title);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--gold-dim);
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

/* ── Dropdown ── */
.adventure-dropdown-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 480px;
}

.adventure-select {
  width: 100%;
  appearance: none;
  background: rgba(10, 6, 2, 0.75);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 0.75rem 2.4rem 0.75rem 1rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.adventure-select:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 2px rgba(212,175,55,0.15);
}

.adventure-select option {
  background: #1a1208;
  color: var(--text-main);
}

.select-arrow {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-dim);
  pointer-events: none;
  font-size: 0.85rem;
}

/* ── Adventure preview panel ── */
.adventure-preview {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.8rem;
  animation: fadeIn 0.3s ease;
}

.adv-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin-bottom: 1rem;
}

.adv-meta-item {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.meta-label {
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: var(--gold-dim);
  text-transform: uppercase;
  flex-shrink: 0;
}

.meta-value {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--text-main);
}

.adv-sinopsis {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 1.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--panel-border);
}

/* ── Character grid ── */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.chars-loading {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem 0;
}

/* ── Character card ── */
.char-card {
  display: flex;
  gap: 0.9rem;
  background: rgba(10, 6, 2, 0.55);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  position: relative;
}

.char-card:hover {
  border-color: var(--gold-dim);
  background: rgba(212,175,55,0.06);
}

.char-card.selected {
  border-color: var(--gold);
  background: rgba(212,175,55,0.1);
  box-shadow: 0 0 0 2px rgba(212,175,55,0.25);
}

.char-card.selected::after {
  content: "✦";
  position: absolute;
  top: 0.28rem;
  left: 0.7rem;
  color: var(--gold);
  font-size: 0.75rem;
}

/* ── Portrait ── */
.char-portrait {
  flex-shrink: 0;
  width: 72px;
  height: 90px;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  background: rgba(0,0,0,0.4);
}

.char-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* ── Card text ── */
.char-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  align-items: flex-start;
  text-align: left;
}

.char-name {
  font-family: var(--font-title);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--gold);
  margin: 0 0 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.char-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}

.char-tag {
  font-family: var(--font-title);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
}

.tag-raza {
  background: rgba(212,175,55,0.15);
  color: var(--gold-dim);
  border: 1px solid rgba(212,175,55,0.25);
}

.tag-nivel {
  background: rgba(130,100,60,0.2);
  color: var(--amber);
  border: 1px solid rgba(130,100,60,0.3);
}

.char-clase {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-main);
  font-weight: 600;
}

.char-subclase {
  font-family: var(--font-body);
  font-size: 0.76rem;
  color: var(--text-dim);
  font-style: italic;
}

.char-trasfondo {
  font-family: var(--font-body);
  font-size: 0.76rem;
  color: var(--text-dim);
}

.char-historia {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.45;
  margin: 0.3rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Mode tabs ── */
.mode-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.4rem;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
}

.mode-tab {
  flex: 1;
  padding: 0.6rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-title);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.mode-tab:first-child {
  border-right: 1px solid var(--panel-border);
}

.mode-tab:hover {
  background: rgba(212,175,55,0.06);
  color: var(--text-main);
}

.mode-tab.active {
  background: rgba(212,175,55,0.12);
  color: var(--gold);
}

/* ── Save dropzone ── */
.save-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 2.5rem 1.5rem;
  border: 2px dashed var(--panel-border);
  border-radius: 10px;
  background: rgba(10,6,2,0.4);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
  margin-bottom: 0.5rem;
}

.save-dropzone:hover,
.save-dropzone.drag-over {
  border-color: var(--gold-dim);
  background: rgba(212,175,55,0.05);
}

.save-dropzone.has-file {
  border-color: var(--gold);
  background: rgba(212,175,55,0.08);
}

.save-dropzone-icon {
  font-size: 2rem;
  line-height: 1;
}

.save-dropzone-text {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-dim);
  max-width: 320px;
  width: 100%;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: break-all;
}

.save-dropzone.has-file .save-dropzone-text {
  color: var(--gold);
}

/* ── Save info panel ── */
.save-info {
  margin-top: 0.75rem;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: rgba(0,0,0,0.25);
  overflow: hidden;
}

.save-info-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid var(--panel-border);
}

.save-info-row:last-child {
  border-bottom: none;
}

.save-info-label {
  font-family: var(--font-title);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  min-width: 9rem;
}

.save-info-value {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--gold);
}

/* ── Compact char-grid ── */
.char-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* ── Compact char-card ── */
.char-portrait--sm {
  width: 100%;
  height: 140px;
  border-radius: 6px 6px 0 0;
}

.char-card {
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
}

.char-main {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
}

/* ── Lupa button ── */
.char-detail-btn {
  position: absolute;
  bottom: 0.45rem;
  right: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: linear-gradient(160deg, var(--surface3, #2a1f14) 0%, var(--surface, #1a1008) 100%);
  border: 1px solid var(--wood-light);
  border-radius: 5px;
  color: var(--amber-dim);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
  z-index: 1;
}

.char-detail-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  pointer-events: none;
}

.char-detail-btn:hover {
  background: linear-gradient(160deg, var(--stone-light, #3a2d1e) 0%, var(--stone, #2a1f14) 100%);
  border-color: var(--amber-dim);
  color: var(--amber);
  box-shadow: 0 3px 12px rgba(232,160,48,0.28), inset 0 1px 0 rgba(255,255,255,0.06);
  transform: translateY(-1px);
}

.char-detail-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* Lupa inline dentro de char-role-btns (cancela el absolute) */
.char-detail-inline {
  position: static;
  width: 2rem;
  height: 2rem;
  margin-left: auto;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Character detail popup ── */
.char-detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
}

.char-detail-overlay.is-open {
  display: flex;
}

.char-detail-panel {
  position: relative;
  background: var(--panel-bg, rgba(20,12,6,0.97));
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}

.char-detail-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  background: transparent;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.char-detail-close:hover {
  color: var(--gold);
  border-color: var(--gold-dim);
}

.char-detail-body {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.char-detail-portrait-wrap {
  flex-shrink: 0;
  width: 140px;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  background: rgba(0,0,0,0.4);
}

.char-detail-portrait-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.char-detail-info {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
}

.char-detail-name {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--gold);
  margin: 0 0 0.3rem;
  letter-spacing: 0.04em;
}

.char-detail-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.char-detail-clase {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-main);
  font-weight: 600;
}

.char-detail-subclase {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-dim);
  font-style: italic;
}

.char-detail-trasfondo {
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.char-detail-historia {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.65;
  margin: 0.4rem 0 0;
}

/* Responsive */
@media (max-width: 520px) {
  .char-grid {
    grid-template-columns: 1fr;
  }

  .adv-meta-grid {
    flex-direction: column;
    gap: 0.4rem;
  }

  .char-detail-body {
    flex-direction: column;
    align-items: center;
  }

  .char-detail-portrait-wrap {
    width: 120px;
    height: 150px;
  }
}

/* ═══════════════════════════════════════════════════════
   ADVENTURE ENDED POPUP
   ═══════════════════════════════════════════════════════ */
.adventure-ended-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.adventure-ended-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.adventure-ended-panel {
  background: var(--surface);
  border: 1px solid var(--gold-dim);
  border-radius: 8px;
  padding: 2.5rem 2rem 2rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 60px rgba(212, 175, 55, 0.15), 0 8px 32px rgba(0,0,0,0.6);
  transform: translateY(20px);
  transition: transform 0.4s ease;
}
.adventure-ended-overlay.is-open .adventure-ended-panel {
  transform: translateY(0);
}

.adventure-ended-emblem {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.2rem;
  opacity: 0.9;
}
.adventure-ended-emblem svg { width: 100%; height: 100%; }

.adventure-ended-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--gold);
  margin: 0 0 0.4rem;
  letter-spacing: 0.05em;
}

.adventure-ended-subtitle {
  font-family: var(--font-body-italic, var(--font-body));
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0 0 1rem;
}

.adventure-ended-rule {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.8rem 0 1rem;
  color: var(--gold-dim);
}
.adventure-ended-rule span:first-child,
.adventure-ended-rule span:last-child {
  flex: 1;
  height: 1px;
  background: var(--gold-dim);
  opacity: 0.4;
}
.adventure-ended-rule .diamond { font-size: 0.65rem; }

.adventure-ended-body {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 1.8rem;
}

.btn-adventure-ended {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  padding: 0.6rem 2rem;
  background: var(--surface2);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  color: var(--gold);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.btn-adventure-ended:hover {
  border-color: var(--gold);
  background: var(--wood-light);
  box-shadow: 0 0 12px rgba(212,175,55,0.2);
}

/* ─── Campaign & companion role styles ──────────────────────────── */

.chars-hint {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-dim);
  font-style: italic;
  margin: 0 0 0.8rem;
  text-align: center;
}

/* Botones de rol dentro de la tarjeta */
.char-role-btns {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.char-role-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--gold-dim);
  background: var(--surface2);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.char-role-btn:hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--wood-light);
  transform: scale(1.12);
}

.char-role-btn.active {
  border-color: var(--gold);
  background: rgba(212,175,55,0.22);
  box-shadow: 0 0 8px rgba(212,175,55,0.35);
  transform: scale(1.08);
}

.char-role-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

/* Borde de selección en tarjeta según rol */
.char-card.role-selected-player {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(212,175,55,0.3);
}

.char-card.role-selected-companion {
  border-color: #7eb8d4;
  box-shadow: 0 0 12px rgba(126,184,212,0.25);
}

/* Primera aventura info */
.first-adventure-wrap {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}

.adventure-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.adventure-cover {
  width: 180px;
  max-width: 40%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 0.45rem;
  display: block;
  flex-shrink: 0;
  cursor: zoom-in;
  transition: opacity 0.15s;
}

.adventure-cover[hidden] {
  display: none !important;
}

.adventure-cover:hover { opacity: 0.88; }

.adventure-info {
  flex: 1;
  min-width: 0;
}

.campaign-cover-banner {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 0.65rem;
  display: block;
  margin-bottom: 1rem;
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.campaign-cover-banner:hover { opacity: 0.9; }

.first-adv-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.first-adv-badge {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  background: rgba(212,175,55,0.12);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}

.first-adv-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--text-main);
}

.first-adv-sinopsis {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-dim);
  font-style: italic;
  margin: 0 0 0.6rem;
  line-height: 1.5;
}

.first-adv-meta {
  margin-top: 0.4rem;
}

.campaign-mode-note {
  margin: 0.8rem 0 1rem;
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.55;
  font-style: italic;
}

.selector-step--embedded {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(212,175,55,0.16);
}

.adventure-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.9rem;
}

.adventure-choice-card {
  position: relative;
  border: 1px solid rgba(212,175,55,0.18);
  border-radius: 0.6rem;
  overflow: hidden;
  background: rgba(0,0,0,0.18);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.adventure-choice-card:hover {
  transform: translateY(-2px);
  border-color: rgba(212,175,55,0.4);
  box-shadow: 0 8px 22px rgba(0,0,0,0.28);
}

.adventure-choice-card.is-selected {
  border-color: rgba(212,175,55,0.65);
  box-shadow: 0 0 0 1px rgba(212,175,55,0.32), 0 10px 26px rgba(0,0,0,0.34);
}

.adventure-choice-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  object-position: center;
  display: block;
  background: rgba(18,12,8,0.55);
}

.adventure-choice-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.6rem 0.7rem;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  line-height: 1.25;
  color: var(--text-bright);
  background: linear-gradient(to top, rgba(12,9,6,0.92), rgba(12,9,6,0.1));
}

@media (max-width: 680px) {
  .adventure-layout {
    flex-direction: column;
  }

  .adventure-cover {
    width: 100%;
    max-width: 100%;
    max-height: 260px;
    margin-bottom: 0.15rem;
  }

  .adventure-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Contexto desplegable */
#campaign-preview {
  display: flex;
  flex-direction: column;
}

#campaign-preview[hidden] {
  display: none !important;
}

#campaign-preview .camp-layout { order: 1; }
#campaign-preview .campaign-mode-note { order: 2; }
#campaign-preview #adventure-step { order: 3; }
#campaign-preview #first-adventure-wrap { order: 4; }
#campaign-preview #char-step { order: 5; }

.camp-layout {
  display: block;
  margin-bottom: 1rem;
}

.camp-info-header {
  margin-bottom: 0.35rem;
}

.camp-ambientacion-text {
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin: 0;
}

.camp-meta-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.85rem;
}

.camp-world-text {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-title);
  font-size: 0.74rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--parchment);
  background: rgba(214, 181, 117, 0.08);
  border: 1px solid rgba(214, 181, 117, 0.26);
  border-radius: 3px;
  padding: 0.22em 0.7em;
  white-space: nowrap;
}
.camp-world-text::before {
  content: "✦";
  font-size: 0.78em;
  opacity: 0.72;
}

.camp-sistema-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-title);
  font-size: 0.74rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--parchment);
  background: rgba(180, 120, 30, 0.12);
  border: 1px solid rgba(180, 120, 30, 0.3);
  border-radius: 3px;
  padding: 0.22em 0.7em;
  white-space: nowrap;
}
.camp-sistema-tag::before {
  content: "⚄";
  font-size: 0.75em;
  opacity: 0.84;
}

.camp-story-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-title);
  font-size: 0.74rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--parchment);
  background: rgba(125, 76, 33, 0.16);
  border: 1px solid rgba(214, 181, 117, 0.28);
  border-radius: 3px;
  padding: 0.22em 0.7em;
  white-space: nowrap;
}

.camp-story-tag[hidden] {
  display: none !important;
}

.camp-story-tag::before {
  content: "✦";
  font-size: 0.75em;
  opacity: 0.84;
}

/* ── Lightbox ── */
.cover-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cover-lightbox[hidden] { display: none; }

.cover-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
}

.cover-lightbox-img {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 0.75rem;
  box-shadow: 0 8px 40px rgba(0,0,0,0.8);
  object-fit: contain;
  cursor: zoom-out;
}

.camp-info {
  flex: 1;
  min-width: 0;
}

.camp-contexto-wrap {
  margin-bottom: 1rem;
}

.camp-contexto-details summary.camp-contexto-summary {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--gold-dim);
  cursor: pointer;
  user-select: none;
  padding: 0.3rem 0;
  list-style: none;
}
.camp-contexto-details summary.camp-contexto-summary::marker,
.camp-contexto-details summary.camp-contexto-summary::-webkit-details-marker { display: none; }
.camp-contexto-details summary.camp-contexto-summary::before {
  content: '▸ ';
  font-size: 0.7rem;
}
.camp-contexto-details[open] summary.camp-contexto-summary::before {
  content: '▾ ';
}

.camp-contexto-text {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.6;
  white-space: pre-line;
  margin: 0.5rem 0 0;
  padding: 0.6rem 0.8rem;
  border-left: 2px solid rgba(212,175,55,0.25);
}

/* ═══════════════════════════════════════════════
   SPELL LIST (hoja de personaje)
   ═══════════════════════════════════════════════ */

.spell-category {
  margin-bottom: 1rem;
}

.spell-category-heading {
  font-family: var(--font-title);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-dim);
  padding: 0.2rem 0 0.4rem;
  border-bottom: 1px solid rgba(212,175,55,0.2);
  margin-bottom: 0.4rem;
}

.spell-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.spell-list-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
}

.spell-name-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: color 0.15s;
}

.spell-name-btn:hover {
  color: var(--gold);
  text-decoration: underline;
}

.spell-level-badge {
  font-family: var(--font-title);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: rgba(212,175,55,0.6);
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 3px;
  padding: 0.1em 0.45em;
  white-space: nowrap;
}

/* Conjuro consumido (espacio de conjuro agotado) */
.spell-list-item--consumed .spell-name-btn {
  color: rgba(180,160,130,0.35);
  text-decoration: line-through;
  cursor: pointer;
}
.spell-list-item--consumed .spell-name-btn:hover {
  color: rgba(180,160,130,0.55);
}
.spell-consumed-tag {
  font-family: var(--font-title);
  font-size: 0.6rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(180,80,60,0.7);
  background: rgba(180,80,60,0.08);
  border: 1px solid rgba(180,80,60,0.2);
  border-radius: 3px;
  padding: 0.1em 0.45em;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════
   SPELL DETAIL POPUP
   ═══════════════════════════════════════════════ */

.spell-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spell-detail-overlay[hidden] { display: none; }

.spell-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,8,6,0.75);
}

.spell-detail-panel {
  position: relative;
  z-index: 1;
  background: linear-gradient(160deg, #1a1410 0%, #100d09 100%);
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
  max-width: 480px;
  width: calc(100% - 2rem);
  max-height: 80vh;
  overflow-y: auto;
  padding: 1.4rem 1.6rem 1.6rem;
}

.spell-detail-close {
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}
.spell-detail-close:hover { color: var(--gold); }

.spell-detail-header {
  margin-bottom: 0.9rem;
  padding-right: 1.5rem;
}

.spell-detail-name {
  font-family: var(--font-title);
  font-size: 1.15rem;
  color: var(--gold);
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.spell-detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.spell-detail-level,
.spell-detail-school {
  font-family: var(--font-title);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.spell-detail-ritual {
  font-family: var(--font-title);
  font-size: 0.68rem;
  color: rgba(212,175,55,0.75);
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: 3px;
  padding: 0.1em 0.45em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.spell-detail-props {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(212,175,55,0.15);
  border-radius: 4px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.9rem;
}

.spell-prop-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.2rem 0;
  font-size: 0.88rem;
}

.spell-prop-label {
  font-family: var(--font-title);
  font-size: 0.72rem;
  color: var(--gold-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-width: 9rem;
  padding-top: 0.05em;
}

.spell-prop-val {
  font-family: var(--font-body);
  color: var(--text-light);
  flex: 1;
}

.spell-detail-desc {
  font-family: var(--font-body);
  font-size: 0.93rem;
  color: var(--text-dim);
  line-height: 1.65;
  margin: 0;
  white-space: pre-wrap;
}


/* ═══════════════════════════════════════════════
   COMPANIONS STATE POPUP
   ═══════════════════════════════════════════════ */

.companions-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 8, 3, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 4.5rem 1.2rem 1.2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.companions-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.companions-modal {
  width: min(400px, 92vw);
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, var(--surface2) 0%, var(--panel-bg) 100%);
  border: 2px solid var(--wood-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 60px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,200,80,0.08);
  transform: translateX(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1);
  overflow: hidden;
}
.companions-overlay.open .companions-modal {
  transform: translateX(0) scale(1);
}
.companions-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.1rem 0.7rem;
  border-bottom: 1px solid rgba(180,140,60,0.2);
  background: rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.companions-modal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-transform: uppercase;
}
.companions-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s;
}
.companions-close-btn:hover { color: var(--gold); }
.companions-modal-body {
  padding: 0.8rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.companions-empty {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.9rem;
  text-align: center;
  margin: 0.5rem 0;
}

/* ── Companion Card ── */
.comp-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(180,140,60,0.15);
  border-radius: var(--radius);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.comp-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.comp-portrait-wrap {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(180,140,60,0.3);
  background: rgba(0,0,0,0.3);
}
.comp-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.comp-portrait-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-dim);
}
.comp-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.comp-name {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--text-light);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comp-hp-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.comp-hp-label {
  font-family: var(--font-title);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.comp-hp-value {
  font-size: 0.9rem;
  color: var(--text-light);
  font-family: var(--font-title);
}
.comp-hp-bar-wrap {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.comp-hp-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
  background: linear-gradient(90deg, var(--hp-green), #6fb85d);
}
.comp-hp-bar.warning { background: linear-gradient(90deg, var(--hp-yellow), #c8a030); }
.comp-hp-bar.danger  { background: linear-gradient(90deg, var(--hp-red), var(--crimson-bright)); }

/* ── Spells section ── */
.comp-spells-section {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(180,140,60,0.1);
}
.comp-spell-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.comp-spell-label {
  font-family: var(--font-title);
  font-size: 0.6rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  padding-top: 0.15rem;
  min-width: 4.5rem;
}
.comp-spell-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.comp-spell-tag {
  font-size: 0.72rem;
  color: rgba(212,175,55,0.85);
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 3px;
  padding: 0.1em 0.4em;
  white-space: nowrap;
}
.comp-spell-tag--cantrip {
  color: rgba(160,200,160,0.85);
  background: rgba(100,160,100,0.08);
  border-color: rgba(100,160,100,0.2);
}
.comp-spell-tag--consumed {
  color: rgba(180,80,60,0.6);
  background: rgba(180,80,60,0.06);
  border-color: rgba(180,80,60,0.18);
}
.comp-spell-strike { text-decoration: line-through; }

/* ── Equipment section ── */
.comp-equipo-section {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(180,140,60,0.1);
}
.comp-section-label {
  font-family: var(--font-title);
  font-size: 0.6rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.comp-equipo-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.comp-equipo-item {
  font-size: 0.8rem;
  color: var(--text-light);
  padding-left: 0.6rem;
  position: relative;
}
.comp-equipo-item::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--text-dim);
}
