:root {
  --ink: #1B2430;
  --ink-soft: #232E3D;
  --line: #3A4756;
  --paper: #F4EFE6;
  --muted: #94A2B2;
  --marigold: #F2A93B;
  --paprika: #E85D4F;
  --teal: #2F8F82;

  --font-display: 'Zilla Slab', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  line-height: 1.5;
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
}

.site-head {
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 24px 24px;
  text-align: left;
}

.site-head h1 {
  font-size: 2.4rem;
  letter-spacing: 0.2px;
}

.site-head p {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 58ch;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* ---------- Setup: rail + map ---------- */

.setup {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  margin-top: 12px;
}

.rail {
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-self: start;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

label, .field-label {
  font-size: 0.9rem;
  color: var(--paper);
}

.field-value {
  font-size: 0.85rem;
  color: var(--marigold);
  font-weight: 600;
}

input[type="text"] {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--paper);
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

input[type="text"]:focus-visible,
button:focus-visible,
input[type="range"]:focus-visible,
.chip:focus-visible {
  outline: 2px solid var(--marigold);
  outline-offset: 2px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--marigold);
}

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

.chip {
  background: var(--ink);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  cursor: pointer;
}

.chip:hover {
  border-color: var(--marigold);
  color: var(--paper);
}

.chip[aria-pressed="true"] {
  background: var(--marigold);
  border-color: var(--marigold);
  color: var(--ink);
  font-weight: 600;
}

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  padding: 12px 18px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--marigold);
  color: var(--ink);
}
.btn-primary:hover { background: #ffc266; }
.btn-primary:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

.btn-accent {
  background: var(--paprika);
  color: var(--paper);
}
.btn-accent:hover { background: #f17364; }
.btn-accent:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  border-color: var(--paper);
  color: var(--paper);
}
.btn-outline:hover {
  border-color: var(--marigold);
  color: var(--marigold);
}

.link-btn {
  background: none;
  border: none;
  color: var(--marigold);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

.hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

.error {
  font-size: 0.85rem;
  color: var(--paprika);
  border: 1px solid var(--paprika);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin: 0;
}

.map-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 420px;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 420px;
}

/* ---------- Results ---------- */

.results {
  margin-top: 40px;
}

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

.results-head h2 {
  font-size: 1.4rem;
}

.results-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

.empty-state {
  color: var(--muted);
  margin: 20px 0;
  max-width: 60ch;
}

.place-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.place-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}

.place-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--marigold);
}

.place-name {
  font-weight: 600;
  color: var(--paper);
}

.place-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

.place-rating {
  color: var(--marigold);
  font-weight: 600;
  white-space: nowrap;
}

.place-link {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
}
.place-link:hover { color: var(--marigold); }

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

.wheel-section {
  margin-top: 56px;
  text-align: center;
}

.wheel-section h2 {
  font-size: 1.4rem;
  margin-bottom: 24px;
}

.wheel-stage {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 40px;
}

.wheel-wrap {
  position: relative;
  width: 440px;
  max-width: 88vw;
}

.wheel-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 50%;
  border: 4px solid var(--ink-soft);
  box-shadow: 0 0 0 2px var(--line);
}

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

.wheel-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 280px;
  text-align: left;
}

.winner-card {
  background: var(--ink-soft);
  border: 1px solid var(--marigold);
  border-radius: var(--radius);
  padding: 16px;
}

.winner-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.winner-name {
  margin: 4px 0 2px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--marigold);
}

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

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .setup {
    grid-template-columns: 1fr;
  }
  .map-frame, #map {
    min-height: 320px;
  }
  .place-row {
    grid-template-columns: auto 1fr;
  }
  .place-rating {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wheel-wrap canvas {
    transition: none !important;
  }
}
