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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, sans-serif;
  background: #2b292b;
  color: #e8e3d8;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.game-container {
  max-width: 100%;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile Safari */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 2rem;
  /* background: #2b2b2b;
  border-bottom: 1px solid #1a1a1a; */
}

header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #c9a961;
  letter-spacing: 0.5px;
}

.mode-selector {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem;
  border-radius: 25px;
}

.mode-btn {
  padding: 0.5rem 1.5rem;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.mode-btn:hover {
  color: rgba(255, 255, 255, 0.9);
}

.mode-btn.active {
  background: #c9a961;
  color: #2b2b2b;
}

.stats {
  display: flex;
  gap: 2rem;
  font-size: 1.1rem;
}

.stats span {
  background: rgba(201, 169, 97, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  color: #e8e3d8;
}

#score,
#streak {
  font-weight: bold;
  color: #c9a961;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.draw-pile-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1rem;
  min-height: 0;
}

.draw-pile-area h2 {
  font-size: 1.2rem;
  font-weight: 400;
  color: #e8e3d8;
  margin-bottom: 1rem;
}

.draw-pile {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  width: 100%;
  max-height: 100%;
  padding: 1rem;
}

.draw-pile .movie-card {
  width: auto;
  height: auto;
  max-height: calc(100vh - 380px);
  max-height: calc(
    100dvh - 380px
  ); /* Dynamic viewport height for mobile Safari */
  max-width: calc(100vw - 2rem);
}

.draw-pile .movie-card .poster {
  width: auto;
  height: 100%;
  max-height: calc(100vh - 380px);
  max-height: calc(100dvh - 380px);
  max-width: calc(100vw - 2rem);
  aspect-ratio: 2/3; /* Maintain proper poster aspect ratio */
  object-fit: contain;
}

.hint {
  margin-top: 1rem;
  color: rgba(232, 227, 216, 0.6);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.hint-plus {
  display: inline-block;
  background: rgba(201, 169, 97, 0.2);
  color: #c9a961;
  padding: 0 0.4rem;
  border-radius: 4px;
  font-weight: bold;
}

.deselect-btn {
  margin-top: 0.75rem;
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
  background: rgba(232, 227, 216, 0.1);
  border: 1px solid rgba(232, 227, 216, 0.3);
  border-radius: 20px;
  color: #e8e3d8;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.deselect-btn:hover {
  background: #c9a961;
  border-color: #c9a961;
  color: #1a1612;
}

.deselect-btn.hidden {
  display: none;
}

.timeline-container {
  flex: 0 0 auto;
  background: #000;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.timeline-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  align-items: center;
  background: #000;
  position: relative;
  border-top: 6px solid black;
  border-bottom: 6px solid black;
  padding: 2rem 0;
}

.timeline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 2rem;
  margin: 0 auto;
  position: relative;
  z-index: 5;
  height: fit-content;
  width: 100%;
  min-width: fit-content;
  justify-content: center;
}

/* Top sprocket holes - on timeline to scroll with content and fill width */
.timeline::before {
  content: "";
  position: absolute;
  top: -2rem;
  left: 0;
  right: 0;
  width: 100%;
  height: 1.4rem;
  background: repeating-linear-gradient(
    to right,
    #e8e3d8 0px,
    #e8e3d8 20px,
    #000 20px,
    #000 30px
  );
  z-index: 0;
  pointer-events: none;
}

/* Bottom sprocket holes - on timeline to scroll with content and fill width */
.timeline::after {
  content: "";
  position: absolute;
  bottom: -2rem;
  left: 0;
  right: 0;
  width: 100%;
  height: 1.4rem;
  background: repeating-linear-gradient(
    to right,
    #dcded9 0px,
    #dcded9 20px,
    #000 20px,
    #000 30px
  );
  z-index: 0;
  pointer-events: none;
}

.movie-card {
  width: 130px;
  flex-shrink: 0;
  cursor: default;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* padding-top: 40px; */
}

/* .movie-card:hover {
  transform: scale(1.05);
} */

.movie-card.dragging {
  opacity: 0.5;
  transform: scale(1.05);
  z-index: 1000;
}

.movie-card.selected {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(78, 204, 163, 0.6);
}

.movie-card.selected .poster {
  border-color: #4ecca3;
}

.movie-card.in-pile {
  cursor: grab;
}

.movie-card .poster {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  position: relative;
}

/* Inner glow overlay for posters */
.movie-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4),
    inset 0 0 10px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  z-index: 2;
}

