/* Teacher Dashboard Styles */

.teacher-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.teacher-header {
  padding: 1rem 2rem;
  background: rgba(0,0,0,0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.teacher-logo {
  font-size: 1.5rem;
  font-weight: 600;
}

.teacher-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.teacher-nav button {
  padding: 0.5rem 1rem;
  background: var(--bg-elevated);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s;
}

.teacher-nav button.active {
  background: var(--primary);
  color: white;
}

.teacher-nav button:hover:not(.active) {
  background: var(--bg-card);
}

.teacher-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.teacher-section {
  display: none;
}

.teacher-section.active {
  display: block;
}

/* Stats */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius);
  text-align: center;
}

.stat-card .stat-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Usage Meter */
.usage-meter {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.usage-bar {
  height: 8px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.usage-bar-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}

.usage-bar-fill.warning { background: var(--warning); }
.usage-bar-fill.danger { background: var(--danger); }

/* Classes */
.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.class-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border-left: 4px solid var(--primary);
  cursor: pointer;
  transition: transform 0.2s;
}

.class-card:hover {
  transform: translateY(-3px);
}

.class-card h3 { margin-bottom: 0.5rem; }
.class-card .class-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.invite-code {
  background: var(--bg-elevated);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

/* Puzzles */
.puzzle-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.puzzle-item {
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.puzzle-info h4 { margin-bottom: 0.25rem; }
.puzzle-info .meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.puzzle-stats {
  display: flex;
  gap: 1rem;
}

.puzzle-stats .stat { text-align: center; }
.puzzle-stats .stat-num { font-size: 1.2rem; font-weight: 600; }
.puzzle-stats .stat-label { font-size: 0.75rem; color: var(--text-muted); }

/* Word Table */
.word-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
}

.word-table th,
.word-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.word-table th { background: var(--bg-elevated); }
.word-table tr:hover { background: var(--bg-elevated); }

/* Forms */
.create-form {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.create-form h3, .create-form h4 {
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Upgrade Banner */
.upgrade-banner {
  background: linear-gradient(45deg, #FFD700, #FFA500);
  color: #1a1a2e;
  padding: 1rem;
  border-radius: var(--radius);
  text-align: center;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Student List */
.student-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.student-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

.student-item .rank {
  width: 30px;
  font-weight: 600;
}

/* Puzzle Words Tags */
.puzzle-word-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-elevated);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  margin: 0.25rem;
  font-size: 0.85rem;
}

.puzzle-word-tag button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  opacity: 0.7;
}

.puzzle-word-tag button:hover {
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .teacher-header {
    flex-direction: column;
    text-align: center;
  }
  
  .teacher-nav {
    justify-content: center;
  }
  
  .teacher-main {
    padding: 1rem;
  }
  
  .upgrade-banner {
    flex-direction: column;
  }
}

/* =====================================================
   ERWEITERTE LEHRER-STYLES
   ===================================================== */

/* Word Tabs */
.word-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.word-tab {
  padding: 0.75rem 1.25rem;
  background: var(--bg-elevated);
  border: 2px solid transparent;
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.word-tab:hover {
  background: var(--bg-card);
  color: var(--text);
}

.word-tab.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(99, 102, 241, 0.2));
  border-color: #10B981;
  color: #10B981;
}

.word-tab-content {
  display: none;
}

.word-tab-content.active {
  display: block;
}

/* AI Form */
.ai-form, .db-form {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(99, 102, 241, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.ai-info, .db-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius);
}

.ai-icon, .db-icon {
  font-size: 2.5rem;
}

.ai-info strong, .db-info strong {
  color: #10B981;
  font-size: 1.1rem;
}

.ai-info p, .db-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.ai-results {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
}

.ai-results h4 {
  margin-bottom: 1rem;
  color: #10B981;
}

.ai-word-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.ai-word-item .word {
  font-weight: 700;
  min-width: 120px;
  text-transform: uppercase;
}

.ai-word-item .hint {
  flex: 1;
  color: var(--text-secondary);
}

.ai-word-item button {
  opacity: 0.5;
  transition: opacity 0.2s;
}

.ai-word-item button:hover {
  opacity: 1;
}

.ai-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.usage-hint {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Lehrer-Datenbank */
.db-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.db-category {
  padding: 1rem;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.db-category:hover {
  border-color: var(--primary);
  background: var(--bg-elevated);
}

.db-category.active {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.1);
}

.db-category-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.db-category-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.db-category-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.db-preview {
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.db-preview h4 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.db-request {
  padding: 1rem;
  background: rgba(245, 158, 11, 0.1);
  border-radius: var(--radius);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.db-request a {
  color: #F59E0B;
}

.db-loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

/* Upgrade Modal Erweiterungen */
.upgrade-modal-content {
  max-width: 900px !important;
}

.referral-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(239, 68, 68, 0.1));
  border: 2px dashed rgba(245, 158, 11, 0.5);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.referral-option .referral-icon {
  font-size: 2rem;
}

.referral-option .highlight {
  color: #F59E0B;
  font-weight: 700;
}

.referral-option .referral-text p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.subscription-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.plan-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
}

.plan-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
}

.plan-card.featured {
  border-color: #10B981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(99, 102, 241, 0.1));
}

.plan-card .plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #10B981, #6366f1);
  color: white;
  padding: 0.25rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.plan-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.plan-price {
  margin-bottom: 0.5rem;
}

.plan-price .price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
}

