:root {
  --body: #e9e6df;
  --ink: #222;
  --orange: #ff5a1f;
  --lcd-bg: #c9d3b5;
}

html,
body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: #2b2b2b;
  color: var(--ink);
}

#main-content {
  width: 100vw;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
  margin-top: 40px;
  box-sizing: border-box;
}

/* The device */
#device {
  width: 560px;
  max-width: 100%;
  background: var(--body);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 -4px 0 rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
}

#device-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

#brand {
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#brand b {
  color: var(--orange);
}

button,
select {
  font: inherit;
  color: var(--ink);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 1rem;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}

#start-button:not(:disabled) {
  background: var(--orange);
}

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

/* LCD */
#lcd {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  background: var(--lcd-bg);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-family: "Courier New", monospace;
  font-weight: bold;
  text-transform: uppercase;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.3);
}

#selectors {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
}

#selectors label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

select {
  padding: 0.5rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  font-size: 1rem;
}

#controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.8rem;
}

#speed {
  width: 160px;
  accent-color: var(--orange);
  vertical-align: middle;
}

/* Keys */
#keyboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 1.2rem 0 0.5rem;
}

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

#keyboard kbd {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-bottom: 4px solid var(--color);
  border-radius: 8px;
  background: #fafaf7;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  transition: background 0.1s, transform 0.1s, box-shadow 0.1s;
}

#keyboard kbd.active {
  background: var(--color);
  transform: translateY(3px);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0.25);
}

#hint {
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Timeline: full width line at the top of the page */
#timeline {
  position: fixed;
  top: 30px;
  left: 0;
  width: 100vw;
  height: 2px;
  background: #888;
}

#playhead {
  position: absolute;
  top: -12px;
  left: 0;
  width: 2px;
  height: 26px;
  background: var(--orange);
  pointer-events: none;
}

#dots,
#ticks {
  position: absolute;
  inset: 0;
}

.tick {
  position: absolute;
  top: 0;
  width: 1px;
  height: 8px;
  background: #aaa;
}

.dot {
  position: absolute;
  top: 8px;
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  transition: transform 0.1s;
}

.dot.pulse {
  transform: translateX(-50%) scale(1.8);
}
