/* ═══════════════════════════════════════════════════════
   BENGAL 1905: THE WEB OF ALLIANCES
   Mobile-first, single-screen layout with full juice
   ═══════════════════════════════════════════════════════ */

:root {
  --bg-deep: #0f0e17;
  --bg-card: #1a1932;
  --bg-card-light: #232245;
  --bg-surface: #16152a;

  --gold: #d4a843;
  --gold-light: #e8c96a;
  --gold-dim: rgba(212, 168, 67, 0.15);
  --gold-glow: rgba(212, 168, 67, 0.08);

  --saffron: #e87d2f;
  --emerald: #2d8a5e;
  --ruby: #c0392b;
  --copper: #8b5e3c;
  --blue-steel: #4a6fa5;
  --ivory: #f0e9d6;
  --ivory-dim: rgba(240, 233, 214, 0.7);
  --ivory-muted: rgba(240, 233, 214, 0.4);

  --text-primary: #f0e9d6;
  --text-secondary: rgba(240, 233, 214, 0.72);
  --text-muted: rgba(240, 233, 214, 0.38);

  --border-gold: rgba(212, 168, 67, 0.25);
  --border-subtle: rgba(240, 233, 214, 0.08);

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }
.hidden { display: none !important; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Lato', 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(212, 168, 67, 0.04) 0%, transparent 60%);
  color: var(--text-primary);
  padding: 0;
  line-height: 1.5;
  font-size: 0.9rem;
}

/* ─── Back Link ─── */
.back-link {
  position: fixed;
  top: 0.5rem;
  left: 0.75rem;
  z-index: 9999;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.7;
  text-decoration: none;
  transition: opacity 0.2s;
}
.back-link:hover { opacity: 1; }

/* ─── Header ─── */
header {
  width: 100%;
  background: linear-gradient(180deg, rgba(26, 25, 50, 0.95) 0%, var(--bg-deep) 100%);
  border-bottom: 1px solid var(--border-gold);
  padding: 10px 16px;
  text-align: center;
}

header h1 {
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--gold);
  text-shadow: 0 2px 12px rgba(212, 168, 67, 0.2);
}

header .subtitle {
  font-family: 'Lato', sans-serif;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ─── Main Container ─── */
main {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  height: calc(100vh - 52px); /* header height */
  height: calc(100dvh - 52px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════
   VIGNETTE (PROLOGUE)
   ═══════════════════════════════════════════════════════ */

.vignette-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.vignette-header h2 {
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.3;
  margin-bottom: 4px;
}

.vignette-header h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--gold);
  margin-top: 10px;
  opacity: 0.4;
}

.vignette-text {
  flex: 1;
  line-height: 1.7;
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin: 14px 0;
}
.vignette-text p { margin: 0 0 10px; }
.vignette-text p:last-child { margin-bottom: 0; }
.vignette-text strong { color: var(--text-primary); font-weight: 700; }
.vignette-text em { color: var(--ivory-dim); }

.cta-button {
  align-self: stretch;
  padding: 12px 24px;
  border-radius: 3px;
  border: 1px solid var(--gold);
  background: rgba(212, 168, 67, 0.1);
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  text-align: center;
  flex-shrink: 0;
  margin-top: auto;
}
.cta-button:hover {
  background: rgba(212, 168, 67, 0.2);
  box-shadow: 0 4px 20px rgba(212, 168, 67, 0.15);
}
.cta-button:active { transform: translateY(1px); }

/* ═══════════════════════════════════════════════════════
   GAME CONTAINER — single-screen grid
   ═══════════════════════════════════════════════════════ */

#gameContainer {
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  grid-template-areas:
    "progress"
    "network"
    "event"
    "actions";
  overflow: hidden;
  padding: 0 10px;
  gap: 0;
}

/* ─── Progress Bar ─── */
.progress-bar {
  grid-area: progress;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
}

.game-date {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: var(--gold);
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.progress-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
}

