:root {
  --bg0: #101214;
  --text: #dee4ea;
  --muted: #738496;
  --accent: #5fa3ff;
  --accent-strong: #3f7dff;
  --pizza-gold: #ffc64d;
  --card: #161a1d;
  --card-border: #bcd6f00a;
  --error: #ff7587;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--text);
  background-color: #101214;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(133, 184, 255, 0.12), rgba(16, 18, 20, 0.2) 70%),
    url("/assets/background-gradient.svg");
  background-position: 50% 50%;
  background-repeat: no-repeat;
  background-size: cover;
}

body.carousel-scroll-lock {
  overflow: hidden;
}

.app {
  width: 100%;
  min-height: 100svh;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1rem;
  padding: 1rem;
}

[hidden] {
  display: none !important;
}

.landing-title {
  margin: 0;
  text-align: center;
  font-family: Syne, Manrope, sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
  color: #dee4ea;
  position: relative;
  min-height: clamp(64px, 14vw, 150px);
  line-height: 1.15;
}

.landing-title,
.pizza-word {
  font-family: Syne, Manrope, sans-serif;
  font-weight: 700;
  background: linear-gradient(180deg, #ffe79d 0%, #ffc64d 50%, #f49a1e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow:
    0 2px 0 rgba(116, 56, 0, 0.55),
    0 8px 18px rgba(0, 0, 0, 0.35);
}

body.image-title-enabled .landing-title {
  color: transparent;
  text-shadow: none;
  background: none;
}

body.image-title-enabled .landing-title::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

body.image-title-enabled .landing-title.is-landing::after {
  background-image: url("/assets/wordmarks/wybierz-styl-pizzy.png");
}

body.image-title-enabled .landing-title.is-wizard::after {
  background-image: url("/assets/wordmarks/parametry-pizzy.png");
}

.ring-host {
  position: relative;
  width: min(1300px, calc(100% - 1rem));
  height: clamp(280px, 60vh, 560px);
  margin-top: 0.1rem;
}

.carousel-shell {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 0;
  position: absolute;
  inset: 0;
}

.wizard-shell {
  display: grid;
  place-items: center;
  position: absolute;
  inset: 0;
}

.carousel-stage {
  height: 100%;
  perspective: 1400px;
  position: relative;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.carousel-stage.is-hovered {
  cursor: default;
}

.carousel-stage.is-grabbed {
  cursor: grabbing;
}

.wizard-stage {
  width: 100%;
  height: clamp(360px, 60vh, 560px);
  cursor: default;
}

.carousel-ring,
.wizard-ring {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.carousel-ring {
  transition: none;
}

.carousel-ring.is-snapping {
  transition: transform 340ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.wizard-ring {
  transition: transform 760ms cubic-bezier(0.2, 0.72, 0.22, 1);
}

.carousel-ring {
  pointer-events: auto;
}

.wizard-ring {
  pointer-events: auto;
}

.carousel-card,
.wizard-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(230px, 30vw, 390px);
  height: clamp(270px, 58vh, 520px);
  border-radius: 22px;
  border: 1px solid var(--card-border);
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(4, 10, 24, 0.5);
}

.carousel-card {
  background-size: cover;
  background-position: center;
  color: #fff;
  cursor: default;
  padding: 1rem;
  transition: border-color 220ms ease, box-shadow 220ms ease;
}

.carousel-card:hover,
.carousel-card:focus-visible {
  border-color: var(--pizza-gold);
  box-shadow: 0 0 0 2px rgba(255, 198, 77, 0.55), 0 20px 45px rgba(4, 10, 24, 0.5);
}

.carousel-card.is-front:hover,
.carousel-card.is-front:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 198, 77, 0.75), 0 20px 45px rgba(4, 10, 24, 0.5);
}

.carousel-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(3, 8, 20, 0.15), rgba(3, 8, 20, 0.85));
}

.carousel-card h3 {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.9rem;
  margin: 0;
  z-index: 1;
  font-family: Syne, Manrope, sans-serif;
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
}

.carousel-hint {
  position: absolute;
  left: 50%;
  bottom: 0.5rem;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 12, 18, 0.58);
  backdrop-filter: blur(3px);
  color: #dbe4ef;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  white-space: nowrap;
  z-index: 5;
}

.carousel-hint.is-dismissed {
  opacity: 0 !important;
}

.carousel-indicator {
  display: none;
}

