/* =========================================================================
   AI MAY DAY · stylesheet
   Stil: Disco Elysium-möter-svenskt-fanzin. Mörk teal, varm guld, kornig.
   Allt med systemfonts, ingen extern resurs.
   ========================================================================= */

:root {
  --bg-deep:    #2a3132;
  --bg-mid:     #3a4244;
  --bg-soft:    #4a5354;
  --gold:       #d4a55c;
  --gold-soft:  #b88947;
  --gold-bright:#f1c781;
  --red:        #b03030;
  --red-bright: #e54a4a;
  --red-deep:   #621818;
  --parchment:  #efe3c8;
  --parchment-d:#c9bb98;
  --moss:       #4a5d56;
  --ink:        #0a1210;

  --font-display: "Trebuchet MS", Tahoma, Verdana, "Helvetica Neue", sans-serif;
  --font-serif:   Tahoma, Verdana, "Trebuchet MS", sans-serif;
  --font-sans:    Tahoma, Verdana, "Trebuchet MS", "Helvetica Neue", sans-serif;
  --font-mono:    "Courier New", "Consolas", ui-monospace, monospace;
  --font-pixel:   "Trebuchet MS", Tahoma, Verdana, sans-serif;

  --shadow-deep: 0 12px 30px rgba(0,0,0,0.55), 0 2px 0 rgba(0,0,0,0.4);
  --hairline: rgba(212,165,92,0.22);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--bg-deep);
  color: var(--parchment);
  font-family: var(--font-sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
  position: relative;
  min-height: 100dvh;
}

/* =========================================================================
   SKY · bakgrund
   ========================================================================= */

.sky {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 22%, #c2c0b4 0%, #94978f 45%, #5e6562 100%),
    linear-gradient(180deg, #b3b6ad 0%, #4a5251 100%);
  z-index: 0;
  overflow: hidden;
}

.moon, .moon-glow { display: none; }

/* skyline borttaget — skapade artefakt-streck i bakgrunden */
.skyline, .skyline--far { display: none; }

/* grain borttagen — mix-blend-mode overlay var GPU-tung */
.grain { display: none; }

/* =========================================================================
   HUD
   ========================================================================= */

.hud {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 22px;
  padding: 11px 22px 9px;
  background:
    linear-gradient(180deg, rgba(7,16,14,0.92) 0%, rgba(7,16,14,0.55) 90%, transparent 100%);
  border-bottom: 1px solid var(--hairline);
}

.hud__title { min-width: 0; }
.hud__eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold-soft);
  margin-bottom: 2px;
  text-transform: uppercase;
}
.hud__h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: normal;
  font-size: clamp(22px, 3.6vw, 40px);
  line-height: 0.95;
  margin: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--parchment);
  text-shadow:
    2px 0 0 #000,
    -2px 0 0 #000,
    0 2px 0 #000,
    2px 2px 0 var(--red-deep),
    4px 4px 0 rgba(0,0,0,0.55);
}
.hud__sub {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.26em;
  color: var(--parchment-d);
  text-transform: uppercase;
}

/* mood */
.mood {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 5px 12px;
  align-items: center;
  background: rgba(15, 24, 22, 0.85);
  border: 2px solid #1a1208;
  padding: 12px 16px;
  min-width: 260px;
  box-shadow: 3px 3px 0 #1a1208;
}
.mood__row {
  display: contents;
}
.mood__label {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--parchment);
}
.mood__bar {
  position: relative;
  height: 10px;
  background: rgba(0,0,0,0.5);
  overflow: hidden;
  border: 2px solid #1a1208;
}
.mood__bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--gold);
  transition: width 0.45s cubic-bezier(.4,.7,.3,1);
  background-image: repeating-linear-gradient(
    -25deg,
    rgba(0,0,0,0.18) 0 4px,
    transparent 4px 8px
  );
}
[data-mood="hype"]   .mood__bar i { background-color: var(--red-bright); }
[data-mood="calm"]   .mood__bar i { background-color: #6fa07a; }
[data-mood="panic"]  .mood__bar i { background-color: #5b8fc4; }
[data-mood="bored"]  .mood__bar i { background-color: #8a7a55; }

.mood__pct {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  color: var(--gold-bright);
  min-width: 38px;
  text-align: right;
}

/* counter */
.counter {
  text-align: right;
  justify-self: end;
}
.counter__num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(22px, 3.3vw, 38px);
  letter-spacing: 0.02em;
  color: var(--gold-bright);
  text-shadow:
    2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000,
    3px 3px 0 rgba(0,0,0,0.5);
  font-variant-numeric: tabular-nums;
}
.counter__num.flicker { animation: flicker 0.4s steps(3) 1; }
.counter__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--parchment-d);
  text-transform: uppercase;
}

/* =========================================================================
   GOAL bar — samma språk som .btn (ifylld, chunky), ej klickbar status
   ========================================================================= */

