:root {
  --primary-color: #ffcc00;
  --secondary-color: #ffa500;
  --accent-color: #444;
  --highlight-color: #ffcc00;
  --background-color: #1a1a1a;
  --text-color: #e0e0e0;
  --card-bg: #2a2a2a;
  --border-color: #555;
  --transition-speed: 0.3s;
  --border-radius: 8px;
  --border-radius-lg: 14px;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 30px rgba(0, 0, 0, 0.45);
  --surface: rgba(30, 30, 30, 0.92);
  --surface-glass: rgba(26, 26, 26, 0.75);
  --surface-highlight: rgba(255, 204, 0, 0.08);
  --text-muted: rgba(224, 224, 224, 0.7);
  --ring: 0 0 0 3px rgba(255, 204, 0, 0.3);
  --max-width: 1120px;
  --glow: 0 0 30px rgba(255, 204, 0, 0.25);
  --card-border: rgba(255, 255, 255, 0.12);
  --elevation: 0 20px 40px rgba(0, 0, 0, 0.55);
  --space-lg: clamp(18px, 3vw, 28px);
  --space-md: clamp(12px, 2vw, 20px);
  --space-sm: clamp(8px, 1.5vw, 14px);
  --font-title: clamp(1.3rem, 2vw + 0.9rem, 2rem);
  --font-body: clamp(0.95rem, 0.6vw + 0.8rem, 1.05rem);
  --font-h1: clamp(1.5rem, 2.6vw + 1rem, 2.4rem);
  --font-h2: clamp(1.2rem, 1.8vw + 0.8rem, 1.7rem);
  --font-h3: clamp(1rem, 1vw + 0.8rem, 1.2rem);
  --button-height: 46px;
  --button-height-sm: 34px;
}

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

body {
  min-height: 100vh;
  overflow-y: auto;
  background: radial-gradient(circle at top, rgba(255, 204, 0, 0.12), transparent 45%),
    radial-gradient(circle at 20% 15%, rgba(0, 255, 255, 0.1), transparent 45%),
    radial-gradient(circle at 80% 30%, rgba(255, 120, 120, 0.12), transparent 40%),
    linear-gradient(135deg, #101010, #232323 50%, #141414);
  animation: bgGradient 16s ease infinite;
  color: var(--text-color);
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  font-size: var(--font-body);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 10% 20%, rgba(255, 204, 0, 0.08), transparent 35%),
    radial-gradient(circle at 90% 15%, rgba(70, 190, 255, 0.1), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(255, 150, 70, 0.08), transparent 45%);
  pointer-events: none;
  opacity: 0.8;
  z-index: -1;
}

body.js-enabled .reveal-card {
  opacity: 0;
  filter: blur(6px);
  transition: opacity 0.6s ease, filter 0.6s ease;
}

body.js-enabled .reveal-card.is-visible {
  opacity: 1;
  filter: blur(0);
}

#ai-loop {
  margin: 16px auto;
  padding: 10px 24px;
  border: 1px solid rgba(255, 204, 0, 0.6);
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(255, 204, 0, 0.15), rgba(20, 20, 20, 0.6));
  backdrop-filter: blur(6px);
  width: fit-content;
  font-size: 0.8em;
  text-align: center;
  transition: opacity 0.5s ease-in-out;
  animation: pulse 2s infinite;
  cursor: pointer;
}

.fade {
  opacity: 0;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 5px var(--primary-color);
  }
  50% {
    box-shadow: 0 0 20px var(--primary-color);
  }
  100% {
    box-shadow: 0 0 5px var(--primary-color);
  }
}

body.valentine-theme {
  --primary-color: #ff8fd1;
  --secondary-color: #ff6fa5;
  --accent-color: #4a1b3f;
  --highlight-color: #ffd1e8;
  --background-color: #2a0d1f;
  --card-bg: #3a1f2e;
  --border-color: #ff8fd1;
  --surface: rgba(58, 31, 46, 0.9);
  --surface-glass: rgba(68, 34, 52, 0.7);
  --surface-highlight: rgba(255, 143, 209, 0.15);
  --text-muted: rgba(255, 209, 232, 0.7);
  --ring: 0 0 0 3px rgba(255, 143, 209, 0.35);
}

