:root {
  --bg-0: #0f1115;
  --bg-1: #171b22;
  --bg-2: #1f2631;
  --panel: rgba(28, 34, 44, 0.75);
  --line: rgba(201, 168, 95, 0.25);
  --gold: #c9a85f;
  --gold-2: #f2d28b;
  --text: #f3f4f6;
  --muted: #a5adba;
  --danger: #d75f4a;
  --info: #58a6ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: 'Lato', sans-serif;
  line-height: 1.55;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(201,168,95,0.12), transparent 70%),
    radial-gradient(900px 500px at 10% 110%, rgba(88,166,255,0.10), transparent 70%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 50%, #0b0d12 100%);
  background-attachment: fixed;
}

.site-title,
h1, h2, h3, h4, h5, h6 {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.02em;
}

.hero-title {
  font-family: 'MedievalSharp', cursive;
  color: var(--gold-2);
  text-shadow: 0 2px 14px rgba(201,168,95,0.2);
}

.hero-section {
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 90%);
}

.panel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.28);
}

.stats-card {
  background: linear-gradient(140deg, rgba(201,168,95,0.12), rgba(31,38,49,0.88));
  border: 1px solid var(--line);
}

.stat-pill {
  background: rgba(13, 17, 23, 0.65);
  border: 1px solid rgba(201, 168, 95, 0.2);
  border-radius: .9rem;
  padding: .75rem;
  text-align: center;
}

.stat-pill span {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold-2);
}

.stat-pill small {
  color: var(--muted);
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .08em;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: .75rem;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #a9781c);
  margin-top: .35rem;
  box-shadow: 0 0 0 4px rgba(201,168,95,0.14);
}

.timeline-content {
  border-left: 1px solid rgba(201,168,95,0.18);
  padding-left: .85rem;
}

.char-card {
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.char-card:hover {
  transform: translateY(-3px);
  border-color: rgba(201,168,95,0.45);
  box-shadow: 0 12px 24px rgba(0,0,0,0.35);
}

.ability-box {
  background: rgba(16, 21, 29, 0.7);
  border: 1px solid rgba(88,166,255,0.2);
}

.navbar {
  backdrop-filter: blur(10px);
  background: rgba(16, 20, 27, 0.92) !important;
}

.navbar-brand-stack {
  line-height: 1.05;
}

.site-kicker {
  font-size: .67rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.nav-game-link {
  font-weight: 600;
  border-radius: .8rem;
  padding: .6rem .8rem !important;
}

.nav-game-link:hover,
.nav-game-link.active {
  background: rgba(255,255,255,0.06);
}

.brand-logo {
  object-fit: contain;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(201, 168, 95, 0.25);
}

.nav-link.btn {
  border-radius: 999px;
}

.table-dark {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255,255,255,0.02);
}

.page-link {
  background: rgba(16, 20, 27, 0.7);
  border-color: rgba(201,168,95,0.25);
  color: var(--gold-2);
}

.page-link:hover {
  background: rgba(201,168,95,0.16);
  color: #fff;
}

#main-nav,
.panel-card,
.hero-section .container > .row > * {
  animation: riseIn .5s ease both;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 991.98px) {
  .hero-title { font-size: 2.2rem; }
}

@media (max-width: 575.98px) {
  .hero-title { font-size: 1.9rem; }
  .timeline-item { grid-template-columns: 16px 1fr; }
}

.map-card {
  overflow: hidden;
}

.world-map-viewport {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: 420px;
  border: 1px solid rgba(201, 168, 95, 0.28);
  border-radius: .8rem;
  overflow: hidden;
  background: rgba(10, 14, 20, 0.92);
  cursor: grab;
}

.world-map-viewport.is-dragging {
  cursor: grabbing;
}

.world-map-stage {
  position: relative;
  transform-origin: top left;
  will-change: transform;
  user-select: none;
}

.world-map-image {
  width: 100%;
  height: auto;
  display: block;
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  background: transparent;
  border: 0;
  padding: 0;
  color: #fff;
  text-align: center;
  z-index: 3;
}

.map-pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  background: #f0c46a;
  box-shadow: 0 0 0 4px rgba(240, 196, 106, 0.2);
}

