* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1230;
  font-family: "Trebuchet MS", "Comic Sans MS", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
  display: block;
}

/* Tillbaka-till-menyn-knapp — alltid uppe i hörnet */
.back-btn {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 20;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 3px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  font-size: 32px;
  text-decoration: none;
  backdrop-filter: blur(4px);
}

.back-btn:active { transform: scale(0.92); }

/* Helskärms-överlägg för start / laddning / fel */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #4b2c8f 0%, #7e3ff2 45%, #f0793b 100%);
  z-index: 10;
}

.overlay.hidden { display: none; }

.card {
  text-align: center;
  padding: 48px 56px;
  background: rgba(255, 255, 255, 0.14);
  border: 4px solid rgba(255, 255, 255, 0.5);
  border-radius: 36px;
  backdrop-filter: blur(6px);
  max-width: 680px;
}

.title {
  font-size: clamp(40px, 8vw, 78px);
  color: #fff;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
  letter-spacing: 1px;
}

.bigfruits {
  font-size: clamp(60px, 14vw, 120px);
  margin: 18px 0;
  line-height: 1;
}

.howto {
  font-size: clamp(20px, 3.4vw, 28px);
  color: #fff;
  line-height: 1.5;
  white-space: pre-line;
}

.note {
  margin-top: 22px;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.85);
}

/* Stor rund spelknapp */
.play-btn {
  margin-top: 28px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: none;
  background: #ffd84d;
  color: #c2410c;
  font-size: 64px;
  cursor: pointer;
  box-shadow: 0 8px 0 #d9a400, 0 12px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s ease;
}

.play-btn.small {
  width: 96px;
  height: 96px;
  font-size: 44px;
  margin-top: 20px;
}

.play-btn:hover { transform: scale(1.05); }
.play-btn:active { transform: translateY(6px) scale(1); box-shadow: 0 2px 0 #d9a400; }

/* Sammanfattning */
.results-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 24px 0 10px;
}

.score-big {
  font-size: clamp(56px, 12vw, 96px);
  font-weight: bold;
  color: #ffd84d;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
  line-height: 1;
}

.thumb-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 480px;
}

.thumb {
  font-size: 38px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}

.thumb.win { background: rgba(54, 196, 74, 0.92); }
.thumb.miss { background: rgba(230, 72, 60, 0.85); }

/* Laddningssnurra */
.spinner {
  width: 84px;
  height: 84px;
  margin: 10px auto 24px;
  border: 10px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffd84d;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