@keyframes bgGradient {
  0% {
    background: linear-gradient(45deg, #1a1a1a, #333);
  }
  50% {
    background: linear-gradient(45deg, #333, #1a1a1a);
  }
  100% {
    background: linear-gradient(45deg, #1a1a1a, #333);
  }
}

header {
  margin: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 1200;
  background: rgba(10, 10, 10, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
}

.navbar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px var(--space-lg);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-md);
}

.nav-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand {
  font-family: 'Press Start 2P', cursive;
  font-size: clamp(1rem, 1.4vw + 0.6rem, 1.4rem);
  letter-spacing: 1px;
  color: var(--primary-color);
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-center,
.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-center {
  justify-content: center;
}

.nav-right {
  justify-content: flex-end;
}

.nav-link {
  color: var(--text-color);
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background var(--transition-speed), color var(--transition-speed);
}

.nav-link:hover {
  background: rgba(255, 204, 0, 0.15);
  color: var(--highlight-color);
}

.nav-ghost {
  border: 1px solid rgba(255, 204, 0, 0.4);
}

.nav-toggle-input {
  display: none;
}

.nav-toggle-button {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  justify-self: end;
}

.nav-toggle-button span {
  width: 24px;
  height: 2px;
  background: var(--text-color);
  border-radius: 999px;
}

@keyframes textPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

h1 {
  font-size: var(--font-h1);
  font-weight: 700;
  margin-bottom: 12px;
}

h2 {
  font-size: var(--font-h2);
  font-weight: 700;
  margin-bottom: 12px;
}

h3 {
  font-size: var(--font-h3);
  margin-bottom: 8px;
}

p {
  margin-bottom: 10px;
  color: var(--text-color);
}

a {
  text-decoration: none;
  color: var(--primary-color);
  transition: color var(--transition-speed);
}

a:hover {
  color: var(--highlight-color);
}

.container {
  max-width: var(--max-width);
  margin: 24px auto;
  padding: var(--space-md);
}

.dashboard {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-lg);
  display: grid;
  gap: var(--space-lg);
}

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-lg);
  align-items: center;
  padding: var(--space-lg);
  border-radius: var(--border-radius-lg);
  background: linear-gradient(140deg, rgba(20, 20, 20, 0.95), rgba(30, 30, 30, 0.75));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg);
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

.summary-card {
  display: grid;
  gap: 8px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--space-lg);
}

.dashboard-column {
  display: grid;
  gap: var(--space-lg);
}

.section-block {
  display: grid;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--border-radius-lg);
  background: rgba(12, 12, 12, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.section-header {
  display: grid;
  gap: 6px;
}

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

.section-grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.center {
  text-align: center;
}

.card,
.command-card,
.score-card {
  background: linear-gradient(140deg, var(--surface), rgba(20, 20, 20, 0.98));
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-lg);
  margin-bottom: 20px;
  transition: background-color var(--transition-speed), box-shadow 0.3s ease, transform 0.3s ease;
  transform: translateY(var(--float-offset, 0px));
  position: relative;
  overflow: hidden;
}

.card::before,
.command-card::before,
.score-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 204, 0, 0.08), transparent 40%, rgba(70, 190, 255, 0.08));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.content-grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.content-grid > .card,
.content-grid > .command-card,
.content-grid > .score-card {
  margin-bottom: 0;
}

.content-grid .score-card,
.content-grid .progress-container {
  grid-column: 1 / -1;
}

.card:hover,
.command-card:hover,
.score-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--elevation);
}

.card:hover::before,
.command-card:hover::before,
.score-card:hover::before {
  opacity: 1;
}

.auth-card {
  border: 1px solid rgba(255, 204, 0, 0.35);
  background: linear-gradient(140deg, rgba(35, 35, 35, 0.95), rgba(18, 18, 18, 0.98));
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 16px;
}

.auth-grid form {
  display: grid;
  gap: 10px;
}

.auth-grid input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: rgba(12, 12, 12, 0.8);
  color: var(--text-color);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-grid input:focus,
.command-card input:focus,
.coin-game-input:focus,
.math-input:focus,
.window-content textarea:focus {
  outline: none;
  border-color: var(--highlight-color);
  box-shadow: var(--ring);
}

.auth-manage {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 12, 12, 0.55);
  display: grid;
  gap: 10px;
}

.auth-manage form {
  display: grid;
  gap: 10px;
}

.auth-manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.file-btn.danger {
  border-color: rgba(255, 77, 109, 0.5);
  color: #ff9ab1;
}

.file-btn.danger:hover {
  box-shadow: 0 0 18px rgba(255, 77, 109, 0.3);
}

.auth-footnote {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-pill {
  background: rgba(255, 204, 0, 0.2);
  border: 1px solid rgba(255, 204, 0, 0.4);
  color: var(--highlight-color);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.file-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.data-grid,
.rally-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 16px;
}

.template-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 16px;
}

