/* Kutlama ekranlari (Poker'in css/styles.css'inden): ulke madalyasi, kita havai fisegi, alkis eli, Dunya Sampiyonu. */
:root { --gold-dim: #b58e1c; --text: var(--ink); }
#championOverlay, #countryMedalOverlay, #continentWinOverlay { position: fixed; z-index: 50; }
.champion-overlay { background: rgba(3, 8, 5, 0.94); }

/* Country won (js/celebrations.js): the country's flag as a round medal in a gold rim, hanging
   from a ribbon; it drops in, bounces and keeps swinging gently. */
#countryMedalOverlay {
  position: fixed;
  z-index: 50;
}

.country-medal-overlay {
  background: radial-gradient(circle at 50% 38%, rgba(60, 45, 8, 0.9), rgba(3, 8, 5, 0.95) 65%);
}

.country-medal-card {
  max-width: 420px;
  width: 100%;
  text-align: center;
  padding: 24px 20px;
}

.country-medal-card h2 {
  color: var(--gold);
  font-size: 24px;
  line-height: 1.3;
  margin: 18px 0 22px;
}

.country-medal {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  transform-origin: 50% 0;
}

.country-medal.is-dropping {
  animation: medal-drop 0.9s cubic-bezier(0.3, 1.4, 0.5, 1) both, medal-swing 3.2s ease-in-out 0.9s infinite;
}

.country-medal-ribbon {
  display: flex;
  gap: 4px;
  margin-bottom: -14px;
}

.country-medal-ribbon span {
  width: 30px;
  height: 64px;
  background: linear-gradient(90deg, #b3202e 0 33%, #f4f1e8 33% 66%, #1c4fa0 66%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 85%, 0 100%);
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.25);
}

.country-medal-ribbon span:first-child {
  transform: skewX(12deg);
}

.country-medal-ribbon span:last-child {
  transform: skewX(-12deg);
}

.country-medal-disc {
  position: relative;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  padding: 10px;
  background: conic-gradient(from 20deg, #fff3b0, #d4a017, #8a6508, #f6d365, #b8860b, #fff3b0);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 40px rgba(246, 211, 101, 0.35);
}

.country-medal-disc img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.25);
}

/* Shine sweeping across the medal. */
.country-medal-disc::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.55) 45%, rgba(255, 255, 255, 0) 60%);
  background-size: 250% 100%;
  animation: medal-shine 2.6s ease-in-out 0.8s infinite;
  pointer-events: none;
}

/* Continent won (js/celebrations.js): lighter than the World Champion's screen. */
#continentWinOverlay {
  position: fixed;
  z-index: 50;
}

.continent-win-overlay {
  background: rgba(3, 8, 5, 0.92);
}

.continent-win-card {
  position: relative;
  max-width: 440px;
  width: 100%;
  text-align: center;
  padding: 24px 20px;
}

.continent-win-icon {
  font-size: 64px;
  line-height: 1;
  animation: champion-pop 0.9s ease-out;
}

.continent-win-congrats {
  margin: 14px 0 4px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
}

.continent-win-card h2 {
  color: var(--gold);
  font-size: 26px;
  line-height: 1.25;
  margin: 0 0 14px;
}

.continent-win-next {
  font-size: 17px;
  margin: 0 0 22px;
}

/* Clapping hands along the bottom of the celebration screens, while the applause plays — so the
   applause can be seen even with the sound off. */
.clap-row {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: clamp(6px, 3vw, 22px);
  font-size: clamp(28px, 7vw, 44px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.clap-row.is-clapping {
  opacity: 1;
}

.clap-row span {
  display: inline-block;
}

.clap-row.is-clapping span {
  animation: clap 0.32s ease-in-out infinite;
}

.clap-row.is-clapping span:nth-child(2n) { animation-duration: 0.28s; animation-delay: 0.07s; }
.clap-row.is-clapping span:nth-child(3n) { animation-duration: 0.35s; animation-delay: 0.12s; }
.clap-row.is-clapping span:nth-child(4n) { animation-delay: 0.19s; }

@keyframes clap {
  0%, 100% { transform: scale(1) rotate(0); }
  50% { transform: scale(0.78) rotate(-8deg); }
}

@keyframes medal-drop {
  0% { transform: translateY(-120vh) rotate(-25deg); }
  100% { transform: translateY(0) rotate(0); }
}

@keyframes medal-swing {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(3deg); }
  75% { transform: rotate(-3deg); }
}

@keyframes medal-shine {
  0% { background-position: 120% 0; }
  60%, 100% { background-position: -120% 0; }
}

.fireworks-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.champion-card {
  position: relative;
  max-width: 420px;
  width: 100%;
  text-align: center;
  padding: 24px 20px;
}

.champion-trophy {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 12px;
  animation: champion-pop 0.9s ease-out;
}

.champion-card h2 {
  color: var(--gold);
  font-size: 24px;
  line-height: 1.3;
  margin: 0 0 10px;
}

.champion-rank {
  font-size: 17px;
  margin: 0 0 22px;
}

@keyframes champion-pop {
  0% { transform: scale(0.2); opacity: 0; }
  70% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