.goal {
  --goal-accent: #b88947;
  appearance: none;
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr minmax(180px, 240px) auto;
  align-items: center;
  gap: 12px 16px;
  margin: 8px 20px 6px;
  padding: 9px 14px 10px 12px;
  background: #f0e3c0;
  color: #1a1208;
  border: 3px solid #1a1208;
  border-left: 5px solid var(--goal-accent);
  box-shadow: 4px 4px 0 #1a1208;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  cursor: pointer;
  user-select: none;
  text-align: left;
  width: calc(100% - 40px);
  transition: background 0.25s ease, border-left-color 0.35s ease, box-shadow 0.12s ease, transform 0.06s ease;
}
.goal:hover { background: #fff4d2; box-shadow: 5px 5px 0 #1a1208; transform: translate(-1px, -1px); }
.goal:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #1a1208; }
.goal:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: -3px; }
.goal__help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  background: #b03030;
  color: #fff;
  border: 2px solid #1a1208;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 10px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 50%;
  line-height: 1;
  flex-shrink: 0;
}
.goal:hover .goal__help { background: #d04848; }
.goal__label {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 6px 8px;
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.28em;
  line-height: 1;
  color: #1a1208;
  background: #d4a55c;
  border: 2px solid #1a1208;
  box-shadow: 2px 2px 0 rgba(26, 18, 8, 0.35);
}
.goal__text {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 900;
  font-size: clamp(13px, 1.65vw, 16px);
  letter-spacing: 0.06em;
  line-height: 1.2;
  color: #1a1208;
}
.goal__bar {
  display: block;
  height: 14px;
  background: rgba(26, 18, 8, 0.12);
  border: 2px solid #1a1208;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.goal__bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--gold-bright);
  transition: width 0.3s ease;
  background-image: repeating-linear-gradient(
    -25deg,
    rgba(0,0,0,0.18) 0 6px,
    transparent 6px 12px
  );
}
.goal.is-winning {
  --goal-accent: #2d6b3e;
  background: linear-gradient(180deg, #e5f4e8 0%, #d4ead9 100%);
}
.goal.is-winning .goal__bar i {
  background-color: #4caf6a;
  box-shadow: 0 0 10px rgba(76, 175, 106, 0.55);
}
.goal.is-winning .goal__text { color: #143a1c; }

.goal.is-danger {
  --goal-accent: #9e2828;
  background: linear-gradient(180deg, #fde8e8 0%, #f8d4d4 100%);
  animation: goal-pulse-danger 0.85s ease-in-out infinite;
}
.goal.is-danger .goal__bar i {
  background-color: var(--red-bright);
  box-shadow: 0 0 10px rgba(229, 74, 74, 0.55);
}
.goal.is-danger .goal__text { color: #4a1010; }

.goal.is-bored {
  --goal-accent: #8a6820;
  background: linear-gradient(180deg, #faf3e0 0%, #f2e6c8 100%);
  animation: goal-pulse-bored 1.35s ease-in-out infinite;
}
.goal.is-bored .goal__bar i {
  background-color: #c9982e;
  box-shadow: 0 0 10px rgba(201, 152, 46, 0.45);
}
.goal.is-bored .goal__text {
  color: #3d3010;
  font-weight: 900;
  letter-spacing: 0.1em;
}

@keyframes goal-pulse-danger {
  0%, 100% { box-shadow: 4px 4px 0 #1a1208; }
  50% {
    box-shadow:
      4px 4px 0 #1a1208,
      0 0 0 3px #9e2828,
      0 0 10px rgba(176, 48, 48, 0.45);
  }
}
@keyframes goal-pulse-bored {
  0%, 100% { box-shadow: 4px 4px 0 #1a1208; }
  50% {
    box-shadow:
      4px 4px 0 #1a1208,
      0 0 0 3px #8a6820,
      0 0 10px rgba(184, 137, 71, 0.4);
  }
}

.goal__time {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: clamp(20px, 2.8vw, 26px);
  font-variant-numeric: tabular-nums;
  color: #1a1208;
  min-width: 72px;
  text-align: right;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.35);
}
.goal.is-winning .goal__time { color: #1e5c2e; }
.goal.is-danger .goal__time { color: #7a1818; }
.goal.is-bored .goal__time { color: #6b4f12; }

/* =========================================================================
   FINALE
   ========================================================================= */

.finale {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7,16,14,0.86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.4s ease;
}
.finale[hidden] { display: none; }
.finale__card {
  background:
    linear-gradient(180deg, rgba(28,42,40,0.96), rgba(15,25,23,0.98));
  border: 4px solid var(--gold-soft);
  padding: 0 36px 18px;
  max-width: 560px;
  width: calc(100% - 32px);
  text-align: center;
  position: relative;
  box-shadow: 8px 8px 0 #1a1208, 0 30px 80px rgba(0,0,0,0.7);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  display: flex;
  flex-direction: column;
}
.finale--win .finale__card    { border-color: #6fe089; box-shadow: 8px 8px 0 #1a3a22, 0 30px 80px rgba(111,224,137,0.25), 0 0 60px rgba(111,224,137,0.3) inset; }
.finale--police .finale__card { border-color: #5b8fc4; box-shadow: 8px 8px 0 #0a1422, 0 30px 80px rgba(0,0,0,0.7); }
.finale--bored .finale__card  { border-color: #d6a850; box-shadow: 8px 8px 0 #4a3618, 0 30px 80px rgba(0,0,0,0.7); }
.finale--win    { background: rgba(7,16,14,0.92); }
.finale--police { background: rgba(10,20,34,0.92); }
.finale--bored  { background: rgba(28,22,12,0.92); }
.finale__card .finale__eyebrow:first-child { margin-top: 22px; }

/* ===== VERDICT-banner: VINST / FÖRLUST ===== */
.finale__verdict {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 -36px 12px;
  padding: 8px 14px 9px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(18px, 3vw, 24px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  border-bottom: 4px solid #1a1208;
  z-index: 1;
}
.finale__verdict-icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: 3px solid #1a1208;
  background: #fff4d2;
  font-size: 22px;
  line-height: 1;
  color: #1a1208;
  box-shadow: 3px 3px 0 #1a1208;
}
.finale__verdict-label {
  text-shadow: 2px 0 0 #1a1208, -2px 0 0 #1a1208, 0 2px 0 #1a1208, 0 -2px 0 #1a1208;
}

/* WIN: grön + guld + glow */
.finale__verdict--win {
  background: linear-gradient(180deg, #6fe089 0%, #3aab58 100%);
  color: #fff;
  box-shadow: 0 0 30px rgba(111, 224, 137, 0.45) inset, 0 4px 0 #1a3a22;
  animation: verdict-pulse-win 1.4s ease-in-out infinite;
}
.finale__verdict--win .finale__verdict-icon {
  background: #f1c781;
  color: #1a1208;
  animation: verdict-icon-spin 0.6s cubic-bezier(.4,1.5,.6,1) 0.2s both;
}
@keyframes verdict-pulse-win {
  0%, 100% { box-shadow: 0 0 30px rgba(111, 224, 137, 0.45) inset, 0 4px 0 #1a3a22; }
  50%      { box-shadow: 0 0 50px rgba(111, 224, 137, 0.7) inset, 0 4px 0 #1a3a22; }
}
@keyframes verdict-icon-spin {
  0%   { transform: rotate(-180deg) scale(0.4); opacity: 0; }
  100% { transform: rotate(0) scale(1); opacity: 1; }
}

/* LOSS: röd-grå sober, ingen pulse */
.finale__verdict--loss {
  background: linear-gradient(180deg, #5a1818 0%, #2a0808 100%);
  color: #ffd3d3;
  box-shadow: 0 0 24px rgba(176, 48, 48, 0.4) inset, 0 4px 0 #1a0808;
}
.finale__verdict--loss .finale__verdict-icon {
  background: #b03030;
  color: #f0e3c0;
  border-color: #1a0808;
}
.finale--police .finale__verdict--loss {
  background: linear-gradient(180deg, #2c4a78 0%, #142640 100%);
  box-shadow: 0 0 24px rgba(91, 143, 196, 0.4) inset, 0 4px 0 #0a1422;
  color: #d6e2f0;
}
.finale--police .finale__verdict--loss .finale__verdict-icon {
  background: #5b8fc4;
  color: #0a1422;
  border-color: #0a1422;
}
.finale--bored .finale__verdict--loss {
  background: linear-gradient(180deg, #7a5e2c 0%, #3a2a14 100%);
  box-shadow: 0 0 24px rgba(214, 168, 80, 0.3) inset, 0 4px 0 #1a1208;
  color: #f1e0b8;
}
.finale--bored .finale__verdict--loss .finale__verdict-icon {
  background: #d6a850;
  color: #1a1208;
  border-color: #1a1208;
}

/* Key art överst i finale — fast höjd + cover beskär lite top/botten */
.finale__keyart {
  margin: 0 -36px 14px;
  border-bottom: 3px solid #1a1208;
  background: #1a1208;
  overflow: hidden;
  line-height: 0;
  max-height: min(180px, 26vh);
}
.finale__keyart img {
  display: block;
  width: 100%;
  height: min(180px, 26vh);
  object-fit: cover;
  object-position: center center;
}
.finale__keyart + .finale__eyebrow { margin-top: 14px; }
.finale__card::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.1;
  pointer-events: none;
  mix-blend-mode: overlay;
}
.finale__eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--gold-soft);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.finale__title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: clamp(26px, 4.4vw, 40px);
  line-height: 0.95;
  margin: 0 0 8px;
  color: var(--parchment);
  text-shadow: 0 1px 0 #000, 0 2px 0 var(--red-deep), 2px 4px 0 rgba(0,0,0,0.5);
}
.finale--win .finale__title { color: #b6e2bf; text-shadow: 0 1px 0 #000, 0 2px 0 #1a3a22, 2px 4px 0 rgba(0,0,0,0.5); }
.finale--police .finale__title { color: #c0d6ee; text-shadow: 0 1px 0 #000, 0 2px 0 #142640, 2px 4px 0 rgba(0,0,0,0.5); }
.finale--bored .finale__title  { color: #d8c89c; text-shadow: 0 1px 0 #000, 0 2px 0 #4a3a1c, 2px 4px 0 rgba(0,0,0,0.5); }
.finale__sub {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--parchment-d);
  font-size: 13px;
  line-height: 1.4;
  margin: 0 0 14px;
  font-size: 15px;
}
.finale__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 18px;
  margin: 0 auto 14px;
  max-width: 400px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.finale__stats > div {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed var(--hairline);
}
.finale__stats dt { color: var(--parchment-d); text-transform: uppercase; }
.finale__stats dd { color: var(--gold-bright); margin: 0; font-variant-numeric: tabular-nums; }
.finale__btn {
  appearance: none;
  background: linear-gradient(180deg, rgba(38,52,50,0.9), rgba(20,30,28,0.95));
  border: 2px solid var(--gold-soft);
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 14px 28px;
  cursor: pointer;
  transition: transform 0.08s, background 0.2s;
  margin-top: auto;
  width: 100%;
  position: sticky;
  bottom: 0;
}

/* LEADERBOARD — utfalls-tavla på finale */
.finale__leaderboard {
  margin: 4px 0 12px;
  padding: 10px 12px 12px;
  background: rgba(0,0,0,0.3);
  border: 2px solid var(--hairline);
}
.lb__head {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--gold-bright);
  text-transform: uppercase;
  margin-bottom: 8px;
  text-align: center;
}
.lb__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.lb__cell {
  background: rgba(26, 18, 8, 0.5);
  border: 2px solid #1a1208;
  padding: 6px 4px 5px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 800;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  transition: transform 0.12s ease;
}
.lb__short {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(212, 165, 92, 0.55);
}
.lb__time {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.4);
  font-variant-numeric: tabular-nums;
}
.lb__cell.is-unlocked .lb__short { color: var(--parchment); }
.lb__cell.is-unlocked .lb__time  { color: var(--gold-bright); }
.lb__cell.is-locked { opacity: 0.55; }

.lb__cell--win.is-unlocked     { border-color: #6fe089; background: rgba(40, 80, 50, 0.45); }
.lb__cell--win.is-unlocked .lb__short { color: #b6e2bf; }
.lb__cell--win.is-unlocked .lb__time  { color: #d4f5dc; }

.lb__cell--police.is-unlocked  { border-color: #5b8fc4; background: rgba(20, 40, 70, 0.45); }
.lb__cell--police.is-unlocked .lb__short { color: #c0d6ee; }
.lb__cell--police.is-unlocked .lb__time  { color: #d4e6f5; }

.lb__cell--bored.is-unlocked   { border-color: #d6a850; background: rgba(70, 50, 20, 0.45); }
.lb__cell--bored.is-unlocked .lb__short { color: #e8d8a8; }
.lb__cell--bored.is-unlocked .lb__time  { color: #f5e6c0; }

.lb__cell.is-current {
  transform: scale(1.06);
  box-shadow: 0 0 0 3px var(--gold-bright), 4px 4px 0 #1a1208;
  z-index: 1;
  animation: lb-current-pulse 1.5s ease-in-out infinite;
}
@keyframes lb-current-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--gold-bright), 4px 4px 0 #1a1208; }
  50%      { box-shadow: 0 0 0 4px #fff4d2, 4px 4px 0 #1a1208; }
}

@media (max-width: 720px) {
  .lb__grid { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .lb__short { font-size: 9px; }
  .lb__time  { font-size: 10px; }
}

/* SHARE-block */
.finale__share {
  margin: 8px 0 12px;
  padding: 9px 12px 10px;
  background: rgba(0,0,0,0.25);
  border: 2px solid var(--hairline);
}
.finale__share-label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--gold-bright);
  text-transform: uppercase;
  margin-bottom: 7px;
  text-align: center;
}
.finale__share-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.finale__share-btn {
  appearance: none;
  background: #f0e3c0;
  border: 2px solid #1a1208;
  box-shadow: 3px 3px 0 #1a1208;
  color: #1a1208;
  font-family: "Trebuchet MS", Tahoma, Verdana, sans-serif;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 8px 6px;
  cursor: pointer;
  transition: transform 0.06s ease;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.finale__share-btn:hover { background: #fff4d2; transform: translate(-1px, -1px); box-shadow: 5px 5px 0 #1a1208; }
.finale__share-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #1a1208; }
.finale__share-btn--copied { background: #92c19c; }
.finale__share-btn--x        .finale__share-btn__icon { font-size: 18px; }
.finale__share-btn--bsky     { background: #d6e8ff; }
.finale__share-btn--bsky:hover { background: #e9f2ff; }
.finale__share-btn--linkedin { background: #b8d8e8; }
.finale__share-btn--linkedin:hover { background: #d0e6f0; }
.finale__share-btn--copy     { background: #e8d8a8; }
.finale__share-btn--copy:hover { background: #f4e4b8; }

@media (max-width: 720px) {
  .finale__share-buttons { grid-template-columns: repeat(2, 1fr); }
}
.finale__btn:hover { background: linear-gradient(180deg, rgba(48,68,64,0.95), rgba(25,38,35,0.98)); }
.finale__btn:active { transform: translateY(1px); }
.finale--win .finale__btn    { background: #2a6e3a; color: #fff4d2; border-color: #1a3a22; }
.finale--win .finale__btn:hover    { background: #348445; }
.finale--police .finale__btn { background: #2c4a78; color: #d6e2f0; border-color: #0a1422; }
.finale--police .finale__btn:hover { background: #3a5d92; }
.finale--bored .finale__btn  { background: #7a5e2c; color: #f1e0b8; border-color: #3a2a14; }
.finale--bored .finale__btn:hover  { background: #94733a; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* =========================================================================
   SCENE
   ========================================================================= */

.scene {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.layer--back  { z-index: 1; }
.layer--mid   { z-index: 2; }
.layer--front { z-index: 3; pointer-events: auto; cursor: crosshair; }
.layer--bubbles { z-index: 50; }
.layer--police  { z-index: 4; pointer-events: none; }
.layer--snow    { z-index: 7; pointer-events: none; width: 100%; height: 100%; }

.vignette { display: none; }
.ground-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 8%; z-index: 4;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(7,16,14,0.35) 100%);
}

/* sprite-pos = positions-wrapper (translate-center + tilt) */
.sprite-pos {
  position: absolute;
  pointer-events: auto;
}

/* sprite = själva bilden, har bobb-animation som modifierar translateY */
.sprite {
  position: relative;
  transform-origin: 50% 80%;
  will-change: transform;
  backface-visibility: hidden;
}
.sprite__img {
  display: block;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  transform: translateZ(0); /* GPU-layer */
}
.sprite--flipped .sprite__img { transform: scaleX(-1); }
.sprite__img--feathered { /* mask borttagen för perf */ }

/* mask-image borttaget helt — för dyrt att composita varje frame */


/* Subtle bobb per lager — translate Y bara, billig på GPU */
@keyframes bobb-back  { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes bobb-mid   { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes bobb-front { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.layer--back  .sprite { animation: bobb-back  5.5s ease-in-out infinite; }
.layer--mid   .sprite { animation: bobb-mid   4.2s ease-in-out infinite; }
.layer--front .sprite { animation: bobb-front 3.4s ease-in-out infinite; }

/* banner-text overlay positionerad inom sprite */
.banner-text {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
  transform: skewX(-2deg) rotate(-1.2deg);
  font-size: 14px;
  line-height: 1;
}
.banner-text--dark  {
  color: #1a1610;
  text-shadow:
    0 1px 0 rgba(255,240,200,0.5),
    0 0 6px rgba(255,240,200,0.18);
}
.banner-text--light {
  color: #f0e3c5;
  text-shadow:
    0 1px 0 rgba(0,0,0,0.65),
    0 0 5px rgba(0,0,0,0.35);
}
.banner-text__inner { display: inline-block; }

/* sprite-bild flippas via .sprite__img — banner-text ska INTE counter-flippas
   (den ligger ovanpå sprite-elementet, inte inom det flippade img-elementet) */

/* mood-overlay per lager — använder rgba istället för mix-blend-mode (mycket lättare GPU) */
.mood-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  transition: background-color 0.5s ease, opacity 0.5s ease;
  opacity: 0;
}

/* =========================================================================
   HOTSPOTS
   ========================================================================= */

.hotspot {
  position: absolute;
  width: 18px; height: 18px;
  margin-left: -9px; margin-top: -9px;
  border-radius: 50%;
  pointer-events: none;
  transition: background-color 0.25s ease, box-shadow 0.4s ease, transform 0.3s ease;
  background: transparent;
}
.hotspot--debug { background: rgba(0,255,180,0.5); }
.hotspot.state-hype       { background: radial-gradient(circle, rgba(229,72,72,0.85) 0%, rgba(229,72,72,0) 70%); box-shadow: 0 0 18px 2px rgba(229,72,72,0.45); transform: scale(1.15); }
.hotspot.state-panic      { background: radial-gradient(circle, rgba(91,143,196,0.8) 0%, rgba(91,143,196,0) 70%); box-shadow: 0 0 16px 2px rgba(91,143,196,0.4); }
.hotspot.state-bored      { background: radial-gradient(circle, rgba(120,110,80,0.45) 0%, transparent 70%); }
.hotspot.state-exhausted  { background: radial-gradient(circle, rgba(70,80,75,0.55) 0%, transparent 70%); transform: scale(0.85); }

/* =========================================================================
   PRATBUBBLOR
   ========================================================================= */

.bubble {
  position: absolute;
  transform: translate(-50%, -100%);
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
  line-height: 1.15;
  padding: 11px 18px 12px;
  border: 2px solid #2c2520;
  border-radius: 16px 16px 16px 4px;
  box-shadow:
    3px 4px 0 rgba(0,0,0,0.65),
    0 0 0 1px rgba(255,255,255,0.04) inset;
  white-space: nowrap;
  max-width: 380px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease, transform 220ms ease;
  z-index: 100;
}
.bubble--visible { opacity: 1; transform: translate(-50%, calc(-100% - 10px)); }
.bubble--shout {
  background: var(--red-bright);
  color: var(--parchment);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.04em;
  border-color: #2a0808;
  border-radius: 4px 16px 4px 16px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.45);
  transform: translate(-50%, -100%) rotate(-2deg);
  padding: 12px 22px 13px;
}
.bubble--shout.bubble--visible { transform: translate(-50%, calc(-100% - 10px)) rotate(-2deg); }
.bubble--panic {
  background: #2a3850;
  color: #e2ebf5;
  border-color: #0a1422;
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 rgba(0,0,0,0.55);
}
.bubble--bored, .bubble--exhausted {
  background: #d8c89c;
  color: #2e2418;
  font-style: italic;
  font-weight: 600;
  font-size: 15px;
  opacity: 0.92;
}

/* *...* action-text — italic + lite genomskinlig */
.bubble__action {
  font-style: italic;
  font-weight: 500;
  font-size: 0.88em;
  color: #6b4830;
  opacity: 0.85;
  letter-spacing: 0;
}
.bubble--shout .bubble__action { color: #ffe0d6; opacity: 0.85; }
.bubble--panic .bubble__action { color: #aac6e0; opacity: 0.9; }

/* per-lager-storlekar: bakre led mindre/dimmade så det blir djup */
.bubble--layer-mid {
  font-size: 14px;
  padding: 9px 14px 10px;
  opacity: 0.92;
}
.bubble--layer-mid.bubble--visible { opacity: 0.92; }
.bubble--layer-mid.bubble--shout { font-size: 16px; }

.bubble--layer-back {
  font-size: 12px;
  padding: 7px 11px 8px;
  opacity: 0.78;
  border-width: 1.5px;
}
.bubble--layer-back.bubble--visible { opacity: 0.78; }
.bubble--layer-back.bubble--shout { font-size: 13px; }
.bubble--layer-back::after { width: 12px; height: 12px; bottom: -8px; }

.bubble::after {
  content: "";
  position: absolute;
  left: 22px; bottom: -11px;
  width: 16px; height: 16px;
  background: inherit;
  border-right: 2px solid #2c2520;
  border-bottom: 2px solid #2c2520;
  transform: rotate(45deg);
}
.bubble--shout::after { border-color: #2a0808; }
.bubble--panic::after { border-color: #0a1422; }

/* =========================================================================
   ACTIONS
   ========================================================================= */

.actions {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 16px 22px 18px;
  background:
    linear-gradient(0deg, rgba(7,16,14,0.95) 0%, rgba(7,16,14,0.85) 100%);
  border-top: 2px solid #1a1208;
}

.btn {
  appearance: none;
  border: 3px solid #1a1208;
  background: #f0e3c0;
  color: #1a1208;
  padding: 10px 14px 11px;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: visible;
  transition: transform 0.06s ease;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 2px;
  align-items: baseline;
  box-shadow: 4px 4px 0 #1a1208;
  border-radius: 0;
}
/* btn::after noise borttagen — mix-blend-mode overlay var onödig GPU-cost */
.btn__kbd {
  grid-row: span 2;
  align-self: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #1a1208;
  color: #1a1208;
  background: #d4a55c;
  border-radius: 0;
}
.btn__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: normal;
  font-size: 17px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1a1208;
  line-height: 1;
}
.btn__sub {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5e4a30;
}
.btn:hover { background: #fff4d2; transform: translate(-1px, -1px); box-shadow: 5px 5px 0 #1a1208; }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #1a1208; }
.btn:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 2px; }

.btn--engage   .btn__title { color: #b03030; }
.btn--engage   .btn__kbd   { background: #e85a5a; }
.btn--chant    .btn__title { color: #8e6420; }
.btn--chant    .btn__kbd   { background: #f1c781; }
.btn--disperse .btn__title { color: #2e6b3a; }
.btn--disperse .btn__kbd   { background: #92c19c; }
.btn--megafon  .btn__title { color: #7a3a9c; }
.btn--megafon  .btn__kbd   { background: #c79ddb; }

.btn--cooling { pointer-events: none; opacity: 0.5; cursor: wait; filter: saturate(0.4); }
.btn--cooling:hover { transform: none; box-shadow: 4px 4px 0 #1a1208; }
.btn__cd-bar {
  position: absolute;
  left: 0; bottom: 0;
  height: 4px;
  width: 100%;
  background: #1a1208;
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 2;
}
.btn--cooling .btn__cd-bar { animation: cd-progress var(--cd-duration, 3s) linear forwards; }
@keyframes cd-progress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.btn--engage:hover   { border-color: var(--red); }
.btn--engage   .btn__title { color: var(--red-bright); }
.btn--chant:hover    { border-color: var(--gold-bright); }
.btn--chant    .btn__title { color: var(--gold-bright); }
.btn--disperse:hover { border-color: #6fa07a; }
.btn--disperse .btn__title { color: #92c19c; }
.btn--megafon:hover  { border-color: #b07ae0; }
.btn--megafon  .btn__title { color: #d6aef0; }

/* ── MEGAFON: combo-ready glow ─────────────────────────── */
.btn__ready-badge {
  position: absolute;
  top: -10px; right: -10px;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 9px;
  letter-spacing: 0.22em;
  background: var(--gold-bright);
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 3px 6px 2px;
  box-shadow: 2px 2px 0 var(--ink);
  opacity: 0;
  transform: translateY(4px) scale(0.85);
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(.4,1.6,.4,1);
  pointer-events: none;
  z-index: 3;
}
.btn--megafon.btn--ready .btn__ready-badge { opacity: 1; transform: translateY(0) scale(1); }
.btn--megafon.btn--ready {
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, #fff4d2 0%, #f0e3c0 100%);
  animation: ready-pulse 1.2s ease-in-out infinite;
}
@keyframes ready-pulse {
  0%, 100% { box-shadow: 4px 4px 0 #1a1208, 0 0 0 0 rgba(241,199,129,0.0); }
  50%      { box-shadow: 4px 4px 0 #1a1208, 0 0 0 4px rgba(241,199,129,0.55); }
}

/* ── COMBO PIPS — sitter inuti MEGAFON-knappen ─────────── */
.btn__combo-pips {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  height: 4px;
  pointer-events: none;
  z-index: 1;
}
.btn__combo-pips i {
  display: block;
  background: rgba(26, 18, 8, 0.18);
  border: 1px solid rgba(26, 18, 8, 0.35);
  transition: background 0.15s ease, transform 0.18s cubic-bezier(.4,1.6,.4,1), box-shadow 0.18s ease;
}
.btn__combo-pips i.is-on {
  background: var(--gold);
  border-color: var(--gold-soft);
  transform: scaleY(1.4);
}
.btn--megafon.btn--ready .btn__combo-pips i {
  background: var(--gold-bright);
  border-color: #b88947;
  box-shadow: 0 0 6px rgba(241, 199, 129, 0.7);
  transform: scaleY(1.4);
}
/* lite extra utrymme i botten på megafon-knappen så pips inte krockar med cd-bar */
.btn--megafon { padding-bottom: 16px; }
.btn--megafon .btn__cd-bar { bottom: 0; height: 3px; }

/* ── FLOATERS — visuella +X HYPE-popups ────────────────── */
.floater {
  position: fixed;
  pointer-events: none;
  z-index: 200;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--parchment);
  text-shadow: 2px 2px 0 #000, 0 0 12px rgba(0,0,0,0.6);
  transform: translate(-50%, -50%);
  animation: floater-rise 1.2s cubic-bezier(.2,.7,.3,1) forwards;
  white-space: nowrap;
}
@keyframes floater-rise {
  0%   { opacity: 0; transform: translate(-50%, -30%) scale(0.7); }
  18%  { opacity: 1; transform: translate(-50%, -55%) scale(1.18); }
  32%  { transform: translate(-50%, -65%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -120%) scale(0.92); }
}
.floater--hype    { color: #ff7a4a; text-shadow: 2px 2px 0 #3a0a0a, 0 0 14px rgba(229,74,74,0.55); }
.floater--chant   { color: var(--gold-bright); font-size: 32px; text-shadow: 3px 3px 0 #3a2410, 0 0 18px rgba(241,199,129,0.6); }
.floater--calm    { color: #92c19c; text-shadow: 2px 2px 0 #0a3010, 0 0 12px rgba(146,193,156,0.5); }
.floater--megafon { color: #f1c781; font-size: 38px; letter-spacing: 0.06em; text-shadow: 3px 3px 0 #3a1a4a, 0 0 22px rgba(255,200,255,0.8); }
.floater--combo   { color: var(--gold-bright); font-size: 28px; text-shadow: 3px 3px 0 #3a2410, 0 0 16px rgba(241,199,129,0.65); }
.floater--muted   { color: var(--parchment-d); font-size: 16px; font-style: italic; opacity: 0.85; }
.floater--wake    { color: #d4a55c; }
.floater--openclaw { color: #88c5e0; font-size: 30px; letter-spacing: 0.06em; text-shadow: 3px 3px 0 #0a1a2a, 0 0 18px rgba(136,197,224,0.7); }
.floater--countdown { color: #ffe6a8; font-size: 96px; font-style: italic; letter-spacing: 0.04em; text-shadow: 4px 4px 0 #3a1a0a, 0 0 32px rgba(255,180,90,0.85); animation: floater-countdown 1s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes floater-countdown {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  18%  { opacity: 1; transform: translate(-50%, -50%) scale(1.25); }
  100% { opacity: 0; transform: translate(-50%, -55%) scale(1.05); }
}

/* ── SLUTSPURT BANNER + body-state ──────────────────────── */
.spurt-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  z-index: 180;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(176, 48, 48, 0.96) 0%, rgba(98, 24, 24, 0.96) 100%);
  border: 4px solid #1a1208;
  box-shadow: 8px 8px 0 #1a1208, 0 0 60px rgba(229, 74, 74, 0.6);
  padding: 22px 42px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #ffe6c8;
  font-family: var(--font-display);
  text-align: center;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(.4, 1.6, .4, 1);
}
.spurt-banner.is-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.spurt-banner__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #ffd07a;
  margin-bottom: 6px;
}
.spurt-banner__title {
  font-size: clamp(38px, 7vw, 64px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 #1a1208, 6px 6px 0 rgba(0,0,0,0.4);
  line-height: 1;
}
.spurt-banner__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 230, 200, 0.8);
  margin-top: 8px;
}

/* Body-mode: röd vinjett-tint på allt under slutspurten */
body.is-final-spurt::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  background: radial-gradient(ellipse at center, rgba(176, 48, 48, 0) 35%, rgba(176, 48, 48, 0.22) 75%, rgba(98, 24, 24, 0.55) 100%);
  animation: spurt-tint 2.4s ease-in-out infinite;
}
@keyframes spurt-tint {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}
body.is-final-spurt .ticker.ticker--top { animation: ticker-rush 0.6s ease-in-out infinite alternate; }
@keyframes ticker-rush {
  from { background-color: #1a1208; }
  to   { background-color: #3a1010; }
}

/* ── NYTT UTFALL HITTAT — celebration på finale-rutan ──── */
/* Sitter INNE i kortet för att inte klippas av overflow:auto */
.finale--new-ending .finale__card {
  padding-top: 8px;
}
.finale--new-ending .finale__card::before {
  content: "★ NYTT UTFALL HITTAT ★";
  display: block;
  margin: 14px auto 0;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.28em;
  background: linear-gradient(90deg, #f1c781 0%, #fff4d2 50%, #f1c781 100%);
  color: #1a1208;
  border: 3px solid #1a1208;
  box-shadow: 4px 4px 0 #1a1208;
  padding: 6px 14px 5px;
  width: fit-content;
  white-space: nowrap;
  animation: new-ending-shimmer 1.6s ease-in-out infinite;
}
@keyframes new-ending-shimmer {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50%      { transform: scale(1.04); filter: brightness(1.18); }
}
.finale--new-ending .finale__verdict { margin-top: 8px; }

@media (max-width: 720px) {
  .spurt-banner { padding: 16px 24px 18px; }
  .floater--countdown { font-size: 72px; }
  .finale--new-ending .finale__card::before { font-size: 9px; padding: 5px 10px 4px; top: -18px; }
}

/* ── OPENCLAW FLAP — sitter ovanför ENGAGE-knappen ─────── */
.openclaw-flap {
  --openclaw-duration: 6.5s;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #1f2a3a 0%, #0e1620 100%);
  border: 2px solid #1a1208;
  box-shadow: 3px 3px 0 #1a1208;
  padding: 6px 12px 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: #88c5e0;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px) scale(0.94);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(.4,1.6,.4,1);
  z-index: 4;
  overflow: hidden;
}
.openclaw-flap::before {
  /* liten "tail" mot knappen */
  content: "";
  position: absolute;
  left: 18px;
  bottom: -7px;
  width: 12px; height: 12px;
  background: #0e1620;
  border-right: 2px solid #1a1208;
  border-bottom: 2px solid #1a1208;
  transform: rotate(45deg);
}
.openclaw-flap.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.openclaw-flap__icon {
  display: inline-block;
  font-size: 14px;
  line-height: 1;
  color: #b3e0f4;
  animation: openclaw-spin 1.4s linear infinite;
}
.openclaw-flap__label { flex: 1; white-space: nowrap; }
.openclaw-flap__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: rgba(136, 197, 224, 0.18);
  overflow: hidden;
}
.openclaw-flap__bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #88c5e0 0%, #b3e0f4 100%);
  transform-origin: left center;
}
.openclaw-flap.is-active .openclaw-flap__bar i {
  animation: openclaw-drain var(--openclaw-duration, 6.5s) linear forwards;
}
@keyframes openclaw-spin {
  to { transform: rotate(360deg); }
}
@keyframes openclaw-drain {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ENGAGE-knappen får blå glöd när OPENCLAW är aktiv */
.btn--engage.has-openclaw {
  border-color: #88c5e0;
  animation: openclaw-pulse 1.2s ease-in-out infinite;
}
@keyframes openclaw-pulse {
  0%, 100% { box-shadow: 4px 4px 0 #1a1208, 0 0 0 0 rgba(136,197,224,0); }
  50%      { box-shadow: 4px 4px 0 #1a1208, 0 0 0 4px rgba(136,197,224,0.55); }
}

/* ── MEGAFON SCREEN-FLASH ──────────────────────────────── */
.megafon-flash {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(255,210,140,0.75) 0%, rgba(241,199,129,0.35) 35%, rgba(0,0,0,0) 70%);
  mix-blend-mode: screen;
  animation: megafon-flash 0.85s ease-out forwards;
}
.megafon-flash--combo {
  background: radial-gradient(circle at 50% 45%, rgba(255,255,210,0.92) 0%, rgba(255,200,255,0.5) 32%, rgba(120,40,180,0.18) 60%, rgba(0,0,0,0) 78%);
}
@keyframes megafon-flash {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── EFFEKT-PILLS i event-val ──────────────────────────── */
.event-choice__body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.event-choice__effect {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.effect-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 9px;
  letter-spacing: 0.16em;
  padding: 2px 6px 1px;
  border: 1.5px solid currentColor;
  text-transform: uppercase;
  line-height: 1.5;
}
.effect-pill--hype.effect-pill--pos      { color: #d04848; background: rgba(208,72,72,0.12); }
.effect-pill--hype.effect-pill--neg      { color: #8a4040; background: rgba(138,64,64,0.12); }
.effect-pill--panic.effect-pill--pos     { color: #2e5a8c; background: rgba(46,90,140,0.14); }
.effect-pill--panic.effect-pill--neg     { color: #4a7a4e; background: rgba(74,122,78,0.14); }
.effect-pill--bored.effect-pill--pos     { color: #6b4f12; background: rgba(184,137,71,0.16); }
.effect-pill--bored.effect-pill--neg     { color: #8a6b30; background: rgba(184,137,71,0.10); }
.effect-pill--exhausted.effect-pill--pos { color: #5a4030; background: rgba(90,64,48,0.14); }
.effect-pill--exhausted.effect-pill--neg { color: #5a4030; background: rgba(90,64,48,0.08); }
.effect-pill--unlock { color: #7a3a9c; background: rgba(122,58,156,0.12); font-weight: 900; }

/* =========================================================================
   TOGGLES (sidebar)
   ========================================================================= */

.toggles {
  position: fixed;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.toggle {
  appearance: none;
  background: #f0e3c0;
  border: 2px solid #1a1208;
  color: #1a1208;
  padding: 7px 10px 8px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 3px 3px 0 #1a1208;
  border-radius: 0;
}
.toggle:hover { background: #fff4d2; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 #1a1208; }
.toggle:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 #1a1208; }
.toggle__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.4);
}
.toggle.is-on { background: #d4a55c; }
.toggle.is-on .toggle__dot { background: #b03030; box-shadow: none; border: 1px solid #1a1208; }
.toggle__dot--static {}

/* =========================================================================
   TICKER
   ========================================================================= */

.ticker {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  border-bottom: 1px solid #3a0e0e;
  background: linear-gradient(180deg, #2a0a0a 0%, #1a0606 100%);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #f5d8a8;
  height: 44px;
  overflow: hidden;
}
.ticker__brand {
  background: var(--red-bright);
  color: #1a0606;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  font-weight: 900;
  letter-spacing: 0.18em;
  border-right: 1px solid #1a0606;
  text-shadow: 0 1px 0 rgba(255,255,255,0.18);
}
/* Mörk band + hög kontrast — TV-crawl / breaking (WCAG AAA på stor text) */
.ticker__track {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  display: flex;
  align-items: center;
  background: #0a0a0a;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.ticker__item {
  display: inline-block;
  padding-left: 100%;
  animation: tick 8.5s linear 1;
  text-transform: uppercase;
  white-space: nowrap;
  font-family: "Arial Black", "Helvetica Neue", Helvetica, Impact, Haettenschweiler, "Franklin Gothic Heavy", sans-serif;
  font-weight: 900;
  font-size: clamp(14px, 2.1vw, 17px);
  letter-spacing: 0.05em;
  line-height: 1.15;
  color: #ffffff;
  /* läsbarhet i rörelse: mörk kontur som på nyhetssändningar */
  text-shadow:
    0 0 1px #000,
    1px 0 0 #000,
    -1px 0 0 #000,
    0 1px 0 #000,
    0 -1px 0 #000,
    2px 2px 4px rgba(0, 0, 0, 0.85);
  -webkit-font-smoothing: antialiased;
}
.ticker__item.is-fresh {
  color: #ffffff;
}
/* Spelarens event-val: tydlig koppling till BREAKING-raden */
.ticker__item.is-from-player {
  color: #fffef8;
  text-shadow:
    0 0 1px #000,
    1px 0 0 #000,
    -1px 0 0 #000,
    0 1px 0 #000,
    0 -1px 0 #000,
    0 0 16px rgba(241, 199, 129, 0.95),
    0 0 28px rgba(212, 165, 92, 0.55),
    2px 2px 4px rgba(0, 0, 0, 0.85);
  animation-duration: 8.5s;
}
/* Hela ticker-baren pulsar när ny spelar-driven nyhet körs */
.ticker.ticker--react {
  animation: ticker-react-bar 0.55s ease-out 3;
  box-shadow: 0 0 0 0 rgba(241, 199, 129, 0);
}
@keyframes ticker-react-bar {
  0%, 100% {
    box-shadow: inset 0 0 0 0 transparent;
    border-bottom-color: #3a0e0e;
  }
  50% {
    box-shadow:
      inset 0 -3px 0 0 var(--gold-bright),
      0 0 26px rgba(241, 199, 129, 0.35);
    border-bottom-color: var(--gold-soft);
  }
}
.ticker.ticker--react .ticker__brand {
  animation: ticker-react-brand 0.5s ease-in-out 3;
}
@keyframes ticker-react-brand {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); color: #2a0a0a; }
}
.ticker__time {
  align-self: center;
  padding: 0 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  color: #f0e8d8;
  font-weight: 700;
}
@keyframes tick {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* =========================================================================
   ONBOARDING (visas första gången)
   ========================================================================= */

.onboard {
  position: fixed; inset: 0;
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0);
  -webkit-backdrop-filter: blur(0);
          backdrop-filter: blur(0);
  transition: background 320ms ease, backdrop-filter 320ms ease;
  padding: 16px;
  overflow: hidden;
}
.onboard[hidden] { display: none; }
.onboard.is-visible {
  background: rgba(7, 12, 11, 0.92);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}
.onboard.is-closing {
  background: rgba(7, 12, 11, 0);
  -webkit-backdrop-filter: blur(0);
          backdrop-filter: blur(0);
}
.onboard.is-closing .onboard__card { transform: translateY(20px) scale(0.97); opacity: 0; }

.onboard__skip {
  position: absolute;
  top: 18px; right: 22px;
  appearance: none;
  width: 40px; height: 40px;
  background: #f0e3c0;
  border: 3px solid #1a1208;
  box-shadow: 4px 4px 0 #1a1208;
  font-family: "Trebuchet MS", Tahoma, Verdana, sans-serif;
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  color: #1a1208;
  cursor: pointer;
  border-radius: 0;
  transition: transform 0.06s ease;
  opacity: 0;
  transform: translateY(-30px);
  z-index: 2;
}
.onboard.is-visible .onboard__skip {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 280ms ease 480ms, transform 280ms ease 480ms;
}
.onboard__skip:hover { background: #fff4d2; transform: translate(-1px, -1px); box-shadow: 5px 5px 0 #1a1208; }
.onboard__skip:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #1a1208; }

/* Screens stackas absolut så de kan slide-byta utan att hoppa */
.onboard__screen {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%;
  max-width: 540px;
}
.onboard__screen[hidden] { display: none; }

.onboard__card {
  background: #f0e3c0;
  color: #1a1208;
  border: 4px solid #1a1208;
  box-shadow: 8px 8px 0 #1a1208;
  padding: 36px 38px 30px;
  text-align: center;
  width: 100%;
  font-family: "Trebuchet MS", Tahoma, Verdana, sans-serif;
  transform: translateY(30px) scale(0.96);
  opacity: 0;
  transition: transform 360ms cubic-bezier(.2,.8,.3,1), opacity 360ms ease;
}
.onboard.is-visible .onboard__card { transform: translateY(0) scale(1); opacity: 1; }

.onboard__eyebrow {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: #b03030;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.onboard__title {
  font-weight: 900;
  font-size: clamp(32px, 6vw, 46px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 18px;
  text-shadow:
    2px 0 0 #b03030,
    -2px 0 0 #b03030,
    0 2px 0 #b03030,
    3px 3px 0 rgba(0,0,0,0.18);
}

/* SCREEN 1 — text fadar in rad för rad */
.onboard__line {
  font-size: 17px;
  line-height: 1.5;
  margin: 0 0 6px;
  color: #2a1f10;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 380ms ease, transform 380ms ease;
}
.onboard__line strong { font-weight: 900; color: #1a1208; }
.onboard.is-visible .onboard__line--1 { opacity: 1; transform: translateY(0); transition-delay: 600ms; }
.onboard.is-visible .onboard__line--2 { opacity: 1; transform: translateY(0); transition-delay: 880ms; }
.onboard.is-visible .onboard__line--3 { opacity: 1; transform: translateY(0); transition-delay: 1180ms; }

/* SCREEN 2 — mekanik */
.onboard__lead {
  font-size: 15px;
  line-height: 1.45;
  margin: 0 0 18px;
  color: #2a1f10;
  font-style: italic;
}
.onboard__moods {
  list-style: none;
  margin: 0 0 18px;
  padding: 14px 16px;
  background: rgba(26,18,8,0.06);
  border: 2px dashed #1a1208;
  text-align: left;
  display: grid;
  gap: 8px;
}
.onboard__moods li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  line-height: 1.35;
}
.onboard__moods strong { font-weight: 900; }
.onboard__moods em { font-style: normal; font-weight: 900; color: #b03030; }
.onboard__pip {
  width: 14px; height: 14px;
  border: 2px solid #1a1208;
  flex-shrink: 0;
}
.onboard__pip--win    { background: #6fe089; }
.onboard__pip--police { background: #5b8fc4; }
.onboard__pip--bored  { background: #d6a850; }

.onboard__buttons-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 14px;
}
.onboard__btn-pill {
  font-family: "Trebuchet MS", Tahoma, Verdana, sans-serif;
  font-weight: 900;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  background: #fff4d2;
  border: 2px solid #1a1208;
  box-shadow: 2px 2px 0 #1a1208;
  color: #1a1208;
  text-transform: uppercase;
}
.onboard__btn-pill--engage   { background: #f4c8c8; }
.onboard__btn-pill--chant    { background: #f1d896; }
.onboard__btn-pill--disperse { background: #c8e8d0; }
.onboard__btn-pill--megafon  { background: #e0c8ec; }

.onboard__small {
  font-size: 13px;
  font-style: italic;
  color: #5e4a30;
  margin: 0 0 22px;
}

.onboard__next, .onboard__start {
  appearance: none;
  display: block;
  width: 100%;
  background: #b03030;
  color: #f0e3c0;
  border: 3px solid #1a1208;
  box-shadow: 4px 4px 0 #1a1208;
  font-family: "Trebuchet MS", Tahoma, Verdana, sans-serif;
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 14px;
  cursor: pointer;
  border-radius: 0;
  transition: transform 0.06s ease;
  margin-top: 4px;
}
.onboard__next:hover, .onboard__start:hover {
  background: #c84040;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #1a1208;
}
.onboard__next:active, .onboard__start:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #1a1208;
}
.onboard__start { background: #2a6e3a; }
.onboard__start:hover { background: #348445; }

.onboard__hint {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #6e5e3a;
  text-transform: uppercase;
}

/* SCREEN-byte: slide horisontellt */
.onboard__screen--scene { transform: translateX(0); transition: transform 360ms cubic-bezier(.2,.8,.3,1), opacity 280ms ease; }
.onboard__screen--how   { transform: translateX(40px); opacity: 0; transition: transform 360ms cubic-bezier(.2,.8,.3,1), opacity 280ms ease; }

.onboard.is-screen-2 .onboard__screen--scene { display: none; }
.onboard.is-screen-2 .onboard__screen--how   { display: flex; transform: translateX(0); opacity: 1; }
.onboard.is-screen-2 .onboard__screen--how .onboard__card { animation: onboardCardEnter 360ms cubic-bezier(.2,.8,.3,1) both; }
@keyframes onboardCardEnter {
  from { transform: translateX(40px) scale(0.97); opacity: 0; }
  to   { transform: translateX(0) scale(1); opacity: 1; }
}

@media (max-width: 720px) {
  .onboard__card { padding: 26px 20px 22px; }
  .onboard__title { font-size: 28px; }
  .onboard__line { font-size: 15px; }
  .onboard__lead { font-size: 14px; }
  .onboard__moods li { font-size: 13px; }
  .onboard__btn-pill { font-size: 10px; padding: 5px 8px; }
  .onboard__skip { width: 36px; height: 36px; font-size: 18px; top: 10px; right: 10px; }
}

/* =========================================================================
   HOWTO-MODAL (visas när man klickar på MÅL)
   ========================================================================= */

.howto {
  position: fixed; inset: 0;
  z-index: 250;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  transition: background 220ms ease, backdrop-filter 220ms ease;
  padding: 16px;
}
.howto[hidden] { display: none; }
.howto.is-visible {
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.howto__card {
  position: relative;
  background: #f0e3c0;
  color: #1a1208;
  border: 4px solid #1a1208;
  box-shadow: 8px 8px 0 #1a1208;
  padding: 26px 30px 26px;
  max-width: 540px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  font-family: "Trebuchet MS", Tahoma, Verdana, sans-serif;
  transform: translateY(40px) scale(0.96);
  opacity: 0;
  transition: transform 280ms cubic-bezier(.2,.8,.3,1), opacity 280ms ease;
}
.howto.is-visible .howto__card { transform: translateY(0) scale(1); opacity: 1; }

.howto__close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  background: #fff4d2;
  border: 2px solid #1a1208;
  box-shadow: 3px 3px 0 #1a1208;
  font-family: inherit;
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
  color: #1a1208;
  cursor: pointer;
  border-radius: 0;
  transition: transform 0.06s ease;
}
.howto__close:hover { background: #ffe0a0; transform: translate(-1px,-1px); box-shadow: 4px 4px 0 #1a1208; }
.howto__close:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 #1a1208; }

.howto__eyebrow {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.32em;
  color: #b03030;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.howto__title {
  font-weight: 900;
  font-size: 28px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 12px;
  text-shadow: 2px 2px 0 rgba(176,48,48,0.18);
}
.howto__lead {
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 18px;
  color: #2a1f10;
}

.howto__grid {
  display: grid;
  gap: 7px;
  margin: 0 0 18px;
  padding: 12px 14px;
  background: rgba(26,18,8,0.06);
  border: 2px dashed #1a1208;
}
.howto__row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.35;
}
.howto__row em { font-style: italic; color: #b03030; font-weight: 700; }
.howto__pip {
  width: 14px; height: 14px;
  border: 2px solid #1a1208;
  flex-shrink: 0;
}
.howto__pip--win    { background: #6fe089; }
.howto__pip--police { background: #5b8fc4; }
.howto__pip--bored  { background: #d6a850; }
.howto__pip--calm   { background: #92c19c; }

.howto__section { margin-bottom: 16px; }
.howto__section:last-of-type { margin-bottom: 22px; }
.howto__sub {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #b03030;
  text-transform: uppercase;
  margin-bottom: 8px;
  border-bottom: 2px dashed rgba(26,18,8,0.3);
  padding-bottom: 4px;
}
.howto__keys {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 12px;
  font-size: 12px;
  color: #2a1f10;
}
.howto__keys span { display: flex; align-items: center; gap: 6px; }
.howto__keys kbd {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 22px; height: 22px;
  background: #d4a55c;
  border: 2px solid #1a1208;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 12px;
  color: #1a1208;
  border-radius: 0;
  flex-shrink: 0;
}
.howto__teaser {
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
  color: #2a1f10;
}
.howto__teaser em { font-style: italic; color: #6b4830; font-weight: 600; }

.howto__ok {
  appearance: none;
  display: block;
  width: 100%;
  background: #b03030;
  color: #f0e3c0;
  border: 3px solid #1a1208;
  box-shadow: 4px 4px 0 #1a1208;
  font-family: "Trebuchet MS", Tahoma, Verdana, sans-serif;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 12px;
  cursor: pointer;
  border-radius: 0;
  transition: transform 0.06s ease;
}
.howto__ok:hover { background: #c84040; transform: translate(-1px,-1px); box-shadow: 5px 5px 0 #1a1208; }
.howto__ok:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 #1a1208; }

@media (max-width: 720px) {
  .howto__card { padding: 22px 18px; }
  .howto__title { font-size: 22px; }
  .howto__keys { grid-template-columns: 1fr; }
}

/* =========================================================================
   CREDITS-FOOTER (egen rad längst ner, diskret men synlig)
   ========================================================================= */

.credits {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 12px 22px 13px;
  background: linear-gradient(180deg, #0a1614 0%, #050b09 100%);
  border-top: 2px solid #1a1208;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(239, 227, 200, 0.72);
}

/* LEAD: OPENSVERIGE som tydligt avsändarmärke */
.credits__lead {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.credits__from {
  font-size: 9px;
  letter-spacing: 0.32em;
  color: var(--gold-soft);
  font-weight: 700;
  opacity: 0.75;
}
.credits__brand {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--parchment);
  text-decoration: none;
  border: none !important;
  text-shadow: 1px 1px 0 #000;
  padding: 2px 0;
  transition: color 0.15s ease;
}
.credits__brand strong { color: var(--gold-bright); font-weight: 900; }
.credits__brand:hover { color: var(--gold-bright); }
.credits__brand:hover strong { color: #fff4d2; }

/* Discord-tap bredvid OpenSverige-loggan */
.credits__discord {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  background: #5865f2;
  color: #fff;
  border: 2px solid #1a1208 !important;
  box-shadow: 2px 2px 0 #1a1208;
  text-decoration: none !important;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.18em;
  transition: transform 0.08s ease, background 0.15s ease;
}
.credits__discord:hover {
  background: #6975f5;
  color: #fff !important;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #1a1208;
  border-color: #1a1208 !important;
}
.credits__discord:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 #1a1208; }
.credits__discord svg { display: block; flex-shrink: 0; }
.credits__discord-label { line-height: 1; }

/* Övriga länkar (av Baltsar · Patch Notes · Juridik) */
.credits__rest {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.credits__item { white-space: nowrap; }
.credits__sep { color: rgba(212,165,92,0.4); }
.credits__rest a {
  color: rgba(241, 199, 129, 0.95);
  text-decoration: none;
  border-bottom: 1px dotted rgba(241,199,129,0.45);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.credits__rest a:hover { color: var(--gold-bright); border-bottom-color: var(--gold-bright); }

@media (max-width: 720px) {
  .credits {
    font-size: 9px;
    padding: 10px 14px 11px;
    gap: 8px 12px;
    letter-spacing: 0.14em;
    justify-content: center;
  }
  .credits__lead { gap: 8px; }
  .credits__brand { font-size: 13px; }
  .credits__discord { padding: 4px 8px 4px 7px; font-size: 9px; gap: 5px; }
  .credits__discord svg { width: 14px; height: 14px; }
  .credits__rest { gap: 3px 8px; }
}

/* =========================================================================
   POLICE & SHAKE
   ========================================================================= */

.police-blob {
  position: absolute;
  right: -120px;
  top: 30%;
  width: 220px;
  height: 60%;
  background: radial-gradient(ellipse at 30% 50%, rgba(91,143,196,0.55) 0%, rgba(40,60,90,0.35) 40%, transparent 70%);
  filter: blur(6px);
  animation: police-roll 3.4s ease-out forwards;
  mix-blend-mode: screen;
}
@keyframes police-roll {
  0%   { transform: translateX(0) scale(0.6); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translateX(-90vw) scale(1.4); opacity: 0; }
}

.police-flash {
  position: absolute; inset: 0;
  background: rgba(91,143,196,0.18);
  animation: police-flash 0.18s steps(2) 4;
  pointer-events: none;
}
@keyframes police-flash {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.scene.is-shaking { animation: shake 0.55s ease; }
@keyframes shake {
  0%, 100% { transform: translate(0,0); }
  10% { transform: translate(-4px, 2px); }
  20% { transform: translate(5px, -3px); }
  30% { transform: translate(-6px, 1px); }
  45% { transform: translate(3px, 4px); }
  60% { transform: translate(-3px, -2px); }
  78% { transform: translate(2px, 1px); }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* =========================================================================
   DEBUG
   ========================================================================= */

.debug-box {
  position: absolute;
  border: 1.5px dashed lime;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 10px;
  color: lime;
  background: rgba(0,255,0,0.06);
}
.debug-box::before {
  content: attr(data-label);
  position: absolute;
  top: -14px; left: 0;
  background: rgba(0,0,0,0.7);
  padding: 1px 4px;
}
.debug-info {
  position: fixed;
  bottom: 50px;
  left: 12px;
  z-index: 9;
  background: rgba(0,0,0,0.85);
  border: 1px solid lime;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: lime;
  line-height: 1.5;
  max-width: 320px;
}

/* =========================================================================
   DESKTOP · stämning ovanpå crowd (nere vänster)
   ========================================================================= */

@media (min-width: 721px) {
  /* flex: fixed .mood deltar inte → bara titel + räknare i raden */
  .hud {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 22px;
  }
  .hud__title {
    min-width: 0;
    flex: 1;
  }
  .counter {
    flex-shrink: 0;
  }
  .mood {
    position: fixed;
    left: max(14px, env(safe-area-inset-left, 0px));
    /* ovanför actions-raden så knappar inte täcks */
    bottom: calc(160px + env(safe-area-inset-bottom, 0px));
    z-index: 6;
    margin: 0;
    min-width: min(260px, 36vw);
    max-width: min(280px, 40vw);
  }
}

/* =========================================================================
   MOBILE
   ========================================================================= */

@media (max-width: 720px) {
  .hud {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 14px 8px;
  }
  .hud__eyebrow { font-size: 9px; margin-bottom: 1px; }
  .hud__sub { font-size: 8.5px; margin-top: 2px; }
  .counter { justify-self: start; text-align: left; display: flex; align-items: baseline; gap: 10px; }
  .counter__label { letter-spacing: 0.18em; }
  .mood { min-width: 0; }
  .actions {
    grid-template-columns: repeat(2, 1fr);
    padding: 10px 12px;
  }
  .btn__sub { display: none; }
  .btn--megafon { padding-bottom: 14px; }
  .btn__combo-pips { left: 8px; right: 8px; bottom: 5px; height: 3px; gap: 2px; }
  .floater { font-size: 18px; }
  .floater--chant   { font-size: 24px; }
  .floater--megafon { font-size: 28px; }
  .toggles {
    right: 6px;
    top: auto;
    bottom: 110px;
    transform: none;
  }
  .toggle { padding: 6px 8px; font-size: 9px; }
  .hud__h1 { font-size: 26px; }
  .moon { width: 56px; height: 56px; top: 6%; }
  .bubble {
    font-size: 13px;
    padding: 8px 12px 9px;
    max-width: 75vw;
    white-space: normal;
    text-align: center;
  }
  .bubble--shout { font-size: 14px; padding: 9px 14px 10px; }
  .bubble--panic { font-size: 13px; }
  .goal {
    margin: 6px 12px 4px;
    padding: 8px 10px 9px;
    font-size: 9px;
    gap: 8px 10px;
    grid-template-columns: auto 1fr minmax(88px, 120px) auto;
    box-shadow: 3px 3px 0 #1a1208;
  }
  .goal__label {
    min-width: 44px;
    padding: 5px 6px;
    font-size: 8px;
    letter-spacing: 0.2em;
  }
  .goal__text { font-size: 11px; letter-spacing: 0.05em; }
  .goal__time { font-size: 17px; min-width: 58px; }
  .goal__bar { height: 11px; }
}