.data-card,
.rally-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 204, 0, 0.2);
  border-radius: 10px;
  padding: 14px;
  display: grid;
  gap: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.template-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 204, 0, 0.2);
  border-radius: 10px;
  padding: 14px;
  display: grid;
  gap: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.data-card h3,
.rally-card h3 {
  font-size: 1rem;
  color: var(--highlight-color);
}

.template-card h3 {
  font-size: 1rem;
  color: var(--highlight-color);
}

.data-card:hover,
.rally-card:hover,
.template-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.5);
}

.data-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.steps-list,
.tips-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  padding-left: 20px;
  color: rgba(224, 224, 224, 0.75);
  font-size: 0.9rem;
}

.steps-list code,
.tips-list code {
  color: var(--highlight-color);
}

.landing-hero {
  text-align: center;
}

.landing-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.landing-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.progress-container {
  width: 100%;
  background: var(--accent-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-bar {
  height: 20px;
  width: 0%;
  background: linear-gradient(120deg, var(--highlight-color), rgba(255, 160, 70, 0.95));
  transition: width 0.5s ease;
}

ul {
  list-style: none;
  padding-left: 0;
}

li {
  margin-bottom: 15px;
  position: relative;
}

li label {
  cursor: pointer;
  display: inline-block;
}

.subtask {
  margin-left: 20px;
  margin-top: 10px;
}

.subtask li {
  margin-bottom: 10px;
  list-style-type: disc;
}

input[type='checkbox'] {
  margin-right: 10px;
  transform: scale(1.2);
  vertical-align: middle;
}

.done {
  text-decoration: line-through;
  color: var(--secondary-color);
}

.pulse {
  animation: pulseGlow 0.6s ease-in-out;
}

@keyframes pulseGlow {
  0% {
    text-shadow: 0 0 0 transparent;
  }
  50% {
    text-shadow: 0 0 12px var(--highlight-color);
  }
  100% {
    text-shadow: 0 0 0 transparent;
  }
}

.swap-clean {
  animation: swapClean 0.6s ease-in-out;
}

@keyframes swapClean {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.file-btn {
  min-height: var(--button-height);
  padding: 10px 20px;
  margin: 5px;
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.95), rgba(255, 176, 77, 0.95));
  color: #111;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition-speed), transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  font-size: 0.95rem;
}

.file-btn.ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--highlight-color);
  border: 1px solid rgba(255, 204, 0, 0.6);
}

.file-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-color);
}

.file-btn.small {
  min-height: var(--button-height-sm);
  padding: 6px 14px;
  font-size: 0.85rem;
}

.file-btn:hover {
  background: var(--highlight-color);
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

.file-btn:active {
  transform: translateY(0);
}

.file-btn:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.file-btn.block {
  display: block;
  margin: 20px auto 0;
}

.command-card input,
.coin-game-input,
.math-input {
  width: min(520px, 100%);
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(12, 12, 12, 0.9);
  color: var(--text-color);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.command-output,
.status-banner,
.coin-status,
.coin-error {
  margin-top: 12px;
  padding: 10px;
  border-radius: var(--border-radius);
  font-size: 0.95rem;
}

.command-output {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  white-space: pre-line;
}

.status-banner {
  background: var(--surface-highlight);
  border: 1px solid rgba(255, 204, 0, 0.4);
  text-align: center;
  box-shadow: var(--shadow);
}

.coin-status {
  background: rgba(0, 128, 255, 0.1);
  border: 1px solid rgba(0, 128, 255, 0.4);
}

.coin-error {
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.4);
  color: #ff4d4d;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.85);
}

.modal-content {
  background-color: var(--surface);
  margin: 10% auto;
  padding: var(--space-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 90%;
  max-width: 600px;
  border-radius: var(--border-radius-lg);
  text-align: center;
  box-shadow: var(--elevation);
  backdrop-filter: blur(10px);
}

.modal-content button {
  margin-top: 15px;
  padding: 10px 20px;
  background: var(--primary-color);
  color: var(--background-color);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background var(--transition-speed);
}

.modal-content button:hover {
  background: var(--highlight-color);
}

#desktop {
  position: relative;
  width: 100%;
  min-height: 300px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius-lg);
  margin: 20px 0;
  overflow: hidden;
  padding: var(--space-sm);
  background: rgba(10, 10, 10, 0.6);
}

.window {
  position: absolute;
  width: 280px;
  background: var(--surface-glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-speed);
}

