/* Næringssentralen – kroppens kontrollrom.
   Stiglet-språket (ink-kant, hard skygge, runde former, Chewy + Nunito)
   brukt på en fabrikkverden: samlebånd, luker, stempler og bestillinger.
   Fargene på lukene er næringsstoff-koder og brukes konsekvent. */

:root {
  --ink: #2b2118;
  --coral: #fa5c66;
  --cream: #fff9f0;
  --yellow: #facc15;
  --paper: #fffdf7;
  --good: #22c55e;
  --good-soft: #dcfce7;
  --bad: #fa5c66;
  --bad-soft: #ffe4e6;
  --muted: #6b5d50;
  --line: 3px solid var(--ink);
  --shadow: 0 4px 0 var(--ink);
  --shadow-lg: 0 6px 0 var(--ink);
  --r-card: 20px;
  --r-btn: 12px;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  overflow: hidden;
  background-color: var(--cream);
  background-image: radial-gradient(rgba(43, 33, 24, 0.07) 1.5px, transparent 1.6px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 600;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }

img { display: block; }

.app {
  position: relative;
  height: calc(100dvh - var(--stiglet-hode-hoyde, 76px));
  max-width: 1560px;
  margin: 0 auto;
  padding: clamp(12px, 2.2vh, 24px) clamp(14px, 2.5vw, 32px);
  overflow: hidden;
}

.app.shake { animation: shake 0.32s; }

@keyframes shake {
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

.screen { display: none; height: 100%; }
.screen.is-active { display: flex; }

.panel {
  background: var(--paper);
  border: var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}

.kicker {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.8rem;
  border: var(--line);
  border-radius: var(--r-btn);
  background: var(--coral);
  color: var(--cream);
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active, .btn.pressed { transform: translateY(4px); box-shadow: none; }
.btn:disabled { cursor: default; filter: grayscale(0.6) opacity(0.55); }
.btn:disabled:active { transform: none; box-shadow: var(--shadow); }

.round-btn {
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.round-btn img { width: 24px; height: 24px; }
.round-btn:active { transform: translateY(4px); box-shadow: none; }

.key {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.35rem;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 0 var(--ink);
}

/* ---------- Skiftplan ---------- */

#screen-start {
  gap: clamp(20px, 3vw, 48px);
  align-items: stretch;
}

.start-left {
  flex: 0 0 38%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(10px, 2vh, 20px);
  min-width: 0;
}

.title {
  margin: 0;
  font-family: "Chewy", cursive;
  font-weight: 400;
  font-size: clamp(2.6rem, 4.6vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
}

.lead {
  margin: 0;
  max-width: 30rem;
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.45;
}

.rank-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  max-width: 30rem;
}

.rank-badge {
  flex: none;
  width: 64px;
  height: 76px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  gap: 5px;
  border: var(--line);
  border-radius: 14px 14px 26px 26px;
  background: var(--coral);
}
.rank-badge i {
  display: block;
  height: 9px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  opacity: 0.35;
}
.rank-badge i.on { background: var(--yellow); opacity: 1; }

.rank-text { flex: 1; min-width: 0; }
.rank-label { margin: 0; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.rank-name { margin: 0.1rem 0 0.4rem; font-family: "Chewy", cursive; font-size: 1.8rem; line-height: 1; }
.rank-bar { height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
.rank-bar span { display: block; height: 100%; width: 0; background: var(--yellow); border-right: 2px solid var(--ink); transition: width 0.6s cubic-bezier(0.2, 1.2, 0.4, 1); }
.rank-next { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--muted); }
.rank-new {
  position: absolute;
  top: -14px;
  right: 14px;
  margin: 0;
  padding: 0.2rem 0.8rem;
  border: var(--line);
  border-radius: 999px;
  background: var(--yellow);
  font-weight: 800;
  font-size: 0.85rem;
  transform: rotate(3deg);
  animation: pop 0.5s cubic-bezier(0.2, 1.8, 0.4, 1);
}

.settings { display: flex; flex-wrap: wrap; gap: 0.6rem 0.8rem; }

.chip-group { display: flex; gap: 0.5rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}
.chip:active { transform: translateY(3px); box-shadow: none; }
.chip.is-on { background: var(--yellow); }
.chip--icon { padding: 0.35rem 0.7rem; }
.chip--icon img { width: 22px; height: 22px; }

.start-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.plan-title {
  margin: 0 0 0.7rem;
  font-family: "Chewy", cursive;
  font-weight: 400;
  font-size: 1.8rem;
}

.modes { display: flex; flex-direction: column; gap: clamp(8px, 1.5vh, 14px); }

.mode-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: clamp(0.6rem, 1.4vh, 0.9rem) 1.1rem;
  text-align: left;
  background: #fff;
  border: var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.mode-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.mode-card:active { transform: translateY(4px); box-shadow: none; }
.mode-card:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.mode-icon {
  flex: none;
  width: clamp(48px, 7vh, 60px);
  height: clamp(48px, 7vh, 60px);
  display: grid;
  place-items: center;
  border: var(--line);
  border-radius: 16px;
  background: var(--mc, var(--cream));
}
.mode-icon img { width: 70%; height: 70%; }

.mode-body { flex: 1; min-width: 0; }
.mode-name { margin: 0; font-family: "Chewy", cursive; font-size: clamp(1.25rem, 1.8vw, 1.5rem); line-height: 1.05; }
.mode-desc { margin: 0.15rem 0 0; font-size: clamp(0.85rem, 1vw, 0.95rem); line-height: 1.3; color: var(--muted); }

.mode-side { flex: none; display: flex; align-items: center; gap: 0.7rem; }

.stars { display: flex; gap: 2px; }
.stars svg { width: 22px; height: 22px; }
.stars path { fill: #fff; stroke: var(--ink); stroke-width: 1.75; stroke-linejoin: round; }
.stars .full path { fill: var(--yellow); }

.plan-hint { margin: 0.9rem 0 0; font-size: 0.85rem; color: var(--muted); }

/* ---------- Spillskjerm ---------- */

#screen-game { flex-direction: column; gap: clamp(8px, 1.4vh, 14px); position: relative; }

.hud {
  flex: none;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hud-mode { min-width: 0; }
.hud-title { margin: 0; font-family: "Chewy", cursive; font-size: clamp(1.4rem, 2vw, 1.8rem); line-height: 1; }
.hud-sub { margin: 0.15rem 0 0; font-size: 0.85rem; font-weight: 800; color: var(--muted); }

.hud-progress {
  flex: 1;
  height: 16px;
  border: var(--line);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
.hud-progress span { display: block; height: 100%; width: 0; background: var(--yellow); box-shadow: 2px 0 0 var(--ink); transition: width 0.3s; }

.combo {
  margin: 0;
  min-width: 7.5rem;
  padding: 0.3rem 0.8rem;
  border: var(--line);
  border-radius: 999px;
  background: var(--yellow);
  font-weight: 800;
  text-align: center;
  visibility: hidden;
}
.combo.is-on { visibility: visible; }
.combo.bump { animation: pop 0.3s cubic-bezier(0.2, 1.8, 0.4, 1); }
.combo.hot { transform: rotate(-3deg); box-shadow: 0 3px 0 var(--ink); }

.score {
  margin: 0;
  min-width: 5ch;
  font-family: "Chewy", cursive;
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 1;
  text-align: right;
  color: var(--coral);
  -webkit-text-stroke: 1px var(--ink);
}
.score.bump { animation: pop 0.3s cubic-bezier(0.2, 1.8, 0.4, 1); }

@keyframes pop {
  0% { transform: scale(0.7); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.feedback {
  flex: none;
  min-height: 3rem;
  margin: 0;
  padding: 0.6rem 1rem;
  border: var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: center;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  font-weight: 700;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.feedback:empty { border-color: transparent; background: transparent; }
.feedback.good { background: var(--good-soft); }
.feedback.bad { background: var(--bad-soft); }
.feedback b { font-weight: 800; }

/* Bølge-/startbanner */
.banner {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(255, 249, 240, 0.86);
}
.banner[hidden] { display: none; }
.banner-card {
  width: min(560px, 92%);
  padding: 1.8rem 2rem 1.4rem;
  text-align: center;
  animation: bannerIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes bannerIn { from { transform: translateY(24px) scale(0.92); opacity: 0; } }
.banner-title { margin: 0.2rem 0 0.5rem; font-family: "Chewy", cursive; font-weight: 400; font-size: clamp(2rem, 3.4vw, 2.8rem); line-height: 1; }
.banner-text { margin: 0 0 1rem; font-size: 1.1rem; line-height: 1.4; }
.banner-fact {
  margin: 0 0 1.2rem;
  padding: 0.7rem 1rem;
  border: 2px dashed var(--ink);
  border-radius: 14px;
  background: #fef9c3;
  font-size: 1rem;
  line-height: 1.4;
  text-align: left;
}
.banner-fact strong { font-weight: 800; }
.banner-key { margin: 0.6rem 0 0; font-size: 0.8rem; color: var(--muted); }

/* Poengsprett og partikler */
.pts {
  position: absolute;
  z-index: 30;
  pointer-events: none;
  font-family: "Chewy", cursive;
  font-size: 2rem;
  color: var(--coral);
  -webkit-text-stroke: 1px var(--ink);
  animation: ptsUp 0.85s forwards;
}
@keyframes ptsUp {
  0% { opacity: 0; transform: translateY(8px) scale(0.6); }
  25% { opacity: 1; transform: translateY(-10px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-60px) scale(1); }
}
.particle {
  position: absolute;
  z-index: 29;
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  pointer-events: none;
}

/* ---------- Bildeflis (mat og kropp) ---------- */

.pic {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: var(--pic, 96px);
  height: var(--pic, 96px);
}
.pic img { width: 100%; height: 100%; object-fit: contain; }
.pic.missing img { display: none; }
.pic.missing::after {
  content: attr(data-letter);
  display: grid;
  place-items: center;
  width: 86%;
  height: 86%;
  border: var(--line);
  border-radius: 999px;
  background: var(--tile, #fde68a);
  font-family: "Chewy", cursive;
  font-size: calc(var(--pic, 96px) * 0.42);
  line-height: 1;
}
.pic.gone { display: none; }

/* ---------- Sorteringshallen ---------- */

.belt-zone {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.task-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
}
.task-line b { font-weight: 800; }

.lane {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(14px, 2.4vh, 24px) 0;
}

.belt {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40px;
  right: -40px;
  border-top: var(--line);
  border-bottom: var(--line);
  background:
    repeating-linear-gradient(90deg, rgba(43, 33, 24, 0.14) 0 4px, transparent 4px 44px),
    #e9dfcf;
  animation: belt 1.4s linear infinite;
}
.belt::before, .belt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 10px;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 12px, var(--ink) 12px 24px);
}
.belt::before { top: -13px; border-top: var(--line); }
.belt::after { bottom: -13px; border-bottom: var(--line); }
@keyframes belt { to { background-position: -44px 0, 0 0; } }
.paused .belt { animation-play-state: paused; }

.item-card {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: min(640px, 90%);
  padding: clamp(0.8rem, 2vh, 1.2rem) clamp(1.2rem, 2.5vw, 2rem);
  background: #fff;
  border: var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lg);
  --pic: clamp(72px, 13vh, 150px);
  will-change: transform;
}
.item-card.reject { animation: reject 0.45s; }
@keyframes reject {
  20% { transform: translateX(-12px) rotate(-3deg); }
  45% { transform: translateX(10px) rotate(2deg); }
  70% { transform: translateX(-6px); }
}
.item-name { margin: 0; font-family: "Chewy", cursive; font-size: clamp(2rem, min(3.6vw, 6vh), 4.2rem); line-height: 1; }
.item-hint { margin: 0.25rem 0 0; font-size: 0.95rem; color: var(--muted); }
.item-src { display: flex; align-items: center; gap: 0.4rem; margin: 0.35rem 0 0; font-size: 0.95rem; color: var(--muted); --pic: 32px; }
.item-src .pic.missing::after { border-width: 2px; font-size: 0.9rem; }

.timer {
  position: relative;
  z-index: 2;
  width: min(420px, 70%);
  height: 14px;
  margin-top: clamp(18px, 3vh, 32px);
  border: var(--line);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
.timer[hidden] { display: none; }
.timer span { display: block; height: 100%; width: 100%; background: var(--good); transform-origin: left; }
.timer span.warn { background: var(--coral); }

.chutes {
  flex: none;
  display: grid;
  grid-template-columns: repeat(var(--n, 6), 1fr);
  gap: clamp(8px, 1.2vw, 16px);
  padding-top: clamp(8px, 1.5vh, 14px);
}
.chute {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, opacity 0.2s;
}
.chute:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.chute:active { transform: translateY(4px); box-shadow: none; }
.chute-top {
  display: grid;
  place-items: center;
  height: clamp(56px, 15vh, 160px);
  background: var(--c);
  border-bottom: var(--line);
}
.chute-mouth {
  width: 62%;
  height: 34%;
  border: var(--line);
  border-radius: 999px;
  background: var(--ink);
  box-shadow: inset 0 5px 0 rgba(0, 0, 0, 0.35);
}
.chute-label {
  padding: clamp(0.45rem, 1.2vh, 0.75rem) 0.4rem;
  font-weight: 800;
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  text-align: center;
  line-height: 1.15;
}
.chute .key { position: absolute; top: 6px; left: 6px; }
.chute.dim { opacity: 0.35; }
.chute.target { animation: gulp 0.4s; }
.chute.is-answer { outline: 4px solid var(--good); outline-offset: 2px; }
@keyframes gulp {
  35% { transform: scale(1.07, 0.92); }
  70% { transform: scale(0.97, 1.03); }
}
.chute.target .chute-mouth { animation: mouth 0.4s; }
@keyframes mouth { 40% { transform: scale(1.25, 1.6); } }

/* ---------- Kostsirkel-terminalen ---------- */

.circle-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) 1.1fr;
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
}
.circle-left { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; }
.circle-left .task-line { position: static; }
.food-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.2rem 1.8rem 1rem;
  background: #fff;
  border: var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lg);
  --pic: clamp(110px, 20vh, 170px);
}
.food-card .item-name { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.food-card.pop { animation: pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1); }
.circle-left .timer { margin-top: 0.4rem; width: min(320px, 90%); }

.circle-wrap { height: 100%; min-height: 0; display: grid; place-items: center; padding: 6px 0; }
.circle-svg { width: 100%; height: 100%; max-height: 100%; max-width: 560px; overflow: visible; }
.circle-svg .seg { stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; cursor: pointer; transition: filter 0.12s, opacity 0.2s; }
.circle-svg .seg:hover { filter: brightness(1.08) saturate(1.2); }
.circle-svg .seg.dim { opacity: 0.3; }
.circle-svg .seg.hit { animation: segHit 0.45s; }
@keyframes segHit { 40% { filter: brightness(1.35); } }
.circle-svg text { font-family: "Nunito", sans-serif; font-weight: 800; fill: var(--ink); pointer-events: none; }
.circle-svg .num { fill: #fff; stroke: var(--ink); stroke-width: 2; }

/* ---------- Egenskapslabben ---------- */

.lab-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(14px, 3vh, 28px);
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}
.question-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: clamp(1rem, 2.4vh, 1.6rem) clamp(1.2rem, 2.5vw, 2rem);
  background: #fff;
  border: var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lg);
  --pic: clamp(80px, 14vh, 120px);
}
.question-card.pop { animation: pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1); }
.question-text { margin: 0; font-family: "Chewy", cursive; font-size: clamp(1.6rem, min(3vw, 5vh), 3.2rem); line-height: 1.1; }
.question-kicker { margin: 0 0 0.3rem; }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 1.6vw, 18px); }
.options.three { grid-template-columns: repeat(3, 1fr); }
.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: clamp(0.9rem, 3vh, 1.8rem) 1.2rem;
  text-align: left;
  background: #fff;
  border: var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  font-weight: 800;
  font-size: clamp(1.1rem, min(1.8vw, 3vh), 1.7rem);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.option:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.option:active { transform: translateY(4px); box-shadow: none; }
.option.right { background: var(--good-soft); animation: pop 0.35s; }
.option.wrong { background: var(--bad-soft); }
.option.reveal { outline: 4px solid var(--good); outline-offset: 2px; }

/* ---------- Påstandssentralen ---------- */

.claims-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3.5vh, 34px);
}
.doc {
  position: relative;
  width: min(760px, 100%);
  min-height: clamp(160px, 28vh, 240px);
  padding: 2.4rem 2.2rem 2rem;
  display: grid;
  place-items: center;
  background: #fffbeb;
  background-image: repeating-linear-gradient(transparent 0 30px, rgba(43, 33, 24, 0.07) 30px 32px);
  border: var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  transform: rotate(-0.6deg);
}
.doc.in { animation: docIn 0.4s cubic-bezier(0.2, 1.3, 0.4, 1); }
@keyframes docIn { from { transform: translateY(-40px) rotate(-3deg); opacity: 0; } }
.doc-label {
  position: absolute;
  top: 0.8rem;
  left: 1.2rem;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.doc-text { margin: 0; font-family: "Chewy", cursive; font-size: clamp(1.6rem, 2.8vw, 2.3rem); line-height: 1.15; text-align: center; }
.stamp {
  position: absolute;
  right: 1.4rem;
  bottom: 1rem;
  padding: 0.2rem 1rem;
  border: 5px solid currentColor;
  border-radius: 12px;
  font-family: "Chewy", cursive;
  font-size: 2.2rem;
  letter-spacing: 0.06em;
  opacity: 0;
  transform: rotate(-12deg) scale(2.6);
  pointer-events: none;
}
.stamp.ok { color: #15803d; }
.stamp.no { color: #e11d48; }
.stamp.down { animation: stampDown 0.25s cubic-bezier(0.3, 1.3, 0.5, 1) forwards; }
@keyframes stampDown { to { opacity: 0.92; transform: rotate(-12deg) scale(1); } }

.stamp-row { display: flex; gap: clamp(12px, 2vw, 24px); }
.stamp-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.8rem 0.85rem 1.1rem;
  background: #fff;
  border: var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  font-weight: 800;
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.stamp-btn img { width: 40px; height: 40px; }
.stamp-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stamp-btn:active { transform: translateY(4px); box-shadow: none; }

/* ---------- Dagens tallerken ---------- */

.plate-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) 1.2fr;
  gap: clamp(14px, 2.5vw, 32px);
}
.plate-left { display: flex; flex-direction: column; gap: clamp(10px, 2vh, 18px); min-height: 0; }
.order {
  position: relative;
  padding: 1.1rem 1.2rem 1rem;
  background: #fffbeb;
  border: var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  --pic: 72px;
}
.order.in { animation: docIn 0.4s cubic-bezier(0.2, 1.3, 0.4, 1); }
.order-head { display: flex; align-items: center; gap: 0.8rem; }
.order-title { margin: 0; font-family: "Chewy", cursive; font-size: clamp(1.5rem, 2.2vw, 1.9rem); line-height: 1; }
.order-text { margin: 0.6rem 0 0.8rem; font-size: 1rem; line-height: 1.4; }
.needs { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.need {
  padding: 0.3rem 0.8rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  font-weight: 800;
  font-size: 0.9rem;
}
.need.done { background: var(--good-soft); animation: pop 0.3s; }
.need.miss { background: var(--bad-soft); animation: shake 0.35s; }

.tray {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  padding: 0.8rem;
  border: var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow);
  --pic: clamp(52px, 9vh, 76px);
}
.slot {
  display: grid;
  place-items: center;
  width: clamp(62px, 11vh, 92px);
  height: clamp(62px, 11vh, 92px);
  margin: 0 auto;
  border: 2px dashed rgba(43, 33, 24, 0.35);
  border-radius: 999px;
}
.slot.filled { border-style: solid; border-color: var(--ink); background: var(--cream); animation: pop 0.3s; }
.plate-left .btn { align-self: stretch; }

.food-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: clamp(8px, 1.2vw, 14px);
  min-height: 0;
  --pic: clamp(48px, 9vh, 84px);
}
.food-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.5rem 0.3rem;
  min-height: 0;
  background: #fff;
  border: var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  font-weight: 800;
  font-size: clamp(0.85rem, 1.1vw, 1rem);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, background 0.15s;
}
.food-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.food-btn.selected { background: #fef9c3; transform: translateY(4px); box-shadow: none; }

/* ---------- Mobil og smale skjermer ---------- */

@media (max-width: 860px) {
  body { overflow: auto; }
  .app { height: auto; min-height: calc(100dvh - var(--stiglet-hode-hoyde, 76px)); overflow: visible; }
  #screen-start { flex-direction: column; }
  .start-left { flex: none; }
  #screen-game { min-height: calc(100dvh - var(--stiglet-hode-hoyde, 76px) - 32px); }
  .hud { flex-wrap: wrap; }
  .hud-progress { order: 5; flex-basis: 100%; }
  .chutes.many { grid-template-columns: repeat(3, 1fr); }
  .circle-layout, .plate-layout { grid-template-columns: 1fr; }
  .circle-wrap { height: 340px; }
  .options, .options.three { grid-template-columns: 1fr; }
  .food-grid { grid-template-columns: repeat(3, 1fr); }
  .key { display: none; }
  .hud { gap: 0.6rem; }
  .hud-title { font-size: 1.25rem; }
  .combo { min-width: 0; font-size: 0.85rem; padding: 0.2rem 0.6rem; }
  .score { margin-left: auto; font-size: 1.8rem; }
  .task-line { position: static; margin-bottom: 0.6rem; }
  .plan-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