.progress-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-subtle);
  border: 1px solid var(--text-muted);
  flex-shrink: 0;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.progress-dot.completed {
  background: var(--gold);
  border-color: var(--gold);
}

.progress-dot.current {
  background: transparent;
  border-color: var(--gold);
  box-shadow: 0 0 6px var(--gold);
  animation: dot-pulse 1.5s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 4px var(--gold); }
  50% { box-shadow: 0 0 10px var(--gold-light); }
}

/* ─── Network Diagram ─── */
.network-container {
  grid-area: network;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 55vh;
  overflow: hidden;
}

.network-svg {
  width: 100%;
  max-width: 420px;
  height: 100%;
  max-height: 100%;
}

/* Tie lines */
.tie-line {
  stroke: var(--gold);
  stroke-linecap: round;
  fill: none;
  pointer-events: none;
  transition: stroke-width 0.5s ease, stroke-opacity 0.5s ease, stroke 0.5s ease, filter 0.3s;
}

/* Critical: dashed red pulse */
.tie-line.critical {
  stroke: var(--ruby);
  stroke-dasharray: 6 4;
  animation: critical-pulse 1s ease-in-out infinite;
}

@keyframes critical-pulse {
  0%, 100% { stroke-opacity: 0.8; }
  50% { stroke-opacity: 0.25; }
}

/* Healthy shimmer */
.tie-line.healthy {
  filter: drop-shadow(0 0 3px rgba(212, 168, 67, 0.25));
}

/* Strain flash */
.tie-line.strain-flash {
  stroke: var(--ruby);
  animation: strain-shake 0.4s ease-out;
  filter: drop-shadow(0 0 6px var(--ruby));
}

@keyframes strain-shake {
  0% { transform: translate(0, 0); }
  15% { transform: translate(2px, -1px); }
  30% { transform: translate(-2px, 1px); }
  45% { transform: translate(1px, -1px); }
  60% { transform: translate(-1px, 1px); }
  75% { transform: translate(1px, 0); }
  100% { transform: translate(0, 0); }
}

/* Persistent strained glow — clickable to see reason */
.tie-line.strained {
  stroke: var(--saffron) !important;
  stroke-opacity: 0.9 !important;
  filter: drop-shadow(0 0 6px var(--saffron));
  animation: strained-pulse 2s ease-in-out infinite;
}

@keyframes strained-pulse {
  0%, 100% { filter: drop-shadow(0 0 3px var(--saffron)); stroke-opacity: 0.7; }
  50% { filter: drop-shadow(0 0 10px var(--saffron)); stroke-opacity: 1; }
}

/* Invisible wide hit area for tapping strained lines */
.tie-hit-area {
  pointer-events: stroke;
  cursor: pointer;
  stroke: transparent;
  stroke-width: 24;
  fill: none;
}

/* Tend glow pulse */
.tie-line.tie-tended {
  filter: drop-shadow(0 0 8px var(--gold-light));
  animation: tend-glow 0.8s ease-in-out;
}

@keyframes tend-glow {
  0% { filter: drop-shadow(0 0 2px var(--gold)); }
  40% { filter: drop-shadow(0 0 14px var(--gold-light)); }
  100% { filter: drop-shadow(0 0 2px var(--gold)); }
}

/* Highlight from action card hover */
.tie-line.tie-highlight-primary {
  stroke: var(--gold-light) !important;
  filter: drop-shadow(0 0 8px var(--gold)) !important;
  stroke-opacity: 1 !important;
}

.tie-line.tie-highlight-cost {
  stroke: var(--ruby) !important;
  filter: drop-shadow(0 0 8px var(--ruby)) !important;
  stroke-opacity: 0.9 !important;
}

.tie-line.tie-highlight-bonus {
  stroke: var(--emerald) !important;
  filter: drop-shadow(0 0 8px var(--emerald)) !important;
  stroke-opacity: 0.9 !important;
}

