@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,600;0,9..144,700;1,9..144,400&family=Inter:wght@400;500;600;700&display=swap');

/* ─── Tokens ──────────────────────────────────────────── */
:root {
  --bg:       #0D1B2A;
  --surface:  #132233;
  --surface2: #1A3A4A;
  --surface3: #21485C;
  --border:   #2B4759;
  --border-strong: #3D6178;
  --gold:     #E8C547;
  --teal:     #5BBFAD;
  --coral:    #E87D5B;
  --text:     #F0EDE4;
  --text-dim: #C3D2DC;
  --muted:    #92B0C2;

  --font-d: 'Fraunces', Georgia, serif;
  --font-u: 'Inter', system-ui, sans-serif;
  --r: 8px; --r-lg: 14px;

  --shadow-card: 0 2px 4px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.28);
  --shadow-lift: 0 4px 8px rgba(0,0,0,.24), 0 16px 40px rgba(0,0,0,.38);

  --max-w: 1500px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font-u);
  font-size: 1rem; line-height: 1.5; min-height: 100dvh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; font-size: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

/* ─── Screens ─────────────────────────────────────────── */
.screen { display: none; min-height: 100dvh; }
.screen.active { display: flex; flex-direction: column; }
#screen-game.active { flex-direction: row; height: 100dvh; overflow: hidden; }
#screen-report.active { display: block; overflow-y: auto; }

