:root {
  color-scheme: dark;
  --ink: #07100a;
  --panel: #14271a;
  --panel-2: #1d3423;
  --cream: #f5edcf;
  --muted: #aabda1;
  --green: #82d257;
  --green-bright: #bcff7b;
  --red: #e64e38;
  --gold: #f0c544;
  --cyan: #79d7c4;
  --line: rgba(199, 227, 181, 0.14);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(93, 178, 75, 0.27), transparent 28rem),
    radial-gradient(circle at 85% 80%, rgba(240, 187, 63, 0.12), transparent 30rem),
    #07130b;
  color: var(--cream);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.arcade-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100dvh;
  margin: 0 auto;
  padding: 16px 0;
  display: grid;
  grid-template-columns: minmax(400px, 540px) minmax(310px, 390px);
  justify-content: center;
  align-items: center;
  gap: 18px;
}

.game-column {
  width: 100%;
}

.game-stage {
  position: relative;
  /* Bredden følger vindueshøjden, så spillet holder 3:4 og aldrig bliver højere end skærmen */
  width: min(100%, calc((100vh - 32px) * 3 / 4));
  width: min(100%, calc((100dvh - 32px) * 3 / 4));
  margin: 0 auto;
  aspect-ratio: 3 / 4;
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border: 1px solid rgba(189, 230, 163, 0.2);
  border-radius: 26px;
  background: #173b26;
  box-shadow: var(--shadow);
  isolation: isolate;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.game-stage::after {
  position: absolute;
  inset: 0;
  z-index: 8;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: inherit;
  pointer-events: none;
  content: "";
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stage-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  min-height: 54px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(to bottom, rgba(9, 27, 15, 0.79), transparent);
  pointer-events: none;
}

.stage-topbar > * {
  pointer-events: auto;
}

/* «ErDet420.dk» + «← Alle spil» øverst til venstre: fælles mærke i css/spil-tilbage.css (Emil 28/10) */

.round-button {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(7, 16, 9, 0.7);
  color: var(--cream);
  cursor: pointer;
}

.run-hud {
  position: absolute;
  top: 58px;
  left: 14px;
  right: 14px;
  z-index: 18;
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 1fr;
  gap: 6px;
  pointer-events: none;
}

.hud-stat {
  min-height: 50px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(12, 30, 16, 0.7);
  backdrop-filter: blur(10px);
}

.rasta-running .hud-stat {
  background: rgba(12, 30, 16, 0.84);
  backdrop-filter: none;
}

.hud-stat span {
  display: block;
  margin-bottom: 2px;
  color: rgba(245, 237, 207, 0.58);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.hud-stat strong {
  color: var(--cream);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.height-stat strong,
.hud-stat:nth-child(3) strong {
  color: var(--green-bright);
}

.pressure-stat strong {
  color: var(--gold);
}

.pressure-stat.is-chill strong {
  color: var(--cyan);
}

.active-perks {
  position: absolute;
  top: 116px;
  left: 14px;
  z-index: 18;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  pointer-events: none;
}

.active-perks span {
  padding: 5px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: rgba(6, 13, 7, 0.78);
  color: var(--green-bright);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.active-perks .chill {
  color: var(--cyan);
}

.active-perks .roots {
  color: #a9d36c;
}

.active-perks .bounce {
  color: var(--gold);
}

.active-perks .xp {
  color: #ff7059;
}

.game-notice {
  position: absolute;
  top: 23%;
  left: 50%;
  z-index: 24;
  min-width: 230px;
  padding: 11px 18px;
  translate: -50% 0;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 13px;
  background: rgba(7, 15, 8, 0.88);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.38);
  text-align: center;
  pointer-events: none;
  animation: notice-in 180ms ease-out;
}

.game-notice strong,
.game-notice span {
  display: block;
}

.game-notice strong {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.game-notice span {
  margin-top: 3px;
  color: rgba(245, 237, 207, 0.7);
  font-size: 10px;
}

@keyframes notice-in {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
}

.start-screen {
  padding: 62px 34px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    linear-gradient(to bottom, rgba(8, 27, 15, 0.03), rgba(8, 27, 15, 0.52) 72%, rgba(7, 20, 11, 0.88)),
    radial-gradient(circle at 50% 34%, rgba(150, 235, 91, 0.3), transparent 48%);
}

.start-screen::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, transparent 49%, rgba(255, 255, 255, 0.026) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(255, 255, 255, 0.02) 50%, transparent 51%);
  background-size: 48px 48px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.start-glow {
  position: absolute;
  top: 128px;
  left: 50%;
  z-index: -1;
  width: 330px;
  height: 330px;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 255, 112, 0.3), transparent 66%);
  filter: blur(8px);
}

.title-lockup {
  position: relative;
  text-align: center;
}

.title-lockup > p:first-child {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.24em;
}

.title-icon {
  position: relative;
  width: 68px;
  height: 66px;
  margin: 0 auto -14px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.42));
}

