/* RESET */
* {
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', 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;
}

/* =========================
   TOP NAV (iOS SEGMENTED CONTROL)
========================= */

.topNav {
        display: flex;
    justify-content: space-between;
    gap: 1em;
    align-items: center;
    position: absolute;
    top: 2em;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 100%;
    height: 50px;
    z-index: 100;
}

/* LEFT SIDE */
.navLeft {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navLabel {
  font-size: 0.95em;
  font-weight: 600;
  color: #7E522F;
  white-space: nowrap;
}

/* SEGMENTED CONTROL WRAPPER */
.lengthFilter {
  display: flex;
  background: #fff;
  padding: 4px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(252, 235, 210, 1);
  gap: 4px;
}

.lengthFilter {
  position: relative;
}

/* 🔥 MOVING PILL */
.pill {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 47px;
  height: 40px;
  background: #7E522F;
  border-radius: 999px;
  /* transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); */
  z-index: 0;
}

/* keep buttons above pill */
.lengthFilter button {
  position: relative;
  z-index: 1;
}

/* SEGMENT BUTTONS */
.lengthFilter button {
  border: none;
  background: transparent;
  border-radius: 12px;
  font-weight: 300;
  cursor: pointer;
  transition: all 0.2s ease;
  /* width: 52px; */
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7E522F;
}

/* ACTIVE STATE */
.lengthFilter button.active {
  background: #7E522F;
  color: white;
  border-radius: 8px;
  /* box-shadow: 0 6px 14px rgba(126, 82, 47, 0.25); */
}

/* PRESS FEEDBACK */
.lengthFilter button:active {
  transform: scale(0.95);
}

/* RIGHT SIDE */
.navRight {
  display: flex;
  align-items: center;
  gap: 1em;
}

/* MUTE BUTTON */
.muteBtn {
 width: 46px;
    height: 46px;
    border-radius: 12px;
    border: none;
    font-size: 18px;
    background: #fff;
    cursor: pointer;
    /* box-shadow: 0 10px 30px rgba(252, 235, 210, 1); */
    border: 1px solid #CDBFAB;
    transition: all 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}


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

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

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

.game {
  max-width: 600px;
  margin: auto;
}

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

/* BUTTON */
button {
  background: #fff;
  border: 1px solid #CDBFAB;

  padding: 12px 18px;
  color: #7E522F;
  border-radius: 100px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
    align-items: center;
}

.speakerIcon {
    margin-right: .25rem;
}

/* IMAGE */
.animal img {
  width: clamp(160px, 45vw, 300px);
  margin: 0;
  border-radius: 12px;
  margin-bottom: 1em;
}


.animal {
  margin-top: 0.5em;
}

/* =========================
   SLOTS
========================= */

.slot.correct {
  pointer-events: none;
}

.shared-tile {
  border: 3px solid rgba(0,0,0,0.25);
  box-shadow: 0 2px 0 rgba(0,0,0,0.15);
  font-weight: 700;
  border-radius: 10px;
  color: #fff;
  -webkit-text-stroke: 1px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.correct {
  background: #4caf50 !important;
  color: #fff !important;
  -webkit-text-stroke: 1px rgba(0,0,0,0.15);
}

.slots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(4px, 1.5vw, 10px);
  margin-top: 0px;
  width: 100%;
  padding: 0 1em;
  box-sizing: border-box;
}

.slot {
  width: clamp(44px, 11vw, 70px);
  height: clamp(44px, 11vw, 70px);
  border: 2px dashed #DBCFC4;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(20px, 5vw, 32px);
  background: #F9F2E9;
  transition: 0.2s ease;
  flex-shrink: 0;
}

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

.slot .letter {
  width: clamp(44px, 14vw, 70px);
  height: clamp(44px, 1vw, 70px);
  font-size: clamp(18px, 4.5vw, 30px);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: none !important;
}

.slot.filled {
  border: none;
}

.slot.correct {
  background: #4caf50;
  color: white;
  border: none;
  /* base fill (you already set via JS pastel) */
  color: white;
  /* 🧠 LETTER STROKE */
  -webkit-text-stroke: 2px rgba(0,0,0,0.25);
  /* fallback for non-webkit */
  text-shadow:
    1px 0 rgba(0,0,0,0.25),
   -1px 0 rgba(0,0,0,0.25),
    0 1px rgba(0,0,0,0.25),
    0 -1px rgba(0,0,0,0.25);
  /* subtle depth */
  box-shadow:
    0 3px 0 rgba(0,0,0,0.12);
    position: relative;
}

.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;
  color: white;
  border: none;
  animation: shake 0.35s ease;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

/* active validation pulse */
.slot.active {
  transform: scale(1.2);
  transition: transform 0.2s ease;
  z-index: 10;
}

/* snap bounce */
.slot.snap {
  animation: snapBounce 0.2s ease;
}

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

/* =========================
   LETTERS
========================= */

.letters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(6px, 2vw, 12px);
  margin-top: 3em;
  width: 80%;
  max-width: 420px;
}

