:root {
  --gof-primary: #157623;
  --gof-primary-bright: #9bca3e;
  --gof-yellow: #ffb920;
  --gof-rust: #de6739;
  --gof-teal: #3abbc0;
  --gof-bg: #dde5ed;
  --gof-text: #2f2c28;
  --gof-text-soft: #5e5c5e;
  --gof-white: #ffffff;
  --gof-border: #c8d2dc;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Arimo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gof-bg);
  color: var(--gof-text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: 100vh;
}

.page-title {
  font-family: 'League Spartan', sans-serif;
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.01em;
  margin: 8px 0 4px;
  color: var(--gof-text);
  text-align: center;
}

/* --- Wheel stage --- */
.wheel-stage {
  position: relative;
  width: min(92vw, 420px);
  aspect-ratio: 1 / 1;
}

.wheel {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.18));
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}

.pointer {
  position: absolute;
  top: 50%;
  left: -10px;
  width: 0;
  height: 0;
  border-top: 18px solid transparent;
  border-bottom: 18px solid transparent;
  border-left: 32px solid var(--gof-text);
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.35));
  z-index: 5;
  pointer-events: none;
  transform-origin: 0% 50%;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.06s ease-out;
}

.hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 23%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 4px solid var(--gof-white);
  background: var(--gof-primary);
  color: var(--gof-white);
  font-family: 'League Spartan', sans-serif;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.hub:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 6px 14px rgba(0,0,0,0.3);
}

.hub:active:not(:disabled) {
  transform: translate(-50%, -50%) scale(0.97);
}

.hub:disabled {
  background: var(--gof-text-soft);
  cursor: not-allowed;
}

/* --- Result --- */
.result {
  width: 100%;
  background: var(--gof-white);
  border: 2px solid var(--gof-primary-bright);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: opacity 0.15s ease;
}

/* Keep the result's space reserved even when "hidden" so clicking Spin again
   doesn't collapse the page and shift the wheel. Just invisible/inert. */
.result[hidden] {
  display: flex;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.result-label {
  font-family: 'League Spartan', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--gof-primary);
  word-break: break-word;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* Explicit override — [hidden]'s default display:none loses to .result-actions
   above without this. Used when the remove-and-spin workflow completes. */
.result-actions[hidden] { display: none; }

/* --- Buttons --- */
.btn {
  font-family: 'Arimo', sans-serif;
  font-weight: 700;
  font-size: 14px;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
  min-height: 40px;
}

.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--gof-primary-bright);
  color: var(--gof-text);
}
.btn-secondary:hover:not(:disabled) { background: #b4d863; }

.btn-tertiary {
  background: var(--gof-white);
  color: var(--gof-text);
  border-color: var(--gof-border);
}
.btn-tertiary:hover:not(:disabled) { background: #f2f5f8; }

/* --- Presets --- */
.presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.preset {
  font-family: 'Arimo', sans-serif;
  font-weight: 700;
  font-size: 13px;
  background: var(--gof-white);
  color: var(--gof-text);
  border: 2px solid var(--gof-border);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  min-height: 36px;
}

.preset:hover:not(:disabled) {
  border-color: var(--gof-primary);
  background: #f2f5f8;
}

.preset.is-active,
.preset.is-active:hover:not(:disabled) {
  background: var(--gof-primary);
  color: var(--gof-white);
  border-color: var(--gof-primary);
  box-shadow: 0 2px 6px rgba(21, 118, 35, 0.3);
}

.preset:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Editor --- */
.editor {
  width: 100%;
  background: var(--gof-white);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.editor-title {
  font-family: 'League Spartan', sans-serif;
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 10px;
  color: var(--gof-text);
}

.option-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.option-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

.option-row input[type="text"] {
  flex: 1;
  font-family: 'Arimo', sans-serif;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--gof-border);
  background: #f7f9fb;
  color: var(--gof-text);
  min-height: 40px;
  min-width: 0;
}

.option-row input[type="text"]:focus {
  outline: none;
  border-color: var(--gof-primary);
  background: var(--gof-white);
}

.option-row input[type="text"]:disabled {
  opacity: 0.6;
}

.option-remove {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--gof-text-soft);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.option-remove:hover:not(:disabled) {
  background: #f0e3df;
  color: var(--gof-rust);
}

.option-remove:disabled { opacity: 0.3; cursor: not-allowed; }

.editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* --- Draft order --- */
.draft-order {
  width: 100%;
  background: var(--gof-white);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.draft-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

.draft-header .editor-title { margin: 0; }

.draft-clear {
  font-size: 12px;
  padding: 6px 12px;
  min-height: 32px;
}

.draft-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  counter-reset: draft;
}

.draft-list li {
  counter-increment: draft;
  padding: 8px 12px;
  background: #f7f9fb;
  border-radius: 8px;
  font-family: 'Arimo', sans-serif;
  font-size: 15px;
  color: var(--gof-text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.draft-list li::before {
  content: counter(draft) ".";
  font-weight: 700;
  color: var(--gof-text-soft);
  min-width: 22px;
}

.draft-list li.is-last {
  background: #e3f0db;
  font-weight: 700;
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gof-text);
  color: var(--gof-white);
  padding: 10px 18px;
  border-radius: 999px;
  font-family: 'Arimo', sans-serif;
  font-weight: 700;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  pointer-events: none;
}

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

/* --- Footer --- */
.gof-footer {
  margin-top: auto;
  padding: 20px 0 8px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  font-family: 'Arimo', sans-serif;
  font-size: 13px;
}

.gof-brand,
.gof-link {
  color: var(--gof-text-soft);
  text-decoration: none;
  font-weight: 700;
}

.gof-brand:hover,
.gof-link:hover {
  color: var(--gof-primary);
}

/* --- Responsive --- */
@media (min-width: 600px) {
  .page-title { font-size: 38px; }
  .result-label { font-size: 26px; }
  .hub { font-size: 22px; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .hub, .btn, .preset { transition: none; }
}
