:root {
  color-scheme: dark;
  --bg: #101418;
  --panel: #171d22;
  --panel-2: #202830;
  --line: #33404b;
  --text: #f5f7f9;
  --muted: #a9b5bf;
  --accent: #39d98a;
  --danger: #ff5a66;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(57, 217, 138, 0.12), transparent 30rem),
    linear-gradient(135deg, #101418, #11181e 55%, #15191d);
  color: var(--text);
}

html {
  scroll-behavior: smooth;
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
  min-width: 0;
}

.home-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(16, 20, 24, 0.9);
  backdrop-filter: blur(16px);
}

.app-page {
  display: none;
  width: min(1180px, calc(100% - 2rem));
  max-width: 100%;
  margin: 0 auto;
  padding: 1rem 0 4rem;
  overflow-x: hidden;
}

.app-page.is-active {
  display: block;
}

.nav-button {
  background: transparent;
  border: 0;
  cursor: pointer;
}

.home-grid,
.profile-grid,
.results-layout,
.leaderboard-grid {
  display: grid;
  gap: 1rem;
}

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

.profile-grid,
.results-layout {
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
}

.leaderboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-hero,
.home-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(23, 29, 34, 0.88);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.home-hero {
  display: grid;
  align-content: space-between;
  min-height: 30rem;
}

.home-hero h1,
.guide-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.home-hero p {
  max-width: 42rem;
  color: var(--muted);
  line-height: 1.6;
}

.home-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  max-width: 34rem;
}

.compact-button {
  min-height: 2.1rem;
  padding: 0 0.7rem;
  font-size: 0.85rem;
}

.player-list,
.preset-list,
.preset-picker,
.preset-page-list,
.result-list,
.compact-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.player-card,
.preset-card,
.preset-color-choice,
.result-row,
.leaderboard-list li {
  display: grid;
  gap: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #10161b;
  padding: 0.8rem;
}

.selectable-card {
  width: 100%;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.player-page-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.page-heading {
  margin-bottom: 1rem;
}

.player-card span,
.preset-card span,
.preset-card small,
.result-row span,
.result-row small,
.leaderboard-list span {
  color: var(--muted);
}

.player-hero-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(57, 217, 138, 0.18), rgba(47, 128, 255, 0.08)), #10161b;
  padding: clamp(1rem, 3vw, 1.4rem);
}

.player-hero-panel h2 {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
}

.player-score-orb {
  display: grid;
  place-items: center;
  width: 7rem;
  aspect-ratio: 1;
  border: 1px solid rgba(57, 217, 138, 0.45);
  border-radius: 50%;
  background: rgba(16, 20, 24, 0.74);
  box-shadow: 0 0 44px rgba(57, 217, 138, 0.16);
}

.player-score-orb strong {
  font-size: 1.45rem;
}

.player-score-orb span {
  color: var(--muted);
  font-size: 0.75rem;
}

.player-stat-grid,
.profile-grid-wide {
  display: grid;
  gap: 1rem;
}

.player-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.player-stat-grid article {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(23, 29, 34, 0.88);
  padding: 0.9rem;
}

.player-stat-grid strong {
  display: block;
  font-size: 1.25rem;
}