.in-pile.movie-card::before {
  display: none;
}
.movie-card .year {
  position: absolute;
  top: 175px;
  left: 50%;
  transform: translateX(-50%);
  background: #c9aa61;
  color: #2b2b2b;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(201, 170, 97, 0.718);
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  z-index: 4;
  font-size: 0.8rem;
  letter-spacing: -0.5px;
}

.movie-card.in-pile .year {
  display: none;
}

.movie-card .title {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 1.2rem;
  font-weight: 500;
  color: #e8e3d8;
  line-height: 1.3;
  overflow: hidden;
  flex-shrink: 0;
}

.movie-card .director {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(232, 227, 216, 0.6);
  margin-top: 0.2rem;
}

.timeline-scroll .movie-card .title,
.timeline-scroll .movie-card .director {
  display: none;
}

.drop-zone {
  width: 15px;
  /* height: 100%; */
  height: 180px;
  /* border: 2px dashed rgba(255, 255, 255, 0.3); */
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  cursor: pointer;
}

/* Hover styles only for devices that support hover (not touch) */
@media (hover: hover) {
  .drop-zone:hover {
    border-color: #c9a961;
    background: rgba(201, 169, 97, 0.2);
    width: 140px;
    box-shadow: 0 0 15px rgba(201, 169, 97, 0.5);
  }

  .drop-zone:hover::after {
    color: #c9a961;
    font-size: 2.5rem;
    text-shadow: 0 0 10px rgba(201, 169, 97, 0.8);
  }
}

/* Drag-over styles always apply (for touch and mouse drag) */
.drop-zone.drag-over {
  border-color: #c9a961;
  background: rgba(201, 169, 97, 0.2);
  width: 140px;
  box-shadow: 0 0 15px rgba(201, 169, 97, 0.5);
}

.drop-zone::after {
  content: "+";
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.25);

  font-weight: 300;
  transition: all 0.2s;
}

.drop-zone.drag-over::after {
  color: #c9a961;
  font-size: 2.5rem;
  text-shadow: 0 0 10px rgba(201, 169, 97, 0.8);
}

.drop-zone.awaiting-placement {
  border-color: rgba(201, 169, 97, 0.5);
  animation: pulse-zone 1.5s ease-in-out infinite;
}

.drop-zone.awaiting-placement::after {
  color: rgba(201, 169, 97, 0.7);
}

@keyframes pulse-zone {
  0%,
  100% {
    background: rgba(201, 169, 97, 0.05);
    box-shadow: none;
  }
  50% {
    background: rgba(201, 169, 97, 0.15);
    box-shadow: 0 0 10px rgba(201, 169, 97, 0.2);
  }
}

/* Animations */
@keyframes entrance {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  60% {
    transform: scale(1.05) translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes entrance-draw-pile {
  0% {
    opacity: 0;
    transform: scale(0.7) rotateY(-15deg);
    filter: blur(4px);
  }
  60% {
    transform: scale(1.03) rotateY(3deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
    filter: blur(0);
  }
}

.movie-card.entrance {
  animation: entrance 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.movie-card.in-pile.entrance {
  animation: entrance-draw-pile 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes correct {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(201, 169, 97, 0.8);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes wrong {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-10px);
  }
  40%,
  80% {
    transform: translateX(10px);
  }
}

.movie-card.correct {
  animation: correct 0.5s ease;
}

.movie-card.correct .poster {
  border-color: #c9a961;
}

.movie-card.wrong {
  animation: wrong 0.5s ease;
}

.movie-card.wrong .poster {
  border-color: #8b4545;
}

/* Game Over Modal */
.game-over {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.game-over.hidden {
  display: none;
}

.game-over-content {
  position: relative;
  background: #2b2b2b;
  padding: 1.5rem;
  border-radius: 16px;
  text-align: center;
  border: 1px solid #1a1a1a;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  width: 95vw;
  height: calc(100vh - 2rem);
  height: calc(100dvh - 2rem); /* Dynamic viewport height for mobile Safari */
  max-width: 1200px;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.game-over-content h2 {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  color: #c9a961;
}

/* Perfect Score Celebration */
.game-over-content.perfect-score h2 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, #ffd700, #ffb347, #ffd700);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: perfect-glow 2s ease-in-out infinite;
  text-shadow: none;
}

.game-over-content.perfect-score {
  border: 2px solid rgba(255, 215, 0, 0.4);
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.2), 0 20px 60px rgba(0, 0, 0, 0.5);
}

.game-over-content.perfect-score::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    ellipse at top,
    rgba(255, 215, 0, 0.1) 0%,
    transparent 50%
  );
  pointer-events: none;
  border-radius: 16px;
}

@keyframes perfect-glow {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.2);
  }
}

