body {
  background: linear-gradient(160deg, #ffb3c6, #f72585 70%, #b5179e);
  color: #14213d;
}

.topbar {
  position: fixed;
  z-index: 40;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.lvl {
  height: 56px;
  padding: 0 18px;
  border-radius: 28px;
  border: 3px solid #fff;
  background: rgba(255, 255, 255, 0.45);
  font-size: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lvl.on {
  background: #fff;
  box-shadow: 0 0 0 4px #ffd166, 0 2px 8px rgba(0, 0, 0, 0.25);
}

.stars {
  position: fixed;
  z-index: 40;
  top: max(8px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 24px;
  font-weight: 800;
  gap: 6px;
}

#game {
  position: fixed;
  inset: max(80px, calc(env(safe-area-inset-top) + 72px)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  gap: 2vmin;
}

/* ---------- big vowel card ---------- */
.letter {
  border: max(6px, 1vmin) solid #fff;
  border-radius: 8vmin;
  background: var(--c, #ef476f);
  color: #fff;
  font-size: 24vmin;
  font-weight: 900;
  line-height: 1;
  padding: 1vmin 6vmin;
  box-shadow: 0 1.5vmin 0 rgba(0, 0, 0, 0.2);
  text-shadow: 0 0.8vmin 0 rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.letter small {
  font-size: 0.6em;
  opacity: 0.9;
}

.letter:active, .pic:active, .vow:active, .big-pic:active {
  transform: translateY(0.8vmin) scale(0.97);
}

/* ---------- picture choices ---------- */
.choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3vmin;
}

.pic {
  width: 26vmin;
  min-width: 140px;
  padding: 1.5vmin;
  border: max(5px, 0.8vmin) solid #fff;
  border-radius: 5vmin;
  background: #fff;
  box-shadow: 0 1.2vmin 0 rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5vmin;
}

.pic .emoji {
  font-size: 16vmin;
  line-height: 1.1;
}

.pic .word {
  font-size: 4.5vmin;
  font-weight: 800;
  color: #14213d;
}

.pic .word b {
  color: var(--c);
}

.pic.wrong {
  animation: shake 0.4s;
  background: #ffd6d6;
}

.pic.right {
  background: #d8f5e5;
  border-color: #06d6a0;
  animation: happy 0.6s;
}

/* ---------- hard level ---------- */
.big-pic {
  border: none;
  background: #fff;
  border-radius: 8vmin;
  padding: 1vmin 5vmin;
  font-size: 24vmin;
  line-height: 1.15;
  box-shadow: 0 1.2vmin 0 rgba(0, 0, 0, 0.2);
}

.slots {
  display: flex;
  gap: 1.2vmin;
  font-size: 15vmin;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0.6vmin 0 rgba(0, 0, 0, 0.25);
}

.slots .gap {
  min-width: 0.8em;
  text-align: center;
  border-bottom: 1.4vmin solid #ffd166;
  color: #ffd166;
  animation: blink 1s ease-in-out infinite;
}

.slots .gap.filled {
  border-bottom-color: transparent;
  color: #fff;
  animation: happy 0.6s;
}

.vowels {
  display: flex;
  gap: 2vmin;
}

.vow {
  width: 15vmin;
  height: 15vmin;
  border-radius: 50%;
  border: max(5px, 0.8vmin) solid #fff;
  background: var(--c);
  color: #fff;
  font-size: 9vmin;
  font-weight: 900;
  box-shadow: 0 1vmin 0 rgba(0, 0, 0, 0.2);
  text-shadow: 0 0.5vmin 0 rgba(0, 0, 0, 0.2);
}

.vow.wrong {
  animation: shake 0.4s;
  opacity: 0.5;
}

/* ---------- celebration ---------- */
#bravo {
  position: fixed;
  z-index: 60;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 12vmin;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1vmin 0 rgba(0, 0, 0, 0.3);
  pointer-events: none;
  white-space: nowrap;
}

#bravo.show {
  animation: bravo 1.1s ease-out;
}

.enter {
  animation: pop-in 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes pop-in { from { transform: scale(0.6); opacity: 0; } }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-1.5vmin); }
  75% { transform: translateX(1.5vmin); }
}

@keyframes happy {
  50% { transform: scale(1.12) rotate(-3deg); }
}

@keyframes blink {
  50% { opacity: 0.45; }
}

@keyframes bravo {
  0% { transform: translate(-50%, -50%) scale(0); }
  25% { transform: translate(-50%, -50%) scale(1.15); }
  70% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
