* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #9fe3ff;
  font-family: "Baloo 2", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #fff;
  user-select: none;
}

#spil { display: block; width: 100vw; height: 100vh; }

[hidden] { display: none !important; }

/* ---------- Skærme: start, pause, slut ---------- */
.skaerm {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(27, 18, 64, 0.45);
}

.boks {
  max-width: 560px;
  width: 100%;
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(74, 44, 140, 0.94), rgba(40, 24, 90, 0.94));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), inset 0 0 0 3px rgba(255, 255, 255, 0.12);
  text-align: center;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(40px, 9vw, 72px);
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffe066;
  text-shadow: 0 4px 0 #ff7a59, 0 8px 18px rgba(0, 0, 0, 0.35);
}

h2 { margin: 0 0 16px; font-size: 32px; }

.maal { font-size: 18px; line-height: 1.4; margin: 0 0 20px; }

button {
  font: inherit;
  font-size: 26px;
  font-weight: 800;
  padding: 12px 52px;
  color: #3a1f00;
  background: linear-gradient(#ffd166, #ff9f43);
  border: none;
  border-radius: 999px;
  box-shadow: 0 5px 0 #c96a1b, 0 8px 16px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.1s;
}
button:hover { transform: translateY(-2px); }
button:active { transform: translateY(3px); box-shadow: 0 2px 0 #c96a1b; }

.styring {
  margin: 24px auto 0;
  border-collapse: collapse;
  font-size: 15px;
  text-align: left;
}
.styring td { padding: 4px 10px; }
.styring td:first-child { text-align: right; white-space: nowrap; }

kbd {
  display: inline-block;
  min-width: 26px;
  padding: 2px 6px;
  margin: 0 1px;
  font: inherit;
  font-weight: 700;
  text-align: center;
  color: #2a1a55;
  background: #f1eaff;
  border-radius: 6px;
  border-bottom: 3px solid #a493d6;
}

.lille { font-size: 13px; opacity: 0.7; margin: 16px 0 0; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6); }

#sigte {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(#fff, #fff) center / 2px 100% no-repeat,
    linear-gradient(#fff, #fff) center / 100% 2px no-repeat;
  mix-blend-mode: difference;
}

#hugge {
  position: absolute;
  left: 50%;
  top: calc(50% + 22px);
  width: 60px;
  height: 6px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
}
#hugge { border-radius: 3px; overflow: hidden; }
#hugge div { height: 100%; width: 0; background: #ffd166; }

#ur {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 16px;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(40, 24, 90, 0.55);
}

#point {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 15px;
  line-height: 1.5;
  text-align: right;
}

#besked {
  position: absolute;
  top: 28%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  transition: opacity 0.4s;
}
#besked.vis { opacity: 1; }

#bund {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#blokNavn { font-size: 18px; font-weight: 700; opacity: 0; }
#blokNavn.vis { animation: tone 1.6s forwards; }
@keyframes tone { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

#hjerter { font-size: 22px; letter-spacing: 1px; color: #ff5d8f; }
#hjerter .tomt { color: rgba(40, 24, 90, 0.5); }

#hotbar {
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(40, 24, 90, 0.5);
  pointer-events: auto;
}

.slot {
  position: relative;
  width: 52px;
  height: 52px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 3px solid transparent;
  transition: transform 0.1s;
}
.slot.valgt { border-color: #ffd166; background: rgba(255, 209, 102, 0.25); transform: translateY(-4px); }
.slot.tom canvas { opacity: 0.3; }
.slot canvas { width: 100%; height: 100%; border-radius: 6px; display: block; }
.slot .nummer { position: absolute; top: 0; left: 3px; font-size: 11px; opacity: 0.8; }
.slot .antal { position: absolute; bottom: 0; right: 3px; font-size: 15px; font-weight: 800; }

#skade { position: absolute; inset: 0; background: #ff0000; opacity: 0; }
#skade.blink { animation: au 0.4s; }
@keyframes au { 0% { opacity: 0.4; } 100% { opacity: 0; } }

@media (max-width: 600px) {
  #ur { font-size: 14px; }
  #point { display: none; }
  .slot { width: 40px; height: 40px; padding: 4px; }
}
