/* ========== FONTS ========== */
@font-face {
  font-family: 'CookieRunBold';
  src: url('fonts/CookieRun Bold.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'CookieRunBlack';
  src: url('fonts/CookieRun Black.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'CookieRunRegular';
  src: url('fonts/CookieRun Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* ========== GLOBAL ========== */
body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'CookieRunRegular', sans-serif;
  background-color: #fffaf5;
  color: #5B3A29;
  text-align: center;
  overflow-x: hidden;
  max-width: 100vw;
  touch-action: manipulation;
}

body.intro-active {
  overflow: hidden;
  height: 100vh;
}

p {
  font-size: 1rem;
  line-height: 1.6;
  color: #4E342E;
}

button {
  font-family: 'CookieRunBlack', sans-serif;
  font-size: 1.5rem;
  color: white;
  -webkit-text-stroke: 1px #4E342E;
  text-shadow: 0 2px 0 #4E342E;
  background-color: #FBC02D;
  padding: 12px 24px;
  margin-top: 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 4px 0 #D9A600;
  transition: all 0.2s ease-in-out;
  display: inline-block;
  width: auto;
}

button:hover {
  background-color: #FFD54F;
  box-shadow: 0 2px 0 #D9A600;
  transform: translateY(2px);
}

/* ========== INTRO ========== */
#intro {
  height: 100svh;
  background: url('img/Draconis_immortalis_title_screen.webp') no-repeat center center;
  background-size: cover;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.intro-overlay {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(14px) saturate(150%);
  border-radius: 30px;
  padding: 50px 25px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  max-width: 700px;
  width: 90%;
  color: #2b2b2b;
  text-align: center;
}

#intro h1 {
  font-family: 'CookieRunBlack', sans-serif;
  font-size: 2.5rem;
  line-height: 1.1;
  color: #e7a82b;
  text-shadow:
    0 2px 0 #4a2b14,
    0 3px 4px rgba(0, 0, 0, 0.4),
    0 -1px 0 #fff2c1;
  margin-bottom: 0.5em;
}

#intro h2 {
  font-size: 1.3em;
  font-weight: 400;
  color: #4E342E;
}

#intro p {
  font-size: 1rem;
  font-family: 'CookieRunRegular', sans-serif;
  line-height: 1.5;
}

/* ========== CHOICE SORTER ========== */

#sorter {
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.4)),
    url('img/Bg_lobby_skin1.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100vh;
  padding: 20px;
}

.sorter-headline {
  font-family: 'CookieRunBlack', sans-serif;
  font-size: 2.5rem;
  line-height: 1.1;
  color: #e7a82b;
  text-shadow:
    0 2px 0 #4a2b14,
    0 3px 4px rgba(0, 0, 0, 0.4),
    0 -1px 0 #fff2c1;
  margin-bottom: 0.5em;
}

.sorter-inner-wrapper {
  padding: 40px;
  max-width: 1000px;
  margin: 0 auto;
}

#choice-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, #fff4e0, #ffe0b2);
  border: 3px solid #ffb74d;
  border-radius: 24px;
  padding: 16px;
  margin: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  max-width: 240px;
  text-align: center;
}

.choice img {
  border-radius: 10px;
  max-height: 175px;
  max-width: 175px;
  display: block;
  margin: 0 auto;
}

.name {
  margin-top: 10px;
  font-weight: bold;
  font-size: .8em;
}

.sorter-progress-wrapper {
  width: 100%;
  max-width: 600px;
  margin: 0 auto 30px;
  text-align: center;
}
.progress-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 12px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.sorter-progress-bar {
  width: 100%;
  max-width: 500px;
  height: 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.sorter-progress-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(
    to right,
    #ff9500 0%,
    #ffb300 70%,
    #ffd54f 90%,
    #ffffff 98%,
    #ffffff 100%
  );
  transition: width 0.3s ease;
  border-radius: 2px;
}

.progress-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(to bottom right, #ffd700, #fbc02d);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: calc(50% - 250px - 20px); 
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 2;
  font-size: 18px;
  
}

.sorter-progress-text {
  font-family: 'CookieRunBold', sans-serif;
  font-size: 1rem;
  color: white;
  margin-top: 8px;
}

/* ========== TIE BUTTON ========== */
#tie-btn {
  font-family: 'CookieRunBlack', sans-serif;
  font-size: 1.2rem;
  color: white;
  -webkit-text-stroke: 1px #4E342E;
  text-shadow: 0 2px 0 #4E342E;
  background-color: #FBC02D;
  padding: 12px 24px;
  margin: 12px auto 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 4px 0 #D9A600;
  transition: all 0.2s ease-in-out;
  display: inline-block;
  width: auto;
}

#tie-btn:hover {
  background-color: #FFD54F;
  box-shadow: 0 2px 0 #D9A600;
  transform: translateY(2px);
}

/* ========== RESULTS ========== */
#results {
  padding: 40px;
  min-height: 100vh;
  overflow-x: hidden;
  background-attachment: scroll;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-image: radial-gradient(circle at center, #193279 0%, #152a65 60%, #102154 100%);
}
}

.results-wrapper {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 5%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  box-sizing: border-box;
}

.results-header {
  font-size: 2.2rem;
  font-family: 'CookieRunBlack', sans-serif;
  color: white;
  text-shadow:
    -2px -2px 0 #2a2a2a,
     2px -2px 0 #2a2a2a,
    -2px  2px 0 #2a2a2a,
     2px  2px 0 #2a2a2a;
  margin-bottom: 32px;
}

