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

body {
  background: #000;
  color: #fff;
  font-family: 'Courier New', Courier, monospace;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#app-wrapper {
  width: 100%;
  max-width: 760px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#title-bar {
  text-align: center;
  padding: 8px 0 4px;
}

#title-bar h1 {
  font-size: 1.25rem;
  color: #ffcc00;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#screen-container {
  width: 100%;
  background: #000;
  border: 2px solid #333;
  border-radius: 4px;
  padding: 8px 12px;
  overflow: hidden;
}

#screen {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.2;
  color: #fff;
  white-space: pre;
  display: block;
  min-height: calc(13 * 1.2 * 14px);
  overflow: hidden;
  /* prevent text selection jitter during animation */
  user-select: none;
  -webkit-user-select: none;
}

@media (max-width: 600px) {
  #app-wrapper {
    padding-top: 55px;
  }
  #screen {
    font-size: 8px;
    line-height: 1.1;
    min-height: calc(13 * 1.1 * 8px);
  }
}

#controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.ctrl-btn {
  background: #1a1a1a;
  color: #0f0;
  border: 1px solid #0f0;
  border-radius: 3px;
  padding: 4px 10px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.ctrl-btn:hover {
  background: #0f0;
  color: #000;
}

.ctrl-btn:active {
  transform: scale(0.95);
}

.ctrl-btn.active {
  background: #0f0;
  color: #000;
  border-color: #0f0;
}

#speed-label {
  color: #0f0;
  font-size: 12px;
  font-family: 'Courier New', Courier, monospace;
  min-width: 60px;
  text-align: center;
}

#speed-range {
  accent-color: #0f0;
  width: 100px;
}

#frame-counter {
  color: #999;
  font-size: 11px;
  font-family: 'Courier New', Courier, monospace;
  text-align: center;
}

#attribution {
  text-align: center;
  font-size: 11px;
  color: #999;
  line-height: 1.6;
}

#attribution a {
  color: #bbb;
  text-decoration: underline;
}

#attribution a:hover {
  color: #ffcc00;
}

#progress-bar-container {
  width: 100%;
  height: 3px;
  background: #1a1a1a;
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

#progress-bar {
  height: 100%;
  background: #0f0;
  border-radius: 2px;
  transition: width 0.1s linear;
  pointer-events: none;
}
