/* === A Simple CSS Reset === */
/* This prevents browser inconsistencies and fixes zoom/overflow issues */
html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}
body {
    background-color: #000;
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 20px;
}

/* === Main Layout === */
.main-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    width: 100%;
    max-width: 1400px;
}

.arena-container {
    flex: 2;
    text-align: center;
}

.ranking-container {
    flex: 1;
    min-width: 300px;
    background-color: #111;
    border: 2px solid #fff;
    padding: 20px;
    height: 85vh;
    overflow-y: auto;
}

h1, h2 {
    text-transform: uppercase;
}

.arena {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 20px 0;
    gap: 20px;
}

.song-card {
    border: 2px solid #fff;
    padding: 20px;
    width: 45%;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease-in-out, opacity 0.3s ease-in-out, border-color 0.2s;
}


.song-card h2 {
  font-size: 1.5em;
}

.vs {
    font-size: 2em;
    font-weight: bold;
}

.choices {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

button {
    background-color: #000;
    color: #fff;
    border: 2px solid #fff;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    margin-top: 5px;
}

button:hover {
    background-color: #fff;
    color: #000;
}

#progress-container {
    width: 80%;
    background-color: #333;
    border: 2px solid #fff;
    margin: 20px auto;
    position: relative;
    height: 30px;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background-color: #29b6f6;
    transition: width 0.5s ease-in-out;
}

#progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

.controls {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #333;
}

#ranking-list {
    list-style-type: decimal;
    padding-left: 30px;
}

#ranking-list li {
    padding: 5px 0;
    border-bottom: 1px solid #333;
    word-break: break-word;
    transition: background-color 0.5s ease-out;
}

#ranking-list li.rank-up {
    animation: flash-green 1s ease-out;
}

#ranking-list li.rank-down {
    animation: flash-red 1s ease-out;
}


#ranking-list small {
    color: #999;
    margin-left: 10px;
}

/* =================================== */
/* === MOBILE RESPONSIVE STYLES === */
/* =================================== */

/* This hides the rankings toggle button on desktop where it's not needed */
@media (min-width: 801px) {
  #toggle-rankings-btn {
    display: none;
  }
}

/* These styles apply only to screens 800px or less (tablets/phones) */
@media (max-width: 800px) {
  body {
    padding: 10px; /* Reduce padding on small screens */
  }

  .main-container {
    flex-direction: column;
  }

  .arena-container {
    /* This makes the main container a flexbox to center its children */
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .ranking-container {
    width: 100%;
    order: 2; /* Make the rankings appear after the arena */
    display: none; /* Hide by default */
  }

  .ranking-container.visible {
    display: block; /* Show when toggled */
    max-height: 70vh;
  }

  #toggle-rankings-btn,
  #reset-btn {
    width: 90%; /* Make control buttons a consistent width */
  }

  .arena {
    flex-direction: column;
    width: 100%;
  }

  .song-card {
    width: 90%;
    min-height: 100px;
  }
  
  .song-card h2 {
    font-size: 1.3em;
  }

  .vs {
    /* We removed the 'transform' property to keep it horizontal */
    font-size: 1.5em; /* Make it a bit smaller than the desktop version */
    margin: 10px 0;   /* Adjust margin for better spacing */
  }
  
  .choices {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
  }

  .choice-btn {
    width: 90%;
  }
  
  #ranking-list small {
    display: none; /* Hide messy rating details on mobile */
  }

  #progress-container {
    width: 90%;
  }

  #progress-text {
    font-size: 0.8em;
    /* Make the text more readable against the bar */
    text-shadow: 0px 0px 4px #000, 0px 0px 4px #000;
  }
}
/* === Ranking Toggle Styles === */
.ranking-header {
  display: flex;
  margin-bottom: 10px;
}

.ranking-toggle-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid #555;
  background-color: #000;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 1em;
}

.ranking-toggle-btn.active {
  background-color: #fff;
  color: #000;
  border-color: #fff;
}
/* === Ko-fi Button Styles === */
#kofi-link {
  text-decoration: none; /* Remove the underline from the link */
}

#kofi-btn {
  /* Give it a slightly different look to stand out */
  border-color: #29b6f6; /* Ko-fi's brand blue color is a nice touch */
  color: #29b6f6;
  margin-bottom: 10px; /* Add some space below it */
}

#kofi-btn:hover {
  background-color: #29b6f6;
  color: #000;
}

/* Make sure it fits in the mobile layout */
@media (max-width: 800px) {
  #kofi-link, #kofi-btn {
    width: 90%; /* Match the width of other mobile control buttons */
  }

  .controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }
}

/* === Animation Keyframes === */
@keyframes flash-green {
    0% { background-color: #000; }
    50% { background-color: #0a3d0a; }
    100% { background-color: #111; }
}

@keyframes flash-red {
    0% { background-color: #000; }
    50% { background-color: #4d0a0a; }
    100% { background-color: #111; }
}

.arena.fade-in .song-card {
    animation: fade-in-anim 0.5s ease-in-out forwards;
}

@keyframes fade-in-anim {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.arena.slide-in .song-card:first-child {
    animation: slide-in-left 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}

.arena.slide-in .song-card:last-child {
    animation: slide-in-right 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}

@keyframes slide-in-left {
  0% {
    transform: translateX(-100px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-in-right {
  0% {
    transform: translateX(100px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}
/* ============================ */
/* === EASTER EGG STYLES (v2) === */
/* ============================ */

#easter-egg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  
  /* New additions for a subtler effect */
  background-size: 25%; /* Makes the image take up 25% of the screen width */
  background-position: center;
  background-repeat: no-repeat;
  
  /* This will make the image itself semi-transparent */
  -webkit-backdrop-filter: brightness(60%) blur(3px); /* Safari support */
  backdrop-filter: brightness(60%) blur(3px);
}

#easter-egg-container.show-easter-egg {
  /* New, faster animation */
  animation: subtle-flash 2.5s ease-out;
}

/* New, subtler animation definition */
@keyframes subtle-flash {
  0% { opacity: 0; transform: scale(1.1); }
  15% { opacity: 0.7; transform: scale(1); } /* Quick fade-in to 70% opacity */
  80% { opacity: 0.7; } /* Hold it for a moment */
  100% { opacity: 0; } /* Fade out */
}