/* ========== TOP COOKIE ========== */
.top-cookie-box {
  display: flex;
  justify-content: center;
  position: relative;
}

.top-cookie-highlight {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.top-cookie-title {
  position: absolute;
  top: -10px;
  left: -30px;
  font-size: 3rem;
  padding: 8px 16px;
  font-family: 'CookieRunBlack', sans-serif;
  color: #F4B626;
  text-shadow:
    0 2px 0 #4a2b14,
    0 3px 4px rgba(0, 0, 0, 0.4),
    0 -1px 0 #fff2c1;
}

.top-cookie-img {
  max-width: 200px;
  margin: 0 auto 12px;
  display: block;
}

.top-cookie-name {
  font-size: 1.4rem;
  color: white;
}

.top-cookie-name .kr-name {
  display: block;
  font-size: 1.2rem;
  margin-top: 4px;
}

/* ========== RANKINGS ========== */
.ranking-title {
  font-size: 1.4rem;
  line-height: 1.1;
  color: #4E342E;
  text-align: center;
  margin-top: 20px;
  margin-bottom: 0px;
}

.full-ranking-wrapper {
  background: linear-gradient(#fff8e6, #ffe9b6);
  border: 4px solid #f9b13a;
  border-radius: 18px;
  padding: 15px 10px;
  max-width: 500px;
  margin: 20px auto;
  box-shadow: inset 0 0 0 4px #fff0c2;
}

.full-ranking-list {
  list-style: none;
  padding: 0 !important;
  margin: 0 !important;
}

#results .full-ranking-list li {
  background: transparent !important;
  border-bottom: 2px dashed #e1a336;
  padding: 10px 0;
  font-size: 0.8rem;
  font-weight: 200;
  color: #5c2c00;
  text-align: left;
}

/* ========== CAROUSEL ========== */
.ranking-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0;
  gap: 16px;
  padding: 10px 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  box-sizing: border-box;
  padding: 16px;
}

.carousel-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 0;
  margin-bottom: 10px;
}

.carousel-controls button {
  font-family: 'CookieRunBlack', sans-serif;
  font-size: 1rem;
  color: white;
  -webkit-text-stroke: 1px #4E342E;
  text-shadow: 0 2px 0 #4E342E;
  background-color: #FBC02D;
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 0 #D9A600;
  transition: all 0.2s ease-in-out;
  width: auto;
}

.carousel-controls button:hover {
  background-color: #FFD54F;
  box-shadow: 0 2px 0 #D9A600;
  transform: translateY(2px);
}

/* ========== RESTART BUTTON ========== */
.restart-btn {
  background-color: #FBC02D;
  color: white;
  font-size: 1rem;
  padding: 20px 20px;
  margin-top: 10px;
  margin-bottom: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 0 #D9A600;
  border: none;
  cursor: pointer;
}

.restart-btn:hover {
  transform: translateY(-2px);
  background-color: #FFD54F;
}

/* ========== ANIMATIONS ========== */
.fade-in { animation: fadeIn 0.8s ease-out forwards; opacity: 0; }
.fade-in-delayed { animation: fadeIn 0.8s ease-out 0.3s forwards; opacity: 0; }
.fade-in-slow { animation: fadeIn 0.8s ease-out 0.6s forwards; opacity: 0; }
.fade-in-slower { animation: fadeIn 0.8s ease-out 0.9s forwards; opacity: 0; }
.fade-in-slowest { animation: fadeIn 0.8s ease-out 1.2s forwards; opacity: 0; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
  #intro h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 30px;
    color: #F4B626;
    text-shadow:
      1px 1px 2px rgba(0, 0, 0, 0.4),
     -1px -1px 0 rgba(255, 255, 255, 0.2);
  }
  

    #intro h2 { font-size: 1.3rem; line-height: 1; 
    }
    #intro p { font-size: .9rem; padding: 0; 
    }

    .intro-overlay {
    width: 80%;
    margin: 0 auto;
    padding: 32px 20px;
  }

    #sorter {
    flex-direction: column;
    align-items: center;
    padding: 0;
    margin: 0;
    gap: 1;
  }
  
 .sorter-inner-wrapper {
  padding: 25px;

}
  
  #sorter h1 {
    font-size: 1.7rem;
    line-height: 1.2;
    margin-bottom: 30px;
    color: #F4B626;
    text-shadow:
      1px 1px 2px rgba(0, 0, 0, 0.4),
     -1px -1px 0 rgba(255, 255, 255, 0.2);
  }

  .choice { max-width: 70%; 
  }
  .choice img { max-width: 100%; height: 120px; 
  }
  #name-left, #name-right { font-size: 1rem; line-height: 1.3; 
  }
  
  .progress-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  left: calc(50% - 160px - 20px); 
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 2;
  font-size: 18px;}

    .top-cookie-img { width: 150px; }
    .top-cookie-name { font-size: 1.3rem; 
    }

    .full-ranking-list li {
    font-size: 0.8rem;
    line-height: 1.3;
    padding: 4px 0;
  }
  .full-ranking-wrapper {
  padding: 10px 10px;}
  
  .ranking-title {
  font-size: 1.2rem;
  text-align: center;
  margin-top: 20px;}
}

