:root {
  --bg: #070b16;
  --panel: #0e1425;
  --line: #263b68;
  --text: #edf7ff;
  --muted: #a9b6cb;
  --dim: #72819f;
  --accent: #65d9ff;
  --accent-2: #c8d7ff;
  --glow: rgba(101, 217, 255, .18);
  --panel-glass: rgba(14, 20, 37, .82);
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(101, 217, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(101, 217, 255, .035) 1px, transparent 1px),
    radial-gradient(circle at top left, rgba(101, 217, 255, .20), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(200, 215, 255, .10), transparent 30rem),
    linear-gradient(135deg, #050815, var(--bg));
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
  font-family: Inter, "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration-color: rgba(101, 217, 255, .45);
  text-underline-offset: 3px;
}

button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.page {
  width: min(1160px, calc(100% - 28px));
  margin: clamp(16px, 3vw, 30px) auto 52px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  color: var(--dim);
  font-size: .82rem;
}

.topbar-links {
  display: flex;
  gap: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 42%),
    linear-gradient(180deg, var(--panel-glass), rgba(8, 13, 27, .92));
  box-shadow: 0 20px 60px rgba(1, 6, 18, .36), inset 0 1px 0 rgba(237, 247, 255, .04);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(20px, 4vw, 34px);
}

.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.05;
  text-shadow: 0 0 28px rgba(101, 217, 255, .22);
}

.hero p,
.meta {
  margin: 0;
  color: var(--muted);
}

.meta {
  color: var(--dim);
  font-size: .78rem;
}

.player-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  margin-top: 14px;
}

.ascii-stage {
  min-height: 520px;
  padding: 14px;
  overflow: hidden;
  position: relative;
}

.ascii-stage--placeholder {
  padding: 0;
  text-align: center;
}

.ascii-frame {
  width: 100%;
  height: 100%;
  min-height: 492px;
  margin: 0;
  overflow: auto;
  color: var(--accent-2);
  text-shadow: 0 0 18px var(--glow);
  white-space: pre;
  font: 11px/1.05 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.ascii-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 28px);
  transform: translate(-50%, -50%);
  color: var(--accent-2);
  text-shadow: 0 0 18px var(--glow);
  white-space: normal;
  text-align: center;
}

.controls,
.sidebar {
  display: grid;
  gap: 12px;
  padding: 16px;
}

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

.control-row.split {
  justify-content: space-between;
}

.button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--accent);
  background: #121b31;
  cursor: pointer;
}

.button:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(101, 217, 255, .10);
}

.range {
  width: 100%;
  accent-color: var(--accent);
}

.file-input {
  width: 100%;
  margin-top: 4px;
  color: var(--muted);
}

.file-input::file-selector-button {
  margin-right: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--accent);
  background: #121b31;
  cursor: pointer;
}

.time {
  color: var(--accent-2);
  white-space: nowrap;
}

.label {
  color: var(--dim);
  font-size: .76rem;
}

.status-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  color: var(--muted);
}

.status-list li::before {
  content: ">";
  margin-right: 8px;
  color: var(--accent);
}

@media (max-width: 900px) {
  .hero,
  .topbar,
  .control-row.split {
    align-items: flex-start;
    flex-direction: column;
  }

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