/* Rubik's Cube CSS-3D renderer styles.
   Geometry (cubie positions, sticker face transforms) is computed in
   src/render.js and applied as inline `transform` styles; this file only
   supplies the static box model, perspective scene, and default look. */

:root {
  --cubie-size: 76px;
  --cubie-gap: 6px;
}

.scene {
  --rx: -25deg;
  --ry: -35deg;
  perspective: 900px;
  width: 100%;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.scene:active {
  cursor: grabbing;
}

.cube {
  position: relative;
  width: 1px;
  height: 1px;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, -25deg)) rotateY(var(--ry, -35deg));
  transition: transform 0.5s ease;
}

.cubie {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--cubie-size);
  height: var(--cubie-size);
  margin: calc(var(--cubie-size) / -2) 0 0 calc(var(--cubie-size) / -2);
  transform-style: preserve-3d;
}

.sticker {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--cubie-size);
  height: var(--cubie-size);
  border-radius: 8px;
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.35);
  backface-visibility: hidden;
}

.layer-turn {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  transform-style: preserve-3d;
  transform-origin: 0 0;
}

/* Face buttons + color legend, created and appended by src/input.js */

.face-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 12px 0;
}

.face-button {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: #f4f4f4;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.face-button:hover {
  background: #e6e6e6;
}

.color-legend {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 8px 0;
}

.legend-swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35);
  display: inline-block;
}
