/* ⚽ Fußball Glücksrad — Mobile-First Styles */

/* ============================================================
   BASE
   ============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #0f1923;
  --bg-card: #1a2332;
  --bg-card-hover: #223044;
  --text: #e8e8e8;
  --text-muted: #8899aa;
  --accent: #FFD700;
  --accent2: #FF6B35;
  --green: #2ecc71;
  --red: #e74c3c;
  --blue: #3498db;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

body {
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

#app {
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  padding: 20px 16px 40px;
  position: relative;
}

/* ============================================================
   SCREENS
   ============================================================ */
.screen {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.3s ease;
}

.screen.active {
  display: flex;
}

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

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #FFA500);
  color: #1a1a1a;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 2px solid var(--accent);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
}

.btn-small {
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-small:active {
  transform: scale(0.95);
}

.btn-swap {
  background: var(--bg-card-hover);
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 4px 10px;
}

.btn-play {
  background: var(--accent);
  color: #1a1a1a;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 8px 16px;
  flex-shrink: 0;
}

/* ============================================================
   HOME
   ============================================================ */
.home-title {
  font-size: 2.2rem;
  text-align: center;
  margin-top: 60px;
  line-height: 1.2;
}

.home-title .emoji {
  font-size: 3rem;
  display: block;
  margin-bottom: 10px;
}

.home-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.home-author {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 40px;
  opacity: 0.6;
}

/* Zurück zum Playground Link */
.hub-link {
  display: block;
  text-align: center;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.hub-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.home-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 30px;
}

/* ============================================================
   MODE SELECTION
   ============================================================ */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.mode-group {
  margin-bottom: 16px;
}

.mode-group-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--bg-card-hover);
}

.mode-option {
  display: block;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-option:hover {
  background: var(--bg-card-hover);
}

.mode-option input[type="radio"] {
  display: none;
}

.mode-option input[type="radio"]:checked + .mode-option-label {
  color: var(--accent);
}

.mode-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.mode-option-label {
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-option-label .mode-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: auto;
}

/* ============================================================
   TEAM SELECTION
   ============================================================ */
#teams-count {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.team-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  max-height: 50vh;
  overflow-y: auto;
}

.team-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.team-item-flag {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.team-item-name {
  flex: 1;
  font-weight: 500;
}

.team-actions {
  display: flex;
  gap: 10px;
}

/* ============================================================
   ROUND OVERVIEW
   ============================================================ */
#round-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 10px 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.match-item-teams {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.match-vs {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.match-score {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  padding: 0 4px;
}

.match-winner.winner {
  color: var(--accent);
  font-weight: 700;
}

.btn-play {
  background: var(--accent);
  color: #1a1a1a;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 6px 12px;
  flex-shrink: 0;
  border-radius: 8px;
  white-space: nowrap;
}

/* Ergebnis auf der Rad-Seite */
.spin-result {
  text-align: center;
  padding: 12px;
  margin: 8px 0;
  background: var(--bg-card);
  border-radius: var(--radius);
  animation: fadeIn 0.3s ease;
}

.spin-result-icon {
  font-size: 2rem;
  margin-bottom: 4px;
}

.spin-result-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.spin-result-text {
  font-size: 0.9rem;
  color: var(--accent);
  font-style: italic;
  line-height: 1.4;
}

/* ============================================================
   SPIN SCREENS
   ============================================================ */
.spin-header {
  text-align: center;
  margin-bottom: 8px;
}

.spin-team {
  font-size: 1.4rem;
  font-weight: 700;
}

.spin-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.wheel-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
  min-height: 300px;
}

#event-wheel-canvas,
#goal-wheel-canvas {
  display: block;
  cursor: pointer;
}

/* ============================================================
   EVENT RESULT
   ============================================================ */
.result-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.result-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.result-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.result-team {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.result-text {
  font-size: 1rem;
  color: var(--accent);
  font-style: italic;
  margin-bottom: 20px;
  line-height: 1.4;
}

/* ============================================================
   GOAL RESULT
   ============================================================ */
.goal-number {
  font-size: 4rem;
  font-weight: 800;
  color: var(--accent);
  margin: 10px 0;
}

.goal-balls {
  font-size: 1.8rem;
  margin: 6px 0;
  letter-spacing: 4px;
}

.goal-extra {
  font-size: 0.95rem;
  color: var(--accent2);
  margin: 8px 0;
  display: none;
}

/* ============================================================
   MATCH RESULT
   ============================================================ */
.match-result-score {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 15px 0;
}

.match-result-team {
  text-align: center;
  font-size: 1rem;
}

.match-result-team .flag {
  font-size: 2rem;
  display: block;
  margin-bottom: 4px;
}

.match-result-score .score {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
}

.match-result-score .colon {
  font-size: 2rem;
  color: var(--text-muted);
}

.match-winner-line {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 8px 0;
}

.match-extra-line {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 8px 0;
  line-height: 1.6;
}

.match-commentary {
  font-style: italic;
  color: var(--accent);
  font-size: 0.95rem;
  margin: 12px 0 20px;
  line-height: 1.4;
}

/* ============================================================
   DRAW
   ============================================================ */
.draw-commentary {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 12px;
}

.draw-placeholder {
  font-size: 1.5rem;
  opacity: 0.4;
}

/* ============================================================
   CHAMPION
   ============================================================ */
.champion-header {
  text-align: center;
  margin-top: 20px;
}

.champion-cup {
  font-size: 5rem;
  margin-bottom: 10px;
  animation: bounce 1s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.champion-name {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.champion-slogan {
  font-size: 1rem;
  color: var(--accent);
  font-style: italic;
  margin-bottom: 20px;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.stats-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--bg-card-hover);
}

.stats-table td:first-child {
  color: var(--text-muted);
}

.stats-table td:last-child {
  text-align: right;
  font-weight: 600;
}

/* ============================================================
   CONFETTI
   ============================================================ */
.confetti {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiFall 3s ease-out forwards;
  pointer-events: none;
  z-index: 100;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-card-hover);
  border-radius: 2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 500px) {
  #app {
    padding: 30px 24px;
  }

  .home-title {
    font-size: 2.5rem;
    margin-top: 80px;
  }
}

@media (max-height: 700px) {
  .home-title {
    margin-top: 30px;
    font-size: 1.8rem;
  }

  .home-title .emoji {
    font-size: 2.2rem;
  }

  .wheel-container {
    min-height: 240px;
    padding: 0;
  }

  .result-card {
    padding: 16px;
  }

  .goal-number {
    font-size: 3rem;
  }
}

/* ============================================================
   UTILITY
   ============================================================ */
.text-center {
  text-align: center;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

.gap-10 { gap: 10px; }

.flex-col {
  display: flex;
  flex-direction: column;
}