.player-stat-grid span {
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-grid-wide {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-bottom: 1rem;
}

.trend-chart {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.trend-chart svg {
  width: 100%;
  min-height: 10rem;
  border-radius: 8px;
  background: #10161b;
}

.trend-chart line {
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1;
}

.trend-chart polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-chart circle {
  fill: #10161b;
  stroke: var(--accent);
  stroke-width: 3;
}

.trend-chart text {
  fill: var(--muted);
  font-size: 0.68rem;
  text-anchor: middle;
}

.trend-caption {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.trend-caption strong {
  color: var(--accent);
}

.single-chart,
.empty-chart {
  min-height: 10rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #10161b;
}

.preset-performance-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.admin-dashboard {
  display: grid;
  gap: 1rem;
}

.admin-activity-row {
  display: grid;
  gap: 0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #10161b;
  padding: 0.8rem;
}

.admin-activity-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.preset-performance-list div {
  display: grid;
  gap: 0.35rem;
}

.preset-performance-list span {
  color: var(--muted);
  font-size: 0.82rem;
}

progress {
  width: 100%;
  height: 0.65rem;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
}

progress::-webkit-progress-bar {
  background: #202830;
}

progress::-webkit-progress-value {
  background: var(--accent);
}

.preset-card {
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.8rem;
}

.preset-card:hover,
.preset-card:focus {
  border-color: rgba(57, 217, 138, 0.55);
}

.preset-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.preset-card-main {
  display: grid;
  gap: 0.45rem;
}

.preset-card-title {
  display: block;
  font-size: 1.05rem;
}

.preset-card-description {
  display: block;
  line-height: 1.45;
}

.preset-key-configs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.preset-key-configs span {
  display: inline-grid;
  min-height: 1.8rem;
  place-items: center;
  padding: 0 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.mini-swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin-top: 0.4rem;
}

.mini-swatch-row span:not(.mini-swatch) {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.mini-swatch {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.preset-detail-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 0.7fr);
  gap: 1rem;
}

.preset-detail-form {
  display: grid;
  gap: 0.8rem;
}

.preset-color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.preset-color-choice {
  color: var(--text);
}

.preset-color-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
}

.preset-color-choice.is-selected,
.preset-color-choice:has(input:checked) {
  border-color: var(--accent);
}

.preset-color-meta {
  margin-top: 1rem;
}

.danger-text {
  color: var(--danger);
}

.result-row {
  width: 100%;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.result-row.is-selected {
  border-color: var(--accent);
}

.detail-panel,
.detail-stats {
  display: grid;
  gap: 0.8rem;
}

.detail-hero {
  border-radius: 8px;
  background: #10161b;
  padding: 1rem;
}

.detail-hero p {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.detail-stats {
  grid-template-columns: repeat(3, 1fr);
}

.detail-stats div {
  border-radius: 8px;
  background: #10161b;
  padding: 0.8rem;
}

.detail-stats strong {
  display: block;
  font-size: 1.35rem;
}

.detail-stats span {
  color: var(--muted);
  font-size: 0.78rem;
}

.leaderboard-list {
  display: grid;
  gap: 0.55rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.stacked-form {
  display: grid;
  gap: 0.85rem;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.8rem;
  background: #101418;
  animation: splashAway 900ms ease 850ms forwards;
}

.splash-screen img {
  width: 6.4rem;
  height: 6.4rem;
  animation: pulseLogo 900ms ease-in-out infinite alternate;
}

.splash-screen strong {
  font-size: 1.45rem;
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.modal-card {
  display: grid;
  gap: 0.85rem;
  width: min(92vw, 420px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #171d22;
  padding: 1rem;
}

.wide-modal .modal-card {
  width: min(94vw, 760px);
}

.modal-logo {
  width: 4.4rem;
  height: 4.4rem;
}

.status-note {
  min-height: 1.2rem;
  margin: 0;
  color: var(--accent);
  font-size: 0.85rem;
}

body.is-playing {
  overscroll-behavior: none;
}

body.is-playing .home-header {
  display: none;
}

body.is-playing .app-page {
  width: 100%;
  padding: 0;
}

body.is-playing .training-stage {
  position: fixed;
  inset: 0;
  z-index: 10;
  min-height: 100svh;
  display: block;
  border: 0;
  padding: 0;
  background: #101418;
  box-shadow: none;
}

body.is-playing .app-shell {
  display: block;
  min-height: 100svh;
}

body.is-playing .control-panel {
  display: none;
}

body.is-playing .pod-screen {
  position: fixed;
  inset: 0;
  z-index: 1;
  min-height: 100svh;
  height: 100svh;
  border-radius: 0;
  box-shadow: none;
  touch-action: none;
}

body.is-playing .pod-screen::after {
  opacity: 0;
}

body.is-playing .pod-screen:active {
  transform: none;
}

body.is-playing .stage-summary {
  display: none;
}

body.is-playing .metric-strip {
  position: fixed;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.7rem;
  z-index: 4;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: rgba(16, 20, 24, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  backdrop-filter: blur(14px);
  padding: 0.35rem;
}

body.is-playing .metric-strip div {
  padding: 0.45rem;
  background: rgba(255, 255, 255, 0.06);
}

body.is-playing .metric-strip span {
  font-size: clamp(0.9rem, 2vw, 1.35rem);
}

body.is-playing .metric-strip small {
  font-size: 0.68rem;
}

body.is-playing .run-controls {
  position: fixed;
  right: 0.7rem;
  top: 0.7rem;
  z-index: 5;
  display: flex;
}

body.is-playing .run-controls .primary-button {
  display: none;
}

body.is-playing .status-bar {
  position: fixed;
  left: 0.7rem;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 5;
  color: #fff;
}

.game-actions {
  display: none;
  gap: 0.45rem;
}

body.is-playing .game-actions {
  display: flex;
  pointer-events: auto;
}

body.is-playing .run-controls {
  display: none;
}

.brand-mark,
.site-nav a {
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 850;
}

.brand-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 28px rgba(57, 217, 138, 0.8);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.menu-toggle {
  display: none;
  min-height: 2.4rem;
  padding: 0 0.85rem;
  background: var(--panel-2);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 850;
}

.site-nav a,
.site-nav button {
  min-height: 2.25rem;
  padding: 0.62rem 0.85rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
}

.site-nav a:hover,
.site-nav button:hover,
.site-nav button.is-active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 420px);
  gap: 1rem;
  min-height: calc(100vh - 4.25rem);
  max-width: 100%;
  min-width: 0;
}

.training-stage,
.control-panel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(23, 29, 34, 0.88);
  box-shadow: var(--shadow);
}

.training-stage {
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr) auto auto;
  gap: 1rem;
  min-height: calc(100vh - 6.25rem);
  padding: clamp(1rem, 2vw, 1.5rem);
}

.status-bar,
.section-heading,
.run-controls,
.tabs,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

h2 {
  font-size: 1rem;
}

.pod-screen {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 100%;
  border: 0;
  border-radius: 8px;
  background: #262f38;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  transition: transform 120ms ease, background 180ms ease, box-shadow 180ms ease;
  touch-action: manipulation;
}

.pod-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.32), transparent 58%);
  opacity: 0.25;
  pointer-events: none;
}

.pod-screen:active {
  transform: scale(0.99);
}

.pod-screen.is-active {
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.16), 0 0 90px var(--active-glow, rgba(57, 217, 138, 0.38));
}