.letter.used {
  opacity: 0.25;
  background: rgba(0,0,0,0.25)!important;
}

.letter {
  position: relative;
  width: clamp(48px, 14vw, 64px);
  height: clamp(48px, 14vw, 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(20px, 5.5vw, 28px);
  font-weight: 800;
  border-radius: 16px;
  box-sizing: border-box;
  color: white;
  -webkit-text-stroke: 1px rgba(0,0,0,0.25);
  text-shadow:
    1px 0 rgba(0,0,0,0.25),
   -1px 0 rgba(0,0,0,0.25),
    0 1px rgba(0,0,0,0.25),
    0 -1px rgba(0,0,0,0.25);
  touch-action: none;
  user-select: none;
  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);
}



#letters {
  min-height: 80px; /* match your letter row height */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================
   SUCCESS
========================= */

.success {
  margin-top: 20px;
}

.successName {
  background-color: #C8E6C9;
  border-radius: 5px;
  color: #43A047;
  margin-bottom: 30px;
  padding: 15px 0;
}

.successWrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.mb-20 {
  margin-bottom: 20px;
}

.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  display: inline-block;
  padding: 30px;
  border: 1px solid #7E522F;
}

.card img {
  border-radius: 12px;
}

.hidden {
  display: none;
}

.guessNewBtn {
  color: #fff;
  background-color: #EA5783;
  border: 1px solid #9D1D43;
}

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

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

/* =========================
   NEW ANIMAL BUTTON
========================= */

.nextAnimalBtn {
  padding: 12px 18px;
    background: #EA5783;
    border: 1px solid #9D1D43;
    color: #fff;
    border-radius: 100px;
    font-size: 16px;
    cursor: pointer;
}

/* =========================
   SETTINGS MODAL
========================= */

.settingsOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.settingsOverlay.open {
  display: flex;
}

.settingsPanel {
  background: #FFF9F0;
  border-radius: 16px;
  padding: 24px;
  min-width: 280px;
  max-width: 360px;
  width: 90%;
  position: relative;
}

.settingsCloseBtn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #888;
  line-height: 1;
}

.settingsTitle {
  margin: 0 0 20px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.settingsRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.borderBottom {
    border-bottom: 1px solid #CDBFAB;
padding-bottom: 1em;
}


.borderTop {
    border-top: 1px solid #CDBFAB;
padding-top: 1em;
}

.settingsRow:last-child {
  margin-bottom: 0;
}

.settingsLabel {
  font-size: 1em;
  color: #555;
}

#settingsModal {
  display: none;
}

#settingsModal.open {
  display: flex;
}



/* =========================
    LEVELS
========================= */

.levelBar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}

.levelNode {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s ease;
}

/* completed */
.levelNode.done {
  background: #e0e0e0;
  color: #777;
  opacity: 0.8;
}

/* current */
.levelNode.current {
  background: #4caf50;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* future */
.levelNode.future {
  border: 2px solid #4caf50;
  color: #4caf50;
  background: transparent;
}



.menu-btn {
  display: none;
  font-size: 18px;
  background: none;
  border: none;
  cursor: pointer;
}

/* mobile only */
@media (max-width: 768px) {
  .menu-btn {
    display: block;
  }

  nav .nav-links {
    display: none; /* hide normal nav */
  }
}


/* =========================
    MENU
========================= */

/* hide menu button on desktop */
.menuBtn {
  display: none;
}

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

  .menuBtn {
    display: block;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    background: var(--maroon);
    color: var(--white) !important;
    padding: 10px 28px;
    border-radius: 50px;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
    box-shadow: 0 4px 14px rgba(92, 26, 46, 0.25);
  }

  .muteBtn {
    width: 100%;
  }

  .caseBtn {
    width: 100%;
  }

  .letters {
    margin-top: 2em;
}
}

/* 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 {
  float: right;
  font-size: 20px;
  background: none;
  border: none;
  cursor: pointer;
}


.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;
}

.nextArrow {
  width: 1.5em;
  margin-left: .5em;
}
