* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #1a1a2e;
  --card-bg: #16213e;
  --text: #eee;
  --text-muted: #8892a4;
  --accent: #e94560;
  --accent-dim: #c73a52;
  --border: #2a2a4a;
  --success: #4caf50;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.header-title {
  font-size: 17px;
  font-weight: 700;
}

.header-back {
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px 4px 0;
  display: none;
}

.header-back.visible {
  display: block;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.notification-badge {
  background: none;
  border: none;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.notification-badge.off {
  opacity: 0.4;
}

/* iOS Banner */
.ios-banner {
  display: none;
  background: #1e2a45;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 12px 16px;
  padding: 14px;
  position: relative;
}

.ios-banner.visible {
  display: block;
}

.ios-banner-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.ios-banner h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.ios-banner ol {
  font-size: 13px;
  color: var(--text-muted);
  padding-left: 20px;
  line-height: 1.7;
}

/* Screens */
.screen {
  display: none;
  padding: 0 0 80px;
}

.screen.active {
  display: block;
}

/* Section */
.section-title {
  font-size: 13px;
  color: var(--text-muted);
  padding: 16px 16px 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Game Card */
.game-card {
  background: var(--card-bg);
  border-radius: 10px;
  margin: 8px 16px;
  padding: 14px;
  border-left: 4px solid var(--accent);
}

.game-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.game-score {
  font-size: 15px;
  font-weight: 700;
}

.game-inning {
  font-size: 13px;
  color: var(--text-muted);
}

.game-player {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.game-player .status {
  color: var(--accent);
  font-weight: 600;
}

/* Scheduled game */
.scheduled-game {
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.scheduled-game:last-child {
  border-bottom: none;
}

.scheduled-game .time {
  color: var(--text);
  font-weight: 600;
  margin-right: 8px;
}

/* Player Card */
.player-card {
  background: var(--card-bg);
  border-radius: 10px;
  margin: 8px 16px;
  padding: 14px;
  border-left: 4px solid var(--accent);
}

.player-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

.player-info {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.player-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}

.player-toggles {
  display: flex;
  gap: 16px;
}

.toggle-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #3a3a5a;
  border-radius: 24px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Menu */
.menu-bar {
  display: flex;
  gap: 12px;
  padding: 16px;
}

.menu-btn {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 14px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
}

.menu-btn:active {
  background: var(--border);
}

/* Settings */
.settings-section {
  background: var(--card-bg);
  border-radius: 10px;
  margin: 8px 16px;
  padding: 16px;
}

.settings-section h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

.settings-section p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.settings-row label {
  font-size: 14px;
}

.time-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.time-inputs input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14px;
  width: 90px;
}

/* Button */
.btn {
  display: block;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 8px;
}

.btn:active {
  background: var(--accent-dim);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:active {
  background: var(--card-bg);
}

/* Disclaimer */
.disclaimer {
  padding: 16px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
}

.disclaimer a {
  color: var(--text-muted);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}
