/* ==========================================================================
   CÓDICE VIVO · SISTEMA DE DISEÑO UNIFICADO
   Fantasía oscura refinada, ergonomía de mesa de rol y soporte móvil completo
   ========================================================================== */

:root {
  --bg: #0c1017;
  --bg-surface: #141b24;
  --bg-surface-elevated: #1a2330;
  --bg-surface-glass: rgba(20, 27, 36, 0.92);
  --line: rgba(255, 255, 255, 0.08);
  --line-accent: rgba(229, 193, 123, 0.35);
  --text: #f0f3f6;
  --muted: #8e9cae;
  --story-text: #e8eaed;
  --gold: #e5c17b;
  --gold-glow: rgba(229, 193, 123, 0.15);
  --gold-hover: #f3d58f;
  --emerald: #5ec89b;
  --amber: #e5a75b;
  --danger: #e06c75;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-story: "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

html {
  font-size: 16px;
  background-color: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 10%, rgba(229, 193, 123, 0.05), transparent 45%),
    linear-gradient(180deg, #0e141d 0%, #0c1017 100%);
  font-family: var(--font-ui);
  line-height: 1.6;
}

h1, h2, h3, h4, .brand-mark, .hero-title, .game-title {
  font-family: var(--font-story);
  color: var(--text);
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--gold-hover);
}

/* ==========================================================================
   APP SHELL & TOP NAVBAR
   ========================================================================== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: var(--bg-surface-glass);
  border-bottom: 1px solid var(--line);
}

.app-nav {
  padding: 0.65rem 1.25rem;
  max-width: 1540px;
  margin: auto;
  gap: 1rem;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.25rem;
  letter-spacing: 0.03em;
  color: var(--gold);
}

.brand-mark small {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-left: 0.35rem;
}

.brand-sigil {
  color: var(--gold);
  font-size: 1.4rem;
}

.app-tabs .nav-link {
  color: var(--muted);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.app-tabs .nav-link:hover,
.app-tabs .nav-link:focus {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.app-tabs .nav-link.active {
  color: var(--gold);
  background: var(--gold-glow);
  box-shadow: inset 0 -2px var(--gold);
}

.nav-account {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.page-host {
  flex: 1;
  padding-top: 2rem;
  width: 100%;
}

.page-host--fluid {
  padding-top: 0.75rem;
}

.app-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 1.5rem 0 2rem;
  font-size: 0.85rem;
  margin-top: 3rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   BOTONES Y CONTROLES DE FORMULARIO
   ========================================================================== */