.game-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: #e8e3d8;
}

.game-stats .stat-divider {
  color: rgba(232, 227, 216, 0.4);
  font-size: 0.8rem;
}

.game-stats #correct-year,
.game-stats #final-score,
.game-stats #best-streak {
  color: #c9a961;
  font-weight: bold;
}

.game-over-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
  flex-shrink: 0;
}

#play-again,
.share-btn {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border: none;
  border-radius: 25px;
  color: white;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

#play-again {
  background: #c9a961;
  color: #2b2b2b;
}

#play-again:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(201, 169, 97, 0.4);
}

.share-btn {
  background: #8b7355;
  display: none;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(139, 115, 85, 0.4);
}

/* Show share button on mobile/touch devices */
@media (max-width: 768px), (hover: none) {
  .share-btn {
    display: block;
  }
}

.poster-grid-container {
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 60px);
  gap: 8px;
  padding: 8px;
  flex: 1;
  align-content: center;
  justify-content: center;
  overflow: hidden;
}

.poster-grid-item {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.poster-grid-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(201, 169, 97, 0.5);
  z-index: 1;
}

.poster-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-grid-item .year-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  color: white;
  font-size: 0.65rem;
  padding: 4px 2px;
  text-align: center;
  font-weight: bold;
}

.poster-grid-item.failed {
  border: 2px solid #8b4545;
  box-shadow: 0 0 15px rgba(139, 69, 69, 0.6);
}

.poster-grid-item .failed-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(139, 69, 69, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.poster-grid-item .x-mark {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: white;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(139, 69, 69, 1);
  animation: pulse-x 1s ease-in-out infinite;
}

@keyframes pulse-x {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Custom scrollbar for timeline filmstrip */
.timeline-scroll::-webkit-scrollbar {
  height: 10px;
}

.timeline-scroll::-webkit-scrollbar-track {
  background: #000;
}

.timeline-scroll::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 0;
}

.timeline-scroll::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Custom scrollbar for game-over-content */
.game-over-content::-webkit-scrollbar,
.poster-grid::-webkit-scrollbar {
  width: 8px;
}

.game-over-content::-webkit-scrollbar-track,
.poster-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.game-over-content::-webkit-scrollbar-thumb,
.poster-grid::-webkit-scrollbar-thumb {
  background: rgba(201, 169, 97, 0.3);
  border-radius: 4px;
}

.game-over-content::-webkit-scrollbar-thumb:hover,
.poster-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(201, 169, 97, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.25rem 1rem;
  }

  .mode-selector {
    gap: 0.25rem;
    padding: 0.2rem;
  }

  .mode-btn {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }

  /* First row: title + mode selector */
  header > :first-child,
  header > :nth-child(2) {
    display: inline-flex;
  }

  header > :first-child {
    flex: 0 0 auto;
  }

  header > :nth-child(2) {
    flex: 1;
    justify-content: flex-end;
  }

  /* All in one row */
  header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    gap: 0.5rem;
    align-items: center;
  }

  header .logo-dropdown {
    grid-column: 1;
    grid-row: 1;
  }

  header .mode-selector {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
  }

  header .stats {
    grid-column: 3;
    grid-row: 1;
    justify-content: flex-end;
  }

  .stats {
    gap: 1rem;
    font-size: 0.75rem;
  }

  .stats span {
    padding: 0.3rem 0.5rem;
  }

  main {
    padding: 0;
  }

  .draw-pile .movie-card {
    max-height: calc(100vh - 420px);
    max-height: calc(
      100dvh - 420px
    ); /* Dynamic viewport height for mobile Safari */
  }

  .draw-pile .movie-card .poster {
    max-height: calc(100vh - 420px);
    max-height: calc(100dvh - 420px);
  }

  .timeline-container {
    padding: 0;
    border-radius: 0;
  }

  .timeline-scroll {
    padding: 1.5rem 0;
  }

  .timeline::before,
  .timeline::after {
    height: 1.4rem;
  }

  .timeline {
    padding: 0 1rem;
    gap: 0.5rem;
  }

  .movie-card {
    width: 100px;
  }

  .movie-card .year {
    top: 135px;
  }

  .drop-zone {
    width: 15px;
    height: 150px;
  }

  .drop-zone.drag-over {
    width: 110px;
  }

  .deselect-btn {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
  }

  .game-over {
    padding: 0.5rem;
  }

  .game-over-content {
    padding: 1rem;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
  }

  .game-over-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .game-over-content.perfect-score h2 {
    font-size: 2rem;
  }

  .game-stats {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
  }

  .poster-grid-container {
    padding: 0.5rem;
  }

  .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 6px;
  }

  .poster-grid-item .x-mark {
    font-size: 2rem;
  }

  .game-over-actions {
    flex-direction: row;
    gap: 0.75rem;
  }

  #play-again,
  .share-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    width: 100%;
  }
}