.pod-screen.is-resting {
  background: #1b242b;
}

.pod-screen.is-wrong {
  animation: wrong 220ms ease;
}

#podLabel {
  z-index: 1;
  font-size: clamp(2.6rem, 11vw, 7.5rem);
  font-weight: 900;
  line-height: 0.95;
  text-align: center;
}

.pod-subcopy {
  z-index: 1;
  max-width: 26rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(1rem, 2vw, 1.25rem);
  text-align: center;
}

.toggle-row {
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 3rem;
}

.toggle-row input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.switch-ui {
  position: relative;
  width: 3.2rem;
  height: 1.7rem;
  border-radius: 999px;
  background: #33404b;
  transition: background 160ms ease;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: #a9b5bf;
  transition: transform 160ms ease, background 160ms ease;
}

.toggle-row input:checked + .switch-ui {
  background: rgba(57, 217, 138, 0.28);
}

.toggle-row input:checked + .switch-ui::after {
  transform: translateX(1.5rem);
  background: var(--accent);
}

.stage-summary {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.7rem;
}

.stage-summary.is-visible {
  display: grid;
}

.stage-summary h2 {
  grid-column: 1 / -1;
  font-size: 1rem;
}

.summary-stat {
  min-width: 0;
  padding: 0.65rem;
  border-radius: 8px;
  background: #10161b;
}

.summary-stat strong {
  display: block;
  font-size: clamp(1rem, 2.5vw, 1.55rem);
}

.summary-stat span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.metric-strip div,
.result-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.metric-strip div {
  padding: 0.8rem;
  min-width: 0;
}

.metric-strip span {
  display: block;
  font-size: clamp(1.15rem, 3vw, 1.8rem);
  font-weight: 850;
}

