html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1a1d3d; /* nightshade blue */
  font-family: system-ui, -apple-system, sans-serif;
}

#scene {
  position: fixed;
  inset: 0;
  will-change: transform;
  touch-action: none; /* the browser must never claim swipes on the cube */
}

#help {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: rgba(199, 204, 232, 0.45);
  pointer-events: none;
  z-index: 4;
}

#hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px 20px;
  text-align: center;
  pointer-events: none;
  color: #c7cce8;
}

.moves {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 15px;
  min-height: 22px;
  letter-spacing: 1px;
}

.moves .label {
  opacity: 0.6;
  margin-right: 8px;
  font-size: 12px;
  text-transform: uppercase;
}

.moves .mv {
  display: inline-block;
  padding: 1px 4px;
  margin: 0 1px;
  border-radius: 4px;
  opacity: 0.45;
}

.moves .mv.done {
  opacity: 1;
  background: rgba(255, 255, 255, 0.18);
}

#controls {
  margin-top: 10px;
  pointer-events: auto;
}

#status {
  font-size: 13px;
  opacity: 0.7;
  margin-right: 14px;
  font-style: italic;
}

#controls button, #sizes button {
  padding: 8px 22px;
  font-size: 14px;
  border: none;
  border-radius: 20px;
  background: #2b3060;
  color: #dde2f7;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  margin: 0 3px;
}

#controls button:hover:not(:disabled), #sizes button:hover:not(:disabled) { transform: translateY(-1px); }
#controls button:disabled, #sizes button:disabled { opacity: 0.4; cursor: default; }

#sizes {
  position: fixed;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#sizes button.active {
  background: #dde2f7;
  color: #2b3060;
}

/* link rail: labels fly here off the cube after the first solve */
#rail {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  z-index: 5;
}

#rail a {
  display: block;
  min-width: 150px;
  padding: 18px 30px;
  text-align: center;
  border: 2px solid transparent;
  border-radius: 14px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: 1px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  visibility: hidden;
  pointer-events: none;
  will-change: transform;
  transition: border-color 0.6s, background-color 0.6s;
}

#rail a.arrived {
  border-color: rgba(221, 226, 247, 0.7);
  background: rgba(43, 48, 96, 0.55);
  pointer-events: auto;
}

#rail a.arrived:hover {
  background: rgba(221, 226, 247, 0.25);
}

/* mobile: tighter chrome so the cube keeps center stage */
@media (max-width: 600px) {
  #rail { right: 10px; gap: 10px; }
  #rail a { min-width: 96px; padding: 10px 16px; font-size: 15px; }
  #sizes { left: 10px; gap: 6px; }
  #controls button, #sizes button { padding: 6px 14px; font-size: 12px; }
  .moves { font-size: 12px; min-height: 18px; }
  #help { font-size: 12px; top: 10px; }
  #status { display: block; margin: 0 0 6px; }
}