/* Touch improvements */
@media (hover: none) {
  .movie-card:hover {
    transform: none;
  }

  .hint {
    font-size: 0.85rem;
  }

  /* Slightly gentler entrance animation on mobile */
  @keyframes entrance-draw-pile {
    0% {
      opacity: 0;
      transform: scale(0.85) translateY(15px);
      filter: blur(2px);
    }
    60% {
      transform: scale(1.02) translateY(-3px);
    }
    100% {
      opacity: 1;
      transform: scale(1) translateY(0);
      filter: blur(0);
    }
  }
}

/* Challenge Mode Styles */
.challenge-indicator {
  background: linear-gradient(135deg, #c9a961, #8b7355);
  color: #1a1a1a;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
  text-align: center;
  animation: pulse-challenge 2s infinite;
}

.challenge-indicator.hidden {
  display: none;
}

.challenge-indicator.beaten {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: white;
  animation: none;
}

@keyframes pulse-challenge {
  0%,
  100% {
    box-shadow: 0 0 5px rgba(201, 169, 97, 0.5);
  }
  50% {
    box-shadow: 0 0 15px rgba(201, 169, 97, 0.8);
  }
}

.challenge-btn {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border: none;
  border-radius: 25px;
  color: white;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  background: linear-gradient(135deg, #5c6bc0, #3949ab);
}

.challenge-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(92, 107, 192, 0.4);
}

.challenge-btn.hidden {
  display: none;
}

.challenge-result {
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: bold;
  text-align: center;
}

.challenge-result.hidden {
  display: none;
}

.challenge-won {
  color: #4caf50;
}

.challenge-lost {
  color: #f44336;
}

@media (max-width: 768px) {
  .challenge-indicator {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }

  .challenge-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    width: 100%;
  }
}

/* Challenge Victory Notification */
.challenge-victory-notification {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3000;
  display: flex;
  justify-content: center;
  padding: 1rem;
  transform: translateY(-100%);
  transition: transform 0.3s ease-out;
}

.challenge-victory-notification.show {
  transform: translateY(0);
}

.victory-content {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: white;
  padding: 1rem 2rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.5);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.victory-text {
  font-size: 1.2rem;
  font-weight: bold;
}

.victory-subtext {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Sparkle particles for notifications */
.notification-sparkle {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color, #fff);
  pointer-events: none;
  z-index: 2999;
  animation: sparkle-burst 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  box-shadow: 0 0 6px var(--color, #fff);
}

@keyframes sparkle-burst {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translateX(var(--end-x, 50px))
      translateY(var(--end-y, 0px)) scale(0);
    opacity: 0;
  }
}

/* Wow Notification for close placements */
.wow-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0) rotate(-10deg);
  z-index: 3000;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
}

