/* Kartkamp – motor for kart + quiz + spinner (Operasjon frihet er første tema).
   Lastes etter /skall/stiglet.css. Bruker bare Stiglet-tokenene:
   ink, krem, korall (eneste knappefarge), gul. Minste tekst: 14 px.

   Regel: ingenting i spillet skal kunne scrolles. Alt har fast høyde eller
   krymper, og lave skjermer (≤ 800 px) får en tettere variant. */

.kk {
  --ink: #2b2118;
  --coral: #fa5c66;
  --cream: #fff9f0;
  --yellow: #facc15;
  --green: #4ade80;
  --purple: #a78bfa;
  --orange: #fb923c;
  --paper: #fff;
  --muted: #6b5d50;
  --right: #15803d;
  --wrong: #c2410c;
  --wheel: 190px;
  --gap: 12px;

  position: relative;
  height: calc(100dvh - var(--stiglet-hode-hoyde, 0px));
  overflow: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 600;
  font-size: 16px;
}

@media (max-height: 800px) {
  .kk {
    --wheel: 150px;
    --gap: 8px;
  }
}

.kk *,
.kk *::before,
.kk *::after {
  box-sizing: border-box;
}

.kk [hidden] {
  display: none !important;
}

.kk h1,
.kk h2,
.kk h3,
.kk p {
  margin: 0;
}

.kk-title {
  font-family: "Chewy", system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* ---- Knapper ---- */

.kk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 0.5rem 1.2rem;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--coral);
  color: var(--cream);
  font: 800 1.05rem/1.2 "Nunito", sans-serif;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.08s, box-shadow 0.08s;
}

.kk-btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--ink);
}

.kk-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.kk-btn--white {
  background: var(--paper);
  color: var(--ink);
}

.kk-btn--big {
  font-size: 1.2rem;
  padding: 0.65rem 1.6rem;
}

.kk-key {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 0.35em;
  border: 2px solid currentColor;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  opacity: 0.85;
}

/* ---- Lasting ---- */

.kk-loading {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 1.2rem;
}

/* ---- Startskjerm ---- */

.kk-start {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  padding: clamp(12px, 3vw, 48px);
  background: #1d2a44 center / cover no-repeat;
}

.kk-start-card {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  width: min(560px, 100%);
  max-height: 100%;
  overflow: hidden;
  padding: 24px 28px;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--ink);
}

.kk-start-card h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.25;
}

.kk-start-sub {
  margin-top: -4px;
  font-weight: 800;
  color: var(--muted);
}

.kk-start-intro {
  font-size: 1.02rem;
  line-height: 1.5;
}

.kk-start-heroes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kk-start-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
  line-height: 1.25;
}

.kk-start-hero img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.kk-start-hero em {
  font-style: normal;
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
  margin-right: 6px;
}

.kk-start-hero strong {
  font-weight: 800;
}

.kk-start-hero span {
  display: block;
  font-size: 14px;
  color: var(--muted);
}

.kk-start-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.kk-start-keys {
  font-size: 14px;
  color: var(--muted);
}

.kk-credits-card h2 {
  font-size: 2rem;
}

.kk-credits {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.kk-credits a {
  color: inherit;
}

@media (max-height: 700px) {
  .kk-start-intro {
    font-size: 15px;
    line-height: 1.4;
  }

  .kk-start-hero img {
    width: 40px;
    height: 40px;
  }
}

/* ---- Spilloppsett ---- */

.kk-game {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
}

.kk-hud {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 14px;
  border-bottom: 3px solid var(--ink);
  background: var(--paper);
  min-width: 0;
}

.kk-hud-lives {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.kk-hud-lives img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--cream);
}

.kk-hud-lives img.is-current {
  background: var(--yellow);
}

.kk-hud-lives img.is-fallen {
  opacity: 0.3;
  filter: grayscale(1);
}

.kk-hud-hp {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 220px;
  flex-shrink: 0;
}

.kk-bar {
  flex: 1;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  overflow: hidden;
}

.kk-bar > i {
  display: block;
  height: 100%;
  background: var(--green);
  transition: width 0.35s, background-color 0.35s;
}

.kk-bar--xp > i {
  background: var(--yellow);
}

.kk-hud-num {
  font-weight: 800;
  white-space: nowrap;
}

