*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Fredoka", system-ui, sans-serif;
  background: #0d1f2d;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  background: #1a3a52;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.panel {
  background: linear-gradient(145deg, rgba(255, 62, 138, 0.95), rgba(255, 140, 66, 0.92));
  border: 4px solid #1a0a14;
  border-radius: 20px;
  box-shadow:
    0 6px 0 #1a0a14,
    inset 0 2px 0 rgba(255, 255, 255, 0.35);
}

#score-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 10px 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

#score-panel .label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff5f8;
  text-shadow: 0 2px 0 #1a0a14;
}

#score-value {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  text-shadow:
    3px 3px 0 #1a0a14,
    -1px -1px 0 #1a0a14,
    1px -1px 0 #1a0a14,
    -1px 1px 0 #1a0a14;
  line-height: 1.1;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 18, 32, 0.55);
  pointer-events: auto;
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  padding: 28px 36px 32px;
  max-width: 90vw;
  text-align: center;
}

.kid-portrait {
  display: block;
  margin: 0 auto 12px;
  width: min(160px, 42vw);
  height: auto;
  aspect-ratio: 160 / 200;
  border-radius: 20px;
  border: 4px solid #1a0a14;
  background: linear-gradient(180deg, #7dd3fc 0%, #bae6fd 100%);
  box-shadow:
    0 4px 0 #1a0a14,
    inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.kid-portrait.hidden {
  display: none;
}

.overlay-card h1 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  color: #fff;
  text-shadow:
    4px 4px 0 #1a0a14,
    -1px -1px 0 #1a0a14;
  letter-spacing: 0.02em;
}

.overlay-msg {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff8fc;
  text-shadow: 0 2px 0 #1a0a14;
}

.hint {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

.hint.goal {
  margin-bottom: 20px;
  font-weight: 600;
  color: #fef08a;
  text-shadow: 0 2px 0 #1a0a14;
}

.btn {
  pointer-events: auto;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 12px 32px;
  border: 4px solid #1a0a14;
  border-radius: 16px;
  background: linear-gradient(180deg, #c8ff4a 0%, #7ae612 45%, #4bc00a 100%);
  color: #0d2a08;
  cursor: pointer;
  box-shadow: 0 5px 0 #1a0a14;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn:hover {
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #1a0a14;
}
