/* Skolappar startmall. Sized for an iPad first; everything scales with the screen. */
:root {
  --bg: #f6f3ea;
  --ink: #1c2233;
  --brand: #1d3577;
  --brand-light: #3457b8;
  --right: #1f8a6f;
  --wrong: #b8601f;
  --card: #ffffff;
  --unit: clamp(14px, 2.6vmin, 26px);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--unit);
  color: var(--ink);
  background: var(--bg);
  /* touch: no double-tap zoom, no pull-to-refresh, no accidental text selection */
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: var(--unit);
  /* keep clear of the notch and the home indicator */
  padding: calc(var(--unit) + env(safe-area-inset-top)) calc(var(--unit) + env(safe-area-inset-right))
           calc(var(--unit) + env(safe-area-inset-bottom)) calc(var(--unit) + env(safe-area-inset-left));
  max-width: 1100px;
  margin: 0 auto;
}
.bar { display: flex; align-items: center; gap: var(--unit); }
.progress { flex: 1; height: 0.9em; border-radius: 99px; background: #dcd6c5; overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 99px; background: var(--right); transition: width 0.3s; }

.screen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--unit) * 1.2); text-align: center; min-height: 0; }
.screen[hidden] { display: none; }
h1, h2 { margin: 0; font-size: 2.6em; line-height: 1.1; }
.lead { margin: 0; font-size: 1.3em; max-width: 24em; }
.stars { margin: 0; font-size: 1.5em; min-height: 1.4em; }

button { font: inherit; color: inherit; border: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 0.2em solid var(--brand-light); outline-offset: 0.15em; }
.primary {
  min-height: 64px; min-width: 9em; padding: 0.6em 1.6em; border-radius: 99px;
  font-size: 1.6em; font-weight: 700; color: #fff; background: var(--brand);
  box-shadow: 0 0.25em 0 #11204a;
}
.primary:active { transform: translateY(0.15em); box-shadow: 0 0.1em 0 #11204a; }
.icon-button { width: 56px; height: 56px; flex: none; border-radius: 50%; font-size: 1.4em; background: var(--card); box-shadow: 0 2px 6px rgb(0 0 0 / 0.15); }

.question { display: flex; align-items: center; gap: var(--unit); }
.prompt { margin: 0; font-size: 2.2em; font-weight: 700; }
.picture { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5em; width: min(60vw, 22em); }
.dot { aspect-ratio: 1; border-radius: 50%; border: 0.18em solid var(--brand); }
.dot.full { background: var(--brand-light); }

.answers { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--unit); width: min(100%, 26em); }
@media (orientation: landscape) { .answers { grid-template-columns: repeat(4, 1fr); width: min(100%, 44em); } }
.answer {
  min-height: 72px; padding: 0.4em; border-radius: 0.6em; font-size: 2.2em; font-weight: 700;
  background: var(--card); box-shadow: 0 0.2em 0 #cfc8b4;
}
.answer:active { transform: translateY(0.1em); }
/* right and wrong are never colour alone: a symbol is added in app.js */
.answer.right { background: var(--right); color: #fff; box-shadow: none; }
.answer.wrong { background: #f3dcc8; color: var(--wrong); box-shadow: none; animation: shake 0.3s; }
.feedback { margin: 0; min-height: 1.6em; font-size: 1.4em; font-weight: 600; }

.reward { position: relative; width: 9em; height: 9em; flex: none; }
.reward span { position: absolute; left: 50%; top: 50%; font-size: 1.6em; animation: burst 1.2s ease-out both; }
@keyframes burst { from { transform: translate(-50%, -50%) scale(0.2); opacity: 0; } 30% { opacity: 1; } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); opacity: 1; } }
@keyframes shake { 25% { transform: translateX(-0.2em); } 75% { transform: translateX(0.2em); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