.kk-hud-level {
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.kk-hud-level b {
  font-family: "Chewy", sans-serif;
  font-weight: 400;
  font-size: 1.4rem;
}

.kk-status {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
}

.kk-hud .kk-btn {
  padding: 0.3rem 0.8rem;
  font-size: 0.95rem;
  box-shadow: 0 3px 0 var(--ink);
}

.kk-main {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  overflow: clip;
}

@media (min-width: 1280px) {
  .kk-main {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .kk-info-btn,
  .kk-side-close {
    display: none !important;
  }
}

.kk-map-area {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 10px;
}

.kk-map {
  display: block;
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 4px 0 var(--ink);
  background: #948878;
}

.kk-hint {
  padding: 5px 14px;
  border-top: 3px solid var(--ink);
  background: var(--paper);
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}

.kk-hint .kk-key {
  margin: 0 2px;
}

/* ---- Sidepanel / skuff: aldri rullefelt ---- */

.kk-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  border-left: 3px solid var(--ink);
  background: var(--cream);
}

@media (max-width: 1279.98px) {
  .kk-side {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    width: min(320px, 90vw);
    transform: translateX(105%);
    transition: transform 0.25s ease;
  }

  .kk-side.is-open {
    transform: none;
  }
}

.kk-side-close {
  align-self: flex-end;
  flex-shrink: 0;
}

.kk-panel {
  flex-shrink: 0;
  padding: 8px 10px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 16px;
}

.kk-panel h3 {
  margin-bottom: 4px;
  font-family: "Chewy", sans-serif;
  font-weight: 400;
  font-size: 1.1rem;
}

.kk-panel--log {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.kk-heroes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.kk-hero {
  padding: 4px 2px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  text-align: center;
  font-size: 14px;
  line-height: 1.2;
}

.kk-hero img {
  width: 36px;
  height: 36px;
}

.kk-hero b,
.kk-hero span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kk-hero b {
  font-weight: 800;
}

.kk-hero.is-current {
  background: #fef3c7;
}

.kk-hero.is-fallen {
  opacity: 0.45;
  filter: grayscale(1);
}

.kk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 14px;
}

.kk-row .kk-row-label {
  width: 24px;
  font-weight: 800;
}

.kk-row .kk-row-val {
  min-width: 58px;
  text-align: right;
  font-weight: 800;
}

.kk-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  text-align: center;
  line-height: 1.1;
}

.kk-stats b {
  display: block;
  font-family: "Chewy", sans-serif;
  font-weight: 400;
  font-size: 1.3rem;
}

.kk-stats span {
  font-size: 14px;
  color: var(--muted);
}

.kk-bosslist,
.kk-freedlist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.kk-bosslist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kk-bosslist li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  line-height: 1.2;
}

.kk-bosslist img {
  width: 26px;
  height: 26px;
}

.kk-bosslist .kk-bl-name {
  flex: 1;
  font-weight: 800;
}

.kk-bosslist .kk-bl-status {
  font-size: 14px;
}

.kk-bosslist li.is-locked {
  opacity: 0.55;
}

.kk-bosslist li.is-open .kk-bl-status {
  color: var(--wrong);
  font-weight: 800;
}

.kk-bosslist li.is-done .kk-bl-status {
  color: var(--right);
  font-weight: 800;
}

.kk-freedlist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 10px;
}

.kk-freedlist li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 1.15;
  min-width: 0;
}

.kk-freedlist img {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.kk-freedlist li span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.kk-freedlist li b {
  font-family: "Chewy", sans-serif;
  font-weight: 400;
  font-size: 1.2rem;
}

@media (max-height: 800px) {
  .kk-side {
    gap: 6px;
    padding: 8px;
  }

  .kk-panel {
    padding: 5px 8px;
  }

  .kk-hero img {
    width: 28px;
    height: 28px;
  }

  .kk-bosslist img,
  .kk-freedlist img {
    width: 22px;
    height: 22px;
  }

  .kk-panel--log {
    display: none;
  }
}

@media (min-height: 901px) {
  .kk-freedlist {
    grid-template-columns: 1fr;
  }
}

/* Kampleggen tar resten av høyden og viser de nyeste linjene nederst. */
.kk-log {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  font-size: 14px;
  line-height: 1.4;
}

.kk-log p {
  flex-shrink: 0;
  margin: 0;
}

.kk-log .is-good {
  color: var(--right);
}

.kk-log .is-bad {
  color: var(--wrong);
}

/* ---- D-pad (bare berøringsskjerm) ---- */

.kk-dpad {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 15;
  display: none;
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(3, 52px);
  gap: 4px;
}

@media (pointer: coarse) {
  .kk-dpad {
    display: grid;
  }

  .kk-hint {
    display: none;
  }
}

.kk-dpad button {
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: 800 1.3rem/1 "Nunito", sans-serif;
  box-shadow: 0 3px 0 var(--ink);
  touch-action: manipulation;
}

.kk-dpad span {
  visibility: hidden;
}

/* ---- Modaler: dekker hele hovedflaten (kart + sidepanel) ---- */

.kk-modal-bg {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: var(--gap);
  overflow: hidden;
  background: rgba(43, 33, 24, 0.45);
}

.kk-card {
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  padding: 16px 20px;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--ink);
}

