:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #5d6964;
  --paper: #f7f3ec;
  --panel: #fffaf1;
  --line: #ded6c8;
  --green: #1f6f63;
  --green-dark: #124a43;
  --coral: #d95f49;
  --gold: #d9a441;
  --blue: #305f8c;
  --rose: #a8435b;
  --shadow: 0 18px 50px rgba(31, 45, 42, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
}

button,
select,
input {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.planner {
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: 360px 1fr;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}

.control-panel {
  padding: 30px;
  background: #fdf7ec;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.brand-block h1,
.live-section h2,
.saved-section h2 {
  margin: 0;
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.brand-block h1 {
  font-size: clamp(2.35rem, 5vw, 4rem);
  overflow-wrap: normal;
}

.brand-block p:last-child {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 28px;
  overflow-wrap: anywhere;
}

.kicker,
.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.filter-group {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.filter-group label,
.toggle-grid legend {
  font-size: 0.86rem;
  font-weight: 800;
}

.helper-note {
  margin: -10px 0 18px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

input[type="text"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

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

.toggle-grid {
  border: 0;
  padding: 0;
  margin: 22px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toggle-grid legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}

.toggle-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: white;
  font-weight: 650;
}

.toggle-grid input {
  accent-color: var(--green);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 10px;
}

.primary-btn,
.secondary-btn,
.icon-btn {
  border: 0;
  min-height: 48px;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-btn {
  background: var(--green);
  color: white;
}

.secondary-btn {
  background: #edf5f2;
  color: var(--green-dark);
  padding: 0 16px;
  border: 1px solid #c9ded7;
}

.icon-btn {
  background: var(--ink);
  color: white;
  font-size: 1.4rem;
}

.roulette-stage {
  position: relative;
  padding: 30px;
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  align-items: start;
  gap: 28px;
  overflow: hidden;
  min-width: 0;
}

.roulette-stage .wheel-wrap,
.roulette-stage .result-card {
  margin-top: clamp(24px, 8vh, 92px);
}

.skyline-art {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  opacity: 0.8;
  pointer-events: none;
}

.ridge {
  position: absolute;
  inset: auto 0 0;
  height: 58%;
  background:
    linear-gradient(135deg, transparent 35%, rgba(31, 111, 99, 0.28) 36% 50%, transparent 51%) 0 0 / 190px 100% repeat-x,
    linear-gradient(to top, rgba(31, 111, 99, 0.2), transparent);
}

.buildings {
  position: absolute;
  bottom: 0;
  left: 8%;
  width: 78%;
  height: 34%;
  background:
    linear-gradient(to top, rgba(23, 33, 31, 0.18), rgba(23, 33, 31, 0.18)) 0 55% / 10% 45% no-repeat,
    linear-gradient(to top, rgba(23, 33, 31, 0.18), rgba(23, 33, 31, 0.18)) 14% 30% / 7% 70% no-repeat,
    linear-gradient(to top, rgba(23, 33, 31, 0.18), rgba(23, 33, 31, 0.18)) 26% 45% / 12% 55% no-repeat,
    linear-gradient(to top, rgba(23, 33, 31, 0.18), rgba(23, 33, 31, 0.18)) 44% 20% / 8% 80% no-repeat,
    linear-gradient(to top, rgba(23, 33, 31, 0.18), rgba(23, 33, 31, 0.18)) 58% 48% / 10% 52% no-repeat,
    linear-gradient(to top, rgba(23, 33, 31, 0.18), rgba(23, 33, 31, 0.18)) 74% 35% / 9% 65% no-repeat,
    linear-gradient(to top, rgba(23, 33, 31, 0.18), rgba(23, 33, 31, 0.18)) 88% 50% / 12% 50% no-repeat;
}

.rocket {
  position: absolute;
  top: 6%;
  right: 14%;
  width: 42px;
  height: 114px;
  border-radius: 50% 50% 12px 12px;
  background: linear-gradient(to right, #f4efe5 0 50%, #e3d8c7 51%);
  transform: rotate(24deg);
  box-shadow: inset 0 -20px 0 var(--coral);
}

.rocket::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 22px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue);
}

.rocket::after {
  content: "";
  position: absolute;
  left: 9px;
  bottom: -28px;
  width: 24px;
  height: 34px;
  background: var(--gold);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}

.wheel-wrap {
  position: relative;
  z-index: 1;
  aspect-ratio: 1;
  min-width: 0;
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  background: conic-gradient(var(--green) 0 60deg, var(--coral) 60deg 120deg, var(--gold) 120deg 180deg, var(--blue) 180deg 240deg, var(--rose) 240deg 300deg, #567c43 300deg);
  border: 12px solid white;
  box-shadow: var(--shadow);
  transition: transform 1.8s cubic-bezier(.12,.72,.12,1);
}

.wheel::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: white;
  border: 10px solid rgba(23, 33, 31, 0.14);
  z-index: 2;
}

.wheel-label {
  position: absolute;
  left: 50%;
  top: 50%;
  color: white;
  width: 76px;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: clamp(0.68rem, 1.35vw, 0.92rem);
  line-height: 1.05;
  font-weight: 900;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}

.pointer {
  position: absolute;
  top: 50%;
  right: -4px;
  width: 34px;
  height: 34px;
  background: var(--ink);
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  transform: translateY(-50%);
}

.result-card {
  position: relative;
  z-index: 1;
  background: rgba(255, 250, 241, 0.9);
  border: 1px solid var(--line);
  padding: clamp(22px, 4vw, 34px);
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.result-card h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  line-height: 1.04;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.result-card h2.compact-title {
  font-size: clamp(1.5rem, 2.7vw, 2.35rem);
}

.result-card h2.dense-title {
  font-size: clamp(1.25rem, 2.1vw, 1.85rem);
  line-height: 1.12;
}

.result-card p {
  color: var(--muted);
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 18px;
}

.tag-row span {
  padding: 7px 10px;
  background: white;
  border: 1px solid var(--line);
  font-size: 0.84rem;
  font-weight: 800;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 10px 0 18px;
}

.details-grid div {
  padding: 14px 12px;
  border-right: 1px solid var(--line);
}

.details-grid div:last-child {
  border-right: 0;
}

.details-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.details-grid strong {
  display: block;
  margin-top: 4px;
}

.idea-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.decision-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.decision-row .secondary-btn {
  min-height: 40px;
}

.itinerary-box {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.itinerary-step {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
  align-items: start;
}

.itinerary-step span {
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.itinerary-step strong {
  display: block;
  margin-bottom: 2px;
}

.itinerary-step p {
  margin: 0;
  font-size: 0.92rem;
}

.live-section,
.saved-section {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  background: #fffaf1;
}

.saved-section > div:not(:first-child) {
  margin-top: 20px;
}

.live-section {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}

.source-grid,
.idea-grid,
.live-pulse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.source-grid {
  grid-column: 2;
}

.source-card,
.mini-card,
.live-card {
  background: white;
  border: 1px solid var(--line);
  padding: 16px;
  min-height: 128px;
  text-align: left;
  cursor: pointer;
}

.source-card {
  text-decoration: none;
}

.source-card strong,
.mini-card strong {
  display: block;
  margin-bottom: 8px;
}

.source-card span,
.mini-card span,
.live-card span,
.section-note,
.live-status {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.mini-card:hover,
.source-card:hover,
.live-card:hover,
.secondary-btn:hover,
.primary-btn:hover,
.icon-btn:hover {
  filter: brightness(0.97);
}

.compact-btn {
  min-height: 42px;
  width: 100%;
  padding: 0 14px;
  margin-top: 12px;
}

.live-status {
  margin: 12px 0 0;
}

.live-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.live-card strong {
  display: block;
  margin-bottom: 8px;
}

.live-card a {
  color: var(--green-dark);
  font-weight: 850;
  text-decoration: none;
}

@media (max-width: 920px) {
  .planner,
  .roulette-stage,
  .live-section {
    grid-template-columns: 1fr;
  }

  .source-grid {
    grid-column: auto;
  }

  .planner {
    min-height: auto;
  }

  .control-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .wheel-wrap {
    width: min(72vw, 380px);
    margin: 0 auto;
  }

  .roulette-stage .wheel-wrap,
  .roulette-stage .result-card {
    margin-top: 0;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: calc(100vw - 18px);
    padding-top: 9px;
  }

  .brand-block h1 {
    font-size: clamp(1.85rem, 8.6vw, 2.05rem);
    line-height: 1.05;
  }

  .brand-block p:last-child {
    max-width: 30ch;
  }

  .control-panel,
  .roulette-stage,
  .live-section,
  .saved-section {
    padding: 18px;
  }

  .toggle-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .details-grid div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .details-grid div:last-child {
    border-bottom: 0;
  }

  .result-card {
    min-height: 360px;
  }

  .wheel-label {
    width: 64px;
    font-size: 0.68rem;
  }
}