/* Tie value label */
.tie-value-label {
  font-family: 'Lato', sans-serif;
  font-size: 9px;
  fill: var(--text-muted);
  text-anchor: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--bg-deep);
  stroke-width: 3px;
  transition: fill 0.3s;
}
.tie-value-label.critical-text {
  fill: var(--ruby);
  font-weight: 700;
}

/* Tie hover label */
.tie-hover-label {
  font-family: 'Lato', sans-serif;
  font-size: 9px;
  fill: var(--text-primary);
  text-anchor: middle;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  font-weight: 700;
  paint-order: stroke;
  stroke: var(--bg-deep);
  stroke-width: 3px;
}
.tie-hover-label.visible { opacity: 1; }

/* Node circles with ambient glow */
.network-node-circle {
  pointer-events: none;
  transition: r 0.3s ease;
}

.network-node-label {
  font-family: 'Lato', sans-serif;
  font-size: 9px;
  fill: var(--text-primary);
  text-anchor: middle;
  pointer-events: none;
  font-weight: 600;
  letter-spacing: 0.03em;
  paint-order: stroke;
  stroke: var(--bg-deep);
  stroke-width: 3px;
}

/* Node react animation (on tend) */
.network-node-circle.node-react {
  animation: node-bounce 0.35s ease-out;
}

@keyframes node-bounce {
  0% { r: 18; }
  40% { r: 22; }
  100% { r: 18; }
}

/* SVG Indicators (floating numbers) */
.svg-indicator {
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  text-anchor: middle;
  pointer-events: none;
  opacity: 0;
  font-weight: 700;
  paint-order: stroke;
  stroke: var(--bg-deep);
  stroke-width: 3px;
}
.svg-indicator.strain-ind { fill: var(--ruby); }
.svg-indicator.decay-ind { fill: rgba(192, 57, 43, 0.6); font-size: 10px; }
.svg-indicator.bonus-ind { fill: var(--emerald); }
.svg-indicator.tend-ind { fill: var(--gold-light); font-size: 15px; }
.svg-indicator.side-cost-ind { fill: var(--ruby); font-size: 11px; }

.svg-indicator.show {
  animation: indicator-float 1.6s ease-out forwards;
}

@keyframes indicator-float {
  0% { opacity: 1; transform: translateY(0) scale(1.2); }
  20% { transform: translateY(-4px) scale(1); }
  100% { opacity: 0; transform: translateY(-18px) scale(0.8); }
}

/* ─── Telegraph Overlay ─── */
.telegraph-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 14, 23, 0.7);
  backdrop-filter: blur(2px);
  z-index: 5;
  animation: telegraph-in 0.3s ease-out;
}

.telegraph-overlay.fading {
  animation: telegraph-out 0.4s ease-in forwards;
}

@keyframes telegraph-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes telegraph-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.telegraph-overlay span {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  padding: 12px 20px;
  border: 1px solid var(--border-gold);
  background: rgba(26, 25, 50, 0.9);
  max-width: 90%;
  animation: typewriter-glow 1.5s ease-in-out;
}

@keyframes typewriter-glow {
  0% { text-shadow: 0 0 4px var(--gold); }
  50% { text-shadow: 0 0 12px var(--gold-light); }
  100% { text-shadow: 0 0 4px var(--gold); }
}

/* ─── Event Compact ─── */
.event-compact {
  grid-area: event;
  padding: 6px 4px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
  border-left: 3px solid transparent;
  transition: border-color 0.2s;
}

/* When showing a strain reason (tapped a glowing line) */
.event-compact.showing-strain {
  border-left-color: var(--saffron);
  cursor: pointer;
}

.strain-back {
  font-size: 0.65rem;
  color: var(--saffron);
  letter-spacing: 0.04em;
  margin-bottom: 2px;
  opacity: 0.7;
}

.strain-amount {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ruby);
}

.event-compact .event-title {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 700;
  line-height: 1.2;
}

