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

:root {
  --topbar-h: 64px;
  --font-main: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --radius: 18px;
  --radius-sm: 12px;

  --bg: #0b1120;
  --card-bg: #111a2e;
  --card-hover: #16213a;
  --text-primary: #e6edf7;
  --text-secondary: rgba(230, 237, 247, 0.62);
  --text-muted: rgba(230, 237, 247, 0.4);
  --border-color: rgba(148, 163, 184, 0.14);
  --accent: #2dd4bf;
  --accent-strong: #14b8a6;
  --accent-2: #38bdf8;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --on-accent: #042f2e;
  --danger: #fb7185;
  --shadow-color: rgba(0, 0, 0, 0.35);
  --header-solid: rgba(11, 17, 32, 0.8);
  --grid-line: rgba(148, 163, 184, 0.05);
  --input-bg: #0d1528;

  --board-lines: #16203a;
  --cell-bg: #0c1427;
  --wall: #34445f;
  --frontier: #2dd4bf;
  --visit-mid: #14b8a6;
  --visited: #0f4e4a;
  --visited-alt: #0c4468;
  --path: #fbbf24;
  --path-glow: rgba(251, 191, 36, 0.5);
  --weight: #a78bfa;
  --start: #2dd4bf;
  --end: #fb7185;
  --head: #38bdf8;
}

[data-theme="light"] {
  --bg: #f6f8fb;
  --card-bg: #ffffff;
  --card-hover: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: rgba(15, 23, 42, 0.66);
  --text-muted: rgba(15, 23, 42, 0.42);
  --border-color: rgba(15, 23, 42, 0.1);
  --accent: #0d9488;
  --accent-strong: #0f766e;
  --accent-2: #0284c7;
  --accent-soft: rgba(13, 148, 136, 0.1);
  --on-accent: #ffffff;
  --danger: #e11d48;
  --shadow-color: rgba(15, 23, 42, 0.08);
  --header-solid: rgba(246, 248, 251, 0.85);
  --grid-line: rgba(15, 23, 42, 0.04);
  --input-bg: #f8fafc;

  --board-lines: #e2e8f0;
  --cell-bg: #ffffff;
  --wall: #1e293b;
  --frontier: #14b8a6;
  --visit-mid: #5eead4;
  --visited: #a7f3e6;
  --visited-alt: #bae6fd;
  --path: #f59e0b;
  --path-glow: rgba(245, 158, 11, 0.28);
  --weight: #7c3aed;
  --start: #0d9488;
  --end: #e11d48;
  --head: #0284c7;
}


html {
  color-scheme: dark;
}

[data-theme="light"] {
  color-scheme: light;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.35;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 5px;
  border: 1px solid currentColor;
  opacity: 0.55;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at top, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at top, #000 20%, transparent 75%);
}


.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--header-solid);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.logo-bg {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-opacity: 0.35;
}

.logo-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-start {
  fill: var(--accent);
}

.logo-end {
  fill: var(--accent-2);
}

.brand-name {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-left: 12px;
  border-left: 1px solid var(--border-color);
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.tab i {
  font-size: 0.8rem;
}

.tab:hover {
  color: var(--text-primary);
}

.tab[aria-current="page"] {
  color: var(--on-accent);
  background: var(--accent);
}

.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  font-family: var(--font-main);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.link-pill:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--text-secondary);
  transition: color 0.2s, background 0.2s, transform 0.15s;
}

.icon-btn:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--card-hover);
}

.icon-btn:active:not(:disabled) {
  transform: scale(0.92);
}


.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 316px minmax(0, 1fr);
  gap: 20px;
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  padding: 20px 24px 24px;
}

.panel,
.stage-card,
.stat {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px -18px var(--shadow-color);
}


.panel {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow-y: auto;
  scrollbar-width: thin;
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
}

.panel-section + .panel-section {
  border-top: 1px solid var(--border-color);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.info {
  margin-left: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: help;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.disabled {
  opacity: 0.4;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.field-label output {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.select {
  position: relative;
  display: block;
}

.select select {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 14px;
  appearance: none;
  -webkit-appearance: none;
  font: 500 0.92rem var(--font-main);
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s;
}

.select select:hover {
  border-color: var(--accent);
}

.select option {
  background: var(--card-bg);
  color: var(--text-primary);
}

.select i {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: var(--text-muted);
  pointer-events: none;
}

.algo-desc,
.tool-hint {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.tool-hint {
  min-height: 4.1em;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
}

.tool-hint strong {
  color: var(--text-primary);
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: var(--card-hover);
  border: 1px solid var(--border-color);
}

.chip i {
  font-size: 0.65rem;
}

.chip.yes i {
  color: var(--accent);
}

.chip.no {
  color: var(--text-muted);
}

.chip.no i {
  color: var(--danger);
}


input[type="range"] {
  width: 100%;
  height: 18px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: var(--board-lines);
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: var(--board-lines);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  transition: transform 0.15s;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.15);
}

input[type="range"]:focus-visible {
  outline: none;
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 35%, transparent);
}

input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 35%, transparent);
}

input[type="range"]:disabled {
  cursor: default;
}


.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn kbd {
  margin-left: auto;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-strong);
  box-shadow: 0 8px 24px -8px var(--accent);
}

