/* RESET */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; }

body {
  font-family: 'Baloo 2', system-ui, sans-serif;
  text-align: center;
  background: #FFF9F0;
  height: 100%;
}

a {
  text-decoration: none;
  font-weight: 600;
  font-size: 1.25rem;
  color: #5c1a2e;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.25em;
}

.backArrow { width: 0.75em; }

/* =========================
   NAV
========================= */


.muteBtn, .caseBtn {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid #CDBFAB;
  font-size: 18px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

/* =========================
   LAYOUT
========================= */

.container {
  width: 100%;
  height: calc(100vh - 77px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 90px;
  padding-bottom: 2em;
}

.roundContainer {
    gap: 0.5em;
    display: flex;
    flex-direction: column;
}

.game { max-width: 600px; width: 100%; margin: auto; padding: 0 1em; }

.gameArea {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.5em;
}

/* =========================
   SCORE / STREAK
========================= */

.scoreBar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1em;
}

#scoreText {
  font-weight: 700;
  font-size: 1rem;
  color: #7E522F;
  background: #fff;
  border: 1px solid #CDBFAB;
  border-radius: 999px;
  padding: 6px 18px;
}

.streakDisplay {
  font-size: 1.25rem;
  min-height: 1.5em;
  display: flex;
  gap: 2px;
}

/* =========================
   INSTRUCTION CARD
========================= */

.instructionCard {
  display: flex;
  align-items: center;
  color: #7E522F;
  font-size: 1.5rem;
  font-weight: 600;
}

.instructionIcon { font-size: 1.25em; }

/* =========================
   BIG LETTER DISPLAY
========================= */

.bigLetterWrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
}

.bigLetter {
  width: clamp(100px, 28vw, 160px);
  height: clamp(100px, 28vw, 160px);
  background: #5E35B1;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(52px, 14vw, 90px);
  font-weight: 800;
  color: #fff;
  /* -webkit-text-stroke: 2px rgba(0,0,0,0.2); */
  box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 10px 30px rgba(126,82,47,0.25);
  position: relative;
  transition: transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.bigLetter::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  border: 3px solid rgba(255,255,255,0.2);
  transform: rotate(-1deg);
}

.bigLetter.pop {
  animation: bigPop 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bigPop {
  0% { transform: scale(0.5) rotate(-8deg); opacity: 0.3; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.bigLetterLabel {
  font-size: 0.85rem;
  color: #CDBFAB;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =========================
   SLOTS  (single slot — inherits shared styles)
========================= */

.slots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0 1em;
}

.slot {
  width: clamp(64px, 18vw, 90px);
  height: clamp(64px, 18vw, 90px);
  border: 2px dashed #DBCFC4;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(28px, 8vw, 44px);
  font-weight: 800;
  background: #F9F2E9;
  transition: 0.2s ease;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
}

.slot.highlight {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.15);
}

.slot.filled {
  border: none;
  color: #fff;
  -webkit-text-stroke: 1px rgba(0,0,0,0.25);
}

.slot.correct {
  background: #4caf50 !important;
  color: #fff !important;
  border: none;
  -webkit-text-stroke: 1px rgba(0,0,0,0.15);
  box-shadow: 0 3px 0 rgba(0,0,0,0.12);
  pointer-events: none;
}

.slot.correct::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 2px solid rgba(0,0,0,0.25);
  transform: rotate(-1.2deg);
}

.slot.correct::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 14px;
  border: 2px dashed rgba(0,0,0,0.2);
  transform: rotate(0.8deg);
}

.slot.wrong {
  background: #ff4d4d !important;
  color: white !important;
  border: none;
  animation: wobble 0.4s ease;
}

/* =========================
   LETTER OPTIONS
========================= */

.letters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(8px, 2.5vw, 14px);
  width: 90%;
  max-width: 460px;
  min-height: 80px;
  align-items: center;
}

.letter {
  position: relative;
  width: clamp(54px, 16vw, 72px);
  height: clamp(54px, 16vw, 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(22px, 6vw, 32px);
  font-weight: 800;
  border-radius: 16px;
  color: white;
  -webkit-text-stroke: 1px rgba(0,0,0,0.25);
  touch-action: none;
  user-select: none;
  cursor: pointer;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.letter::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 2px solid rgba(0,0,0,0.25);
  transform: rotate(-1.2deg);
}

.letter::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 14px;
  border: 2px dashed rgba(0,0,0,0.2);
  transform: rotate(0.8deg);
}

.letter:active { transform: scale(0.92); }

.letter.used {
  opacity: 0.3;
  filter: grayscale(1);
  pointer-events: none;
  transform: scale(0.95);
}

/* =========================
   ANIMATIONS
========================= */

@keyframes wobble {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-6px); }
  40%  { transform: translateX(6px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

@keyframes snapBounce {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes wavePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35) rotate(-3deg); }
  70%  { transform: scale(0.95) rotate(2deg); }
  100% { transform: scale(1); }
}

/* =========================
   NEXT ROUND BUTTON
========================= */

.nextRoundBtn {
  padding: 14px 28px;
  background: #EA5783;
  border: 1px solid #9D1D43;
  color: #fff;
  border-radius: 100px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5em;
  transition: transform 0.15s ease;
  font-family: 'Baloo 2', sans-serif;
}

.nextRoundBtn:active { transform: scale(0.96); }

.nextArrow { width: 1.4em; }

/* =========================
   CONFETTI
========================= */

#confettiCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* =========================
   MOBILE
========================= */

.menuBtn { display: none; }

@media (max-width: 768px) {
  .nav-links { display: none; }

  .menuBtn {
    display: block;
    background: #5c1a2e;
    color: #fff;
    padding: 10px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    font-family: 'Baloo 2', sans-serif;
  }

  .muteBtn { width: 100%; }
  .letters { margin-top: 1em; }
}

/* MODAL */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 999;
}

.mobile-menu.open {
  display: flex;
  justify-content: center;
  align-items: center;
}

.mobile-menu-content {
  background: #fdf5ed;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 320px;
}

.close-menu {
  font-size: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
}

.modal-controls {
  margin-top: 1em;
  display: flex;
  flex-direction: row;
  gap: 1em;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1em;
}

.modal-header p {
  font-weight: 800;
  font-size: 1.25rem;
  color: #5c1a2e;
}