:root {
  --bg-night: #07131f;
  --bg-deep: #102236;
  --panel: rgba(8, 17, 30, 0.78);
  --panel-border: rgba(167, 208, 255, 0.16);
  --text: #eef5ff;
  --muted: #b8c8db;
  --accent-blue: #35b7ff;
  --accent-blue-soft: #82d8ff;
  --accent-gold: #ffcf57;
  --accent-gold-soft: #ffe9a2;
  --accent-green: #8ff7b5;
  --danger: #ff8a8a;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(41, 96, 167, 0.32), transparent 36%),
    radial-gradient(circle at 20% 20%, rgba(255, 207, 87, 0.18), transparent 24%),
    linear-gradient(145deg, var(--bg-night), #091726 36%, var(--bg-deep));
}

button,
input,
textarea,
select {
  font: inherit;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.aurora {
  position: absolute;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(24px);
  opacity: 0.38;
  pointer-events: none;
}

.aurora-left {
  top: -10rem;
  left: -10rem;
  background: radial-gradient(circle, rgba(53, 183, 255, 0.45), transparent 60%);
}

.aurora-right {
  right: -8rem;
  bottom: -8rem;
  background: radial-gradient(circle, rgba(255, 207, 87, 0.35), transparent 62%);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: calc(100% - 2rem);
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.hero {
  margin-bottom: 1.5rem;
}

.eyebrow,
.section-label,
.vote-label,
.selection-caption,
.board-legend span {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  color: var(--accent-gold-soft);
}

.hero h1,
.wizard-topbar h2,
.vote-brief h3,
.selection-card h3 {
  font-family: "Cinzel", Georgia, serif;
}

.hero h1 {
  margin: 0.35rem 0 0.65rem;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.08;
}

.hero-copy {
  max-width: 52rem;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.wizard-card {
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(11, 21, 34, 0.84), rgba(8, 17, 30, 0.92));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  border-radius: 28px;
  padding: 1.35rem;
}

.wizard-topbar,
.wizard-actions,
.status-cluster,
.selection-layout,
.vote-layout,
.selection-grid,
.party-grid,
.slot-list,
.board-meta,
.vote-points,
.board-legend,
.vote-callout,
.selection-text {
  display: flex;
}

.wizard-topbar,
.wizard-actions,
.board-meta,
.vote-callout {
  justify-content: space-between;
  gap: 1rem;
}

.wizard-topbar,
.status-cluster,
.selection-layout,
.vote-layout,
.selection-grid,
.party-grid,
.slot-list,
.board-meta,
.vote-points,
.board-legend,
.vote-callout,
.selection-text {
  align-items: center;
}

.wizard-topbar {
  margin-bottom: 1rem;
}

.wizard-topbar h2 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.45rem, 2.6vw, 2.15rem);
}

.status-cluster {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.selection-pill,
.progress-pill,
.tile-chip,
.slot-chip,
.vote-chip,
.nav-button,
.party-tile,
.slot-option {
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease, box-shadow 220ms ease, opacity 220ms ease;
}

.selection-pill,
.progress-pill {
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font-size: 0.92rem;
}

.selection-pill {
  background: rgba(53, 183, 255, 0.1);
  border: 1px solid rgba(53, 183, 255, 0.28);
}

.progress-pill {
  background: rgba(255, 207, 87, 0.1);
  border: 1px solid rgba(255, 207, 87, 0.28);
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
  height: 100%;
  width: 16.66%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-blue));
  transition: width 280ms ease;
}

.slides-viewport {
  margin: 1.2rem 0 1rem;
  overflow: hidden;
  transition: height 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.slides {
  display: flex;
  align-items: flex-start;
  width: 600%;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.slide {
  width: calc(100% / 6);
  padding: 0.25rem;
  flex: 0 0 calc(100% / 6);
}

.slide-card {
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
    rgba(10, 19, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem;
}

.selection-layout,
.vote-layout {
  gap: 1.5rem;
}

.selection-layout {
  display: grid;
  grid-template-columns: minmax(180px, 22%) minmax(0, 1fr);
}

.vote-layout {
  display: grid;
  grid-template-columns: minmax(180px, 26%) minmax(0, 1fr);
}

.selection-layout,
.vote-layout {
  align-items: stretch;
}

.selection-card,
.vote-brief,
.board-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
}

.selection-card,
.vote-brief {
  width: 100%;
  padding: 1.2rem;
}

.selection-card h3,
.vote-brief h3 {
  margin: 0.45rem 0 0.7rem;
  font-size: 1.5rem;
}

.selection-card p,
.vote-brief p,
.vote-points li,
.selection-text {
  color: var(--muted);
}

.selection-card p,
.vote-brief p {
  margin: 0;
  line-height: 1.6;
}

.selection-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.selection-text {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.board-card {
  flex: 1;
  padding: 1rem;
  position: relative;
  overflow: auto;
  min-width: 0;
}

.selection-grid,
.party-grid {
  width: 100%;
  gap: 1rem;
}

.party-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(auto, 1fr));
}

.party-tile {
  position: relative;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(53, 183, 255, 0.08), rgba(255, 207, 87, 0.08)),
    rgba(255, 255, 255, 0.03);
  padding: 1rem;
  text-align: left;
  color: inherit;
  cursor: pointer;
  overflow: hidden;
}

.nav-button:hover {
  transform: translateY(-2px);
}

.party-tile:hover,
.slot-option:hover {
  outline: 2px solid rgba(130, 216, 255, 0.9);
  outline-offset: -2px;
}

.party-tile.selected,
.slot-option.selected {
  border-color: rgba(255, 207, 87, 0.6);
  box-shadow: 0 18px 40px rgba(255, 207, 87, 0.16);
}