.carousel-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(188, 214, 240, 0.28);
  border: 1px solid rgba(188, 214, 240, 0.35);
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.carousel-indicator-dot.is-active {
  background: var(--pizza-gold);
  border-color: #ffda7a;
  transform: scale(1.15);
}

.carousel-ring.is-mobile-list {
  position: relative;
  inset: auto;
  transform: none !important;
  transform-style: flat;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  padding: 0.2rem 0 0.9rem;
}

.wizard-card {
  width: clamp(184px, 24vw, 312px);
  height: clamp(216px, 46vh, 416px);
  background: var(--card);
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  align-content: stretch;
  gap: 0.34rem;
  transform-style: preserve-3d;
  opacity: 0.22;
  filter: blur(1.2px);
  pointer-events: none;
  overflow-y: auto;
  overflow-x: hidden;
  transition: opacity 260ms ease, filter 260ms ease;
}

.wizard-card.is-active {
  opacity: 1;
  filter: none;
  pointer-events: auto;
}

.wizard-card h2 {
  margin: 0;
  font-size: 1.02rem;
  font-family: Syne, Manrope, sans-serif;
  line-height: 1.15;
}

label {
  font-size: 0.76rem;
  color: #cad6e4;
  font-weight: 600;
  line-height: 1.25;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(188, 214, 240, 0.2);
  background: #101214;
  color: var(--text);
  padding: 0.42rem 0.56rem;
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: none;
  border-color: #8cb8ff;
  box-shadow: 0 0 0 3px rgba(95, 164, 255, 0.28);
}

small {
  color: #9aaec3;
  font-size: 0.64rem;
  line-height: 1.3;
  margin-top: -0.12rem;
}

small:empty {
  display: none;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.36rem;
}

.step-actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.36rem;
  padding-top: 0.28rem;
}

.step-actions.one {
  grid-template-columns: 1fr;
}

.primary-btn,
.ghost-btn {
  min-height: 38px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  font-weight: 700;
  padding: 0.46rem 0.75rem;
  font-size: 0.92rem;
}

.primary-btn {
  color: #2a1600;
  background: linear-gradient(180deg, #ffe79d 0%, #ffc64d 52%, #f49a1e 100%);
}

.wizard-shell .primary-btn {
  color: #2a1600;
  background: var(--pizza-gold);
}

.ghost-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(188, 214, 240, 0.2);
}

.back-fixed {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 12;
}

@media (max-height: 760px) and (max-width: 991px) {
  .back-fixed {
    position: static;
    right: auto;
    bottom: auto;
    width: min(620px, 100%);
    margin-top: 0.35rem;
  }
}