.map-pin-label {
  display: block;
  margin-top: .3rem;
  padding: .15rem .45rem;
  border-radius: .4rem;
  background: rgba(12, 17, 25, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: .74rem;
  line-height: 1.1;
  white-space: nowrap;
}

.map-pin.is-current .map-pin-dot {
  background: #58a6ff;
  box-shadow: 0 0 0 5px rgba(88, 166, 255, 0.28), 0 0 20px rgba(88, 166, 255, 0.55);
}

.map-token {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  padding: 0;
  color: #fff;
  text-align: center;
  z-index: 5;
  cursor: grab;
}

.world-map-viewport.move-mode {
  cursor: crosshair;
}

.map-token img {
  border: 2px solid var(--token-color, rgba(255, 255, 255, 0.75));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.map-token.is-selected img {
  box-shadow: 0 0 0 3px rgba(240, 196, 106, 0.45), 0 2px 12px rgba(0, 0, 0, 0.6);
}

.map-token-label {
  display: block;
  margin-top: .2rem;
  padding: .12rem .4rem;
  border-radius: .35rem;
  background: rgba(10, 14, 20, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: .7rem;
  line-height: 1.1;
  white-space: nowrap;
}

.map-team-dot {
  width: .65rem;
  height: .65rem;
  border-radius: 999px;
  display: inline-block;
  vertical-align: middle;
  margin-right: .35rem;
  background: var(--token-color, #58a6ff);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.fog-blob {
  position: absolute;
  width: 180px;
  height: 180px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14,18,26,0.88) 0%, rgba(8,11,16,0.98) 60%);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  z-index: 2;
}

.map-info-panel {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: .75rem;
  padding: .85rem 1rem;
  background: rgba(10, 14, 20, 0.58);
}

.map-region-list {
  margin: 0;
  padding-left: 1rem;
}

.map-region-list li {
  margin-bottom: .25rem;
  color: var(--text);
}

.guide-tabs {
  gap: .6rem;
}

.guide-tabs .nav-link {
  border: 1px solid rgba(201, 168, 95, 0.25);
  color: var(--gold-2);
  background: rgba(16, 20, 27, 0.65);
  border-radius: 999px;
  padding: .55rem 1rem;
  transition: all .2s ease;
}

.guide-tabs .nav-link:hover {
  color: #fff;
  border-color: rgba(201, 168, 95, 0.55);
  background: rgba(201, 168, 95, 0.15);
}

.guide-tabs .nav-link.active {
  color: #141820;
  background: linear-gradient(135deg, #f0d18a, #c9a85f);
  border-color: rgba(255, 224, 154, 0.9);
}

.guide-hero-card {
  background:
    radial-gradient(900px 300px at 0% 10%, rgba(88, 166, 255, 0.1), transparent 60%),
    linear-gradient(130deg, rgba(19, 24, 33, 0.9), rgba(12, 16, 24, 0.95));
}

.guide-hero-image {
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: cover;
  border-left: 1px solid rgba(201, 168, 95, 0.22);
  filter: saturate(1.1) contrast(1.05);
}

.guide-role-card {
  border-color: rgba(201, 168, 95, 0.3);
}

.guide-role-icon {
  width: 42px;
  height: 42px;
  border-radius: .7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .65rem;
  font-size: 1.2rem;
  color: var(--gold-2);
  background: rgba(201, 168, 95, 0.16);
  border: 1px solid rgba(201, 168, 95, 0.35);
}

.guide-subtabs {
  gap: .5rem;
}

.guide-subtabs .nav-link {
  border-radius: .75rem;
  border: 1px solid rgba(88, 166, 255, 0.28);
  color: #c9defd;
  background: rgba(14, 20, 30, 0.78);
  padding: .45rem .85rem;
}

.guide-subtabs .nav-link:hover {
  color: #fff;
  border-color: rgba(88, 166, 255, 0.52);
  background: rgba(88, 166, 255, 0.16);
}

.guide-subtabs .nav-link.active {
  color: #0f1a2c;
  background: linear-gradient(135deg, #9fceff, #62b4ff);
  border-color: rgba(186, 225, 255, 0.95);
}

.guide-library-card {
  height: 100%;
  padding: .95rem;
  border-radius: .8rem;
  border: 1px solid rgba(201, 168, 95, 0.24);
  background: rgba(12, 16, 24, 0.55);
}

.guide-library-card h4 {
  font-size: 1rem;
  margin-bottom: .6rem;
  color: var(--gold-2);
}

.guide-library-card ul {
  margin: 0;
  padding-left: 1rem;
}

.guide-library-card li {
  margin-bottom: .3rem;
  color: var(--text);
}

.guide-library-card a {
  color: #9fceff;
  text-decoration: none;
}

.guide-library-card a:hover {
  text-decoration: underline;
}

.character-sheet-header {
  background:
    radial-gradient(800px 220px at 95% 0%, rgba(88,166,255,0.12), transparent 55%),
    linear-gradient(135deg, rgba(21, 26, 35, 0.92), rgba(14, 18, 26, 0.92));
}

.character-vitals .stat-pill {
  min-height: 84px;
}

.save-pill {
  background: rgba(16, 21, 29, 0.75);
  border: 1px solid rgba(88,166,255,0.25);
  border-radius: .7rem;
  padding: .55rem .7rem;
}

.game-hub-card {
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  border: 1px solid rgba(255,255,255,0.14);
}

.game-hub-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
}

.game-dnd {
  background: linear-gradient(130deg, rgba(201,168,95,0.15), rgba(17,22,31,0.92));
}

.game-hunger {
  background: linear-gradient(130deg, rgba(88,166,255,0.18), rgba(13,18,28,0.92));
}

.hero-panel {
  background:
    radial-gradient(700px 260px at 0% 0%, rgba(201,168,95,0.12), transparent 55%),
    linear-gradient(140deg, rgba(18, 22, 31, 0.95), rgba(10, 13, 20, 0.92));
}

.metric-grid .stat-pill,
.live-panel .stat-pill {
  min-height: 88px;
}

.live-panel {
  background:
    radial-gradient(700px 260px at 100% 0%, rgba(88,166,255,0.12), transparent 58%),
    linear-gradient(145deg, rgba(20,25,35,0.95), rgba(12,16,24,0.94));
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  font-size: .78rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6b7280;
  box-shadow: 0 0 0 4px rgba(107,114,128,0.16);
}

.live-status.is-live .status-dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,0.16), 0 0 16px rgba(34,197,94,0.3);
}

.live-status.is-offline .status-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245,158,11,0.16);
}

.live-hero-block {
  padding: 1rem;
  border-radius: .9rem;
  background: rgba(10, 14, 20, 0.55);
  border: 1px solid rgba(255,255,255,0.08);
}

.live-surface {
  padding: 1rem;
  border-radius: .9rem;
  background: rgba(10, 14, 20, 0.55);
  border: 1px solid rgba(255,255,255,0.08);
}

.compact-live-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .65rem;
}

.compact-live-list li {
  padding: .75rem .85rem;
  border-radius: .85rem;
  background: rgba(8, 12, 18, 0.6);
  border: 1px solid rgba(255,255,255,0.08);
}

.compact-live-list strong {
  color: var(--gold-2);
}

.live-tribute-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .85rem;
  text-align: left;
}

.tribute-card {
  padding: .85rem .95rem;
  border-radius: .85rem;
  background: rgba(8, 12, 18, 0.6);
  border: 1px solid rgba(255,255,255,0.08);
}

@media (max-width: 1199.98px) {
  .navbar .navbar-nav {
    gap: .15rem;
  }
}

@media (max-width: 767.98px) {
  .site-kicker {
    display: none;
  }
}
