:root {
  --bk-yellow: #fda405;
  --bk-brown: #502213;
  --color-primary: var(--bk-yellow);
  --color-primary-dark: rgba(253, 171, 0, 0.75);
  --color-accent: var(--bk-yellow);
  --bg-main: var(--bk-brown);
  --bg-gradient: linear-gradient(
    180deg,
    rgba(80, 34, 19, 0.95) 0%,
    rgba(80, 34, 19, 1) 100%
  );
  --bg-gradient-dark: linear-gradient(
    180deg,
    rgba(253, 171, 0, 0.35) 0%,
    rgba(253, 171, 0, 0) 100%
  );
  --color-text-main: #ffffff;
  --color-text-muted: rgba(255, 255, 255, 0.75);
  --color-inactive: rgba(253, 171, 0, 0.55);
  --color-btn-inactive: rgba(255, 255, 255, 0.55);
  --color-inactive-light: rgba(253, 171, 0, 0.2);
  --slider-bg-active: var(--bk-yellow);
  --slider-bg-inactive: rgba(253, 171, 0, 0.3);
  --color-chart-top: rgba(80, 34, 19, 0.85);
  --color-chart-bottom: var(--bk-brown);
  --bg-gradient-chart: linear-gradient(
    to bottom,
    rgba(80, 34, 19, 0.85) 0%,
    rgba(80, 34, 19, 1) 100%
  );
  --img: url("../img/bk.png") center / contain no-repeat;
}

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

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, sans-serif;
  background: var(--bg-gradient);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: center;
  gap: 20px;
  padding: 20px;
}

.app-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: calc(env(safe-area-inset-top) + 12px);
}

.app-logo {
  height: 40px;
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  background: transparent;
}

.screen {
  display: none !important;
  animation: fadeIn 0.3s ease-in;
}

.screen.active {
  display: block !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.icon-arrow path {
  stroke: var(--color-primary);
}

/* Main Screen */
.main-screen {
  margin-top: 20px;
  text-align: center;
}

.main-screen h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 10px;
}

.main-screen h2 {
  font-size: 24px;
  font-weight: 400;
  color: var(--color-text-main);
  margin-bottom: 8px;
}

.main-screen p {
  font-size: 16px;
  color: var(--color-text-muted);
}

.main-image {
  width: 100%;
  max-width: 450px;
  height: 300px;
  background: var(--img);
  border-radius: 20px;
  margin: 0 auto 0;
}

.btn-primary {
  width: 100%;
  padding: 18px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

/* Test Screen */
.test-screen {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
}

.progress-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text-muted);
  font-size: 14px;
}

.progress-track {
  flex: 1;
  height: 6px;
  background: var(--color-inactive);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-accent);
  transition: width 0.3s ease;
}

.question-card {
  background: var(--bg-question-card);
  border-radius: 20px;
  padding: 20px 20px;
}