.highlight {
  border: 1px solid rgba(188, 214, 240, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.56rem;
}

.highlight p {
  margin: 0;
  font-size: clamp(1.12rem, 2.4vw, 1.62rem);
  font-weight: 800;
}

.results-grid {
  margin-top: 0.44rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.36rem;
}

.result-card {
  border: 1px solid rgba(141, 86, 8, 0.4);
  border-radius: 10px;
  padding: 0.42rem;
  background: var(--pizza-gold);
}

.result-card p {
  margin: 0;
}

.result-card p:first-child {
  color: rgba(58, 33, 0, 0.88);
  font-size: 0.68rem;
}

.result-card p:last-child {
  margin-top: 0.14rem;
  font-weight: 800;
  font-size: 0.94rem;
  color: #2d1a00;
}

.result-meta {
  margin-top: 0.4rem;
  padding-top: 0.38rem;
  border-top: 1px dashed rgba(144, 173, 230, 0.36);
  color: #c9d8ef;
}

.result-meta p {
  margin: 0.16rem 0;
  font-size: 0.8rem;
}

.wizard-card[data-step="3"] {
  padding: 0.68rem;
  gap: 0.24rem;
}

.wizard-card[data-step="3"] .highlight {
  padding: 0.46rem;
}

.wizard-card[data-step="3"] .highlight p {
  font-size: clamp(1rem, 2.1vw, 1.46rem);
}

.wizard-card[data-step="3"] .results-grid {
  margin-top: 0.34rem;
  gap: 0.3rem;
}

.wizard-card[data-step="3"] .result-card {
  padding: 0.36rem;
}

.wizard-card[data-step="3"] .result-card p:first-child {
  font-size: 0.62rem;
}

.wizard-card[data-step="3"] .result-card p:last-child {
  font-size: 0.84rem;
  margin-top: 0.08rem;
}

.wizard-card[data-step="3"] .result-meta {
  margin-top: 0.3rem;
  padding-top: 0.28rem;
}

.wizard-card[data-step="3"] .result-meta p {
  font-size: 0.72rem;
  line-height: 1.2;
  margin: 0.1rem 0;
}

.wizard-card[data-step="3"] .step-actions {
  padding-top: 0.2rem;
}

.wizard-card[data-step="3"] .ghost-btn,
.wizard-card[data-step="3"] .primary-btn {
  min-height: 34px;
  padding: 0.38rem 0.62rem;
  font-size: 0.84rem;
}

.wizard-card[data-step="2"] {
  padding: 0.68rem;
  gap: 0.24rem;
}

.wizard-card[data-step="2"] label {
  font-size: 0.72rem;
}

.wizard-card[data-step="2"] input,
.wizard-card[data-step="2"] select {
  min-height: 33px;
  padding: 0.34rem 0.5rem;
}

.wizard-card[data-step="2"] small {
  font-size: 0.61rem;
  line-height: 1.2;
}

.wizard-card[data-step="2"] .step-actions {
  gap: 0.3rem;
  padding-top: 0.2rem;
}

.wizard-card[data-step="2"] .ghost-btn,
.wizard-card[data-step="2"] .primary-btn {
  min-height: 34px;
  padding: 0.38rem 0.62rem;
  font-size: 0.84rem;
}

.wizard-card[data-step="2"] .error {
  min-height: 0.8rem;
  margin: 0.12rem 0 0;
  font-size: 0.7rem;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.error {
  min-height: 1.1rem;
  margin: 0.2rem 0 0;
  color: var(--error);
}

@media (max-width: 860px) {
  .app {
    align-content: start;
    gap: 0.6rem;
    padding-top: 0.72rem;
  }

  .ring-host {
    height: clamp(430px, calc(100svh - 8.2rem), 760px);
    margin-top: 0;
  }

  .ring-host.is-wizard {
    height: clamp(450px, 76svh, 680px);
  }

  .carousel-stage.mobile-list {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 0.2rem 0.38rem 0.75rem;
    scroll-padding-top: 1.8rem;
  }

  .carousel-stage.mobile-list::-webkit-scrollbar {
    display: none;
  }

  .carousel-stage.mobile-list .carousel-hint {
    position: sticky;
    top: 0.2rem;
    bottom: auto;
    opacity: 1;
    z-index: 6;
    font-size: 0.64rem;
    padding: 0.28rem 0.62rem;
    text-align: center;
    max-width: calc(100% - 1rem);
    white-space: normal;
  }

  .carousel-stage.mobile-list .carousel-indicator {
    position: sticky;
    top: 50%;
    right: 0.45rem;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.44rem;
    width: fit-content;
    height: 0;
    margin-left: auto;
    z-index: 6;
    pointer-events: none;
  }

  .carousel-stage.mobile-list .carousel-ring {
    align-content: start;
  }

  .carousel-card {
    width: clamp(184px, 72vw, 300px);
    height: clamp(184px, 72vw, 300px);
    border-radius: 18px;
  }

  .carousel-stage.mobile-list .carousel-card {
    position: relative;
    left: auto;
    top: auto;
    transform: none !important;
    margin-inline: auto;
    scroll-snap-align: center;
  }

  .carousel-card h3 {
    font-size: clamp(1.24rem, 5vw, 1.9rem);
  }

  .wizard-stage {
    height: 100%;
  }

  .wizard-card {
    width: clamp(220px, 82vw, 340px);
    height: clamp(386px, 70svh, 612px);
    padding: 0.72rem;
    gap: 0.3rem;
  }

  input,
  select {
    min-height: 34px;
  }

  .primary-btn,
  .ghost-btn {
    min-height: 36px;
  }

  .carousel-shell {
    grid-template-columns: 1fr;
  }

  .split,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .back-fixed {
    position: static;
    right: auto;
    bottom: auto;
    width: min(620px, 100%);
    margin-top: 1.1rem;
    margin-bottom: calc(0.25rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 991px) {
  body {
    background-size: contain;
  }
}

@media (max-width: 479px) {
  .landing-title {
    min-height: clamp(56px, 15vw, 96px);
  }

  .wizard-card h2 {
    font-size: 0.96rem;
  }

  label {
    font-size: 0.74rem;
  }

  small {
    font-size: 0.62rem;
    line-height: 1.28;
  }

  .wizard-card {
    border-radius: 16px;
  }

  .step-actions {
    gap: 0.4rem;
    padding-top: 0.32rem;
  }

  body {
    background-size: 200%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
