/* decision-wheel-specific styles.
 * Base chrome (variables, .btn, .actions, .status, .footer) is provided by /_chrome.css.
 */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  grid-template-areas:
    "wheel options"
    "wheel sidebar";
  gap: 16px;
  padding: 16px;
  align-items: start;
}

.wheel-pane { grid-area: wheel; }
.options-pane { grid-area: options; }
.sidebar-ad { grid-area: sidebar; }

@media (max-width: 880px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-areas: "wheel" "options" "sidebar";
  }
}

.pane {
  background: var(--bg-pane);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}

.pane-head > label {
  font-size: 13px;
  color: var(--fg-mute);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Wheel pane ------------------------------------------------------------- */

.wheel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 360px;
}

.wheel {
  width: 100%;
  max-width: 460px;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.35));
  outline: none;
  /* Slice rotation is set inline by render.js */
  transform-origin: 50% 50%;
  will-change: transform;
}

.wheel:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 50%;
}

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

.spin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 4px solid var(--bg-pane);
  background: var(--accent-strong);
  color: white;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: transform 80ms ease;
}

.spin-btn:hover:not(:disabled) { background: var(--accent); }
.spin-btn:active:not(:disabled) { transform: translate(-50%, -50%) scale(0.96); }
.spin-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.status {
  padding: 8px 14px 14px;
}

.status kbd {
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-elev);
}

/* Options pane ----------------------------------------------------------- */

.options {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
}

.option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
}

.option:hover { background: var(--bg-elev); }
.option.dragging { opacity: 0.4; }
.option.drop-target { border-color: var(--accent); }

.option-handle {
  cursor: grab;
  color: var(--fg-mute);
  user-select: none;
  font-size: 14px;
  padding: 4px 6px;
  line-height: 1;
}
.option-handle:active { cursor: grabbing; }

.option-color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex: 0 0 auto;
}

.option-input {
  flex: 1 1 auto;
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  padding: 6px 8px;
  border-radius: 6px;
  min-width: 0;
}

.option-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev);
}

.option-remove {
  background: transparent;
  border: none;
  color: var(--fg-mute);
  font-size: 16px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
}
.option-remove:hover { color: var(--err); background: var(--err-bg); }

.hint {
  padding: 6px 14px 12px;
  font-size: 12px;
  color: var(--fg-mute);
}

/* Sidebar / affiliate ---------------------------------------------------- */

.sidebar-ad,
.affiliate-strip {
  background: var(--bg-pane);
}

.sidebar-ad {
  min-height: 180px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.affiliate-strip {
  margin: 16px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.affiliate-strip h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.affiliate-note {
  margin: 0;
  color: var(--fg-mute);
  font-size: 13px;
}

.ad-slot {
  padding: 16px;
}

.ad-placeholder {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 24px 12px;
  text-align: center;
  color: var(--fg-mute);
  font-size: 12px;
}

.ad-placeholder code {
  font-family: var(--mono);
  background: var(--bg-elev);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Modals ----------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
  animation: fade 180ms ease;
}

.modal[hidden] { display: none; }

.modal-card {
  background: var(--bg-pane);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  animation: pop 220ms cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.modal-eyebrow {
  margin: 0 0 4px;
  color: var(--fg-mute);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.modal-title {
  margin: 0 0 18px;
  font-size: 28px;
  line-height: 1.15;
  word-break: break-word;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.interstitial-ad {
  margin: 12px 0 16px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0;
}

/* Confetti --------------------------------------------------------------- */

.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9;
}

/* Toast feedback (used after Save) --------------------------------------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* SVG slice text */
.wheel-slice-text {
  font-family: var(--sans);
  font-weight: 600;
  fill: #fff;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.45);
  stroke-width: 2;
  stroke-linejoin: round;
  pointer-events: none;
}