.question-card h3 {
  font-size: 16px;

  color: var(--color-text-main);
  margin-bottom: 20px;
  text-align: center;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.option-card {
  background: white;
  border: 2px solid white;
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.option-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.option-card.selected {
  border-color: var(--color-accent);
  background: var(--bk-yellow);
}

.option-card img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  margin-bottom: 10px;
  border-radius: 16px;
}

.option-card span {
  display: block;
  font-size: 15px;
  color: #1a1a1a;
  font-weight: 500;
  text-align: center;
}

.option-card.selected span {
  color: white;
}

/* Gender Selection (Horizontal Cards) */
.options-horizontal {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.options-horizontal .option-card {
  flex: 1;
  max-width: 180px;
  padding: 5px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.options-horizontal .option-card img {
  width: 80px;
  height: 80px;
  border-radius: 16px;
}

/* Vertical List Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.options-list .option-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  text-align: left;
}

.options-list .option-card img {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  flex-shrink: 0;
}

.options-list .option-card span {
  font-size: 16px;
  color: var(--color-text-main);
  text-align: left;
}

/* Slider Input */
.slider-container {
  margin: 16px 0;
}

.slider-input {
  width: 100%;
  padding: 10px 20px;
  border: 1px solid #e0e0e0;
  border-radius: 50px;
  font-size: 16px;
  margin-bottom: 16px;
  text-align: center;
}

.slider-wrapper {
  position: relative;
  padding: 10px 0;
}

.slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    var(--slider-bg-active) 0%,
    var(--slider-bg-active) 50%,
    var(--slider-bg-inactive) 50%,
    var(--slider-bg-inactive) 100%
  );
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  border: 4px solid var(--color-accent);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  border: 4px solid var(--color-accent);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 14px;
  color: var(--color-text-muted);
}

/* Navigation Buttons */
.nav-buttons {
  display: flex;
  gap: 15px;
  margin-top: auto;
}

.btn-secondary {
  flex: 1;
  padding: 16px;
  background: white;
  color: #1a1a1a;
  border: 2px solid #1a1a1a;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secondary:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--bg-main);
}

.btn-next {
  flex: 1;
  padding: 16px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-next:hover {
  background: var(--color-primary-dark);
}

.btn-next:disabled {
  background: var(--color-btn-inactive);
  cursor: not-allowed;
}

/* Calculating Screen */
.calculating-screen {
  text-align: center;
  padding: 60px 20px;
}

.circular-progress {
  width: 200px;
  height: 200px;
  margin: 0 auto 40px;
  position: relative;
}

.circular-progress svg {
  transform: rotate(-90deg);
}

.circular-progress circle {
  fill: none;
  stroke-width: 12;
}

.circle-bg {
  stroke: var(--color-inactive);
}

.circle-progress {
  stroke: var(--color-primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  font-weight: 700;
  color: var(--color-primary);
}

.calculating-screen h2 {
  font-size: 24px;
  color: var(--color-text-main);
  font-weight: 600;
}

/* Results Screen */
.results-screen {
  padding-bottom: 40px;
}

.results-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: #011008;
  text-align: center;
  margin-bottom: 24px;
}

.results-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-divider {
  border: none;
  border-top: 1px solid var(--color-inactive-light);
  margin: 0;
}

.result-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.1);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.result-icon img {
  width: 100%;
  height: 100%;
  display: block;
}

.result-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.result-label {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: #011008;
}

.result-separator {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: #011008;
}

.result-value-inline {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  color: #011008;
}

.result-description {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  color: #011008;
  margin: 0;
}

.chart-with-lines {
  position: relative;
}

.chart-svg {
  width: 100%;
  height: auto;
}

.chart-placeholder {
  width: 100%;
  height: 120px;
  background: var(--bg-gradient-chart);
  border-radius: 12px;
  margin: 15px 0;
  position: relative;
  overflow: hidden;
}

.chart-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80%;
}

.chart-line svg {
  width: 100%;
  height: 100%;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  color: #011008;
  text-align: center;
}

.age-bars {
  display: flex;
  gap: 20px;
  margin-top: 15px;
}

.age-bar {
  flex: 1;
  text-align: center;
}

.age-bar-content {
  height: 170px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.age-bar-fill-gradient {
  width: 100%;
  height: 100%;
  background: var(--bg-gradient-dark);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: #011008;
  position: relative;
}

.age-bar-fill-gradient::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary);
}

.age-bar-label {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  color: #011008;
  margin-top: 12px;
}

.calories-display {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: #011008;
  margin: 20px 0;
}

.calories-bar {
  width: 100%;
  height: 16px;
  background: var(--color-inactive-light);
  border-radius: 8px;
  overflow: hidden;
  margin: 15px 0;
}

.calories-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 8px;
  transition: width 0.3s;
}

.calories-labels {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  color: #011008;
}

.expand-btn {
  background: none;
  border: none;
  color: var(--color-accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
}

.prize-card {
  background: white;
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  margin-bottom: 20px;
}

.prize-image {
  width: 100%;
  height: 100px;
  margin: 0 auto 0px;
  display: block;
  object-fit: contain;
}

.prize-card h2 {
  font-size: 27px;

  color: #1a1a1a;
  margin-bottom: 15px;
}

.prize-card p {
  font-size: 13px;
  color: #000;
  margin-bottom: 25px;
}

.btn-orange {
  width: 100%;
  padding: 10px 24px 12px;
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  border-radius: 28px;
  font-size: 24px;
  font-weight: 500;
  font-family: "Roboto", sans-serif;
  cursor: pointer;
  transition: background 0.3s;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.btn-orange:hover {
  background: var(--color-primary-dark);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-main);
  border-radius: 30px;
  padding: 30px;
  max-width: 440px;
  width: 100%;
  position: relative;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #5d4037;
  background: #d7ccc8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #5d4037;
  transition: all 0.3s;
}

.modal-close:hover {
  background: #bcaaa4;
  transform: rotate(90deg);
}

/* Slot Machine (Vertical Roulette) */
.slot-window {
  width: 272px;
  height: 274px;
  overflow: hidden;
  border-radius: 20px;

  position: relative;
  background: var(--bg-main);
  margin: 0 auto 30px;
  padding: 15px;
  box-sizing: border-box;
}

.slot-window::before,
.slot-window::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: #5d4037;
  z-index: 3;
  pointer-events: none;
}

.slot-window::before {
  top: 0;
}

.slot-window::after {
  bottom: 0;
}

.slot-track {
  position: relative;
  width: 100%;
  transition: transform 3s cubic-bezier(0.2, 0.9, 0.4, 1);
}