.plan-badge-inline {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
  margin-bottom: 1rem;
}

.plan-badge-inline.trial {
  background: rgba(245, 158, 11, 0.2);
  color: #F59E0B;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.plan-features {
  list-style: none;
  text-align: left;
  margin: 1rem 0;
}

.plan-features li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.plan-features li:last-child {
  border-bottom: none;
}

.plan-card .btn-primary {
  width: 100%;
  margin-top: 1rem;
}

.payment-note {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Clean Create Form */
.create-form {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.create-form h3 {
  margin-bottom: 1rem;
  color: var(--text);
  font-size: 1.1rem;
}

.create-form h4 {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* =====================================================
   PROGRESS CHECKLIST
   ===================================================== */
.progress-checklist {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.progress-checklist h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  transition: all 0.2s;
}

.checklist-item:hover {
  background: rgba(99, 102, 241, 0.1);
}

.checklist-item.completed {
  opacity: 0.7;
  background: rgba(16, 185, 129, 0.1);
}

.checklist-item .check-icon {
  font-size: 1.5rem;
  min-width: 40px;
  text-align: center;
}

.checklist-item.completed .check-icon {
  color: #10B981;
}

.checklist-item .check-content {
  flex: 1;
}

.checklist-item .check-content strong {
  display: block;
  margin-bottom: 0.25rem;
}

.checklist-item .check-content p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.checklist-item.completed .check-content strong {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* =====================================================
   AI GENERATOR IMPROVED
   ===================================================== */
.ai-form {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.ai-info {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 8px;
}

.ai-icon {
  font-size: 2.5rem;
}

.ai-info strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.ai-info p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.ai-button-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.ai-status {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.ai-results {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.ai-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.ai-results-header h4 {
  margin: 0;
}

.ai-results-actions {
  display: flex;
  gap: 0.5rem;
}

.ai-word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

.ai-word-item {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border);
  position: relative;
}

.ai-word-item .word {
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.ai-word-item .hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex: 1;
}

.ai-word-item .word-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  justify-content: flex-end;
}

.ai-word-item .btn-approve {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10B981;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.ai-word-item .btn-reject {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #EF4444;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.usage-hint {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Word Tabs */
.word-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.word-tab {
  padding: 0.75rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
  transition: all 0.2s;
}

.word-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.word-tab:hover:not(.active) {
  background: var(--bg-card);
  border-color: var(--primary);
}

.word-tab-content {
  display: none;
}

.word-tab-content.active {
  display: block;
}

/* DB Info */
.db-form {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(5, 150, 105, 0.05) 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.db-info {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 8px;
}

.db-icon {
  font-size: 2.5rem;
}

.db-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.db-category-card {
  padding: 1rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
}

.db-category-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.db-category-card h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.db-category-card .count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .ai-button-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .ai-results-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .ai-word-grid {
    grid-template-columns: 1fr;
  }
  
  .checklist-item {
    flex-wrap: wrap;
  }
  
  .checklist-item .btn-small {
    width: 100%;
    margin-top: 0.5rem;
  }
}

/* =====================================================
   LIVE-SPIEL (Kahoot-Style)
   ===================================================== */

.section-intro {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.live-game-setup .btn-large {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  margin-top: 1rem;
}

/* Lobby */
.live-game-lobby {
  text-align: center;
  padding: 2rem;
}

.live-game-lobby.hidden,
.live-game-active.hidden,
.live-game-results.hidden {
  display: none;
}

.lobby-header {
  margin-bottom: 2rem;
}

.game-code-display {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 1.5rem 2rem;
  border-radius: 16px;
  display: inline-block;
  margin: 1rem 0;
}

.game-code-display .label {
  display: block;
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 0.5rem;
}

.game-code-display .code {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.3rem;
  font-family: 'Courier New', monospace;
}

.join-url {
  color: var(--text-secondary);
  margin-top: 1rem;
}

.players-waiting {
  margin: 2rem 0;
}

.player-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto;
}

.player-tag {
  background: var(--bg-elevated);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: playerJoin 0.3s ease;
}

@keyframes playerJoin {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.player-tag .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.lobby-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Aktives Spiel */
.live-game-active {
  padding: 1rem;
}

.game-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.game-progress .progress-bar {
  flex: 1;
  height: 10px;
  background: var(--bg-elevated);
  border-radius: 5px;
  overflow: hidden;
}

.game-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #34D399);
  transition: width 0.3s ease;
}

.current-word-display {
  background: linear-gradient(135deg, #1e1e3f 0%, #2d2d5a 100%);
  border-radius: 20px;
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
}

.word-timer {
  font-size: 4rem;
  font-weight: 700;
  color: #10B981;
  margin-bottom: 1rem;
  transition: color 0.3s;
}

.word-timer.warning { color: #F59E0B; }
.word-timer.danger { color: #EF4444; animation: pulse 0.5s infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.word-hint {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.word-length {
  font-size: 2rem;
  letter-spacing: 0.5rem;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

.live-leaderboard {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.leaderboard-list {
  max-height: 200px;
  overflow-y: auto;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 8px;
  margin-bottom: 0.25rem;
}

.leaderboard-item:nth-child(1) { background: rgba(255, 215, 0, 0.1); }
.leaderboard-item:nth-child(2) { background: rgba(192, 192, 192, 0.1); }
.leaderboard-item:nth-child(3) { background: rgba(205, 127, 50, 0.1); }

.leaderboard-item .rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.leaderboard-item:nth-child(1) .rank { background: #FFD700; color: #000; }
.leaderboard-item:nth-child(2) .rank { background: #C0C0C0; color: #000; }
.leaderboard-item:nth-child(3) .rank { background: #CD7F32; color: #000; }

.leaderboard-item .name { flex: 1; }
.leaderboard-item .score { font-weight: 600; color: var(--primary); }
.leaderboard-item .streak { font-size: 0.85rem; color: #10B981; }

.game-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-danger {
  background: #EF4444;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
}

.btn-danger:hover { background: #DC2626; }

/* Ergebnisse */
.live-game-results {
  text-align: center;
  padding: 2rem;
}

.final-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  margin: 2rem 0;
  min-height: 200px;
}

.podium-place {
  text-align: center;
  padding: 1rem;
  border-radius: 12px;
  background: var(--bg-card);
}

.podium-place.first {
  order: 2;
  transform: translateY(-20px);
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #000;
}

.podium-place.second { order: 1; background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%); color: #000; }
.podium-place.third { order: 3; background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%); color: #fff; }

.podium-place .place-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.podium-place .place-name { font-weight: 600; margin-bottom: 0.25rem; }
.podium-place .place-score { font-size: 1.25rem; }

.final-stats {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem auto;
  max-width: 400px;
}

/* Mobile */
@media (max-width: 768px) {
  .game-code-display .code {
    font-size: 2rem;
    letter-spacing: 0.2rem;
  }
  
  .current-word-display {
    padding: 2rem 1rem;
  }
  
  .word-timer {
    font-size: 3rem;
  }
  
  .word-hint {
    font-size: 1.2rem;
  }
}

/* =====================================================
   ANALYTICS DASHBOARD
   ===================================================== */

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.analytics-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.25rem;
}

.analytics-card h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

.analytics-list {
  max-height: 300px;
  overflow-y: auto;
}

.analytics-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.analytics-item .rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.analytics-item .info {
  flex: 1;
  min-width: 0;
}

.analytics-item .name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-item .meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.analytics-item .value {
  font-weight: 600;
  color: var(--primary);
}

.activity-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 150px;
  padding: 1rem;
  gap: 0.5rem;
}

.chart-bar {
  flex: 1;
  max-width: 60px;
  background: linear-gradient(to top, var(--primary), #818cf8);
  border-radius: 4px 4px 0 0;
  position: relative;
  min-height: 5px;
  transition: height 0.3s ease;
}

.chart-bar:hover {
  background: linear-gradient(to top, #4f46e5, #a78bfa);
}

.chart-bar .tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.chart-bar:hover .tooltip {
  opacity: 1;
}

.chart-label {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  
  .activity-chart {
    height: 120px;
  }
}