.title-icon .face {
  position: absolute;
  top: 18px;
  left: 16px;
  width: 36px;
  height: 39px;
  border-radius: 48% 48% 44% 44%;
  background: #8b5435;
}

.title-icon .face::before,
.title-icon .face::after {
  position: absolute;
  top: 17px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #160e0a;
  content: "";
}

.title-icon .face::before {
  left: 9px;
}

.title-icon .face::after {
  right: 9px;
}

.dread {
  position: absolute;
  top: 27px;
  width: 8px;
  height: 35px;
  border-radius: 999px;
  background: #120d09;
  rotate: 8deg;
}

.dread-a {
  left: 10px;
}

.dread-b {
  left: 49px;
  rotate: -8deg;
}

.dread-c {
  left: 4px;
  height: 29px;
  rotate: 18deg;
}

.beanie {
  position: absolute;
  left: 14px;
  z-index: 2;
  width: 40px;
  height: 8px;
}

.beanie-green {
  top: 8px;
  border-radius: 50% 50% 0 0;
  background: #3a9445;
}

.beanie-gold {
  top: 15px;
  background: var(--gold);
}

.beanie-red {
  top: 22px;
  border-radius: 0 0 6px 6px;
  background: var(--red);
}

.title-lockup h1 {
  position: relative;
  margin: 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(64px, 11.5vw, 92px);
  font-weight: 900;
  line-height: 0.74;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  filter: drop-shadow(0 9px 0 #061008) drop-shadow(0 13px 0 rgba(225, 71, 51, 0.8));
}

.title-lockup h1 span {
  display: block;
}

.title-lockup h1 span:first-child {
  color: var(--cream);
}

.title-lockup h1 span:last-child {
  color: var(--green-bright);
}

.edition-line {
  width: min(330px, 86%);
  margin: 23px auto 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.edition-line i {
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--red));
}

.edition-line i:last-child {
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green));
}

.edition-line b {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.17em;
}

.tagline {
  max-width: 340px;
  margin: 12px auto 0;
  color: rgba(245, 237, 207, 0.68);
  font-size: 11px;
  font-weight: 650;
}

.start-panel {
  position: relative;
  width: min(410px, 100%);
  margin: auto auto 0;
}

