/**
 * CurveGolf Design System & Stylesheet
 * Guided by Clean & Friendly Design System guidelines.
 */

:root {
  /* Color Palette - Light Mode */
  --bg-app: #FAF8F5;
  --bg-surface: #FFFFFF;
  --bg-surface-subtle: #F1EFEA;
  --bg-card: #FFFFFF;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #10B981;

  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-dim: #94A3B8;

  --color-primary: #10B981;
  --color-primary-hover: #059669;
  --color-primary-subtle: rgba(16, 185, 129, 0.12);

  --color-secondary: #3B82F6;
  --color-secondary-hover: #2563EB;

  --color-gold: #F59E0B;
  --color-gold-hover: #D97706;
  --color-gold-subtle: rgba(245, 158, 11, 0.15);

  --color-danger: #EF4444;
  --color-danger-subtle: rgba(239, 68, 68, 0.12);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.09), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-primary: 0 4px 14px rgba(16, 185, 129, 0.35);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", Menlo, Monaco, Consolas, monospace;

  /* Layout */
  --header-height: 56px;
  --dock-height: 180px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
}

[data-theme="dark"] {
  --bg-app: #0F172A;
  --bg-surface: #1E293B;
  --bg-surface-subtle: #334155;
  --bg-card: #1E293B;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-focus: #34D399;

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --color-primary: #34D399;
  --color-primary-hover: #10B981;
  --color-primary-subtle: rgba(52, 211, 153, 0.15);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
}

/* App Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* Header */
.app-header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 20;
  flex-shrink: 0;
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.brand-logo:hover {
  transform: scale(1.02);
}

.brand-title {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-title strong {
  color: var(--color-primary);
  font-weight: 800;
}

.header-nav {
  display: flex;
  gap: 4px;
}

.nav-btn {
  background: transparent;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.nav-btn:hover {
  background: var(--bg-surface-subtle);
  color: var(--text-main);
}

.nav-btn.active {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  font-weight: 600;
}

.icon-btn {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-surface);
  transform: translateY(-1px);
}

/* Main Content Area */
.app-main {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.app-screen {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.app-screen.active {
  display: flex;
  flex-direction: column;
}

/* Screen 1: Game View */
#screen-game {
  height: 100%;
  display: none;
  flex-direction: column;
}

#screen-game.active {
  display: flex;
}

.canvas-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-app);
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

/* Game HUD */
.game-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

.hud-left {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
}

.hud-level-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.hud-level-concept {
  font-size: 0.78rem;
  color: var(--color-primary);
  font-weight: 600;
}

.hud-center {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.hud-stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 65px;
}

.hud-stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.hud-stat-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.hud-stars-display {
  display: flex;
  gap: 2px;
  font-size: 0.95rem;
  line-height: 1;
}

.star-icon.filled {
  color: var(--color-gold);
}

.star-icon.empty {
  color: var(--text-dim);
}

.hud-right {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}

/* Time Trial HUD Badge */
.highlight-timer {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: #EF4444 !important;
}

.timer-text {
  color: #EF4444 !important;
  font-family: var(--font-mono) !important;
  font-weight: 800 !important;
  letter-spacing: 0.05em;
}

/* Sandbox Floating Toolbar */
.sandbox-floating-toolbar {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 8px 14px;
  box-shadow: var(--shadow-lg);
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.sandbox-toolbar-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.sandbox-tools-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

.btn-tool {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-tool:hover {
  background: var(--bg-surface);
  border-color: var(--color-primary);
}

.btn-tool.active {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  border-color: var(--color-primary);
  font-weight: 700;
}

.btn-tool.danger:hover {
  background: var(--color-danger);
  color: #FFFFFF;
}

.hud-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.hud-btn:hover {
  background: var(--bg-surface-subtle);
  transform: translateY(-1px);
}

.hud-btn.active {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.hud-btn.icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  font-size: 1rem;
}

/* Bottom Editor Dock */
.editor-dock {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  padding: 10px 16px 12px 16px;
  z-index: 15;
  flex-shrink: 0;
}

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

.editor-tabs {
  display: flex;
  background: var(--bg-surface-subtle);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}

.editor-tab-btn {
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.editor-tab-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.dock-actions-quick {
  display: flex;
  align-items: center;
  gap: 16px;
}

.speed-control-group {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-speed {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-speed.active {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
}

.power-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.power-val {
  color: var(--text-main);
  font-family: var(--font-mono);
  font-weight: 600;
  min-width: 48px;
}

/* Formula Editor Panel */
.editor-panel {
  display: none;
}

.editor-panel.active {
  display: block;
}

.formula-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.formula-equation-prefix {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  padding: 0 4px;
}

.formula-input-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

#formula-input {
  width: 100%;
  height: 42px;
  background: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 95px 0 14px;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-main);
  outline: none;
  transition: all 0.15s ease;
}

#formula-input:focus {
  background: var(--bg-surface);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--color-primary-subtle);
}

.validation-pill {
  position: absolute;
  right: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
}

.validation-pill.valid {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}

.validation-pill.error {
  background: var(--color-danger-subtle);
  color: var(--color-danger);
}

.formula-error-text {
  font-size: 0.75rem;
  color: var(--color-danger);
  margin-top: 2px;
  margin-left: 36px;
  min-height: 16px;
  font-family: var(--font-mono);
}

/* Primary Action Buttons */
.btn-primary-putt {
  height: 42px;
  padding: 0 24px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border: none;
  border-radius: var(--radius-pill);
  color: #FFFFFF;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-primary-putt:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.btn-primary-putt:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary-putt:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  height: 42px;
  padding: 0 16px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: var(--border-color);
}

/* Helpers & Chips */
.formula-helpers-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.math-chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.btn-math-chip {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.1s ease;
}

.btn-math-chip:hover {
  background: var(--bg-surface);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.btn-math-chip:active {
  transform: translateY(1px);
}

.history-controls {
  display: flex;
  gap: 4px;
}

.btn-mini {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-mini:hover {
  background: var(--bg-surface-subtle);
  border-color: var(--border-color);
  color: var(--text-main);
}

/* Visual Sliders Panel */
.visual-panel-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.template-selector-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.dropdown-styled {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
}

.visual-formula-pill {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
}

.sliders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.slider-card {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

.slider-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.param-value {
  font-family: var(--font-mono);
  color: var(--color-primary);
  font-weight: 700;
}

.slider-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slider-control-row input[type="range"] {
  flex: 1;
}

.btn-step {
  width: 24px;
  height: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
}

.btn-step:hover {
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}

/* Screens: Content Pages (Levels, Daily, Records) */
.screen-content-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px;
  overflow-y: auto;
  height: 100%;
}

.screen-content-wrapper.narrow {
  max-width: 760px;
}

.screen-header {
  margin-bottom: 24px;
}

.screen-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.screen-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Level Grid Cards */
.levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  padding-bottom: 40px;
}

.level-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
  transition: all 0.15s ease;
}

.level-card.unlocked {
  cursor: pointer;
}

.level-card.unlocked:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.level-card.locked {
  opacity: 0.6;
  background: var(--bg-surface-subtle);
  cursor: not-allowed;
}

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

.level-card-num {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-primary);
}