.kk-card.is-hit {
  animation: kk-shake 0.4s ease-out;
  border-color: var(--wrong);
}

/* Vanlig kamp: spørsmål til venstre, hjul til høyre */
.kk-fight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 20px;
  width: min(1180px, 100%);
}

.kk-fight-main,
.kk-fight-side {
  min-width: 0;
  min-height: 0;
}

.kk-fight-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-left: 3px dashed rgba(43, 33, 24, 0.25);
  padding-left: 18px;
}

.kk-enemy-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}

.kk-token {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

.kk-token img {
  width: 80%;
  height: 80%;
}

.kk-token--enemy {
  background: var(--cream);
}

.kk-token--hero {
  background: var(--yellow);
}

.kk-enemy-name {
  font-family: "Chewy", sans-serif;
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.1;
}

.kk-enemy-hp {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.kk-taunt {
  width: 100%;
  padding: 8px 12px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
  font-style: italic;
  font-size: 15px;
  line-height: 1.35;
  animation: kk-pop 0.3s ease-out;
}

.kk-qbox {
  min-height: 0;
}

.kk-question {
  margin: 6px 0 10px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
}

.kk-claim {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
  padding: 10px 14px;
  background: #fef3c7;
  border: 3px dashed var(--ink);
  border-radius: 12px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.kk-claim-label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.kk-answers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kk-answer {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: 700 17px/1.3 "Nunito", sans-serif;
  text-align: left;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}

.kk-answer:hover:not(:disabled) {
  background: #fef3c7;
}

.kk-answer:disabled {
  cursor: default;
}

.kk-answer .kk-key {
  flex-shrink: 0;
}

.kk-answer.is-right {
  background: #bbf7d0;
  border-color: var(--right);
}

.kk-answer.is-wrong {
  background: #fed7aa;
  border-color: var(--wrong);
}

.kk-answer.is-dim {
  opacity: 0.5;
}

.kk-input-row {
  display: flex;
  gap: 8px;
}

.kk-input {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: 700 17px/1.3 "Nunito", sans-serif;
}

.kk-input:focus {
  outline: 3px solid var(--yellow);
  outline-offset: 1px;
}

.kk-feedback {
  margin-top: 10px;
  font-size: 17px;
  font-weight: 800;
}

.kk-feedback.is-right {
  color: var(--right);
}

.kk-feedback.is-wrong {
  color: var(--wrong);
}

.kk-feedback small {
  display: block;
  font-size: 15px;
  color: var(--ink);
  font-weight: 700;
}

@media (max-height: 800px) {
  .kk-card {
    padding: 12px 16px;
  }

  .kk-token {
    width: 56px;
    height: 56px;
  }

  .kk-enemy-name {
    font-size: 1.35rem;
  }

  .kk-question {
    margin: 4px 0 8px;
    font-size: 18px;
  }

  .kk-answers {
    gap: 6px;
  }

  .kk-answer,
  .kk-input {
    padding: 6px 12px;
    font-size: 16px;
  }

  .kk-feedback {
    margin-top: 6px;
    font-size: 16px;
  }
}

/* ---- Spinner ---- */

.kk-spin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  width: 100%;
}

.kk-spin .kk-btn {
  max-width: 100%;
  white-space: normal;
}

.kk-wheel-wrap {
  position: relative;
  flex-shrink: 0;
  width: var(--wheel);
  height: var(--wheel);
}

.kk-wheel-wrap::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  z-index: 1;
  transform: translateX(-50%);
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 18px solid var(--ink);
}

.kk-wheel {
  display: block;
  width: 100%;
  height: 100%;
}

.kk-spin-lead {
  font-size: 15px;
  line-height: 1.3;
  min-height: 2.6em;
}

.kk-spin-result {
  min-height: 1.3em;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
}

.kk-spin-result.is-right {
  color: var(--right);
}

.kk-spin-result.is-wrong {
  color: var(--wrong);
}

.kk-flash {
  font-family: "Chewy", sans-serif;
  font-weight: 400;
  font-size: 1.8rem;
  min-height: 2rem;
  line-height: 1;
  color: var(--right);
}

/* ---- Bosskamp: portrett | spørsmål | hjul ---- */

.kk-boss {
  display: grid;
  grid-template-columns: minmax(200px, 290px) minmax(0, 1fr) 270px;
  gap: var(--gap);
  width: min(1320px, 100%);
  max-height: 100%;
  min-height: 0;
}

.kk-boss > .kk-card {
  min-width: 0;
  min-height: 0;
}

.kk-boss-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.kk-boss-left .kk-token {
  width: 120px;
  height: 120px;
}

.kk-portrait {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0;
  width: 100%;
}

.kk-portrait img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 30vh;
  margin: 0 auto;
  object-fit: contain;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
}

