* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Nunito", sans-serif;
  background: linear-gradient(180deg, #7ec8e3 0%, #b8e3f0 60%, #d9f2e6 100%);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

#spill {
  display: block;
  width: 100%;
  height: 100%;
}

.hidden { display: none !important; }

#superkraftBanner,
#flykraftBanner {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  color: white;
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  white-space: nowrap;
  animation: superkraft-puls 0.5s infinite alternate;
}

#superkraftBanner { background: linear-gradient(90deg, #fd79a8, #fdcb6e); }
#flykraftBanner { background: linear-gradient(90deg, #74b9ff, #55efc4); }

@keyframes superkraft-puls {
  from { transform: translateX(-50%) scale(1); }
  to { transform: translateX(-50%) scale(1.05); }
}

#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 5;
}

#distanse {
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: 28px;
  color: #2d3436;
  text-shadow: 0 2px 0 rgba(255,255,255,0.6);
}

#kaosmeter {
  text-align: right;
}

#kaosLabel {
  display: block;
  font-weight: 800;
  font-size: 14px;
  color: #e17055;
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}

#kaosBar {
  width: 130px;
  height: 10px;
  background: rgba(255,255,255,0.6);
  border-radius: 999px;
  margin-top: 4px;
  overflow: hidden;
  border: 2px solid rgba(45,52,54,0.2);
}

#kaosFyll {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #fdcb6e, #e17055, #d63031);
  transition: width 0.15s ease;
}

.skjerm {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(6px);
}

.skjerm h1 {
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(48px, 16vw, 96px);
  font-weight: 800;
  color: #e17055;
  margin: 0;
  text-shadow: 4px 4px 0 #fdcb6e, -2px -2px 0 rgba(255,255,255,0.5);
  letter-spacing: 2px;
  transform: rotate(-3deg);
}

.skjerm h2 {
  font-family: "Baloo 2", sans-serif;
  font-size: clamp(24px, 6vw, 34px);
  color: #2d3436;
  margin: 0 0 4px;
  max-width: 480px;
}

.tagline {
  font-size: 18px;
  font-weight: 700;
  color: #2d3436;
  margin: 0 0 12px;
}

.hint {
  font-size: 13px;
  color: #2d3436;
  opacity: 0.75;
  max-width: 320px;
  margin: 14px 0 0;
}

.dagens-info {
  font-size: 13px;
  font-weight: 700;
  color: #00786e;
  margin: 10px 0 0;
}

.flibbknapp {
  font-family: "Baloo 2", sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: white;
  background: #e17055;
  border: none;
  border-radius: 999px;
  padding: 18px 52px;
  cursor: pointer;
  box-shadow: 0 6px 0 #b7492f;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  letter-spacing: 1px;
}

.flibbknapp:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 #b7492f;
}

.stats {
  display: flex;
  gap: 18px;
  font-family: "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: #2d3436;
  margin: 6px 0 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.stats .poeng { color: #e17055; }

.flibbknapp.liten {
  font-size: 16px;
  padding: 12px 28px;
}

.lenkeknapp {
  font-family: "Nunito", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #00786e;
  background: none;
  border: none;
  cursor: pointer;
  margin-top: 10px;
  text-decoration: underline;
}

#highscoreSkjema {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 4px 0 10px;
}

#highscoreNavn {
  font-family: "Nunito", sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 2px solid #e17055;
  width: 220px;
  max-width: 80vw;
}

.highscore-liste {
  list-style: none;
  padding: 0;
  margin: 6px 0 16px;
  width: 100%;
  max-width: 320px;
  font-family: "Baloo 2", sans-serif;
}

.highscore-liste li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #2d3436;
}

.highscore-liste li:nth-child(odd) { background: rgba(255,255,255,0.5); }
.highscore-liste li .plass { color: #e17055; width: 26px; }
.highscore-liste li .hs-navn { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.highscore-liste li .hs-poeng { color: #00786e; }

#reglerSkjerm {
  justify-content: flex-start;
  overflow-y: auto;
  padding-top: 40px;
  padding-bottom: 40px;
}

.regel-liste {
  list-style: none;
  padding: 0;
  margin: 6px 0 16px;
  width: 100%;
  max-width: 420px;
  text-align: left;
}

.regel-liste li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #2d3436;
  line-height: 1.4;
}

.regel-liste li:nth-child(odd) { background: rgba(255,255,255,0.5); }
.regel-ikon { font-size: 20px; flex-shrink: 0; }
.regel-tekst { flex: 1; min-width: 0; }