.event-compact .event-narration {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.5;
  margin-top: 3px;
}
.event-compact .event-narration p { margin: 0; }
.event-compact .event-narration strong { color: var(--text-primary); font-weight: 700; }
.event-compact .event-narration em { color: var(--ivory-dim); }

/* (Reveal prompt removed — narration shows immediately) */

/* Action area slide-in */
.action-area.revealing {
  animation: actions-slide-in 0.3s ease-out;
}
@keyframes actions-slide-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Learn more toggle */
.learn-more-toggle {
  display: inline-block;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Lato', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 2px 0;
  margin-top: 2px;
  transition: color 0.2s;
}
.learn-more-toggle:hover { color: var(--gold); }

.learn-more-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary);
  font-style: italic;
}
.learn-more-content.expanded {
  max-height: 200px;
  margin-top: 4px;
}
.learn-more-content p { margin: 0; }

/* ─── Action Overlay (on network) ─── */
.action-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

/* Markers anchored to fixed slots around the network */
.tie-action-marker {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 5px 10px;
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--gold-light);
  white-space: nowrap;
  text-align: left;
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.25);
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s, max-width 0.25s;
  animation: marker-fade-in 0.35s ease-out both;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 11;
}

/* Fixed slot positions — stable across all events */
.tie-action-marker.slot-0 { left: 4px; top: 4px; }
.tie-action-marker.slot-1 { right: 4px; top: 4px; }
.tie-action-marker.slot-2 { left: 50%; bottom: 4px; transform: translateX(-50%); text-align: center; }

.tie-action-marker:hover {
  background: var(--bg-card-light);
  box-shadow: 0 0 20px rgba(212, 168, 67, 0.45);
  z-index: 12;
}

.tie-action-marker.expanded {
  white-space: normal;
  max-width: 56%;
  padding: 8px 12px;
  z-index: 15;
  border-color: var(--gold-light);
  box-shadow: 0 0 24px rgba(212, 168, 67, 0.5);
}

.tie-action-marker .marker-label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  font-weight: 600;
}

.tie-action-marker .marker-desc {
  display: none;
  font-family: 'Lato', sans-serif;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.3;
}

.tie-action-marker .marker-effects {
  display: none;
  font-family: 'Lato', sans-serif;
  font-size: 0.62rem;
  margin-top: 4px;
  color: var(--text-muted);
}

.tie-action-marker.expanded .marker-desc,
.tie-action-marker.expanded .marker-effects {
  display: block;
}

.tie-action-marker .marker-confirm {
  display: none;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--gold);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tie-action-marker.expanded .marker-confirm {
  display: block;
}

@keyframes marker-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Connector lines from markers to their target ties */
.marker-connector {
  pointer-events: none;
  stroke: rgba(212, 168, 67, 0.18);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  fill: none;
}

/* ─── Action Cards (fallback / tutorial) ─── */
.action-area {
  grid-area: actions;
  padding: 4px 0 8px;
}

.action-cards {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.action-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0 8px;
  text-align: left;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--gold);
  background: var(--bg-card);
  padding: 8px 10px;
  cursor: pointer;
  font-family: 'Lato', sans-serif;
  color: var(--text-primary);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  min-height: 44px;
}

.action-card:hover {
  background: var(--bg-card-light);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  border-color: var(--gold-dim);
}

.action-card:active {
  transform: scale(0.98);
}

.action-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.action-card:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

.action-label {
  font-weight: 700;
  font-size: 0.82rem;
  grid-column: 1;
  grid-row: 1;
}

.action-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  grid-column: 1;
  grid-row: 2;
  line-height: 1.3;
}

.action-effects {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}

.action-primary {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--emerald);
  white-space: nowrap;
}

.action-side {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ruby);
  white-space: nowrap;
  opacity: 0.8;
}

.action-side.bonus {
  color: var(--emerald);
}