.quick-records {
  margin-bottom: 9px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.quick-records div {
  padding: 8px 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(13, 33, 17, 0.7);
  text-align: center;
  backdrop-filter: blur(8px);
}

.quick-records span,
.quick-records strong {
  display: block;
}

.quick-records span {
  color: var(--muted);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.quick-records strong {
  margin-top: 2px;
  color: var(--cream);
  font-size: 14px;
}

.primary-button {
  width: 100%;
  min-height: 62px;
  padding: 10px 16px;
  border: 0;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 42%),
    var(--green);
  box-shadow:
    inset 0 -5px 0 rgba(20, 64, 23, 0.45),
    0 11px 28px rgba(67, 145, 54, 0.28);
  color: #071009;
  cursor: pointer;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-align: left;
  transition:
    transform 120ms ease,
    filter 120ms ease;
}

.primary-button:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.primary-button:active {
  transform: translateY(2px);
}

.primary-button span {
  font-size: 15px;
}

.primary-button small {
  display: block;
  margin-bottom: 2px;
  color: rgba(7, 16, 9, 0.63);
  font-size: 8px;
  letter-spacing: 0.14em;
}

.primary-button > b {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(7, 16, 9, 0.14);
  font-size: 23px;
}

.start-controls {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: rgba(245, 237, 207, 0.5);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.hint-touch {
  display: none;
}

kbd {
  min-width: 20px;
  height: 20px;
  margin-right: 2px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3);
  color: var(--cream);
  font-family: inherit;
}

.open-source-note {
  margin: 8px 0 0;
  color: rgba(245, 237, 207, 0.32);
  font-size: 7px;
  text-align: center;
}

.open-source-note a {
  color: rgba(163, 237, 107, 0.56);
}

.age-note {
  margin: 5px 0 0;
  color: rgba(245, 237, 207, 0.55);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.age-note a {
  color: rgba(163, 237, 107, 0.78);
}

.ready-screen {
  position: absolute;
  inset: 0;
  z-index: 19;
  display: grid;
  place-content: center;
  background: rgba(12, 40, 20, 0.09);
  text-align: center;
  pointer-events: none;
}

.ready-screen span,
.ready-screen strong {
  display: block;
}

.ready-screen span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.ready-screen strong {
  margin-top: -6px;
  font-family: Impact, sans-serif;
  font-size: 108px;
  line-height: 1;
  text-shadow: 0 8px 0 rgba(0, 0, 0, 0.4);
}

.compact-overlay {
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 30px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(4, 9, 5, 0.72);
  backdrop-filter: blur(12px);
}

.compact-card {
  width: min(380px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.045), transparent 42%),
    #101a12;
  box-shadow: var(--shadow);
  text-align: center;
}

.compact-kicker {
  color: var(--gold);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.compact-card h2 {
  margin: 5px 0 7px;
  font-family: Impact, sans-serif;
  font-size: 48px;
  letter-spacing: 0.03em;
}

.compact-card > p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
}

.secondary-button {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.11em;
}

.result-height {
  margin: 10px 0 16px;
}

.result-height strong,
.result-height span {
  display: block;
}

.result-height strong {
  color: var(--green-bright);
  font-family: Impact, sans-serif;
  font-size: 72px;
  line-height: 0.9;
}

.result-height span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.result-grid {
  margin-bottom: 15px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.result-grid div {
  padding: 9px 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
}

.result-grid span,
.result-grid b {
  display: block;
}

.result-grid span {
  color: var(--muted);
  font-size: 7px;
  font-weight: 850;
}

.result-grid b {
  margin-top: 2px;
  color: var(--cream);
  font-size: 15px;
}

.result-grid i {
  font-style: normal;
}

.result-unlock {
  margin: -8px 0 14px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 214, 91, 0.34);
  border-radius: 10px;
  background:
    linear-gradient(105deg, rgba(255, 214, 91, 0.13), transparent),
    rgba(39, 78, 30, 0.28);
}

.result-unlock span,
.result-unlock strong,
.result-unlock small {
  display: block;
}

.result-unlock span {
  color: var(--gold);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.result-unlock strong {
  margin: 2px 0;
  color: var(--green-bright);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.result-unlock small {
  color: var(--cream);
  font-size: 8px;
}

.touch-controls {
  position: absolute;
  right: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 18px;
  z-index: 25;
  display: none;
  justify-content: space-between;
  pointer-events: none;
}

.touch-controls button {
  width: 82px;
  height: 82px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(5, 12, 6, 0.64);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.22);
  color: var(--cream);
  font-size: 30px;
  pointer-events: auto;
  touch-action: none;
}

.touch-controls button.active {
  border-color: var(--green-bright);
  background: rgba(68, 128, 53, 0.75);
  transform: translateY(3px);
}

.companion-panel {
  width: 100%;
  max-height: calc(100dvh - 32px);
  padding: 17px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 35%),
    rgba(12, 20, 14, 0.95);
  box-shadow: var(--shadow);
  scrollbar-width: thin;
  scrollbar-color: rgba(133, 186, 99, 0.3) transparent;
}

.panel-brand {
  padding: 0 2px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.brand-orbit {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(163, 237, 107, 0.4);
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(80, 143, 57, 0.1);
  color: var(--green-bright);
  font-size: 22px;
}

.panel-brand small,
.panel-brand strong {
  display: block;
}

.panel-brand small {
  color: var(--muted);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.panel-brand strong {
  font-size: 13px;
  letter-spacing: 0.07em;
}

.panel-brand > b {
  padding: 4px 7px;
  border: 1px solid rgba(255, 197, 68, 0.22);
  border-radius: 6px;
  color: var(--gold);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.profile-card {
  margin: 13px 0;
  padding: 13px;
  border: 1px solid rgba(132, 192, 95, 0.2);
  border-radius: 15px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 13px;
  background:
    radial-gradient(circle at 10% 30%, rgba(120, 197, 78, 0.13), transparent 52%),
    #142017;
}

.level-badge {
  width: 60px;
  height: 60px;
  border: 1px solid rgba(163, 237, 107, 0.35);
  border-radius: 17px;
  display: grid;
  place-content: center;
  background: rgba(7, 16, 9, 0.48);
  text-align: center;
}

.level-badge span,
.level-badge strong {
  display: block;
}

.level-badge span {
  color: var(--muted);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.level-badge strong {
  color: var(--green-bright);
  font-size: 24px;
  line-height: 1;
}

.profile-progress > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-progress span,
.profile-progress b,
.profile-progress small {
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.profile-progress span,
.profile-progress small {
  color: var(--muted);
}

.profile-progress b {
  color: var(--cream);
}

.progress-track,
.mission-track {
  position: relative;
  height: 8px;
  margin: 7px 0 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.34);
}

.progress-track i,
.mission-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold));
  box-shadow: 0 0 12px rgba(156, 225, 99, 0.32);
  transition: width 350ms ease;
}

.panel-section {
  margin-top: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.018);
}

.section-heading {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-heading small,
.section-heading h2 {
  display: block;
}

.section-heading small {
  color: var(--muted);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.section-heading h2 {
  margin: 1px 0 0;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.section-heading > span {
  color: var(--gold);
}

.record-list {
  display: grid;
  gap: 7px;
}

.record-list div {
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
}

.record-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.record-list b {
  color: var(--cream);
  font-size: 10px;
}

.record-list i {
  font-style: normal;
}

.leaderboard-section {
  background:
    linear-gradient(135deg, rgba(255, 204, 72, 0.07), transparent 38%),
    rgba(255, 255, 255, 0.018);
}

.preview-badge,
.achievement-count {
  padding: 4px 7px;
  border: 1px solid rgba(240, 197, 68, 0.27);
  border-radius: 6px;
  color: var(--gold) !important;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.09em;
}

.leaderboard-head,
.leaderboard-list li {
  display: grid;
  grid-template-columns: 23px minmax(88px, 1fr) 28px 42px 54px;
  align-items: center;
  gap: 5px;
}

.leaderboard-head {
  padding: 0 5px 5px;
  color: rgba(245, 237, 207, 0.34);
  font-size: 6px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-align: right;
}

.leaderboard-head span:nth-child(2) {
  text-align: left;
}

.leaderboard-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard-list li {
  min-height: 34px;
  padding: 4px 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.052);
  color: var(--cream);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.leaderboard-list li:nth-child(-n + 3) {
  background: linear-gradient(90deg, rgba(240, 197, 68, 0.065), transparent);
}

.leaderboard-list li.leaderboard-empty {
  display: block;
  padding: 10px 5px;
  background: none;
  color: var(--muted);
  text-align: center;
}

.leaderboard-local {
  margin: 7px 0 0;
  padding: 6px 8px;
  border: 1px solid rgba(188, 255, 123, 0.42);
  border-radius: 7px;
  background: rgba(130, 210, 87, 0.13);
  color: var(--green-bright);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-align: center;
}

.leader-rank {
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.leaderboard-list li:nth-child(1) .leader-rank {
  color: var(--gold);
}

.leaderboard-list li:nth-child(2) .leader-rank {
  color: #d8e1df;
}

.leaderboard-list li:nth-child(3) .leader-rank {
  color: #d58e59;
}

.leader-identity {
  min-width: 0;
  text-align: left;
}

.leader-identity strong,
.leader-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: uppercase;   /* tavlens look; navnet selv er uændret (21/10) */
}

.leader-identity strong {
  font-size: 8px;
  letter-spacing: 0.035em;
}

.leader-identity small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 6px;
  letter-spacing: 0.06em;
}

.leader-level {
  color: var(--green-bright);
}

.leader-height {
  color: var(--gold);
}

.leader-score {
  color: rgba(245, 237, 207, 0.72);
}

.leaderboard-note {
  margin: 7px 0 0;
  color: rgba(245, 237, 207, 0.31);
  font-size: 6px;
  line-height: 1.35;
  text-align: center;
}

.mission-section {
  background:
    linear-gradient(110deg, rgba(229, 78, 55, 0.06), transparent 45%),
    rgba(255, 255, 255, 0.018);
}

.mission-reward {
  padding: 4px 6px;
  border: 1px solid rgba(240, 197, 68, 0.25);
  border-radius: 6px;
  font-size: 7px;
  font-weight: 900;
}

.mission-section p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.mission-section > span {
  display: block;
  color: rgba(245, 237, 207, 0.52);
  font-size: 7px;
  font-weight: 850;
  text-align: right;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.achievement-tile {
  min-height: 58px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 6px;
  background: rgba(0, 0, 0, 0.14);
  color: rgba(245, 237, 207, 0.28);
}

.achievement-tile b {
  grid-row: 1 / 3;
  width: 26px;
  height: 26px;
  border: 1px solid currentColor;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 8px;
}

.achievement-tile span {
  overflow: hidden;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.achievement-tile small {
  color: var(--muted);
  font-size: 6px;
  line-height: 1.25;
}

.achievement-tile.is-unlocked {
  border-color: rgba(188, 255, 123, 0.25);
  background:
    radial-gradient(circle at 10% 40%, rgba(188, 255, 123, 0.13), transparent 58%),
    rgba(68, 126, 50, 0.08);
  color: var(--green-bright);
}

.achievement-tile.is-unlocked small {
  color: rgba(255, 214, 91, 0.7);
}

.perk-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.perk-card {
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  background: rgba(0, 0, 0, 0.16);
}

.perk-card b {
  grid-row: 1 / 3;
  width: 23px;
  height: 23px;
  border: 1px solid currentColor;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 10px;
}

.perk-card span {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.perk-card small {
  color: var(--muted);
  font-size: 7px;
}

.perk-card.chill {
  color: var(--cyan);
}

.perk-card.roots {
  color: #9ccd64;
}

.perk-card.boost {
  color: var(--gold);
}

.perk-card.xp {
  color: #ff6c57;
}

.panel-footer {
  margin-top: 14px;
  padding: 0 2px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(245, 237, 207, 0.28);
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.panel-footer a {
  color: rgba(163, 237, 107, 0.55);
  text-decoration: none;
}

@media (max-width: 860px) {
  .arcade-shell {
    width: min(590px, calc(100% - 20px));
    grid-template-columns: 1fr;
    align-items: start;
    padding: 10px 0 28px;
  }

  .game-stage {
    width: min(100%, calc((100vh - 20px) * 3 / 4));
    width: min(100%, calc((100dvh - 20px) * 3 / 4));
    max-height: calc(100dvh - 20px);
  }

  .companion-panel {
    max-height: none;
  }
}

@media (pointer: coarse), (max-width: 680px) {
  .touch-controls:not([hidden]) {
    display: flex;
  }

  .start-screen {
    padding-right: 20px;
    padding-left: 20px;
  }

  .hint-desktop {
    display: none;
  }

  .hint-touch {
    display: inline;
  }
}

@media (max-width: 470px) {
  .arcade-shell {
    width: 100%;
    padding: 0 0 20px;
  }

  .game-stage {
    border-right: 0;
    border-left: 0;
    border-radius: 0 0 22px 22px;
  }

  .companion-panel {
    width: calc(100% - 20px);
    margin: 0 auto;
  }

  .run-hud {
    left: 8px;
    right: 8px;
    gap: 3px;
  }

  .hud-stat {
    padding: 7px 5px;
  }

  .hud-stat span {
    font-size: 6px;
  }

  .hud-stat strong {
    font-size: 11px;
  }

  .title-lockup h1 {
    font-size: clamp(59px, 20vw, 88px);
  }

  .quick-records {
    gap: 3px;
  }

  .touch-controls button {
    width: 70px;
    height: 70px;
  }
}

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

#rasta-audio-badge {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 40;
  padding: 7px 14px;
  border-radius: 999px;
  border: 2px solid rgba(12, 24, 10, 0.65);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  cursor: pointer;
  touch-action: manipulation;
}

#rasta-audio-badge.is-on {
  background: rgba(140, 220, 110, 0.92);
  color: #10240c;
}

#rasta-audio-badge.is-off {
  background: rgba(20, 26, 16, 0.82);
  color: rgba(243, 233, 208, 0.75);
}

.hud-stat.combo-stat {
  background: linear-gradient(135deg, #ffdf6b, #ff9d3c);
  color: #241505;
  animation: combo-pulse 0.55s ease-in-out infinite alternate;
}

.hud-stat.combo-stat span {
  color: rgba(36, 21, 5, 0.72);
}

@keyframes combo-pulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hud-stat.combo-stat {
    animation: none;
  }
}

.result-combo {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 850;
  color: #ffdf6b;
}

/* 19/10: om rekorden er sendt til månedens tavle (indsend.js) */
.result-tavle {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  color: #c9f7a6;
}

.result-tavle a {
  color: #ffdf6b;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.picker-block {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.picker-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  opacity: 0.72;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 7px 12px;
  border-radius: 999px;
  border: 2px solid rgba(23, 16, 11, 0.65);
  background: rgba(20, 40, 22, 0.55);
  color: #f3e9d0;
  font-family: inherit;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.chip:hover:not(:disabled) {
  transform: translateY(-1px);
}

.chip.is-selected {
  background: #efc83f;
  color: #1c1206;
  border-color: #17100b;
}

.chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.preview-tag {
  margin: 4px 0 0;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #8fe370;
  opacity: 0.8;
}

@media (max-width: 560px), (max-height: 700px) {
  .start-screen {
    padding: 16px 18px 14px;
    justify-content: flex-start;
    gap: 10px;
  }

  .start-screen .title-lockup {
    transform: scale(0.72);
    transform-origin: top center;
    margin-bottom: -13%;
  }

  .start-panel {
    gap: 8px;
  }
}

@media (max-width: 430px), (max-height: 560px) {
  .start-screen {
    padding: 12px 14px 12px;
    gap: 8px;
  }

  .start-screen .quick-records {
    display: none;
  }

  .start-screen .tagline {
    margin: 0;
    font-size: 12px;
  }

  .start-screen .title-lockup {
    transform: scale(0.56);
    margin-bottom: -22%;
  }
}

/* Smalle telefoner i højkant (Fable 21/10 M4): topbjælken (link + 4:20-chip) lå hen over titlen og figuren.
   Linkets tekst gemmes (420-mærket bliver, teksten læses stadig op), så chippen ikke afkortes, og menuen
   begynder under bjælken. Vendt telefon styres af reglen for max-height 500 længere nede. */
@media (max-width: 430px) {
  .start-screen {
    padding-top: 58px;
  }
}

/* Pause-tegnet «Ⅱ» (romertal U+2161) mangler i nogle Android-skrifter (Fable 21/10 L12): to CSS-streger i stedet. */
#pause-button {
  display: inline-grid;
  place-items: center;
}

#pause-button[hidden] {
  display: none;
}

#pause-button > span {
  display: none;
}

#pause-button::before {
  width: 8px;
  height: 13px;
  border-right: 3px solid currentColor;
  border-left: 3px solid currentColor;
  content: "";
}

.beta-baelke {
  background: #1e7a34;
  color: #fff;
  text-align: center;
  padding: 8px 14px;
  font-size: 0.9rem;
  line-height: 1.4;
  position: relative;
  z-index: 9999;
}

.indsend-boks {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(245, 237, 207, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.indsend-boks p[role="status"] {
  margin: 0 0 6px;
  font-size: 8px;
  line-height: 1.5;
  color: rgba(245, 237, 207, 0.72);
}

.indsend-boks label {
  display: block;
  margin: 4px 0 2px;
  font-size: 7px;
  color: rgba(245, 237, 207, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.indsend-boks input {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 6px;
  font-size: 9px;
  color: rgba(245, 237, 207, 0.9);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(245, 237, 207, 0.22);
  border-radius: 4px;
}

.indsend-boks button {
  margin-top: 6px;
  padding: 6px 10px;
  font-size: 8px;
  cursor: pointer;
  color: #1b1408;
  background: #f0c948;
  border: 0;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.indsend-note {
  margin: 6px 0 0;
  font-size: 7px;
  line-height: 1.5;
  color: rgba(245, 237, 207, 0.45);
}

.indsend-note a {
  color: rgba(240, 201, 72, 0.85);
}

#indsend-svar {
  min-height: 1em;
}

.ur420-vaert {
  display: flex;
  align-items: center;
  min-width: 0;
}

.ur420 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 16, 10, 0.72);
  color: var(--cream);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  max-width: 100%;
}

.ur420__tekst {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ur420--fejrer {
  border-color: var(--gold);
  color: var(--ink);
  background: var(--gold);
  animation: ur420-puls 1.1s ease-in-out infinite;
}

@keyframes ur420-puls {
  0%, 100% { box-shadow: 0 0 0 rgba(240, 197, 68, 0); }
  50% { box-shadow: 0 0 16px rgba(240, 197, 68, 0.7); }
}

@media (prefers-reduced-motion: reduce) {
  .ur420--fejrer { animation: none; }
}

@media (max-height: 430px) {
  .ur420 { padding: 4px 8px; font-size: 10px; }
  .ur420__ikon { display: none; }
}

@media (pointer: coarse), (max-width: 680px) {
  #rasta-audio-badge {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: max(14px, env(safe-area-inset-bottom));
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 10px 18px;
  }

  #game-stage:has(#start-screen:not([hidden])) #rasta-audio-badge {
    display: none;
  }

  .round-button {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  .chip,
  .spil-tilbage a,
  .open-source-note a,
  .age-note a {
    position: relative;
  }

  .chip::after,
  .spil-tilbage a::after,
  .open-source-note a::after,
  .age-note a::after {
    content: "";
    position: absolute;
    inset: -7px;
  }

  .chip::after {
    inset: -4px -3px;
  }
}

/* Telefon og touch: tekst på mindst ca. 11 px, og felter på 16 px, så iPhone ikke zoomer ind */
@media (pointer: coarse), (max-width: 680px) {
  .indsend-boks input {
    font-size: 16px;
  }

  .title-lockup > p:first-child,
  .hud-stat span,
  .active-perks span,
  .quick-records span,
  .primary-button small,
  .start-controls,
  .open-source-note,
  .compact-kicker,
  .result-height span,
  .result-grid span,
  .result-unlock span,
  .result-unlock small,
  .panel-brand small,
  .panel-brand > b,
  .level-badge span,
  .profile-progress span,
  .profile-progress b,
  .profile-progress small,
  .section-heading small,
  .record-list div,
  .achievement-count,
  .leaderboard-head,
  .leaderboard-list li,
  .leader-rank,
  .leader-identity strong,
  .leader-identity small,
  .leaderboard-note,
  .leaderboard-local,
  .mission-reward,
  .mission-section p,
  .mission-section > span,
  .achievement-tile span,
  .achievement-tile small,
  .perk-card span,
  .perk-card small,
  .panel-footer,
  .preview-tag,
  .indsend-boks p[role="status"],
  .indsend-boks label,
  .indsend-boks button,
  .indsend-note {
    font-size: 11px;
  }

  .age-note {
    font-size: 11px;
    letter-spacing: 0.06em;
  }

  .hud-stat span {
    letter-spacing: 0.06em;
  }

  .record-list b {
    font-size: 12px;
  }

  .achievement-tile b {
    font-size: 10px;
  }

  .achievement-tile span {
    white-space: normal;
  }
}

/* Liggende telefon: spillet er smalt, så topbjælke, HUD, knapper og kort pakkes tættere */
@media (max-width: 860px) and (max-height: 500px) {
  .stage-topbar {
    min-height: 44px;
    padding: 7px 8px;
  }

  .ur420 {
    padding: 4px 8px;
    font-size: 10px;
  }

  .ur420__ikon {
    display: none;
  }

  .start-screen {
    padding-top: 48px;
  }

  .title-lockup h1 {
    font-size: 60px;
  }

  .run-hud {
    top: 50px;
    left: 6px;
    right: 6px;
    gap: 3px;
  }

  .hud-stat {
    min-height: 0;
    padding: 4px;
  }

  .hud-stat span {
    font-size: 9px;
    letter-spacing: 0.02em;
  }

  .hud-stat strong {
    font-size: 11px;
  }

  .active-perks {
    top: 98px;
    left: 6px;
  }

  .compact-overlay {
    padding: 10px;
  }

  .compact-card {
    padding: 14px;
  }

  .compact-card h2 {
    font-size: 30px;
  }

  .result-height {
    margin: 4px 0 8px;
  }

  .result-height strong {
    font-size: 44px;
  }

  .touch-controls {
    right: 8px;
    left: 8px;
  }

  .touch-controls button {
    width: 60px;
    height: 60px;
  }

  #rasta-audio-badge {
    padding: 6px 10px;
  }
}