/* ─── Knapper ─────────────────────────────────────────── */
.btn-primary {
  background: var(--text); color: var(--bg); border: none; border-radius: var(--r);
  padding: 0.85rem 2rem; font-size: 1.05rem; font-weight: 600;
  cursor: pointer; letter-spacing: 0.01em;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s;
  box-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 0 rgba(0,0,0,.35); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary.is-urgent { background: var(--coral); color: #17100C; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%,92%,100% { transform: none; } 96% { transform: translateY(-3px); } }

.btn-secondary {
  background: transparent; color: var(--text); border: 1px solid var(--border-strong);
  border-radius: var(--r); padding: 0.8rem 1.5rem; font-size: 1rem; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.btn-secondary:hover { border-color: var(--muted); background: rgba(255,255,255,.04); }
.btn-small { padding: 0.55rem 1.1rem; font-size: 0.95rem; }

/* ─── Tittelskjerm ────────────────────────────────────── */
#screen-title {
  align-items: center; justify-content: center;
  padding: 3rem 1.5rem; text-align: center; gap: 1.75rem;
}
.title-eyebrow { font-size: 0.85rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.title-main {
  font-family: var(--font-d); font-size: clamp(3rem, 9vw, 6rem); font-weight: 600;
  line-height: 1; letter-spacing: -0.02em;
}
.title-main em { font-style: italic; font-weight: 300; color: var(--teal); }
.title-sub {
  font-family: var(--font-d); font-style: italic; font-size: 1.2rem;
  color: var(--text-dim); max-width: 42ch; line-height: 1.65;
}
.title-voices { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.voice-pill {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.55rem 1.1rem; border: 1px solid var(--border-strong); border-radius: 100px;
  font-size: 1rem; color: var(--text-dim); background: var(--surface);
}

.resume-banner {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--gold); border-radius: var(--r-lg);
  padding: 1.1rem 1.4rem; display: flex; flex-direction: column; gap: 0.85rem;
  align-items: center; max-width: 30rem;
}
.resume-text { font-size: 1rem; color: var(--text-dim); }
.resume-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

.name-input-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.name-label { font-size: 0.9rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.name-input {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r);
  color: var(--text); font-family: var(--font-d); font-size: 1.25rem; font-style: italic;
  padding: 0.75rem 1.25rem; text-align: center; width: 280px; transition: border-color .15s;
}
.name-input::placeholder { color: var(--muted); font-style: normal; font-size: 1rem; }
.name-input:focus { outline: none; border-color: var(--teal); }

/* ─── Målere ──────────────────────────────────────────── */
.sidebar-meters {
  width: 92px; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  padding: 1.25rem 0; flex-shrink: 0;
}
.meter-wrap {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 0.85rem 0; width: 100%; position: relative;
}
.meter-wrap + .meter-wrap { border-top: 1px solid var(--border); }
.meter-track {
  width: 16px; flex: 1; min-height: 80px; background: var(--bg);
  border-radius: 100px; overflow: hidden; position: relative; margin-bottom: 0.6rem;
  border: 1px solid var(--border);
}
.meter-fill {
  position: absolute; bottom: 0; left: 0; width: 100%;
  height: var(--fill, 50%); border-radius: 100px;
  transition: height .7s cubic-bezier(.4,0,.2,1), width .7s cubic-bezier(.4,0,.2,1);
}
[data-meter="business"] .meter-fill { background: var(--gold); }
[data-meter="people"]   .meter-fill { background: var(--coral); }
[data-meter="nature"]   .meter-fill { background: var(--teal); }

.meter-icon { font-size: 1.35rem; line-height: 1; }
.meter-value {
  font-family: var(--font-d); font-size: 1.35rem; font-weight: 600;
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.meter-name { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.meter-wrap.is-critical .meter-value { color: var(--coral); }
.meter-wrap.is-critical .meter-track { border-color: var(--coral); box-shadow: 0 0 0 2px rgba(232,125,91,.18); }
.meter-wrap.is-strong .meter-value { color: var(--teal); }

.meter-delta {
  position: absolute; left: 50%; bottom: 45%; transform: translateX(-50%);
  font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums;
  pointer-events: none; animation: delta-float 1.6s ease-out forwards;
  text-shadow: 0 2px 6px rgba(0,0,0,.8);
}
.meter-delta.pos { color: var(--teal); }
.meter-delta.neg { color: var(--coral); }
@keyframes delta-float {
  0%   { opacity: 0; transform: translate(-50%, 8px) scale(.8); }
  18%  { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  35%  { transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -34px); }
}
.meter-wrap.is-shaking .meter-track { animation: shake .45s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-3px); } 40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); } 80% { transform: translateX(2px); }
}
@media (prefers-reduced-motion: reduce) {
  .meter-fill, .meter-delta, .meter-wrap.is-shaking .meter-track,
  .btn-primary.is-urgent { animation: none !important; transition: none !important; }
}

/* ─── Hovedkolonne ────────────────────────────────────── */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.game-header {
  padding: 0.9rem 1.75rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-shrink: 0; background: var(--surface);
}
.header-left { display: flex; align-items: baseline; gap: 1.25rem; min-width: 0; }
.game-title { font-family: var(--font-d); font-size: 1rem; font-style: italic; color: var(--text-dim); white-space: nowrap; }
.year-display { display: flex; align-items: baseline; gap: 0.4rem; }
.year-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.year-number { font-family: var(--font-d); font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.years-left { font-size: 0.85rem; color: var(--muted); }
.player-name-display { font-family: var(--font-d); font-style: italic; font-size: 1.1rem; color: var(--gold); white-space: nowrap; }

/* Tidsmåleren */
.time-meter { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; justify-content: center; }
.time-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.time-segments { display: flex; gap: 3px; }
.time-seg {
  width: 11px; height: 20px; border-radius: 3px;
  transition: background .3s ease, opacity .3s ease;
}
.time-seg.left  { background: var(--teal); }
.time-seg.spent { background: var(--surface3); }
.time-count { font-size: 0.88rem; color: var(--muted); white-space: nowrap; }
.time-count strong { color: var(--text); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.time-meter.is-low .time-seg.left { background: var(--coral); }
.time-meter.is-low .time-label { color: var(--coral); }

/* ─── Rutenett: kart til venstre, sak til høyre ───────── */
.game-grid {
  flex: 1; overflow: hidden; display: grid;
  grid-template-columns: minmax(340px, 0.85fr) minmax(420px, 1.15fr);
  gap: 1.5rem; padding: 1.25rem 1.75rem;
  max-width: var(--max-w); width: 100%; margin: 0 auto;
}
.grid-col { display: flex; flex-direction: column; gap: 1rem; min-height: 0; min-width: 0; }
.grid-col-events { overflow: hidden; }

/* Kart */
.map-container {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 0.9rem; box-shadow: var(--shadow-card);
}
.map-title {
  font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin-bottom: 0.6rem; text-align: center;
}
#island-map { width: 100%; height: auto; display: block; }
.map-region.inactive { pointer-events: none; }
.map-region.active { cursor: pointer; }
.map-region.active:hover path { filter: brightness(1.12); }
.map-region.active:focus-visible path { stroke: var(--text); stroke-width: 3; }
.region-label { font-family: 'Inter', sans-serif; font-size: 9px; pointer-events: none; user-select: none; }

@keyframes alert-pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.region-alert { animation: alert-pulse 1.4s ease-in-out infinite; }
.region-alert.is-urgent { animation-duration: .8s; }
.region-alert.is-deferred { animation: none; opacity: .65; }
@media (prefers-reduced-motion: reduce) { .region-alert { animation: none; } }

/* Historikk */
.log-area {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 0.9rem 1.1rem; flex: 1; min-height: 0; display: flex; flex-direction: column;
}
.log-title {
  font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin-bottom: 0.5rem; flex-shrink: 0;
}
.log-entries { display: flex; flex-direction: column; gap: 0.3rem; overflow-y: auto; flex: 1; min-height: 60px; }
.log-entry {
  font-size: 0.92rem; color: var(--text-dim); line-height: 1.45;
  border-bottom: 1px solid rgba(43,71,89,.55); padding: 0.28rem 0;
}
.log-year {
  font-variant-numeric: tabular-nums; color: var(--muted);
  margin-right: 0.5rem; font-size: 0.85rem;
}

/* ─── Hendelsesområde ─────────────────────────────────── */
.events-area { flex: 1; min-height: 0; overflow-y: auto; }
.event-panel { height: 100%; }

.event-prompt {
  display: flex; align-items: center; justify-content: center; height: 100%;
  min-height: 200px; border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
  background: rgba(19,34,51,.5);
}
.event-prompt-text {
  font-family: var(--font-d); font-style: italic; font-size: 1.15rem;
  color: var(--text-dim); line-height: 1.7; text-align: center; max-width: 34ch;
}
.event-prompt-text .ok { color: var(--teal); font-style: normal; font-family: var(--font-u); font-size: 1rem; }
.event-prompt-text .warn { color: var(--coral); font-style: normal; font-family: var(--font-u); font-size: 1rem; }

/* Hendelseskortet – skjermens hovedrolle */
.event-card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--r-lg); padding: 1.5rem; box-shadow: var(--shadow-card);
}
.event-card.type-B { border-left-color: var(--coral); }
.event-card.type-C { border-left-color: #C05B8C; }
.event-card.type-D { border-left-color: var(--gold); }
.event-card.is-escalated { box-shadow: var(--shadow-card), 0 0 0 1px rgba(232,125,91,.35); }

.event-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.9rem;
}
.event-region {
  font-size: 0.9rem; color: var(--muted); margin-bottom: 0.35rem;
  display: flex; align-items: center; gap: 0.45rem;
}
.event-region-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.event-region em { color: var(--text-dim); font-style: normal; }
.event-title {
  font-family: var(--font-d); font-size: 1.75rem; font-weight: 600;
  line-height: 1.15; letter-spacing: -0.01em;
}
.event-type-tag {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 600;
  padding: 0.3rem 0.7rem; border-radius: 100px; background: var(--surface2);
  color: var(--text-dim); white-space: nowrap; flex-shrink: 0;
}
.tag-B { background: rgba(232,125,91,.18); color: #F6A98D; }
.tag-C { background: rgba(192,91,140,.2);  color: #E79CC0; }
.tag-D { background: rgba(232,197,71,.16); color: #F0D477; }

.event-escalation {
  background: rgba(232,125,91,.12); border-left: 3px solid var(--coral);
  border-radius: 0 var(--r) var(--r) 0; padding: 0.75rem 1rem; margin-bottom: 0.9rem;
  font-size: 0.95rem; line-height: 1.55; color: #F6C0AC;
}
.event-escalation strong { color: var(--coral); }

.event-description {
  font-size: 1.08rem; line-height: 1.65; color: var(--text);
  margin-bottom: 1.25rem; max-width: 62ch;
}

/* Valgknapper */
.event-choices { display: flex; flex-direction: column; gap: 0.6rem; }
.choice-btn {
  width: 100%; display: flex; align-items: center; gap: 0.85rem; text-align: left;
  background: var(--surface2); border: 1px solid var(--border-strong);
  border-radius: var(--r); padding: 0.9rem 1rem; color: var(--text);
  font-size: 1.05rem; line-height: 1.4; cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
}
.choice-btn:hover:not(:disabled) {
  background: var(--surface3); border-color: var(--teal); transform: translateX(3px);
}
.choice-marker {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 6px;
  background: var(--bg); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 700;
}
.choice-btn:hover:not(:disabled) .choice-marker { background: var(--teal); color: var(--bg); }
.choice-text { flex: 1; }
.choice-cost {
  flex-shrink: 0; font-size: 0.88rem; font-weight: 600; color: var(--muted);
  background: var(--bg); padding: 0.28rem 0.6rem; border-radius: 100px;
  font-variant-numeric: tabular-nums;
}
.choice-cost.too-much { color: var(--coral); }
.choice-btn.is-unaffordable { opacity: .5; cursor: not-allowed; }

.choice-defer { border-style: dashed; background: transparent; color: var(--text-dim); }
.choice-defer:hover:not(:disabled) { border-color: var(--gold); background: rgba(232,197,71,.07); }
.choice-defer:hover:not(:disabled) .choice-marker { background: var(--gold); }
.choice-defer.is-active { border-color: var(--gold); border-style: solid; background: rgba(232,197,71,.1); }

.event-deferred-note {
  margin-top: 0.9rem; font-size: 0.95rem; color: var(--gold);
  border-top: 1px solid var(--border); padding-top: 0.75rem;
}

/* Resultat */
.choice-result {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--teal); border-radius: var(--r-lg);
  padding: 1.5rem; box-shadow: var(--shadow-card);
}
.result-event-title {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin-bottom: 0.5rem;
}
.result-choice-text {
  font-family: var(--font-d); font-size: 1.4rem; font-weight: 600;
  margin-bottom: 0.9rem; line-height: 1.3;
}
.result-deltas { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.result-delta {
  font-size: 1rem; font-weight: 700; padding: 0.35rem 0.7rem; border-radius: var(--r);
  font-variant-numeric: tabular-nums;
}
.result-delta.pos { background: rgba(91,191,173,.18); color: var(--teal); }
.result-delta.neg { background: rgba(232,125,91,.18); color: var(--coral); }
.result-sub { font-size: 0.95rem; color: var(--muted); line-height: 1.55; }
.result-next { margin-top: 1.1rem; }

/* Avslutt året */
.end-year-wrap {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 1rem; flex-shrink: 0; flex-wrap: wrap;
}
.end-year-hint { font-size: 0.95rem; color: var(--muted); }
.end-year-hint.warn { color: var(--gold); }

/* ─── Høyre sidebar ───────────────────────────────────── */
.sidebar-right {
  width: 268px; background: var(--surface); border-left: 1px solid var(--border);
  padding: 1.25rem 1rem; overflow-y: auto; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 1.5rem;
}
.sidebar-block { display: flex; flex-direction: column; gap: 0.5rem; }
.sidebar-section-title {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.11em;
  color: var(--muted); font-weight: 600;
}
.sidebar-section-title.warn { color: var(--gold); }
.sidebar-section-title.bad  { color: var(--coral); }
.sidebar-empty { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }

.region-list { display: flex; flex-direction: column; gap: 0.35rem; }
.region-list-item {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  padding: 0.55rem 0.6rem; border-radius: var(--r); cursor: pointer;
  font-size: 0.95rem; background: transparent; border: 1px solid transparent;
  color: var(--text); text-align: left; transition: background .15s, border-color .15s;
}
.region-list-item:hover { background: var(--surface2); }
.region-list-item.active { background: var(--surface2); border-color: var(--teal); }
.region-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.region-list-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.region-neglect {
  font-size: 0.78rem; font-weight: 700; color: var(--coral);
  background: rgba(232,125,91,.16); padding: 0.1rem 0.35rem; border-radius: 4px;
}
.region-cost { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.region-status { font-size: 0.95rem; font-weight: 700; width: 1.1rem; text-align: center; }
.region-status.pending  { color: var(--gold); }
.region-status.done     { color: var(--teal); }
.region-status.deferred { color: var(--muted); }

.neglect-list { display: flex; flex-direction: column; gap: 0.3rem; }
.neglect-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  font-size: 0.9rem; color: var(--text-dim); padding: 0.35rem 0.5rem;
  background: rgba(232,197,71,.08); border-radius: 6px; line-height: 1.35;
}
.neglect-item.scar { background: rgba(232,125,91,.1); color: #F0B6A2; }
.neglect-years { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }

.map-legend { display: flex; flex-direction: column; gap: 0.35rem; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.legend-emoji { font-size: 1rem; }
.legend-label { flex: 1; color: var(--text-dim); }
.legend-year { font-variant-numeric: tabular-nums; font-size: 0.85rem; color: var(--muted); }

/* ─── Avisoverlay ─────────────────────────────────────── */
.paper-overlay {
  position: fixed; inset: 0; background: rgba(13,27,42,.9);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  z-index: 600; opacity: 0; pointer-events: none; transition: opacity .3s;
  overflow-y: auto;
}
.paper-overlay.show { opacity: 1; pointer-events: all; }

.news-paper {
  background: #F5F0E8; color: #1A1008;
  max-width: 540px; width: 100%; padding: 2.25rem;
  border-radius: 3px; box-shadow: 0 24px 70px rgba(0,0,0,.65);
  margin: auto;
}
.news-paper-summary { max-width: 660px; }
.news-paper-header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.news-paper-name { font-family: var(--font-d); font-size: 1.7rem; font-weight: 700; letter-spacing: -0.01em; }
.news-paper-date { font-size: 0.9rem; color: #5A5248; text-transform: uppercase; letter-spacing: 0.08em; }
.news-paper-divider { border-top: 2px solid #1A1008; margin: 0.6rem 0 1rem; }
.news-caused-by {
  font-size: 0.95rem; color: #4A4238; font-style: italic;
  margin-bottom: 0.9rem; line-height: 1.6; border-left: 3px solid #C9BFAE; padding-left: 0.9rem;
}
.news-headline {
  font-family: var(--font-d); font-size: 2rem; font-weight: 700;
  line-height: 1.12; margin-bottom: 0.75rem; letter-spacing: -0.015em;
}
.news-ingress { font-size: 1.05rem; line-height: 1.65; color: #302A22; margin-bottom: 1.25rem; }
.news-dismiss-btn { background: #1A1008; color: #F5F0E8; width: 100%; box-shadow: 0 2px 0 rgba(0,0,0,.3); }

/* Årsoppgjøret */
.summary-deltas {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem; margin-bottom: 1.4rem;
}
.summary-delta {
  display: flex; align-items: center; gap: 0.5rem;
  background: #EAE3D6; border-radius: 6px; padding: 0.6rem 0.75rem;
  border-left: 3px solid #B5AB98;
}
.summary-delta.pos  { border-left-color: #2E7D5B; }
.summary-delta.neg  { border-left-color: #B34A28; }
.summary-delta-icon { font-size: 1.1rem; }
.summary-delta-name { flex: 1; font-size: 0.9rem; color: #3A342A; }
.summary-delta-val  { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.summary-delta.pos .summary-delta-val  { color: #2E7D5B; }
.summary-delta.neg .summary-delta-val  { color: #B34A28; }
.summary-delta.flat .summary-delta-val { color: #6A6255; }

.summary-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.summary-col-title {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700;
  color: #1A1008; border-bottom: 1px solid #C9BFAE; padding-bottom: 0.35rem; margin-bottom: 0.6rem;
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem;
}
.summary-col-title-bad { color: #B34A28; border-bottom-color: #E0B4A2; }
.summary-budget { font-size: 0.78rem; font-weight: 500; color: #6A6255; letter-spacing: 0.02em; text-transform: none; }
.summary-list { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }
.summary-list li { display: flex; align-items: baseline; gap: 0.5rem; font-size: 0.95rem; line-height: 1.45; color: #302A22; }
.summary-what { flex: 1; }
.summary-what em { color: #554C3E; }
.summary-months, .summary-years {
  font-size: 0.8rem; color: #6A6255; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.summary-list-bad li { color: #7A3418; }
.summary-list-bad .summary-years { color: #B34A28; font-weight: 600; }
.summary-empty { font-size: 0.95rem; color: #6A6255; font-style: italic; }

.summary-scars { margin-top: 1.25rem; background: #F0DED6; border-radius: 6px; padding: 0.9rem 1rem; }
.summary-scars-title {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 700; color: #8C2F0E; margin-bottom: 0.4rem;
}
.summary-list-scar li { color: #8C2F0E; font-weight: 600; }

/* ─── År-overgang ─────────────────────────────────────── */
#year-transition {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 500; opacity: 0; pointer-events: none; transition: opacity .4s;
}
#year-transition.show { opacity: 1; pointer-events: all; }
.transition-year {
  font-family: var(--font-d); font-size: clamp(4rem, 16vw, 9rem); font-weight: 700;
  color: var(--surface3); font-variant-numeric: tabular-nums; line-height: 1;
}
.transition-sub { font-family: var(--font-d); font-style: italic; color: var(--muted); font-size: 1.15rem; margin-top: 0.75rem; }

/* ─── Toast ───────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 0.5rem; z-index: 1000;
  pointer-events: none; align-items: center;
}
.toast {
  background: var(--surface2); border: 1px solid var(--border-strong); border-radius: var(--r);
  padding: 0.7rem 1.3rem; font-size: 1rem; color: var(--text);
  box-shadow: var(--shadow-lift); max-width: 380px; text-align: center;
  animation: toast-in .3s ease forwards;
}
.toast.is-leaving { opacity: 0; transform: translateY(-10px); transition: opacity .4s, transform .4s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ─── Sluttrapport ────────────────────────────────────── */
.report-inner { max-width: 760px; margin: 0 auto; padding: 3.5rem 1.75rem 5rem; width: 100%; }
.report-eyebrow {
  font-size: 0.85rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1.5rem;
}
.report-loading { font-family: var(--font-d); font-style: italic; color: var(--muted); font-size: 1.15rem; }

.epithet {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-left: 4px solid var(--gold); border-radius: var(--r-lg);
  padding: 2rem; margin-bottom: 2.5rem; box-shadow: var(--shadow-card);
}
.epithet-frame {
  font-size: 0.95rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.1em; margin-bottom: 0.6rem;
}
.epithet-title {
  font-family: var(--font-d); font-size: clamp(1.9rem, 5.5vw, 3rem); font-weight: 700;
  line-height: 1.1; letter-spacing: -0.02em; color: var(--gold); margin-bottom: 0.9rem;
}
.epithet-blurb { font-family: var(--font-d); font-style: italic; font-size: 1.15rem; line-height: 1.65; color: var(--text-dim); }

.report-headline {
  font-family: var(--font-d); font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 600;
  line-height: 1.2; margin-bottom: 2.5rem; padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.report-section { margin-bottom: 2.5rem; }
.report-section-title {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.11em;
  color: var(--muted); font-weight: 600; margin-bottom: 0.9rem;
}

.chart-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.25rem; box-shadow: var(--shadow-card);
  overflow-x: auto;
}
.report-chart { width: 100%; min-width: 460px; height: auto; display: block; }
.chart-legend { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--border); }
.chart-legend-item { display: flex; align-items: center; gap: 0.45rem; font-size: 0.92rem; color: var(--text-dim); }
.chart-swatch { width: 14px; height: 3px; border-radius: 2px; }

.report-voices { display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 2.5rem; }
.voice-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem; box-shadow: var(--shadow-card);
}
.voice-card-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; }
.voice-icon { font-size: 1.5rem; }
.voice-name {
  font-family: var(--font-d); font-size: 1.25rem; font-weight: 600; flex: 1;
  display: flex; flex-direction: column;
}
.voice-sub { font-family: var(--font-u); font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.voice-score {
  font-family: var(--font-d); font-size: 1.9rem; font-weight: 700;
  font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 0.4rem;
}
.voice-change { font-family: var(--font-u); font-size: 0.85rem; font-weight: 600; }
.voice-change.pos { color: var(--teal); }
.voice-change.neg { color: var(--coral); }
.voice-text { font-size: 1.05rem; line-height: 1.7; color: var(--text); margin-bottom: 0.9rem; }

.highlight {
  display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap;
  font-size: 0.92rem; padding: 0.55rem 0.75rem; border-radius: var(--r);
  background: var(--surface2); margin-top: 0.45rem;
}
.highlight-tag {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
  padding: 0.15rem 0.45rem; border-radius: 4px; white-space: nowrap;
}
.highlight.win  .highlight-tag { background: rgba(91,191,173,.2); color: var(--teal); }
.highlight.loss .highlight-tag { background: rgba(232,125,91,.2); color: var(--coral); }
.highlight-text { flex: 1; color: var(--text-dim); min-width: 12rem; }
.highlight-text em { color: var(--text); font-style: normal; font-weight: 600; }
.highlight-delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.highlight.win  .highlight-delta { color: var(--teal); }
.highlight.loss .highlight-delta { color: var(--coral); }

.scar-list, .achievement-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.scar-badge {
  display: flex; align-items: baseline; gap: 0.4rem; padding: 0.45rem 0.85rem;
  background: rgba(232,125,91,.12); border: 1px solid rgba(232,125,91,.3);
  border-radius: 100px; font-size: 0.92rem; color: #F0B6A2;
}
.scar-badge em { font-style: normal; color: var(--muted); font-size: 0.82rem; }
.achievement-badge {
  display: flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.9rem;
  background: var(--surface2); border: 1px solid var(--border-strong);
  border-radius: 100px; font-size: 0.92rem;
}

.report-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ─── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ─── Responsivt ──────────────────────────────────────── */
@media (max-width: 1180px) {
  .sidebar-right { width: 232px; }
  .game-grid { grid-template-columns: minmax(300px, .9fr) minmax(360px, 1.1fr); gap: 1.1rem; padding: 1rem 1.25rem; }
}

@media (max-width: 980px) {
  #screen-game.active { height: auto; min-height: 100dvh; overflow: visible; flex-direction: column; }
  .main-content { overflow: visible; order: 1; }
  .sidebar-meters {
    width: 100%; flex-direction: row; border-right: none;
    border-bottom: 1px solid var(--border); padding: 0.85rem 1rem; order: 0;
    position: sticky; top: 0; z-index: 50;
  }
  .meter-wrap { flex-direction: row; align-items: center; justify-content: flex-start; gap: 0.6rem; padding: 0 0.75rem; }
  .meter-wrap + .meter-wrap { border-top: none; border-left: 1px solid var(--border); }
  .meter-track { width: 100%; height: 12px; min-height: 0; flex: 1; margin-bottom: 0; }
  .meter-fill { height: 100%; width: var(--fill, 50%); top: 0; }
  .meter-name { display: none; }
  .meter-delta { bottom: auto; top: -4px; left: auto; right: 0; transform: none; }

  .game-grid { grid-template-columns: 1fr; overflow: visible; }
  .events-area { overflow: visible; }
  .map-container { max-width: 520px; margin: 0 auto; }
  .sidebar-right { width: 100%; border-left: none; border-top: 1px solid var(--border); order: 2; }
  .game-header { flex-wrap: wrap; gap: 0.85rem; padding: 0.85rem 1.25rem; }
  .time-meter { order: 3; width: 100%; justify-content: flex-start; }
}

@media (max-width: 560px) {
  html { font-size: 15px; }
  .game-grid { padding: 0.85rem; }
  .event-card, .choice-result { padding: 1.15rem; }
  .event-title { font-size: 1.45rem; }
  .report-inner { padding: 2.5rem 1.15rem 4rem; }
  .epithet { padding: 1.35rem; }
  .news-paper { padding: 1.5rem; }
  .news-headline { font-size: 1.6rem; }
  .time-seg { width: 8px; height: 16px; }
  .end-year-wrap { justify-content: space-between; }
}
