@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #46178f;
  --bg-dark: #130030;
  --bg-gradient: linear-gradient(135deg, #46178f 0%, #250850 50%, #0d0022 100%);
  --color-red: #e21b3c;
  --color-blue: #1368ce;
  --color-yellow: #d89e00;
  --color-green: #26890c;
  
  --color-red-hover: #c01330;
  --color-blue-hover: #0f52a5;
  --color-yellow-hover: #b58400;
  --color-green-hover: #1e6d09;

  --glass-bg: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body, #root {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  font-family: var(--font-body);
  background: var(--bg-gradient);
  color: #ffffff;
}

button {
  font-family: var(--font-heading);
  cursor: pointer;
  border: none;
  outline: none;
}

/* Glassmorphism utility */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 20px;
}

.glass-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
}

/* Kahoot Shape Buttons */
.shape-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 1.25rem;
  color: white;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3), 0 10px 20px rgba(0, 0, 0, 0.2);
  width: 100%;
  text-align: left;
}

.shape-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.2);
}

.shape-btn.red { background-color: var(--color-red); }
.shape-btn.blue { background-color: var(--color-blue); }
.shape-btn.yellow { background-color: var(--color-yellow); }
.shape-btn.green { background-color: var(--color-green); }

.shape-icon {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  flex-shrink: 0;
}

/* Mobile full-screen controller grid */
.mobile-controller {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 16px;
  justify-content: space-between;
}

.mobile-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  flex: 1;
  margin-top: 16px;
}

@media (max-width: 600px) {
  .mobile-choice-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
  }
}

.mobile-shape-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3);
  font-size: 3rem;
  color: white;
  transition: transform 0.1s ease;
}

.mobile-shape-btn:active {
  transform: scale(0.96) translateY(4px);
}

/* Custom Number Slider Styling */
.slider-container {
  width: 100%;
  padding: 24px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.custom-range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  margin: 20px 0;
}

.custom-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffcc00;
  box-shadow: 0 0 15px rgba(255, 204, 0, 0.8), 0 4px 6px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.custom-range-slider::-webkit-slider-thumb:active {
  transform: scale(1.2);
}

/* Factoid Overlay Card */
.factoid-card {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 140, 0, 0.25));
  border: 2px solid rgba(255, 215, 0, 0.5);
  border-radius: 20px;
  padding: 24px;
  margin-top: 20px;
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(70, 23, 143, 0.6); }
  50% { box-shadow: 0 0 40px rgba(230, 0, 115, 0.8); }
}

/* Leaderboard Podium */
.podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
  height: 320px;
}

.podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  border-radius: 16px 16px 0 0;
  width: 140px;
  font-family: var(--font-heading);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: height 1s ease-out;
}

.podium-step.first {
  height: 240px;
  background: linear-gradient(180deg, #ffd700 0%, #b39700 100%);
  color: #332600;
}

.podium-step.second {
  height: 180px;
  background: linear-gradient(180deg, #e0e0e0 0%, #9e9e9e 100%);
  color: #212121;
}

.podium-step.third {
  height: 130px;
  background: linear-gradient(180deg, #cd7f32 0%, #8c531b 100%);
  color: #2b1706;
}

/* Animated Timer Ring */
.timer-ring-container {
  position: relative;
  width: 90px;
  height: 90px;
}

.timer-ring-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.timer-ring-circle {
  transition: stroke-dashoffset 1s linear;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}