.kk-portrait figcaption {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
}

.kk-credit {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--muted);
}

.kk-credit a {
  color: inherit;
}

.kk-boss-left .kk-enemy-hp {
  width: 100%;
}

.kk-boss.is-shake .kk-boss-left {
  animation: kk-shake 0.35s ease-out;
}

.kk-boss.is-hit .kk-boss-mid {
  animation: kk-shake 0.35s ease-out;
}

.kk-boss-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.kk-boss-hero .kk-token {
  width: 56px;
  height: 56px;
}

.kk-boss-hero .kk-enemy-name {
  font-size: 1.3rem;
}

.kk-boss-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.kk-boss-msg {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

@media (max-height: 800px) {
  .kk-portrait img {
    max-height: 24vh;
  }

  .kk-boss-left .kk-token {
    width: 90px;
    height: 90px;
  }

  .kk-boss-left .kk-taunt {
    padding: 6px 10px;
    font-size: 14px;
  }
}

.kk-banner {
  position: absolute;
  top: 16%;
  left: 50%;
  z-index: 40;
  transform: translateX(-50%);
  padding: 8px 24px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--coral);
  color: var(--cream);
  font-family: "Chewy", sans-serif;
  font-size: 1.9rem;
  box-shadow: 0 4px 0 var(--ink);
  pointer-events: none;
  animation: kk-pop 0.3s ease-out;
}

.kk-banner--light {
  background: var(--yellow);
  color: var(--ink);
}

/* ---- Kildekort: bilde til venstre, tekst til høyre ---- */

.kk-source {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 20px;
  width: min(1240px, 100%);
  height: min(100%, 660px);
}

.kk-source--plain {
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  width: min(640px, 100%);
  height: auto;
}

.kk-source-photo {
  position: relative;
  min-height: 0;
  min-width: 0;
  background: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
}

.kk-source-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.kk-source-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.kk-source-label {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.kk-source h2 {
  font-family: "Chewy", sans-serif;
  font-weight: 400;
  font-size: 1.9rem;
  line-height: 1.2;
}

.kk-source-caption {
  font-size: 17px;
  line-height: 1.5;
}

.kk-source-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  text-align: center;
}

.kk-source--plain .kk-source-stats {
  grid-template-columns: repeat(4, 1fr);
}

.kk-source-stats b {
  display: block;
  font-family: "Chewy", sans-serif;
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.1;
}

.kk-source-stats span {
  font-size: 14px;
}

.kk-source-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 6px;
}

@media (max-height: 800px) {
  .kk-source-caption {
    font-size: 16px;
    line-height: 1.4;
  }
}

/* ---- Toast ---- */

.kk-toast {
  position: absolute;
  bottom: 6%;
  left: 50%;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(-50%);
  padding: 10px 20px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--cream);
  box-shadow: 0 4px 0 var(--ink);
  font-family: "Chewy", sans-serif;
  font-size: 1.7rem;
  white-space: nowrap;
  pointer-events: none;
  animation: kk-pop 0.3s ease-out;
}

.kk-toast img {
  width: 52px;
  height: 52px;
}

.kk-toast small {
  display: block;
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 16px;
}

.kk-dmg {
  position: absolute;
  top: 40%;
  left: 50%;
  z-index: 46;
  transform: translate(-50%, -50%);
  font-family: "Chewy", sans-serif;
  font-size: 3rem;
  color: var(--wrong);
  text-shadow: 0 3px 0 var(--cream);
  pointer-events: none;
  animation: kk-rise 1.3s ease-out forwards;
}

@keyframes kk-pop {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes kk-rise {
  0% {
    opacity: 1;
    transform: translate(-50%, -30%) scale(1.2);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -110%) scale(0.9);
  }
}

@keyframes kk-shake {
  0%,
  100% {
    transform: none;
  }

  25% {
    transform: translateX(-6px);
  }

  50% {
    transform: translateX(6px);
  }

  75% {
    transform: translateX(-3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .kk *,
  .kk *::before,
  .kk *::after {
    animation: none !important;
    transition: none !important;
  }
}
