@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Rajdhani:wght@300;400;600&display=swap');

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

:root {
  --bg: #080808;
  --panel-bg: #0a0a0a;
  --dot-off: #1a1a1a;
  --dot-on: #ffffff;
  --accent: #ffffff;
  --dim: #444;
  --ui-bg: #111;
  --ui-border: #2a2a2a;
  --font-mono: 'Share Tech Mono', monospace;
  --font-ui: 'Rajdhani', sans-serif;
}

html,
body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--accent);
  font-family: var(--font-ui);
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  gap: 0;
}

/* ── DISPLAY PANEL ── */
.display-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#dotCanvas {
  display: block;
  image-rendering: pixelated;
}

/* scan-line overlay */
.display-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 3px,
      rgba(0, 0, 0, 0.08) 3px,
      rgba(0, 0, 0, 0.08) 4px);
  pointer-events: none;
  z-index: 10;
}

/* ── CONTROLS ── */
.controls {
  background: var(--ui-bg);
  border-top: 1px solid var(--ui-border);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

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

.text-input {
  flex: 1;
  background: #000;
  border: 1px solid var(--ui-border);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 8px 12px;
  outline: none;
  letter-spacing: 0.05em;
  transition: border-color 0.2s;
}

.text-input:focus {
  border-color: #555;
}

.btn {
  background: #fff;
  color: #000;
  border: none;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn:hover {
  background: #ccc;
}

.btn.ghost {
  background: transparent;
  color: #888;
  border: 1px solid #333;
}

.btn.ghost:hover {
  border-color: #888;
  color: #fff;
}

.btn.active {
  background: #fff;
  color: #000;
}

.anim-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--dim);
  margin-right: 2px;
  flex-shrink: 0;
}

.anim-btn {
  background: transparent;
  color: #666;
  border: 1px solid #282828;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.anim-btn:hover {
  color: #fff;
  border-color: #555;
}

.anim-btn.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}

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

.speed-row input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 2px;
  background: #333;
  outline: none;
  cursor: pointer;
}

.speed-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
}

.speed-val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #666;
  width: 28px;
  text-align: right;
}

.play-btn {
  background: transparent;
  color: #666;
  border: 1px solid #282828;
  font-size: 11px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  line-height: 1;
  padding: 0;
}

.play-btn:hover {
  color: #fff;
  border-color: #555;
}

.play-btn.paused {
  color: #fff;
  border-color: #fff;
}

/* status bar */
.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 14px;
  border-top: 1px solid var(--ui-border);
  background: #0c0c0c;
  flex-shrink: 0;
}

.statusbar span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #444;
  letter-spacing: 0.08em;
}

.statusbar .status-mode {
  color: #888;
}

@media (max-width: 600px) {
  .controls {
    padding: 8px 10px;
    gap: 6px;
  }

  .anim-btn {
    padding: 4px 9px;
    font-size: 10px;
  }

  .btn {
    padding: 7px 12px;
    font-size: 11px;
  }
}