.level-card-difficulty {
  font-size: 0.85rem;
  color: var(--color-gold);
}

.level-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.level-card-concept {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.level-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.mini-star.filled {
  color: var(--color-gold);
}

.mini-star.empty {
  color: var(--text-dim);
}

.mini-par-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--color-primary-subtle);
  color: var(--color-primary);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.lock-icon {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
}

/* Daily Hero Card */
.daily-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  box-shadow: var(--shadow-md);
  text-align: center;
  margin-top: 20px;
}

.daily-tag {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  background: var(--color-primary-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  display: inline-block;
  margin-bottom: 12px;
}

.daily-hero-card h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.daily-hero-card p {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 24px auto;
  font-size: 0.95rem;
}

.daily-stats-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 28px;
}

.daily-stat-badge {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.daily-stat-badge.secondary {
  color: var(--text-muted);
}

.btn-hero-primary {
  padding: 14px 36px;
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border: none;
  border-radius: var(--radius-pill);
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  transition: all 0.15s ease;
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.stat-card.highlight {
  border-color: var(--color-gold);
  background: var(--color-gold-subtle);
}

.stat-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.stat-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 101;
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Results Celebration */
.results-celebration-header {
  padding: 24px 20px 14px 20px;
  text-align: center;
  background: linear-gradient(180deg, var(--color-primary-subtle) 0%, transparent 100%);
}

.par-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.par-badge.hole-in-one {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.par-badge.birdie {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
}

.par-badge.par {
  background: var(--color-secondary);
  color: #FFFFFF;
}

.par-badge.bogey {
  background: var(--text-muted);
  color: #FFFFFF;
}

.results-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.results-stars-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 2rem;
}

.star-big.filled {
  color: var(--color-gold);
  animation: starBounce 0.4s ease;
}

.star-big.empty {
  color: var(--text-dim);
}

@keyframes starBounce {
  0% { transform: scale(0.5); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.score-hero-container {
  text-align: center;
  padding: 12px 20px;
}

.score-hero-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.score-hero-value {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--color-primary);
  font-family: var(--font-mono);
  letter-spacing: -0.03em;
}

.badge-new-record {
  display: inline-block;
  background: var(--color-gold);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.score-breakdown-table {
  background: var(--bg-surface-subtle);
  border-radius: var(--radius-md);
  margin: 0 20px 20px 20px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

.breakdown-row span:last-child {
  font-family: var(--font-mono);
  color: var(--text-main);
}

.modal-footer-actions {
  display: flex;
  gap: 12px;
  padding: 0 20px 24px 20px;
}

.modal-footer-actions button {
  flex: 1;
  justify-content: center;
}

/* Settings List */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
}

.setting-inline-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
}

.setting-item.checkbox-row {
  cursor: pointer;
}

.setting-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 6px 0;
}

.setting-item.danger-row {
  align-items: flex-start;
}

.setting-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: normal;
  margin-top: 2px;
}

.btn-danger {
  background: var(--color-danger-subtle);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-danger:hover {
  background: var(--color-danger);
  color: #FFFFFF;
}

.hint-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-main);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .header-left {
    gap: 12px;
  }
  .brand-title {
    display: none;
  }
  .hud-level-concept {
    display: none;
  }
  .formula-helpers-row {
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .dock-actions-quick {
    display: none;
  }
}