.window-header {
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.9), rgba(255, 160, 70, 0.9));
  color: #111;
  padding: 8px;
  cursor: move;
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
  user-select: none;
}

.window-content {
  padding: 10px;
  font-size: 0.95rem;
}

.window-content textarea {
  width: 100%;
  height: 100px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(12, 12, 12, 0.9);
  color: var(--text-color);
}

.window-footer {
  text-align: right;
  padding: 5px;
  font-size: 0.8rem;
  color: var(--secondary-color);
}

.popup-alert {
  display: inline-block;
  padding: 10px 15px;
  background-color: #f4e1c1;
  color: #8b4513;
  border: 2px solid #8b4513;
  border-radius: 5px;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  animation: popupAnimation 0.5s ease-in-out,
    woodSway 2s ease-in-out infinite 2.5s;
  margin-top: 10px;
}

@keyframes popupAnimation {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes woodSway {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(2deg);
  }
  50% {
    transform: rotate(0deg);
  }
  75% {
    transform: rotate(-2deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.coin-display {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.coin-log {
  font-weight: bold;
}

.math-result {
  margin-top: 10px;
  font-weight: bold;
}

.memo-output {
  margin-top: 10px;
  font-size: 0.9rem;
}


#notesWindow {
  top: 20px;
  left: 20px;
}

#fileViewerWindow {
  top: 160px;
  left: 320px;
}

.coin {
  padding: 6px 10px;
  background: rgba(255, 204, 0, 0.2);
  border: 1px solid var(--highlight-color);
  border-radius: 999px;
  min-width: 40px;
  text-align: center;
}

.folder {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 8px 0;
}

.folder:focus-visible {
  outline: 2px solid var(--highlight-color);
  outline-offset: 2px;
}

.folder-content {
  display: none;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--background-color);
  margin-bottom: 10px;
}

.brake-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: center;
}

.brake-controls {
  display: grid;
  gap: 12px;
}

.brake-pressure-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brake-pressure-value {
  min-width: 52px;
  font-weight: bold;
  color: var(--highlight-color);
}

.brake-toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.9rem;
}

.brake-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brake-display {
  display: grid;
  gap: 16px;
  align-items: center;
  justify-items: center;
}

.brake-gauge {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(
    var(--highlight-color) var(--brake-level, 45%),
    rgba(255, 255, 255, 0.08) 0
  );
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6), var(--glow);
  position: relative;
}

.brake-gauge::after {
  content: '';
  position: absolute;
  inset: 12px;
  background: var(--card-bg);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brake-gauge-value,
.brake-gauge-label {
  position: relative;
  z-index: 1;
  text-align: center;
}

.brake-gauge-value {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--highlight-color);
}

.brake-gauge-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(224, 224, 224, 0.7);
}

.brake-metrics {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

.brake-signal {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  text-align: center;
  min-width: 200px;
}

.whiteout-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.2));
  opacity: 0;
  pointer-events: none;
  z-index: 1200;
}

.whiteout-overlay.active {
  animation: whiteoutFlash 0.7s ease-out;
}

@keyframes whiteoutFlash {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
  }
}

footer {
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.95), rgba(255, 148, 77, 0.95));
  padding: 20px 10px;
  text-align: center;
  color: #111;
  border-radius: var(--border-radius-lg);
  margin-top: 20px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
}

footer .social-links a {
  margin: 0 10px;
  color: var(--background-color);
  transition: transform var(--transition-speed);
}

footer .social-links a:hover {
  transform: scale(1.1);
}

.status-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 600px) {
  .navbar {
    grid-template-columns: auto 1fr auto;
    padding: 14px var(--space-md);
  }

  .nav-center {
    position: absolute;
    top: 64px;
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: flex-start;
    background: rgba(10, 10, 10, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 12px;
    gap: 8px;
    box-shadow: var(--shadow-lg);
    display: none;
  }

  .nav-toggle-button {
    display: flex;
  }

  .nav-toggle-input:checked ~ .nav-center {
    display: flex;
  }

  .nav-left {
    flex-wrap: wrap;
  }

  .nav-right {
    gap: 8px;
  }

  .dashboard {
    padding: var(--space-md);
  }

  .hero-section {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: var(--space-sm);
    max-width: 94%;
  }

  .card,
  .command-card,
  .score-card {
    padding: var(--space-md);
  }

  input[type='checkbox'] {
    transform: scale(1);
  }

  .window {
    width: 100%;
    position: relative;
    left: 0;
    top: 0;
    margin-bottom: var(--space-md);
  }

  #ai-loop,
  .file-btn {
    font-size: 0.7em;
  }

  .section-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
