/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100dvh;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #1a1a2e;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

body.settings-body {
  height: auto;
  min-height: 100dvh;
  overflow-y: auto;
}

/* ===== Score Pulse Animation ===== */
@keyframes score-pulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.score-pulse {
  animation: score-pulse 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== Main App Layout ===== */
.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100vw;
}

.panels {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ===== Team Panels ===== */
.team-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: filter 0.1s ease;
}

.team-panel:active {
  filter: brightness(0.88);
}

/* Thin divider between panels */
.team-panel + .team-panel {
  border-left: 2px solid rgba(0, 0, 0, 0.3);
}

.team-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(1rem, 3vw, 1.6rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.25em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.team-score {
  font-family: 'Orbitron', monospace, system-ui;
  font-size: clamp(5rem, 20vw, 14rem);
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(255, 255, 255, 0.08);
}

/* ===== Subtract Button ===== */
.subtract-btn {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 10px 28px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  transition: background 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
  z-index: 10;
}

.subtract-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.subtract-btn:active {
  transform: translateX(-50%) scale(0.95);
  background: rgba(255, 255, 255, 0.35);
}

/* ===== Action Bar ===== */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #16162a;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 16px;
  flex-shrink: 0;
  height: 56px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 28px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.2s ease, transform 0.15s ease, color 0.2s ease;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.action-btn:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.2);
}

.action-btn--reset {
  background: rgba(255, 60, 60, 0.15);
  border-color: rgba(255, 60, 60, 0.3);
  color: #ff6b6b;
}

.action-btn--reset:hover {
  background: rgba(255, 60, 60, 0.25);
  color: #ff8a8a;
}

/* ===== Portrait Mode ===== */
@media (orientation: portrait) {
  .panels {
    flex-direction: column;
  }

  .team-panel + .team-panel {
    border-left: none;
    border-top: 2px solid rgba(0, 0, 0, 0.3);
  }

  .team-score {
    font-size: clamp(5rem, 22vw, 12rem);
  }

  .team-name {
    font-size: clamp(1rem, 4vw, 1.5rem);
  }
}

/* ===== Landscape Mode ===== */
@media (orientation: landscape) {
  .panels {
    flex-direction: row;
  }

  .team-score {
    font-size: clamp(5rem, 15vw, 14rem);
  }
}

/* ============================================
   Settings Page
   ============================================ */

.settings-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 20px;
  background: #1a1a2e;
  overflow-y: auto;
}

.settings-card {
  background: #22223a;
  border-radius: 20px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-card h1 {
  font-family: 'Orbitron', monospace, system-ui;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 28px;
  color: #fff;
  letter-spacing: 0.05em;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

.form-group input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.form-group input[type="text"]:focus {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
}

.form-group input[type="color"] {
  width: 100%;
  height: 48px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  cursor: pointer;
  outline: none;
}

.form-group input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 4px;
}

.form-group input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

.settings-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.settings-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  border-radius: 12px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  border: none;
  min-height: 48px;
  transition: background 0.2s ease, transform 0.15s ease;
}

.settings-btn:active {
  transform: scale(0.96);
}

.settings-btn--save {
  background: #4361ee;
  color: #fff;
}

.settings-btn--save:hover {
  background: #5a7bff;
}

.settings-btn--back {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.settings-btn--back:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ===== Randomize Button ===== */
.randomize-btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.randomize-btn:hover {
  background: linear-gradient(135deg, #8b5cf6, #60a5fa);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
}

.randomize-btn:active {
  transform: scale(0.96);
}
