/* style.css — UI overlay styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a0a;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  transition: background-color 0.5s ease;
  touch-action: none;
}

body.win-off {
  background-color: #0a0a3a;
}

body.win-on {
  background-color: #3a2a0a;
}

#canvas-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  touch-action: none;
}

#canvas-container canvas {
  display: block;
  cursor: pointer;
  touch-action: none;
}

/* Hint Overlay */
#hint-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 15vh 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 15;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.8s ease;
}

#hint-overlay.hidden {
  opacity: 0;
}

#hint-title {
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(24px, 7vw, 36px);
  font-weight: 700;
  letter-spacing: 0.05em;
}

#hint-text {
  color: rgba(255, 255, 255, 0.6);
  font-size: clamp(15px, 4vw, 20px);
}

#hint-subtext {
  color: rgba(255, 255, 255, 0.35);
  font-size: clamp(13px, 3vw, 16px);
}

/* UI Overlay */
#ui-overlay {
  position: absolute;
  bottom: 0;
  right: 0;
  padding: clamp(8px, 2vw, 16px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(6px, 1.5vw, 12px);
  pointer-events: none;
  z-index: 10;
  width: clamp(100px, 25vw, 140px);
}

#ui-overlay > * {
  pointer-events: auto;
}

.ui-label {
  color: #aaa;
  font-size: clamp(12px, 2.5vw, 16px);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: right;
}

#move-count {
  color: #fff;
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 700;
  line-height: 1;
  text-align: right;
}

.ui-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: clamp(13px, 2.5vw, 15px);
  font-family: inherit;
  border-radius: 6px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.2s, border-color 0.2s;
  touch-action: manipulation;
}

.ui-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

.ui-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

#polytope-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23fff'/%3E%3C/svg%3E") no-repeat right 8px center;
  padding: 8px 24px 8px 8px;
}

#polytope-select option {
  background: #1a1a1a;
  color: #fff;
}

.zoom-controls {
  display: flex;
  gap: 4px;
}

.zoom-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Author */
#author {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: clamp(8px, 2vw, 16px);
  color: rgba(255, 255, 255, 0.2);
  font-size: clamp(10px, 2vw, 12px);
  pointer-events: none;
  z-index: 10;
}

/* Win Overlay */
#win-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#win-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

#win-message {
  color: #fff;
  font-size: clamp(32px, 8vw, 56px);
  font-weight: 700;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
  margin-bottom: 8px;
}

#win-subtitle {
  color: #ccc;
  font-size: clamp(14px, 3vw, 20px);
  margin-bottom: 16px;
  min-height: 1.4em;
}

#win-moves {
  color: #aaa;
  font-size: clamp(16px, 3vw, 22px);
  margin-bottom: 24px;
}

#win-scramble {
  font-size: clamp(15px, 3vw, 18px);
  padding: 12px 32px;
}