.btn {
  border-radius: 8px;
  padding: 0.55rem 1.15rem;
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.btn-sm {
  min-height: 36px;
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
}

.btn-lg {
  min-height: 48px;
  padding: 0.75rem 1.6rem;
  font-size: 1rem;
}

.btn-dark {
  background: linear-gradient(135deg, #d8b266, #b88a4a);
  border: 1px solid rgba(229, 193, 123, 0.4);
  color: #0c1017;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(216, 178, 102, 0.2);
}

.btn-dark:hover,
.btn-dark:focus {
  background: linear-gradient(135deg, #e5c17b, #c79854);
  color: #0c1017;
  box-shadow: 0 6px 20px rgba(216, 178, 102, 0.35);
}

.btn-outline-light,
.btn-outline-dark,
.btn-outline-gold {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.btn-outline-light:hover,
.btn-outline-dark:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-outline-gold {
  color: var(--gold);
  border-color: var(--line-accent);
}

.btn-outline-gold:hover {
  background: var(--gold);
  color: #0c1017;
}

.btn-danger {
  background: rgba(224, 108, 117, 0.15);
  border: 1px solid rgba(224, 108, 117, 0.4);
  color: #ffb4ae;
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.form-control,
.form-select {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  min-height: 44px;
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  background: var(--bg-surface-elevated);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
  color: var(--text);
}

.form-control::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.form-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

/* ==========================================================================
   COMPONENTES: CARDS, PANELES Y CHIPS
   ========================================================================== */
.content-panel,
.game-card,
.campaign-card,
.empty-panel,
.info-panel,
.auth-card,
.rpg-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.4rem;
  position: relative;
  transition: all 0.2s ease;
}

.game-card:hover,
.campaign-card:hover {
  border-color: var(--line-accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
}

.chip--accent {
  background: var(--gold-glow);
  border-color: var(--line-accent);
  color: var(--gold);
}

.status-pill {
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill--active {
  background: rgba(94, 200, 155, 0.15);
  border: 1px solid rgba(94, 200, 155, 0.3);
  color: var(--emerald);
}

.status-pill--waitingforplayers {
  background: var(--gold-glow);
  border: 1px solid var(--line-accent);
  color: var(--gold);
}

.status-pill--paused {
  background: rgba(229, 167, 91, 0.15);
  border: 1px solid rgba(229, 167, 91, 0.3);
  color: var(--amber);
}

.badge-yourturn {
  background: var(--gold-glow);
  border: 1px solid var(--line-accent);
  color: var(--gold);
  animation: pulse 2s infinite;
}

/* ==========================================================================
   PORTADA / HERO Y PASOS DE JUEGO (LANDING)
   ========================================================================== */
.story-hero {
  padding: 4.5rem 1.5rem 3.5rem;
  text-align: center;
  background: radial-gradient(circle at 50% 20%, rgba(229, 193, 123, 0.09), transparent 60%);
  border-bottom: 1px solid var(--line);
  margin-bottom: 3rem;
}

.story-hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  line-height: 1.15;
  margin: 1rem auto 1.5rem;
  max-width: 800px;
}

.story-hero p {
  max-width: 680px;
  margin: 0 auto 2.2rem;
  font-size: 1.18rem;
  color: var(--muted);
  line-height: 1.7;
}

.landing-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.8rem;
  margin-top: 1.5rem;
}

.landing-step {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.75rem;
  position: relative;
}

.landing-step__number {
  font-family: var(--font-story);
  font-size: 2.2rem;
  color: var(--gold);
  opacity: 0.35;
  line-height: 1;
  margin-bottom: 0.75rem;
  display: block;
}

.landing-step h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.landing-step p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ==========================================================================
   MESA DE ROL (IN-GAME WORKSPACE & LAYOUT)
   ========================================================================== */
.body-game-window .app-footer {
  display: none;
}

.game-workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  gap: 1.25rem;
  align-items: start;
  width: 100%;
}

.game-rail {
  position: sticky;
  top: 4.8rem;
  display: grid;
  gap: 1rem;
}

.game-rail__header,
.game-rail__meta,
.game-rail__nav,
.game-rail__footer,
.game-chat__panel {
  border: 1px solid var(--line);
  background: var(--bg-surface);
  border-radius: 14px;
}

.game-rail__header,
.game-rail__meta,
.game-rail__footer {
  padding: 1.1rem;
}

.game-rail__header h1 {
  font-size: 1.4rem;
  margin: 0.2rem 0;
  line-height: 1.25;
}

.game-rail__nav {
  padding: 0.6rem;
  display: grid;
  gap: 0.35rem;
}

.game-nav-link {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.game-nav-link:hover,
.game-nav-link:focus {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.game-nav-link.is-active {
  color: var(--gold);
  border-color: var(--line-accent);
  background: var(--gold-glow);
}

.game-mini-card {
  padding: 0.75rem 0.85rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.game-mini-card span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
}

.game-mini-card strong {
  display: block;
  font-size: 0.95rem;
}

/* ÁREA CENTRAL Y CRÓNICA */
.game-main {
  min-width: 0;
  display: grid;
  gap: 1rem;
}

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

.story-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.story-card header strong {
  color: var(--gold);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.story-card header span {
  color: var(--muted);
  font-size: 0.8rem;
}

.story-card p {
  font-family: var(--font-story);
  font-size: 1.15rem;
  line-height: 1.85;
  color: var(--story-text);
  margin-top: 0.5rem;
}

.story-dropcap {
  font-size: 1.35em;
  font-weight: 700;
  color: var(--gold);
  margin-right: 2px;
}

.dialogue-quote {
  border-left: 3px solid var(--gold);
  padding-left: 1rem;
  margin: 1.25rem 0;
  color: #f7e6c4;
  font-style: italic;
}

/* COMPOSITOR DE ACCIÓN */
.composer-dock {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
}

.quick-tags {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.tag-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tag-btn:hover {
  color: var(--gold);
  border-color: var(--line-accent);
  background: var(--gold-glow);
}

.game-turn-textarea {
  min-height: 110px;
  resize: vertical;
}

/* BARRA INFERIOR EXCLUSIVA PARA MÓVIL (< 900px) */
.mobile-bottom-tabs {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 54px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--line-accent);
  align-items: center;
  justify-content: space-around;
  padding: 0 0.5rem;
  z-index: 1000;
  backdrop-filter: blur(12px);
}

.mobile-tab-item {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.72rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  flex: 1;
  padding: 4px 0;
  font-weight: 600;
}

.mobile-tab-item.is-active,
.mobile-tab-item:hover {
  color: var(--gold);
}

/* ==========================================================================
   REGLAS RESPONSIVAS MÓVILES (< 900px)
   ========================================================================== */
@media (max-width: 900px) {
  .game-workspace {
    grid-template-columns: 1fr;
    padding-bottom: 60px; /* Espacio para barra inferior */
  }

  aside.game-rail,
  aside.game-chat {
    display: none !important;
  }

  .mobile-bottom-tabs {
    display: flex !important;
  }

  .story-hero {
    padding: 2.75rem 1rem 2rem;
  }

  .story-card {
    padding: 1.1rem;
  }

  .app-nav {
    padding: 0.5rem 1rem;
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ================================================================
   CLASES COMPLEMENTARIAS — añadidas en rediseño Códice Vivo
   ================================================================ */

/* ---- Layout helpers ---- */
.section-title {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.section-title h1, .section-title h2 { margin: 0; font-size: 1.3rem; }
.section-title span { font-size: .82rem; color: var(--muted); }

.page-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.page-intro h1 { margin: 0 0 .4rem; }
.page-intro p { color: var(--muted); margin: 0; }
.page-intro__meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.muted-copy { color: var(--muted); font-size: .88rem; }

.inline-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.inline-actions form { margin: 0; }

.section-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}
.section-grid--wide { grid-template-columns: 1fr 380px; }
@media (max-width: 900px) {
  .section-grid, .section-grid--wide { grid-template-columns: 1fr; }
}

.stack-list { display: flex; flex-direction: column; gap: 1rem; }

.collection-tools {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.collection-tools label { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.collection-tools .form-control { max-width: 260px; }

/* ---- Record cards (admin accordions) ---- */
.record-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.record-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.record-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1.1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.record-card__header::-webkit-details-marker { display: none; }
.record-card__header::after { content: '▸'; color: var(--muted); flex-shrink: 0; }
details[open] .record-card__header::after { content: '▾'; }
.record-card__header strong { font-size: 1rem; }
.record-card__summary { font-size: .82rem; color: var(--muted); margin: .2rem 0 0; }

.record-card__body {
  padding: 1rem 1.1rem 1.1rem;
  border-top: 1px solid var(--border);
}
.record-card__footer {
  padding: .8rem 1.1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.record-card__toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: .5rem;
}
.record-card__danger {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(220,53,69,.25);
  display: flex;
  justify-content: flex-end;
}

/* ---- Form layouts ---- */
.form-stack { display: flex; flex-direction: column; gap: .85rem; }
.form-stack .field, .form-stack > div { display: flex; flex-direction: column; gap: .3rem; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem 1.2rem;
  align-items: start;
}
.form-grid > div { display: flex; flex-direction: column; gap: .3rem; }
.grid-span-2 { grid-column: 1 / -1; }
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
}

.advanced-fields { margin: .5rem 0; }
.advanced-fields > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: .88rem;
  padding: .4rem 0;
  list-style: none;
  user-select: none;
}
.advanced-fields > summary::-webkit-details-marker { display: none; }
.advanced-fields > summary::before { content: '▸ '; }
details[open].advanced-fields > summary::before { content: '▾ '; }

.field-hint { font-size: .78rem; color: var(--muted); margin-top: .2rem; display: block; }

/* ---- Auth pages ---- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.2rem 2rem;
  width: 100%;
  max-width: 420px;
}
.auth-card--wide { max-width: 580px; }
.auth-note { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 1rem; }

/* ---- Game workspace panels ---- */
.game-overview-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.game-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.game-panel--story { flex: 1 1 auto; min-height: 0; }
.game-panel--composer { flex-shrink: 0; }

.story-stream {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.history-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .6rem .9rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.history-card__meta { font-size: .78rem; color: var(--muted); }
.history-actions__list { list-style: none; padding: .6rem .9rem; margin: 0; display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; }

/* ---- Queue panel ---- */
.queue-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
}
.queue-list { display: flex; flex-direction: column; gap: .5rem; padding: .8rem; }
.queue-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: .6rem .8rem;
  font-size: .88rem;
}

/* ---- Participant / party ---- */
.participant-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.participant-sheet__header {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.participant-sheet__details { padding: .8rem 1rem; }
.participant-sheet__state { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---- Game sheet / action forms ---- */
.game-sheet-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .6rem;
  margin-bottom: 1rem;
}
.game-saved-action {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: .6rem .8rem;
  font-size: .88rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
}

.game-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem .9rem;
  align-items: start;
}
@media (max-width: 600px) {
  .game-form-grid { grid-template-columns: 1fr; }
}

.game-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .6rem;
}

/* ---- Landing sections ---- */
.landing-section { padding: 3rem 0; }
.landing-section--cta {
  text-align: center;
  padding: 4rem 1rem;
}
.landing-section--cta h2 { font-size: 2rem; margin-bottom: 1rem; }

/* ---- Admin dashboard extras ---- */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  transition: border-color .15s;
}
.admin-card:hover { border-color: var(--gold); }
.admin-card strong { font-size: 1.8rem; font-family: var(--font-story); color: var(--gold); line-height: 1; }
.admin-card span { font-size: .82rem; color: var(--muted); }
.admin-card small { font-size: .78rem; color: var(--muted); margin-top: auto; }

.dashboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem .9rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: border-color .15s, background .15s;
}
.dashboard-row:hover { background: var(--surface); border-color: var(--border); }
.dashboard-row div { display: flex; flex-direction: column; gap: .15rem; }
.dashboard-row strong { font-size: .95rem; }
.dashboard-row small { font-size: .78rem; color: var(--muted); }

.connection-summary {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .8rem 1rem;
  margin-bottom: .8rem;
}
.connection-summary strong { font-size: .95rem; }
.connection-summary p { font-size: .85rem; color: var(--muted); margin: .2rem 0; }

.metric-grid { margin-bottom: 1.5rem; }
.dashboard-body { margin-top: 1.5rem; }

.create-panel { }

/* ---- Code / plain list ---- */
.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: .8rem 1rem;
  font-family: monospace;
  font-size: .85rem;
  white-space: pre-wrap;
  word-break: break-all;
}
.code-grid { display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; align-items: start; font-size: .88rem; }
.plain-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .3rem; }

/* ---- Turn / tag posts ---- */
.tag-post {
  background: rgba(var(--gold-rgb, 212,175,55), .07);
  border-left: 3px solid var(--gold);
  border-radius: 0 7px 7px 0;
  padding: .5rem .8rem;
  font-size: .9rem;
}
.turn-action-copy { font-size: .9rem; color: var(--muted); }

/* ---- Campaign cards extended ---- */
.campaign-list { display: flex; flex-direction: column; gap: 1rem; }
.campaign-list--full { max-width: 100%; }
.campaign-emblem {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* ---- Alert overrides ---- */
.alert { border-radius: 10px; border: 1px solid; }
.alert-info { background: rgba(13,202,240,.08); border-color: rgba(13,202,240,.25); color: #cce; }
.alert-danger { background: rgba(220,53,69,.08); border-color: rgba(220,53,69,.3); color: #fcc; }

.app-toast-region {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 3000;
  display: grid;
  gap: .65rem;
  width: min(24rem, calc(100vw - 2rem));
  pointer-events: none;
}

.app-toast {
  padding: .9rem 1rem;
  border: 1px solid rgba(217, 177, 94, .34);
  border-radius: .7rem;
  color: #edf1f3;
  background: #111a20;
  box-shadow: 0 .75rem 2rem rgba(0, 0, 0, .38);
}

.app-toast--success { border-color: rgba(61, 190, 140, .55); }
.app-toast--warning { border-color: rgba(217, 177, 94, .68); }
.app-toast--error { border-color: rgba(224, 108, 117, .62); }

/* ---- Landing steps ---- */
.landing-steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.landing-steps article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.2rem;
}
.landing-steps h3 { margin: .4rem 0 .5rem; }
.landing-steps p { color: var(--muted); font-size: .9rem; margin: 0 0 .8rem; }
.landing-steps a { color: var(--gold); text-decoration: none; font-size: .88rem; }
.landing-steps a:hover { text-decoration: underline; }

/* RPG core character onboarding */
.core-wizard { max-height:calc(100dvh - 24px); }
.core-wizard .swal2-html-container { overflow-y:auto; text-align:left; max-height:65dvh; }
.core-wizard label { display:block; margin-top:12px; }
.core-wizard .swal2-input,.core-wizard .swal2-textarea { width:100%; margin:8px 0; box-sizing:border-box; }
.core-wizard .swal2-textarea { min-height:90px; max-height:220px; overflow-y:auto; }
.core-selector { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:20px 0; }
.core-selector button,.core-grants button { color:inherit; background:#202936; border:1px solid #a98a51; border-radius:8px; padding:12px; }
.core-grants { display:flex; gap:8px; overflow-x:auto; padding-bottom:8px; }
.core-grants button { flex:0 0 auto; }
#core-character-sheet { overflow-wrap:anywhere; }

.core-wizard .swal2-input,.core-wizard .swal2-textarea { background:#101720; color:#f3eee4; border:1px solid #59616b; font-size:16px; }
.core-wizard progress { accent-color:#c7a25a; max-width:100%; }
