/* ==========================================================================
   Hamburger Menu Drawer
   ========================================================================== */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.3s, opacity 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 0;
  box-sizing: border-box;
}

.menu-overlay.is-open {
  visibility: visible;
  opacity: 1;
  transition: visibility 0s, opacity 0.3s ease;
}

.menu-overlay-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(80, 97, 115, 0.45);
  backdrop-filter: blur(8px);
}

.menu-content {
  position: relative;
  width: 88%;
  max-width: 330px;
  max-height: calc(100dvh - 24px);
  z-index: 2010;
  transform: translateY(30px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.menu-overlay.is-open .menu-content {
  transform: translateY(0) scale(1);
}

.menu-header {
  display: none;
}

.close-btn {
  display: none;
}

.menu-card {
  font-family: var(--font-jap);
  background: #fdfbf7;
  border-radius: 24px 30px 20px 35px / 30px 25px 35px 28px;
  padding: 22px 16px 12px;
  box-shadow: 4px 4px 0px #eadebf, 0 12px 36px rgba(0, 0, 0, 0.06);
  border: 2px solid #dfd9c4;
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.menu-card::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  bottom: 5px;
  border: 1px dashed #dfd9c4;
  border-radius: 18px 24px 15px 28px / 24px 18px 28px 22px;
  pointer-events: none;
}

.menu-card-title {
  font-family: var(--font-jap);
  font-size: 14px;
  font-weight: 700;
  color: #63503c;
  text-align: center;
  margin-bottom: 14px;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.menu-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 4px 12px 4px 2px;
  margin: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbb994 #f3edd9;
}

/* Custom Scrollbar for Menu List (Matching Disclaimer Modal Exactly) */
.menu-list::-webkit-scrollbar {
  width: 5px;
  display: block;
}

.menu-list::-webkit-scrollbar-track {
  background: #f3edd9;
  border-radius: 4px;
}

.menu-list::-webkit-scrollbar-thumb {
  background: #cbb994;
  border-radius: 4px;
}

.menu-list::-webkit-scrollbar-thumb:hover {
  background: #b5a17a;
}

.menu-list li {
  margin-bottom: 8px;
}

.menu-list li:last-child {
  margin-bottom: 0;
}

.menu-link {
  font-family: var(--font-jap);
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border: 1.5px solid #dfd9c4;
  border-radius: 10px 8px 12px 9px / 9px 10px 8px 11px;
  background: #ffffff;
  color: var(--color-text-dark);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
  box-shadow: 2px 2px 0px rgba(223, 217, 196, 0.3);
}

.menu-link:hover,
.menu-link:active {
  background: var(--color-accent-yellow-light);
  border-color: #dcb871;
  color: #5c4a2b;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px #dcb871;
}

.menu-icon {
  margin-right: 10px;
  font-size: 15px;
}

.menu-card-footer {
  text-align: center;
  font-size: 8px;
  color: var(--color-main);
  margin-top: 18px;
  font-family: var(--font-eng);
  letter-spacing: 1px;
}

/* Drawer Menu PC Overrides */
@media (min-width: 769px) {
  .menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding-top: 85px;
    padding-right: 30px;
    background: transparent;
    pointer-events: auto;
    overflow: hidden;
  }

  .menu-overlay-bg {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    backdrop-filter: none;
  }

  .menu-content {
    width: 360px;
    height: auto;
    max-height: calc(100vh - 110px);
    margin: 0;
    position: relative;
    z-index: 2010;
    transform: translateX(100%) scale(1);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
  }

  .menu-overlay.is-open .menu-content {
    transform: translateX(0) scale(1);
  }

  .menu-header {
    display: none;
  }

  .close-btn {
    display: none;
  }

  .menu-card {
    background: #fdfbf7;
    border: 2px solid #dfd9c4;
    border-radius: 24px 30px 20px 35px / 30px 25px 35px 28px;
    box-shadow: 4px 4px 0px #eadebf, 0 12px 36px rgba(0, 0, 0, 0.06);
    padding: 16px 14px 14px;
    position: relative;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbb994 #f3edd9;
  }

  .menu-card::-webkit-scrollbar {
    width: 5px;
    display: block;
  }

  .menu-card::-webkit-scrollbar-track {
    background: #f3edd9;
    border-radius: 4px;
  }

  .menu-card::-webkit-scrollbar-thumb {
    background: #cbb994;
    border-radius: 4px;
  }

  .menu-card-title {
    font-family: var(--font-jap);
    font-size: 13px;
    font-weight: 700;
    color: #63503c;
    text-align: center;
    margin-bottom: 10px;
    line-height: 1.3;
  }

  .menu-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0;
    overflow-y: auto;
  }

  .menu-list li {
    margin-bottom: 0;
  }

  .menu-link {
    display: flex;
    align-items: center;
    padding: 6.5px 10px;
    border: 1.5px solid #dfd9c4;
    border-radius: 10px 8px 12px 9px / 9px 10px 8px 11px;
    background: #ffffff;
    color: var(--color-text-dark);
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 2px 2px 0px rgba(223, 217, 196, 0.3);
    transition: all 0.2s ease;
  }

  .menu-link:hover {
    background: var(--color-accent-yellow-light);
    border-color: #dcb871;
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px #dcb871;
    color: #5c4a2b;
  }

  .menu-icon {
    font-size: 14px;
    margin-right: 8px;
  }

  .menu-card-footer {
    text-align: center;
    font-size: 11px;
    color: var(--color-main);
    margin-top: 12px;
    font-family: var(--font-eng);
    letter-spacing: 1px;
  }
}