.party-tile.muted {
  opacity: 0.45;
}

.party-label,
.slot-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.party-name,
.slot-name {
  font-size: 1.18rem;
  font-weight: 700;
}

.party-hint,
.slot-hint {
  margin-top: 0.45rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.check-orb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.32);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.check-orb.placeholder {
  visibility: hidden;
}

.check-orb::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: transparent;
  transition: background 220ms ease;
}

.selected .check-orb {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 6px rgba(255, 207, 87, 0.12);
}

.selected-slot {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 6px rgba(255, 207, 87, 0.12);
}

.selected .check-orb::after {
  background: radial-gradient(circle at 30% 30%, #fff3cb, var(--accent-gold));
}

.selected-slot::after {
  background: radial-gradient(circle at 30% 30%, #fff3cb, var(--accent-gold));
}

.slot-stage .party-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(auto, 1fr));
}

.slot-stage .party-tile {
  cursor: default;
}

.slot-stage .party-tile.active-party {
  border-color: rgba(53, 183, 255, 0.5);
  box-shadow: 0 18px 40px rgba(53, 183, 255, 0.18);
}

.slot-list {
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.slot-option {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  cursor: pointer;
  padding: 0.9rem 1rem;
  text-align: left;
}

.slot-option.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.preview-stage .party-tile {
  display: flex;
  flex-direction: column;
}

.preview-stage .board-card,
.slot-stage .board-card {
  overflow: visible;
}

.preview-stage .party-grid,
.slot-stage .party-grid {
  height: auto;
  align-content: start;
}

.preview-slot {
  cursor: default;
}

.vote-layout {
  gap: 1.2rem;
}

.vote-layout .board-card {
  min-height: 100%;
}

.vote-brief {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.vote-chip {
  display: inline-flex;
  width: fit-content;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.vote-chip-blue {
  background: rgba(53, 183, 255, 0.14);
  border: 1px solid rgba(53, 183, 255, 0.34);
  color: #aee8ff;
}

.vote-chip-yellow {
  background: rgba(255, 207, 87, 0.14);
  border: 1px solid rgba(255, 207, 87, 0.34);
  color: var(--accent-gold-soft);
}

.vote-points {
  margin: 0;
  padding: 0 0 0 1.2rem;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
}

.vote-callout {
  margin-top: auto;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(143, 247, 181, 0.16);
  background: rgba(143, 247, 181, 0.06);
}

.callout-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-green);
}

.callout-value {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.04rem;
  font-weight: 700;
}

.board-meta {
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.board-legend {
  gap: 0.75rem;
  flex-wrap: wrap;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.legend-chip::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 4px;
}

.legend-chip.blue::before {
  background: var(--accent-blue);
}

.legend-chip.yellow::before {
  background: var(--accent-gold);
}

.legend-chip.highlight::before {
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f6fffb, var(--accent-green));
}

.board-svg {
  width: 100%;
  height: auto;
  display: block;
}

.nav-button {
  border: 0;
  border-radius: 16px;
  padding: 0.95rem 1.35rem;
  cursor: pointer;
}

.nav-button.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-button.primary {
  background: linear-gradient(120deg, var(--accent-gold), #ffa95f 50%, var(--accent-blue));
  color: #061018;
  font-weight: 800;
  box-shadow: 0 15px 35px rgba(53, 183, 255, 0.22);
}

.nav-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.marker-label {
  font-size: 24px;
  font-weight: 700;
  fill: #08121f;
}

.stand-here-label {
  font-size: 20px;
  font-weight: 800;
  fill: #ff5252;
  paint-order: stroke;
  stroke: rgba(8, 18, 31, 0.9);
  stroke-width: 4px;
  letter-spacing: 0.04em;
}

.tile-label {
  font-size: 17px;
  font-weight: 700;
  fill: rgba(255, 255, 255, 0.9);
}

.vote-ring {
  fill: rgba(143, 247, 181, 0.08);
  stroke: rgba(143, 247, 181, 0.9);
  stroke-width: 8;
  animation: pulseRing 2.2s ease-in-out infinite;
}

.focus-line {
  stroke: rgba(255, 255, 255, 0.34);
  stroke-width: 4;
  stroke-dasharray: 12 12;
}

.movement-arrow {
  fill: none;
  stroke: rgba(255, 107, 107, 0.95);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(255, 107, 107, 0.3));
}

.vote-caption {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.95rem;
}

@keyframes pulseRing {
  0%,
  100% {
    transform: scale(0.98);
    transform-origin: center;
    opacity: 0.9;
  }
  50% {
    transform: scale(1.04);
    transform-origin: center;
    opacity: 0.45;
  }
}

@media (max-width: 920px) {
  .wizard-topbar,
  .wizard-actions {
    flex-direction: column;
  }

  .selection-card,
  .vote-brief {
    width: 100%;
  }

  .wizard-topbar,
  .status-cluster {
    align-items: flex-start;
  }

  .status-cluster {
    justify-content: flex-start;
  }

}

@media (max-width: 700px) {
  .app-shell {
    width: calc(100% - 1rem);
    padding-top: 1.1rem;
  }

  .wizard-card,
  .slide-card {
    padding: 1rem;
  }

  .party-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .selection-layout,
  .vote-layout {
    grid-template-columns: minmax(140px, 30%) minmax(0, 1fr);
  }

  .slides {
    width: 600%;
  }

  .slide {
    width: calc(100% / 6);
  }

  .board-meta,
  .vote-callout {
    flex-direction: column;
    align-items: flex-start;
  }
}