/* ─── Tutorial Hint ─── */
.tutorial-hint {
  position: fixed;
  bottom: 50%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: var(--bg-card);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--gold-light);
  text-align: center;
  max-width: 280px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  animation: hint-appear 0.3s ease-out;
}

@keyframes hint-appear {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.tutorial-hint.bottom {
  bottom: auto;
  top: auto;
  bottom: 30%;
}

/* ─── Score / End Game ─── */
.status-message {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  padding: 8px;
  min-height: 0;
}
.status-victory { color: var(--emerald); font-weight: 700; }
.status-defeat { color: var(--ruby); font-weight: 700; }

.score-panel {
  text-align: center;
  padding: 12px;
}
.score-total {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.score-label {
  font-family: 'Lato', sans-serif;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}
.score-rank {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--gold-light);
  margin-top: 4px;
  animation: rank-reveal 0.6s ease-out;
}

@keyframes rank-reveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* End game: scrollable content replaces the grid */
#gameContainer.game-over {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px;
  gap: 0;
}

#gameContainer.game-over .progress-bar { display: none; }
#gameContainer.game-over .action-area { display: none; }

.reflection-box {
  padding: 14px 16px;
  background: rgba(212, 168, 67, 0.05);
  border: 1px solid var(--border-gold);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  margin-top: 12px;
}
.reflection-label {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.reflection-box p {
  margin: 0 0 6px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.reflection-box ul {
  margin: 6px 0 0;
  padding-left: 1.2em;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
}
.reflection-box li { margin-bottom: 6px; }

button.secondary {
  margin: 12px auto 0;
  display: block;
  padding: 10px 20px;
  border-radius: 3px;
  border: 1px solid var(--border-gold);
  background: rgba(212, 168, 67, 0.08);
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
  max-width: 300px;
}
button.secondary:hover { background: rgba(212, 168, 67, 0.15); }
button.secondary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ─── Glossary ─── */
.glossary-term {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted rgba(212, 168, 67, 0.4);
  color: var(--gold);
  transition: color 0.15s;
}
.glossary-term:hover { color: var(--gold-light); }
.glossary-term::after {
  content: attr(data-description);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: 4px;
  width: min(260px, 70vw);
  font-family: 'Lato', sans-serif;
  font-size: 0.78rem;
  line-height: 1.5;
  font-style: normal;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-gold);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 15;
  white-space: normal;
}
.glossary-term::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--bg-card);
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 15;
}
.glossary-term:hover::after,
.glossary-term:focus-visible::after,
.glossary-term:hover::before,
.glossary-term:focus-visible::before {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

/* Larger phones / small tablets */
@media (min-width: 400px) {
  .action-cards {
    gap: 6px;
  }
  .action-card {
    padding: 10px 12px;
  }
  .event-compact {
    max-height: 120px;
  }
}

/* Tablets and desktop */
@media (min-width: 640px) {
  main {
    max-width: 720px;
  }

  header h1 { font-size: 1.4rem; }
  header { padding: 14px 20px; }

  main {
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
  }

  .action-cards {
    flex-direction: row;
    gap: 8px;
  }

  .action-card {
    flex: 1;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .action-effects {
    grid-column: 1;
    grid-row: 3;
    align-items: flex-start;
    flex-direction: row;
    gap: 8px;
    margin-top: 4px;
  }

  .event-compact {
    max-height: 100px;
    padding: 8px 6px;
  }
  .network-svg {
    max-width: 480px;
  }

  .vignette-panel {
    padding: 32px 24px;
    justify-content: center;
    align-items: center;
  }

  .vignette-text {
    flex: 0;
    font-size: 1rem;
    max-width: 520px;
  }

  .vignette-panel .cta-button {
    margin-top: 24px;
    max-width: 520px;
    align-self: center;
  }

  .vignette-header h2 {
    font-size: 1.6rem;
  }
}

/* Large desktop */
@media (min-width: 1024px) {
  main {
    max-width: 800px;
  }
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