.slot-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 203px;
  position: relative;
  background: var(--bg-main);
  border-radius: 20px;
  border: 3px solid var(--color-primary);
  transition: all 0.3s ease;
  padding: 15px;
  margin-bottom: 10px;
  box-sizing: border-box;
}

.slot-item.highlight {
  border-color: var(--color-primary);
  box-shadow: 0px 0px 16px 0px rgba(229, 116, 29, 0.6);
}

.slot-item-title {
  font-family: "Roboto", sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text-main);
  margin-bottom: 10px;
  text-align: center;
}

.slot-item img {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  border-radius: 12px;
}

.divider {
  width: 100%;
  height: 1px;

  margin: 20px 0;
}

.divider-thin {
  width: 100%;
  height: 1px;
  background: #5d4037;
  margin: 15px 0;
}

.modal h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 10px;
}

.modal p {
  font-size: 16px;
  color: var(--color-text-muted);
  margin-bottom: 25px;
}

.spin-button {
  width: 100%;
  padding: 10px 24px 12px;
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  border-radius: 28px;
  font-size: 24px;
  font-weight: 500;
  font-family: "Roboto", sans-serif;
  cursor: pointer;
  transition: background 0.3s;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  margin-bottom: 15px;
}

.spin-button:hover:not(:disabled) {
  background: var(--color-primary-dark);
}

.spin-button:disabled {
  background: #ffcc80;
  cursor: not-allowed;
  opacity: 0.6;
}

.prize-result {
  display: none;
  margin-top: 20px;
}

.prize-result.show {
  display: block;
}

.prize-result img {
  width: 120px;
  height: 100px;
  object-fit: contain;
  margin: 0 auto 15px;
}

/* Email Screen */
.email-screen {
  text-align: center;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.email-header-image {
  width: 100%;
  max-width: 350px;
  height: auto;
  margin: 0 auto 30px;
}

.email-screen h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 25px;
}

.email-screen ol {
  text-align: left;
  margin: 0 0 30px 20px;
  color: var(--color-text-muted);
  line-height: 1.8;
}

.email-screen h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: 15px;
  text-align: left;
}

.email-input {
  width: 100%;
  padding: 15px 20px;
  border: 1px solid #d0d0d0;
  border-radius: 50px;
  font-size: 16px;
  margin-bottom: 15px;
  background: #ffffff;
  color: #1a1a1a;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.3s;
}

.email-input:focus {
  border-color: #5d4037;
}

.email-input.error {
  border-color: #f44336;
}

.email-input::placeholder {
  color: #9e9e9e;
}

.email-error {
  color: #f44336;
  font-size: 14px;
  margin-top: -10px;
  margin-bottom: 10px;
  text-align: left;
  padding-left: 20px;
  display: none;
}

.email-error.show {
  display: block;
}

.checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 25px;
  text-align: left;
}

.checkbox-container input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: #bdbdbd;
  opacity: 0.6;
  flex-shrink: 0;
}

.checkbox-container input[type="checkbox"]:checked {
  accent-color: var(--color-primary);
}

.checkbox-container label {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
  cursor: pointer;
}

/* Success Screen */
.success-screen {
  text-align: center;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.success-icon {
  width: 120px;
  height: 120px;
  margin: 10px auto 40px;
  background: var(--color-inactive-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon svg {
  width: 60px;
  height: 60px;
  stroke: var(--color-primary);
  stroke-width: 4;
  fill: none;
}

.success-screen img {
  width: 100%;
  height: 100px;
  margin: 0 auto 0px;
  display: block;
  object-fit: contain;
}

.success-screen h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 15px;
}

.success-screen p {
  font-size: 14px;
  color: var(--color-accent);
  margin-bottom: 30px;
  line-height: 1.6;
}

.success-screen h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 30px;
}

/* Footer */
.footer {
  padding: 32px 0px;
  margin-top: auto;
  border-radius: 20px 20px 0 0;
}

.email-screen .footer,
.success-screen .footer {
  margin-top: auto;
}

#screen-roulette {
  display: flex;
  flex-direction: column;
}

#screen-roulette > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

#screen-roulette .footer {
  background: transparent;
  padding: 20px 0;
  margin-top: auto;
}

#screen-roulette .footer-legal a {
  color: var(--color-accent);
}

#screen-roulette .footer-legal a:hover {
  color: var(--color-accent);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.footer-legal a {
  color: var(--color-accent);
  text-decoration: none;
  font-size: 14px;
}

.payment-icons {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.payment-logos {
  max-width: 100%;
  height: auto;
  display: block;
}

.payment-icon {
  width: 60px;
  height: 40px;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.payment-icon img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

/* Responsive */
@media (max-width: 480px) {
  .main-screen h1 {
    font-size: 28px;
  }

  .option-card img {
    width: 60px;
    height: 60px;
  }
}
