* { box-sizing: border-box; }
body {
  margin: 0 auto;
  max-width: 960px;
  padding: 12px;
  font-family: ui-rounded, "Nunito", system-ui, sans-serif;
  color: #2b2340;
  background: #fff4cf;
}
header { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
h1 { margin: 8px 0; font-size: clamp(1.45rem, 5vw, 2.25rem); }
.tagasi { color: inherit; font-weight: 900; }
#mang {
  position: relative;
  overflow: hidden;
  border: 4px solid #2b2340;
  border-radius: 20px;
  background: #d4f1de;
  box-shadow: 0 10px 0 #d99c54;
  touch-action: none;
}
#vaade { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
#info {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: white;
  font-size: clamp(.8rem, 2.6vw, 1.15rem);
  font-weight: 900;
  text-shadow: 0 2px 3px #000;
  pointer-events: none;
}
#teade {
  position: absolute;
  inset: 10% 12%;
  display: none;
  place-content: center;
  padding: 20px;
  text-align: center;
  color: #2b2340;
  background: rgba(255, 247, 213, 0.96);
  border: 4px solid #2b2340;
  border-radius: 22px;
}
#teade.nahtav { display: grid; }
#teade h2 { margin: 0 0 8px; font-size: clamp(1.35rem, 4vw, 2.2rem); }
#teade p { margin: 0 0 14px; }
#alusta {
  justify-self: center;
  padding: 12px 24px;
  border: 3px solid #2b2340;
  border-radius: 999px;
  color: #2b2340;
  background: #8ee46b;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 5px 0 #2b2340;
}
#alusta:active { transform: translateY(4px); box-shadow: 0 1px 0 #2b2340; }
#nupud {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(48px, 72px));
  justify-content: center;
  gap: 8px;
}
#nupud button {
  min-height: 54px;
  border: 3px solid rgba(255,255,255,.9);
  border-radius: 16px;
  color: white;
  background: rgba(43,35,64,.68);
  font-size: 1.6rem;
  font-weight: 900;
  user-select: none;
  -webkit-user-select: none;
}
#nupud button[data-key="curl"] { background: rgba(154, 106, 72, .85); }
#nupud button.vajutatud { background: rgba(255, 170, 55, .9); }
.abi { text-align: center; font-weight: 700; }
@media (hover: hover) and (pointer: fine) and (min-width: 700px) {
  #nupud { opacity: .38; }
}
@media (max-width: 520px) {
  body { padding: 6px; }
  #info { top: 6px; left: 8px; right: 8px; }
  #teade { inset: 4% 5% 28%; padding: 7px; }
  #teade h2 { margin-bottom: 4px; font-size: 1.05rem; line-height: 1.05; }
  #teade p { margin-bottom: 5px; font-size: .74rem; line-height: 1.08; }
  #alusta { padding: 7px 18px; font-size: .9rem; box-shadow: 0 3px 0 #2b2340; }
  #nupud { bottom: 5px; gap: 5px; grid-template-columns: repeat(5, 1fr); }
  #nupud button { min-height: 43px; font-size: 1.3rem; }
  .abi { font-size: .85rem; }
}