small,
label,
.history-list,
.panel-copy {
  color: var(--muted);
}

button {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.primary-button,
.secondary-button,
.icon-button,
.tab {
  min-height: 2.75rem;
  padding: 0 1rem;
  cursor: pointer;
}

.primary-button {
  flex: 1;
  border-color: transparent;
  background: var(--accent);
  color: #07140d;
  font-weight: 850;
}

.secondary-button,
.icon-button,
.tab {
  background: var(--panel-2);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.control-panel {
  min-height: calc(100vh - 6.25rem);
  padding: 0.75rem;
  overflow: hidden;
}

.tabs {
  margin-bottom: 0.75rem;
  padding: 0.25rem;
  border-radius: 8px;
  background: #11171c;
}

.tab {
  flex: 1;
  border: 0;
  color: var(--muted);
}

.tab.is-active {
  background: #26323b;
  color: var(--text);
}

.panel-page {
  display: none;
  max-height: calc(100vh - 6rem);
  overflow: auto;
  padding-right: 0.25rem;
}

.panel-page.is-active {
  display: grid;
  gap: 0.8rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10161b;
  color: var(--text);
  padding: 0 0.75rem;
}

textarea {
  min-height: 5rem;
  padding: 0.75rem;
  resize: vertical;
}

.results-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.results-overview article,
.insight-list p {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(23, 29, 34, 0.88);
  padding: 0.8rem;
}

.results-overview strong {
  display: block;
  font-size: 1.35rem;
}

.results-overview span,
.insight-list p {
  color: var(--muted);
}

.attempt-score {
  display: inline-grid;
  margin-top: 0.8rem;
  min-height: 2rem;
  place-items: center;
  padding: 0 0.7rem;
  border-radius: 999px;
  background: rgba(57, 217, 138, 0.16);
  color: var(--accent);
}

.insight-list {
  display: grid;
  gap: 0.55rem;
}

.two-col,
.mode-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}

.color-toggle {
  min-height: 4.5rem;
  padding: 0.4rem;
  background: #11171c;
}

.color-swatch {
  display: block;
  height: 2rem;
  border-radius: 6px;
  margin-bottom: 0.4rem;
}

.color-toggle.is-selected {
  border-color: var(--accent);
}

.result-card {
  padding: 1rem;
}

dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem 1rem;
  margin: 0.8rem 0 0;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 800;
}

.history-list {
  display: grid;
  gap: 0.55rem;
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
}

.panel-copy {
  margin: 0.55rem 0 0.85rem;
  line-height: 1.5;
}

.stacked-actions {
  margin-bottom: 0.8rem;
}

.status-pill {
  display: inline-grid;
  place-items: center;
  min-height: 1.8rem;
  padding: 0 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
}

.pod-list {
  display: grid;
  gap: 0.55rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.pod-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  min-height: 2.4rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #10161b;
}

.pod-list small {
  color: var(--muted);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}

.guide-section {
  width: 100%;
  margin: 0 auto;
  padding: 3rem 0 0;
  scroll-margin-top: 4.25rem;
}

.guide-section.is-first {
  padding-top: 0;
}

.guide-section:last-of-type {
  padding-bottom: 4rem;
}

.guide-heading {
  display: grid;
  gap: 0.6rem;
  max-width: 46rem;
  margin-bottom: 1.1rem;
}

.guide-heading h2 {
  font-size: clamp(1.65rem, 3vw, 2.45rem);
}

.guide-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.tutorial-grid,
.feature-list,
.use-case-grid {
  display: grid;
  gap: 0.8rem;
}

.tutorial-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-list,
.use-case-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tutorial-card,
.feature-list article,
.use-case-grid article {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(23, 29, 34, 0.82);
}