/* ==========================================================================
   Stamp Rally & Ending Menu Styles
   ========================================================================== */
.stamp-rally-panel {
  background: #f7f3e8;
  border: 1.5px solid #e5dec9;
  border-radius: 12px;
  padding: 6px 8px 8px;
  margin-top: 8px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.stamp-rally-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  padding: 0 2px;
}

.stamp-rally-title {
  font-family: var(--font-eng);
  font-size: 9.5px;
  font-weight: 700;
  color: #63503c;
  letter-spacing: 0.5px;
}

.stamp-count-badge {
  font-family: var(--font-eng);
  font-size: 9.5px;
  font-weight: 800;
  color: #d97706;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 1px 6px;
}

.stamp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.stamp-rally-note {
  font-family: var(--font-jp);
  font-size: 10px;
  font-weight: 500;
  color: #8c7b6b;
  text-align: center;
  margin-top: 6px;
  margin-bottom: 0;
  line-height: 1.3;
}

.stamp-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1.5px solid #e5dec9;
  border-radius: 8px;
  padding: 4px 2px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stamp-icon {
  font-size: 13px;
  color: #c8bfab;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stamp-slot.is-stamped {
  background: #fffdf0;
  border-color: #fcd34d;
  box-shadow: 0 2px 6px rgba(245, 182, 39, 0.18);
}

.stamp-slot.is-stamped .stamp-icon {
  color: #f5b627;
  transform: scale(1.25);
}

.stamp-label {
  font-family: var(--font-eng);
  font-size: 8.5px;
  font-weight: 700;
  color: #8c7b6b;
  margin-top: 2px;
  white-space: nowrap;
}

/* Finale Special Gorgeous Crown Stamp Styling */
.stamp-slot-finale {
  border: 1.5px solid #e5dec9;
  background: #ffffff;
}

.stamp-slot-finale .stamp-icon {
  font-size: 13px;
  color: #c8bfab;
}

.stamp-slot-finale.is-stamped {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4), inset 0 0 8px rgba(255, 255, 255, 0.9);
  animation: finaleStampPulse 2s infinite alternate;
}

.stamp-slot-finale.is-stamped .stamp-icon {
  color: #d97706;
  font-size: 14px;
  filter: drop-shadow(0 2px 4px rgba(217, 119, 6, 0.5));
  transform: scale(1.35) rotate(-5deg);
}

.stamp-slot-finale.is-stamped .stamp-label {
  color: #78350f;
  font-weight: 800;
}

@keyframes finaleStampPulse {
  0% {
    box-shadow: 0 0 5px rgba(245, 158, 11, 0.3);
  }

  100% {
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.7), 0 2px 8px rgba(251, 191, 36, 0.5);
  }
}

/* Ending Menu Link */
.menu-item-ending {
  margin-top: 4px;
}

.ending-link.is-locked {
  background: #f3efe6;
  border-color: #dfd9c4;
  color: #948574;
  opacity: 0.85;
  cursor: pointer;
}

.ending-link.is-locked:hover {
  background: #ebe5d7;
  border-color: #cbbe9f;
  color: #63503c;
  transform: none;
  box-shadow: 2px 2px 0px rgba(223, 217, 196, 0.3);
}

.ending-link.is-unlocked {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #f59e0b;
  color: #78350f;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
  animation: endingGlow 2.5s infinite alternate;
}

.ending-link.is-unlocked:hover {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #d97706;
  transform: translate(-1px, -2px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.45);
}

@keyframes endingGlow {
  0% {
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.3);
  }

  100% {
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.6);
  }
}