.btn-secondary {
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

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

.btn-ghost {
  flex: 1;
  height: 38px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--card-hover);
}

.btn-row {
  display: flex;
  gap: 8px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  border: 1px solid var(--border-color);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  border-radius: 9px;
  font-family: var(--font-main);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}

.segmented button i {
  font-size: 0.72rem;
}

.segmented button:hover {
  color: var(--text-primary);
}

.segmented button[aria-checked="true"] {
  color: var(--text-primary);
  background: var(--card-hover);
  box-shadow: 0 1px 0 var(--border-color), 0 4px 12px -6px var(--shadow-color);
}

.segmented button[aria-checked="true"] i {
  color: var(--accent);
}

.panel-footer {
  margin-top: auto;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shortcuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.shortcuts kbd {
  margin-right: 4px;
}

.credit {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.credit a {
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  transition: color 0.2s, border-color 0.2s;
}

.credit a:hover {
  color: var(--accent);
  border-color: var(--accent);
}


.stage {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  min-height: 0;
}

.stage-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
}

.toolbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding: 10px 12px 10px 20px;
  border-bottom: 1px solid var(--border-color);
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 0.88rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s;
}

.status[data-state="running"] .status-dot {
  background: var(--accent-2);
  animation: pulse 1.4s ease-in-out infinite;
}

.status[data-state="running"][data-paused="true"] .status-dot {
  animation: none;
}

.status[data-state="done"] .status-dot {
  background: var(--accent);
}

.status[data-state="fail"] .status-dot {
  background: var(--danger);
}

.status-label {
  font-family: var(--font-main);
  font-weight: 600;
  white-space: nowrap;
}

.status-detail {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-detail:not(:empty)::before {
  content: "·";
  margin-right: 10px;
  color: var(--text-muted);
}

.playback {
  display: flex;
  align-items: center;
  gap: 2px;
}

.divider {
  width: 1px;
  height: 20px;
  margin: 0 10px;
  background: var(--border-color);
}

.speed {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.speed input {
  width: 110px;
}

.speed output {
  min-width: 58px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
}

.tipbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px 9px 20px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border-color);
}

.tip-icon {
  color: var(--accent);
}

.tip-text {
  flex: 1;
  min-width: 0;
  line-height: 1.5;
}

.tip-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.tip-link {
  font-family: var(--font-main);
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.tip-link:hover {
  text-decoration: underline;
}

.tip-close {
  width: 30px;
  height: 30px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin: 0 2px;
  border-radius: 50%;
  vertical-align: -1px;
}

.dot-start {
  background: var(--start);
}

.dot-end {
  border: 2px solid var(--end);
}

.board-wrap {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: hidden;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  padding: 12px 20px 14px;
  list-style: none;
  font-size: 0.78rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--board-lines);
  background: var(--cell-bg);
}

.sw-start {
  border: none;
  border-radius: 50%;
  background: var(--start);
}

.sw-end {
  border: 2.5px solid var(--end);
  border-radius: 50%;
  background: transparent;
}

.sw-wall { background: var(--wall); border-color: var(--wall); }
.sw-frontier { background: var(--frontier); border-color: var(--frontier); }
.sw-visited { background: var(--visited); border-color: var(--visited); }
.sw-path { background: var(--path); border-color: var(--path); }

.sw-weight::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 1px;
  background: var(--weight);
  transform: rotate(45deg);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border-radius: 14px;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transform-origin: left center;
}

.stat-value.bump {
  animation: bump 0.45s ease-out;
}


.board {
  --cell: 22px;
  --gap: 1px;
  --head-dur: 80ms;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell));
  grid-auto-rows: var(--cell);
  gap: var(--gap);
  padding: var(--gap);
  background: var(--board-lines);
  border-radius: 8px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
}

.cell {
  position: relative;
  border-radius: 2px;
  background: var(--cell-bg);
}

.cell.wall {
  background: var(--wall);
  animation: pop 0.28s ease-out;
}

.cell.frontier {
  background: var(--frontier);
  animation: pop 0.24s ease-out;
}

.cell.visited {
  background: var(--visited);
  animation: visit 0.65s ease-out;
}

.cell.visited-alt {
  background: var(--visited-alt);
  animation: visit-alt 0.65s ease-out;
}