.tutorial-card {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.feature-list article,
.use-case-grid article {
  padding: 1rem;
}

.tutorial-card h3,
.feature-list h3,
.use-case-grid h3 {
  margin: 0;
  font-size: 1rem;
}

.tutorial-card p,
.feature-list p,
.use-case-grid p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.visual {
  display: grid;
  min-height: 8rem;
  border-radius: 8px;
  background: #10161b;
  border: 1px solid var(--line);
  overflow: hidden;
}

.visual-phone {
  place-items: center;
  position: relative;
}

.visual-phone::before {
  content: "";
  width: 4.6rem;
  height: 7.4rem;
  border: 0.35rem solid #33404b;
  border-radius: 1rem;
  background: linear-gradient(#1c252d, #39d98a);
}

.phone-speaker {
  position: absolute;
  top: 1.45rem;
  width: 2.2rem;
  height: 0.22rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
}

.phone-screen {
  position: absolute;
  bottom: 2rem;
  color: #07140d;
  font-size: 0.82rem;
  font-weight: 850;
}

.visual-controls {
  align-content: center;
  gap: 0.5rem;
  padding: 1.1rem;
}

.visual-controls span {
  display: block;
  height: 0.72rem;
  border-radius: 999px;
  background: #33404b;
}

.visual-controls span:nth-child(2) {
  width: 72%;
}

.visual-controls span:nth-child(3) {
  width: 52%;
}

.visual-controls strong {
  display: inline-grid;
  place-items: center;
  width: 5rem;
  min-height: 2rem;
  border-radius: 8px;
  background: var(--accent);
  color: #07140d;
}

.visual-timing,
.visual-run,
.visual-repeat {
  align-content: center;
  gap: 0.6rem;
  padding: 1rem;
}

.visual-timing span,
.visual-run span,
.visual-repeat span {
  display: grid;
  place-items: center;
  min-height: 2.1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #182027;
  font-weight: 800;
}

.visual-colors {
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
  padding: 1rem;
}

.visual-colors span {
  border-radius: 8px;
  background: var(--swatch);
  box-shadow: 0 0 28px rgba(255, 255, 255, 0.12);
}

@keyframes wrong {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}

@keyframes splashAway {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes pulseLogo {
  from {
    transform: scale(0.96);
    filter: drop-shadow(0 0 14px rgba(57, 217, 138, 0.35));
  }
  to {
    transform: scale(1.04);
    filter: drop-shadow(0 0 32px rgba(57, 217, 138, 0.7));
  }
}

@media (max-width: 860px) {
  .home-header {
    align-items: center;
    flex-direction: row;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
  }

  .site-nav {
    position: fixed;
    top: 3.8rem;
    right: 0.75rem;
    z-index: 12;
    display: none;
    width: min(18rem, calc(100vw - 1.5rem));
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(16, 20, 24, 0.98);
    padding: 0.55rem;
    box-shadow: var(--shadow);
  }

  body.menu-open .site-nav {
    display: flex;
  }

  .site-nav button {
    width: 100%;
    text-align: left;
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 0;
  }

  .home-grid,
  .profile-grid,
  .results-layout,
  .leaderboard-grid,
  .results-overview,
  .player-stat-grid,
  .profile-grid-wide,
  .player-page-list,
  .preset-detail-layout {
    grid-template-columns: 1fr;
  }

  .training-stage,
  .control-panel {
    min-height: auto;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .training-stage {
    min-height: calc(100svh - 5.5rem);
    border-top: 0;
  }

  .pod-screen {
    min-height: 48svh;
  }

  body.is-playing .pod-screen {
    min-height: 100svh;
  }

  .panel-page {
    max-height: none;
  }

  .tutorial-grid,
  .feature-list,
  .use-case-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .preset-card {
    grid-template-columns: 1fr;
  }

  .preset-actions {
    width: 100%;
  }

  .preset-actions .compact-button {
    flex: 1;
  }

  .metric-strip,
  .stage-summary,
  .two-col,
  .mode-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .run-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .primary-button {
    grid-column: 1 / -1;
  }

  .home-actions {
    grid-template-columns: 1fr 1fr;
  }

  body.is-playing .metric-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-height: 7rem;
    overflow: hidden;
  }

  .tutorial-grid,
  .feature-list,
  .use-case-grid {
    grid-template-columns: 1fr;
  }

  .guide-section {
    width: min(100% - 1rem, 1180px);
    padding-top: 3rem;
  }
}
