:root {
  --sky-top: #ffe2a3;
  --sky-bot: #f6b65e;
  --ink: #2b2f36;
  --panel: rgba(255, 252, 244, 0.96);
  --accent: #e2703a;
  --accent-2: #3f9d4f;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--sky-bot);
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#wrap {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* geluid-knop */
.mute {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 14px;
  z-index: 30;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: transform 0.1s ease, background 0.2s ease;
}
.mute:active { transform: scale(0.92); }

/* overlays */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(60, 36, 12, 0.28);
  backdrop-filter: blur(2px);
  animation: fade 0.25s ease;
}
.overlay.hidden { display: none; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.panel {
  width: min(440px, 92vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--panel);
  border-radius: 22px;
  padding: 26px 24px 24px;
  text-align: center;
  box-shadow: 0 22px 60px rgba(60, 36, 12, 0.35);
  animation: pop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

@keyframes pop {
  from { transform: translateY(14px) scale(0.96); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.logo {
  margin: 4px 0 6px;
  font-size: clamp(40px, 12vw, 64px);
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--accent-2);
  text-shadow: 0 3px 0 rgba(44, 122, 57, 0.25);
}

.grade {
  margin: 2px 0 8px;
  font-size: clamp(30px, 9vw, 44px);
  font-weight: 900;
  color: var(--accent);
}

.sub {
  margin: 0 0 16px;
  font-size: 16px;
  opacity: 0.78;
}

.howto {
  text-align: left;
  display: grid;
  gap: 10px;
  margin: 0 auto 20px;
  font-size: 14.5px;
  line-height: 1.5;
}
.ht { background: rgba(63, 157, 79, 0.09); border-radius: 12px; padding: 10px 12px; }
.ht b { color: var(--accent-2); }

.kbd {
  display: inline-block;
  padding: 1px 8px;
  margin: 0 1px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
  font-size: 12.5px;
  font-weight: 700;
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 14px;
  padding: 15px 26px;
  font-size: 17px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.btn:active { transform: translateY(2px) scale(0.98); }
.btn.primary {
  background: linear-gradient(180deg, #f4894f, var(--accent));
  color: #fff;
  box-shadow: 0 6px 0 #b9531f, 0 12px 24px rgba(226, 112, 58, 0.4);
}
.btn.primary:active { box-shadow: 0 2px 0 #b9531f, 0 6px 14px rgba(226, 112, 58, 0.4); }

.best { margin: 16px 0 2px; font-size: 14px; font-weight: 700; opacity: 0.7; }

.r-text { margin: 0 0 14px; font-size: 15.5px; opacity: 0.82; }

.r-stats {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin: 0 0 22px;
}
.r-stats .st { display: grid; gap: 2px; }
.r-stats .st .v { font-size: 30px; font-weight: 900; color: var(--ink); }
.r-stats .st .l { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.6; }
.r-stats .st.new .v { color: var(--accent); }
