/* ==================== CORE COMPONENTS ==================== */

/* Buttons */
.btn {
  padding: 12px 28px;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: var(--shadow);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary { background: var(--kahoot-blue); }
.btn-secondary { background: var(--kahoot-yellow); color: #333; }
.btn-success { background: var(--kahoot-green); }
.btn-danger { background: var(--kahoot-red); }
.btn-white { background: var(--white); color: #0a4aad; }
.btn-large { padding: 16px 40px; font-size: 1.2rem; border-radius: 6px; }

/* Screen Management */
.screen, .screen-flex {
  display: none !important;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

.screen.active { display: block !important; }
.screen-flex.active { display: flex !important; }

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 30, 80, 0.9);
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  z-index: 10000;
  font-weight: 600;
  border-left: 4px solid var(--accent-cyan);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
  animation: slideUp 0.3s ease-out;
}

.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.info { border-left-color: #3b82f6; }

@keyframes slideUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Ranking & Podium */
.podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  height: 250px;
  margin-bottom: 2rem;
}

.podium-item {
  flex: 1;
  max-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.podium-name {
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
}

.podium-score {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
  opacity: 0.8;
}

.podium-bar {
  width: 100%;
  background: linear-gradient(to top, var(--kahoot-blue), var(--accent-cyan));
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  color: rgba(255,255,255,0.3);
}

.podium-item:nth-child(1) .podium-bar { height: 120px; } /* 2nd */
.podium-item:nth-child(2) .podium-bar { height: 160px; background: linear-gradient(to top, #0a4aad, #fbbf24); color: rgba(0,0,0,0.2); } /* 1st */
.podium-item:nth-child(3) .podium-bar { height: 100px; } /* 3rd */

.ranking-list {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}

.ranking-row {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.05);
  margin-bottom: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  animation: slideIn 0.3s ease backwards;
}

.ranking-row.is-me {
  background: rgba(77, 201, 246, 0.15);
  border: 1px solid rgba(77, 201, 246, 0.3);
}

.rank-num { font-weight: 900; width: 40px; font-size: 1.2rem; color: var(--accent-cyan); }
.rank-name { flex: 1; font-weight: 700; }
.rank-score { font-weight: 800; font-variant-numeric: tabular-nums; }