.cell.path {
  z-index: 1;
  background: var(--path);
  box-shadow: 0 0 8px var(--path-glow);
  animation: path 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cell.weight::after {
  content: "";
  position: absolute;
  inset: 29%;
  border-radius: 2px;
  background: var(--weight);
  transform: rotate(45deg);
  animation: pop 0.3s ease-out;
}

.cell.path.weight::after {
  background: color-mix(in srgb, var(--weight) 70%, #000);
}

.cell.wall.weight::after {
  display: none;
}

.cell.still,
.cell.still::after {
  animation: none;
}

.marker,
.head {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--cell);
  height: var(--cell);
  pointer-events: none;
}

.marker {
  z-index: 3;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease-out;
}

.marker::before {
  content: "";
  width: 78%;
  height: 78%;
  border-radius: 50%;
  transition: transform 0.15s ease-out;
}

.marker-start::before {
  background: var(--start);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--start) 25%, transparent), 0 0 14px var(--start);
}

.marker-end::before {
  border: 3px solid var(--end);
  background: radial-gradient(circle, var(--end) 0 28%, var(--cell-bg) 32%);
  box-shadow: 0 0 14px color-mix(in srgb, var(--end) 60%, transparent);
}

.marker.dragging {
  transition: transform 0.05s linear;
}

.marker.dragging::before {
  transform: scale(1.25);
}

.head {
  z-index: 2;
  border-radius: 4px;
  background: var(--head);
  box-shadow: 0 0 14px var(--head);
  opacity: 0;
  transition: transform var(--head-dur) linear, opacity 0.25s;
}

.head.on {
  opacity: 1;
}

.cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  width: var(--cell);
  height: var(--cell);
  border-radius: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}

.cursor.on {
  opacity: 1;
}

.cursor[data-kind="wall"] {
  background: color-mix(in srgb, var(--wall) 75%, transparent);
  box-shadow: 0 0 0 2px var(--accent);
}

.cursor[data-kind="weight"] {
  box-shadow: 0 0 0 2px var(--weight);
}

.cursor[data-kind="weight"]::after {
  content: "";
  position: absolute;
  inset: 29%;
  border-radius: 2px;
  background: var(--weight);
  opacity: 0.6;
  transform: rotate(45deg);
}

.cursor[data-kind="erase"] {
  box-shadow: 0 0 0 2px var(--danger);
  background: color-mix(in srgb, var(--danger) 18%, transparent);
}

.cursor[data-kind="grab"] {
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--text-primary);
  transform-origin: center;
}


@keyframes pop {
  0% { transform: scale(0.35); }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes visit {
  0% { transform: scale(0.3); border-radius: 50%; background: var(--frontier); }
  45% { background: var(--visit-mid); }
  100% { transform: scale(1); border-radius: 2px; }
}

@keyframes visit-alt {
  0% { transform: scale(0.3); border-radius: 50%; background: var(--accent-2); }
  100% { transform: scale(1); border-radius: 2px; }
}

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

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-2) 60%, transparent); }
  50% { box-shadow: 0 0 0 5px transparent; }
}

@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.12); color: var(--accent); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .cell,
  .cell::after,
  .stat-value.bump,
  .status-dot {
    animation: none !important;
  }

  .marker,
  .head {
    transition: none;
  }
}


@media (max-width: 1100px) {
  .brand-sub,
  .link-pill span {
    display: none;
  }

  .link-pill {
    width: 36px;
    padding: 0;
    justify-content: center;
    border: none;
  }

  .app {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
    padding: 16px;
  }

  .stats {
    gap: 12px;
  }
}

@media (hover: none), (max-width: 860px) {
  .btn kbd,
  .shortcuts {
    display: none;
  }
}

@media (max-height: 860px) and (min-width: 861px) {
  .shortcuts {
    display: none;
  }
}

@media (max-width: 860px) {
  .app {
    display: flex;
    flex-direction: column;
    height: auto;
  }

  .stage {
    order: -1;
  }

  .stage-card {
    flex: none;
  }

  .board-wrap {
    flex: none;
    height: 62vh;
    height: 62svh;
    padding: 12px;
  }

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

  .panel {
    overflow: visible;
  }
}

@media (max-width: 560px) {
  .topbar {
    gap: 8px;
    padding: 0 12px;
  }

  .brand-name,
  .link-pill {
    display: none;
  }

  .tab {
    padding: 0 12px;
    font-size: 0.82rem;
  }

  .tab i {
    display: none;
  }

  .tipbar {
    padding: 8px 8px 8px 14px;
    font-size: 0.8rem;
  }

  .tip-link,
  .tip-icon {
    display: none;
  }

  .toolbar {
    padding: 10px 12px;
  }

  .status {
    width: 100%;
  }

  .playback {
    width: 100%;
  }

  .speed {
    flex: 1;
  }

  .speed input {
    width: 100%;
  }

  .stat {
    padding: 12px 14px;
  }

  .stat-value {
    font-size: 1.15rem;
  }

  .shortcuts {
    display: none;
  }
}
