/* Spin Wheel — CodeCraft Support */

.wheel-page {
  padding: 28px 20px 64px;
  min-height: calc(100vh - 120px);
}

.wheel-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.wheel-header {
  margin-bottom: 28px;
}

.wheel-eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.wheel-header h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.wheel-sub {
  margin: 0;
  color: var(--muted);
  max-width: 42ch;
  line-height: 1.5;
}

.wheel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 28px;
  align-items: start;
}

.wheel-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: 20px;
  background:
    radial-gradient(ellipse 70% 55% at 50% 35%, rgba(33, 200, 208, 0.12), transparent 70%),
    linear-gradient(165deg, var(--bg-3), var(--bg-2));
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background-color 0.25s ease;
}

.wheel-canvas-wrap {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1;
}

.wheel-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border-radius: 50%;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
  transition: transform 0.15s ease;
}

.wheel-canvas-wrap canvas:active {
  transform: scale(0.985);
}

.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  z-index: 2;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 28px solid var(--accent);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  pointer-events: none;
}

.wheel-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.wheel-actions .btn-lg {
  min-width: 160px;
  padding: 12px 28px;
  font-size: 1.05rem;
  font-weight: 700;
}

.wheel-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.wheel-panel {
  border-radius: 20px;
  background: linear-gradient(165deg, var(--bg-3), var(--bg-2));
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  min-height: 420px;
}

.wheel-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wheel-tab {
  flex: 1;
  padding: 14px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.wheel-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.wheel-tab.is-active {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.wheel-tab-panel {
  display: none;
  padding: 18px 18px 22px;
}

.wheel-tab-panel.is-active {
  display: block;
}

.wheel-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.wheel-label code {
  font-size: 0.8em;
  color: var(--accent);
}

.wheel-textarea {
  width: 100%;
  min-height: 280px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.45;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease;
}

.wheel-textarea:focus {
  border-color: var(--accent);
}

.wheel-input,
.wheel-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
}

.wheel-input:focus,
.wheel-select:focus {
  border-color: var(--accent);
}

.wheel-select {
  cursor: pointer;
  margin-bottom: 12px;
}

.wheel-meta {
  margin: 8px 0 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.wheel-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wheel-fieldset {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.wheel-fieldset legend {
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.wheel-fieldset input[type="range"] {
  width: 100%;
  margin-bottom: 12px;
  accent-color: var(--accent);
}

.wheel-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  cursor: pointer;
  user-select: none;
}

.wheel-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.wheel-color-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.wheel-color-row label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.wheel-color-row input[type="color"],
#bgColor {
  width: 44px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.wheel-logo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.wheel-fieldset #bgResetBtn {
  margin-top: 10px;
}

/* Winner modal */
.wheel-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.wheel-modal[hidden] {
  display: none;
}

.wheel-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.wheel-modal-card {
  position: relative;
  width: min(100%, 400px);
  padding: 28px 24px;
  border-radius: 18px;
  background: linear-gradient(165deg, var(--bg-3), var(--bg-2));
  border: 1px solid rgba(33, 200, 208, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: wheelModalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes wheelModalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.wheel-modal-eyebrow {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.wheel-modal-card h2 {
  margin: 0 0 22px;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  font-weight: 800;
  line-height: 1.25;
  word-break: break-word;
}

.wheel-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

@media (max-width: 900px) {
  .wheel-layout {
    grid-template-columns: 1fr;
  }

  .wheel-canvas-wrap {
    width: min(100%, 340px);
  }

  .wheel-panel {
    min-height: 0;
  }

  .wheel-textarea {
    min-height: 200px;
  }
}