.wow-notification.show {
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
  opacity: 1;
}

.wow-notification.hide {
  transform: translate(-50%, -50%) scale(0.5) rotate(10deg);
  opacity: 0;
  transition: transform 0.25s ease-in, opacity 0.25s ease-in;
}

.wow-content {
  background: linear-gradient(135deg, #c9a961, #673d0d);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 4px 30px rgba(255, 107, 53, 0.6);
  animation: wow-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wow-text {
  font-size: 1.5rem;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: wow-wiggle 0.5s ease-in-out;
}

.wow-subtext {
  font-size: 0.8rem;
  opacity: 0.95;
  margin-top: 0.15rem;
}

@keyframes wow-bounce {
  0% {
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.15);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes wow-wiggle {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-5deg);
  }
  75% {
    transform: rotate(5deg);
  }
}

/* Same Date Notification for exact date matches */
.same-date-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0) rotate(10deg);
  z-index: 3000;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
}

.same-date-notification.show {
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
  opacity: 1;
}

.same-date-notification.hide {
  transform: translate(-50%, -50%) scale(0.5) rotate(-10deg);
  opacity: 0;
  transition: transform 0.25s ease-in, opacity 0.25s ease-in;
}

.same-date-content {
  background: linear-gradient(135deg, #9b59b6, #e74c3c);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 4px 30px rgba(155, 89, 182, 0.6);
  animation: same-date-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.same-date-text {
  font-size: 1.5rem;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: same-date-pop 0.6s ease-out;
}

.same-date-subtext {
  font-size: 0.8rem;
  opacity: 0.95;
  margin-top: 0.15rem;
}

@keyframes same-date-bounce {
  0% {
    transform: scale(0.3) rotate(-10deg);
  }
  40% {
    transform: scale(1.2) rotate(3deg);
  }
  60% {
    transform: scale(0.9) rotate(-2deg);
  }
  80% {
    transform: scale(1.05) rotate(1deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes same-date-pop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Barbenheimer Notification - special for Barbie + Oppenheimer */
.barbenheimer-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0) rotate(0deg);
  z-index: 3000;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
}

.barbenheimer-notification.show {
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
  opacity: 1;
}

.barbenheimer-notification.hide {
  transform: translate(-50%, -50%) scale(0.5) rotate(-5deg);
  opacity: 0;
  transition: transform 0.25s ease-in, opacity 0.25s ease-in;
}

.barbenheimer-content {
  background: linear-gradient(
    135deg,
    #ff69b4 0%,
    #ff1493 50%,
    #1a1a1a 50%,
    #ff4500 100%
  );
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 4px 30px rgba(255, 105, 180, 0.4),
    0 4px 30px rgba(255, 69, 0, 0.4);
  animation: barbenheimer-explode 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.barbenheimer-text {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 105, 180, 0.5);
  animation: barbenheimer-flash 0.8s ease-in-out;
}

@keyframes barbenheimer-explode {
  0% {
    transform: scale(0.2) rotate(-15deg);
  }
  30% {
    transform: scale(1.3) rotate(5deg);
  }
  50% {
    transform: scale(0.9) rotate(-3deg);
  }
  70% {
    transform: scale(1.1) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes barbenheimer-flash {
  0%,
  100% {
    opacity: 1;
  }
  25% {
    opacity: 0.8;
    transform: scale(1.05);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
  75% {
    opacity: 0.9;
    transform: scale(1.02);
  }
}

@media (max-width: 768px) {
  .victory-content {
    padding: 0.75rem 1.5rem;
  }

  .victory-text {
    font-size: 1rem;
  }

  .victory-subtext {
    font-size: 0.8rem;
  }
}

/* Logo Dropdown Menu */
.logo-dropdown {
  position: relative;
}

.logo-trigger {
  font-size: 1.5rem;
  font-weight: 600;
  color: #c9a961;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  user-select: none;
  transition: opacity 0.2s;
}

.logo-trigger:hover {
  opacity: 0.8;
}

.dropdown-arrow {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  transition: transform 0.2s;
}

.logo-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  background: #3a3a3a;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  min-width: 150px;
  z-index: 200;
  overflow: hidden;
}

.dropdown-menu.hidden {
  display: none;
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: #e8e3d8;
  text-decoration: none;
  transition: background 0.2s;
  font-size: 0.95rem;
}

.dropdown-item:hover {
  background: rgba(201, 169, 97, 0.2);
  color: #c9a961;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0.5rem 0;
}

.dropdown-credit {
  padding: 0.6rem 1rem;
  font-size: 0.75rem;
  color: #888;
}

.dropdown-credit a {
  white-space: nowrap;
}
.dropdown-credit a,
.help-body a {
  color: #c9a961;
  text-decoration: none;
}

.dropdown-credit a:hover {
  text-decoration: underline;
}

/* Help Modal */
.help-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.help-modal.hidden {
  display: none;
}

.help-content {
  background: #2b2b2b;
  border-radius: 16px;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.help-header h2 {
  color: #c9a961;
  font-size: 1.4rem;
  margin: 0;
}

.help-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.help-close:hover {
  color: #e8e3d8;
}

.help-body {
  padding: 1.5rem;
}

.help-body p {
  margin: 0 0 1rem;
  color: #e8e3d8;
  line-height: 1.5;
}

.help-body p:last-child {
  margin-bottom: 0;
}

.help-body .hint-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  background: #c9a961;
  color: #1a1a1a;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.9em;
}

/* Archive Modal */
.archive-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.archive-modal.hidden {
  display: none;
}

.archive-content {
  background: #2b2b2b;
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.archive-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.archive-header h2 {
  color: #c9a961;
  font-size: 1.4rem;
  margin: 0;
}

.archive-close {
  background: none;
  border: none;
  color: #e8e3d8;
  font-size: 1.75rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.archive-close:hover {
  opacity: 1;
}

.archive-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.archive-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  margin-bottom: 0.75rem;
  transition: background 0.2s;
  cursor: pointer;
}

.archive-item:hover {
  background: rgba(201, 169, 97, 0.1);
}

.archive-item:last-child {
  margin-bottom: 0;
}

.archive-item-info {
  flex: 1;
}

.archive-item-number {
  font-size: 0.8rem;
  color: rgba(232, 227, 216, 0.5);
  margin-bottom: 0.25rem;
}

.archive-item-theme {
  font-size: 1.05rem;
  color: #e8e3d8;
  font-weight: 500;
}

.archive-item-date {
  font-size: 0.8rem;
  color: rgba(232, 227, 216, 0.5);
  margin-top: 0.25rem;
}

.archive-item-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.archive-item-score {
  font-size: 0.9rem;
  color: #c9a961;
  font-weight: 600;
}

.archive-item-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  text-transform: uppercase;
  font-weight: 600;
}

.archive-item-badge.completed {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
}

.archive-item-badge.today {
  background: rgba(201, 169, 97, 0.2);
  color: #c9a961;
}

.archive-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: rgba(232, 227, 216, 0.5);
}

.archive-play-btn {
  background: #c9a961;
  color: #2b2b2b;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.archive-play-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(201, 169, 97, 0.3);
}

/* Archive modal scrollbar */
.archive-list::-webkit-scrollbar {
  width: 6px;
}

.archive-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.archive-list::-webkit-scrollbar-thumb {
  background: rgba(201, 169, 97, 0.3);
  border-radius: 3px;
}

.archive-list::-webkit-scrollbar-thumb:hover {
  background: rgba(201, 169, 97, 0.5);
}

@media (max-width: 768px) {
  .logo-trigger {
    font-size: 1.25rem;
  }

  .dropdown-menu {
    min-width: 130px;
  }

  .dropdown-item {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
  }

  .archive-content {
    max-height: 90vh;
  }

  .archive-header {
    padding: 1rem;
  }

  .archive-header h2 {
    font-size: 1.2rem;
  }

  .archive-item {
    padding: 0.875rem 1rem;
  }

  .archive-item-theme {
    font-size: 0.95rem;
  }
}
