/* ===== Skip-Bo Deluxe Buddy – App-spezifische Styles ===== */

:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --accent-color: #818cf8;
  --text-color: #f1f5f9;
  --text-muted: rgba(241, 245, 249, 0.55);
  --card-bg: #1e293b;
  --border-color: rgba(255, 255, 255, 0.12);
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
  --input-bg: rgba(255, 255, 255, 0.07);
}

body {
  background: var(--bg-gradient);
  min-height: 100vh;
}

/* ===== Screens ===== */
.screen { display: none; }
.screen.active { display: block; }

/* ===== Container ===== */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

/* ===== Headings ===== */
h1 {
  font-size: 1.75rem;
  font-weight: 800;
  text-align: center;
  margin: 24px 0 8px;
  background: linear-gradient(135deg, var(--accent-color), #e0e7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.center { text-align: center; }
.muted { color: var(--text-muted); }

/* ===== Player count buttons ===== */
.player-count-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 12px 0;
}
.player-count-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 2px solid var(--border-color);
  color: var(--text-color);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s;
}
.player-count-btn:hover { border-color: var(--primary-color); background: rgba(99,102,241,0.15); }
.player-count-btn.active { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }

/* ===== Player name rows ===== */
.player-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.player-name-row .badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ===== Target Score input in setup ===== */
.target-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}
.target-score-row label {
  color: var(--text-muted);
  font-size: .9rem;
  white-space: nowrap;
}
.target-score-row input {
  width: 100px;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
}

/* ===== Row actions ===== */
.row-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.row-actions .btn { flex: 1; }

/* ===== Game screen gamebar ===== */
.buddy-gamebar-mode {
  white-space: normal;
  word-break: break-word;
  text-align: right;
}

/* ===== Scoreboard ===== */
.scoreboard-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.scoreboard {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.scoreboard th {
  background: rgba(99,102,241,0.18);
  padding: 10px 12px;
  text-align: center;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
  white-space: nowrap;
}
.scoreboard td {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--text-muted);
}
.scoreboard .round-col { text-align: left; font-weight: 600; color: var(--text-muted); min-width: 52px; }
.scoreboard .total-row td {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-color);
  background: rgba(99,102,241,0.10);
  border-top: 2px solid var(--border-color);
}
.winner-cell { background: rgba(99,102,241,0.12); }
.pts-winner {
  color: #a5b4fc;
  font-weight: 700;
}
.pts-zero { color: rgba(255,255,255,0.2); }
.leading-cell { color: #a5b4fc !important; font-weight: 800 !important; }

/* ===== Round input card ===== */
.round-input-card { margin-top: 12px; }
.round-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.round-num { font-weight: 800; font-size: 1.05rem; }

/* ===== Winner switcher ===== */
.winner-section label {
  color: var(--text-muted);
  font-size: .9rem;
  display: block;
  margin-bottom: 8px;
}
.winner-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.winner-btn {
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--input-bg);
  border: 2px solid var(--border-color);
  color: var(--text-color);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.winner-btn:hover { border-color: var(--primary-color); }
.winner-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

/* ===== Remaining cards inputs ===== */
.remaining-section { margin-top: 4px; }
.remaining-section > label {
  color: var(--text-muted);
  font-size: .9rem;
  display: block;
  margin-bottom: 8px;
}
.remaining-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.remaining-row:last-child { border-bottom: none; }
.remaining-label {
  flex: 1;
  font-weight: 600;
  font-size: .95rem;
  min-width: 80px;
}
.remaining-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.stepper-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(99,102,241,0.2);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .15s;
}
.stepper-btn:hover { background: rgba(99,102,241,0.4); }
.remaining-input {
  width: 64px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 6px 4px;
}

/* ===== Points preview ===== */
.points-preview {
  margin: 12px 0 0;
  padding: 10px 16px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 10px;
  text-align: center;
  font-weight: 700;
  color: #a5b4fc;
  font-size: 1rem;
}

/* ===== Viewer note ===== */
#viewerNote { text-align: center; padding: 20px; }

/* ===== Game actions ===== */
.game-actions-card { margin-top: 12px; }

/* ===== End screen / Podium ===== */
.podium {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}
.podium-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--input-bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}
.podium-entry.rank-1 { border-color: #fbbf24; background: rgba(251,191,36,0.08); }
.podium-entry.rank-2 { border-color: #94a3b8; background: rgba(148,163,184,0.06); }
.podium-entry.rank-3 { border-color: #a78bfa; background: rgba(167,139,250,0.06); }
.podium-rank { font-size: 1.5rem; min-width: 36px; text-align: center; }
.podium-name { flex: 1; font-weight: 700; font-size: 1.05rem; }
.podium-score { font-weight: 800; font-size: 1.1rem; color: var(--accent-color); }

/* ===== Back row ===== */
.back-row {
  text-align: center;
  margin-top: 12px;
}
.back-row a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem;
}

/* ===== Info section ===== */
.info-section {
  margin-top: 16px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: 14px;
  border: 1px solid var(--border-color);
  font-size: .9rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.info-section h3 { color: var(--text-color); margin-bottom: 8px; font-size: 1rem; }
.info-section ul, .info-section ol { padding-left: 18px; margin: 8px 0; }
.info-section li { margin-bottom: 4px; }
.info-section strong { color: var(--text-color); }

/* ===== Feedback section ===== */
.feedback-section { text-align: center; }
.feedback-section h3 { margin-bottom: 6px; }

/* ===== Icon button ===== */
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--text-muted);
  transition: background .15s;
}
.icon-btn:hover { background: rgba(255,255,255,0.08); }

/* ===== Rules modal ===== */
.rules-modal-box { max-width: 560px; max-height: 90vh; overflow-y: auto; }
.rules-content h3 { color: var(--text-color); margin: 16px 0 6px; font-size: 1rem; }
.rules-content p, .rules-content li { color: var(--text-muted); font-size: .9rem; line-height: 1.6; }
.rules-content ul, .rules-content ol { padding-left: 18px; margin: 6px 0; }
.rules-content li { margin-bottom: 4px; }

/* ===== Disclaimer ===== */
.disclaimer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: .75rem;
  font-style: italic;
  color: rgba(241,245,249,0.3);
  line-height: 1.5;
}

/* ===== Confetti ===== */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2000;
}
.confetti-piece {
  position: absolute;
  top: -10vh;
  width: 10px;
  height: 18px;
  opacity: 0.9;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translate3d(0,0,0) rotate(0deg); opacity: 1; }
  100% { transform: translate3d(0,120vh,0) rotate(540deg); opacity: 0; }
}
