:root {
  --ink: #1f2933;
  --muted: #667085;
  --paper: #ffffff;
  --surface: #f4f7f6;
  --line: #d8e0df;
  --primary: #0f766e;
  --primary-dark: #0a5f59;
  --accent: #d97706;
  --danger: #b42318;
  --success: #067647;
  --gold: #d59b16;
  --silver: #8a96a3;
  --bronze: #a6602a;
  --shadow: 0 18px 45px rgba(31, 41, 51, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
}

main {
  min-height: calc(100vh - 76px);
}

.partner-logo {
  position: fixed;
  top: 18px;
  right: clamp(16px, 4vw, 44px);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(31, 41, 51, 0.12);
  backdrop-filter: blur(12px);
  text-decoration: none;
}

.partner-logo span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.partner-logo img {
  display: block;
  width: clamp(96px, 12vw, 142px);
  max-height: 34px;
}

.site-footer {
  display: flex;
  justify-content: center;
  padding: 22px clamp(18px, 5vw, 64px);
  color: var(--muted);
}

.hero,
.page-panel,
.admin-page,
.game-screen,
.result-screen {
  padding: clamp(28px, 6vw, 72px) clamp(18px, 5vw, 64px);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 540px);
  align-items: center;
  gap: clamp(28px, 6vw, 78px);
  min-height: calc(100vh - 76px);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.16), transparent 48%),
    linear-gradient(45deg, rgba(217, 119, 6, 0.13), transparent 55%),
    #fff;
}

.hero-with-form {
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(11, 34, 31, 0.78) 0%, rgba(11, 34, 31, 0.58) 43%, rgba(11, 34, 31, 0.22) 100%),
    url("../images/bg%20sentier%20desktop.png") center / cover no-repeat;
}

.game-screen,
.result-screen {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(11, 34, 31, 0.82) 0%, rgba(11, 34, 31, 0.5) 45%, rgba(11, 34, 31, 0.18) 100%),
    url("../images/bg%20sentier%20desktop.png") center / cover no-repeat;
}

.game-screen::before,
.result-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.22));
  pointer-events: none;
}

.game-screen > *,
.result-screen > * {
  position: relative;
  z-index: 1;
}

.game-copy {
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.34);
}

.game-copy .eyebrow {
  color: #f7c66a;
}

.result-screen .eyebrow {
  color: #f7c66a;
}

.game-copy .lead {
  color: rgba(255, 255, 255, 0.9);
}

.hero-with-form::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.24));
  pointer-events: none;
}

.hero-with-form > * {
  position: relative;
  z-index: 1;
}

.background-credit {
  position: absolute;
  right: 14px;
  bottom: 10px;
  z-index: 2;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.hero-with-form .hero-content {
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.34);
}

.hero-with-form .eyebrow {
  color: #f7c66a;
}

.hero-with-form .lead {
  color: rgba(255, 255, 255, 0.9);
}

.hero-with-form .form-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(14px);
}

.hero h1,
.page-panel h1,
.game-copy h1,
.admin-heading h1,
.result-screen h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(2.1rem, 5vw, 4.5rem);
  line-height: 1.02;
}

.lead {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.65;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  color: #fff;
  background: var(--primary);
}

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

.button-secondary {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.info-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.info-band article {
  padding: 34px clamp(18px, 4vw, 48px);
  background: #fff;
}

.info-band h2,
.form-card h2,
.table-panel h2 {
  margin: 0 0 10px;
}

.info-band p,
.muted {
  color: var(--muted);
  line-height: 1.55;
}

.form-card,
.table-panel,
.ticket {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-card {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 4vw, 34px);
}

.form-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  background: #fff;
}

input:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(15, 118, 110, 0.16);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-label input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

.field-error {
  min-height: 18px;
  color: var(--danger);
  font-weight: 700;
}

.alert {
  padding: 14px 16px;
  border-radius: 8px;
  font-weight: 800;
}

.alert-error {
  color: var(--danger);
  background: #fff1f0;
}

.alert-success {
  color: var(--success);
  background: #ecfdf3;
}

.game-screen {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 540px);
  gap: clamp(28px, 7vw, 86px);
  align-items: center;
  min-height: calc(100vh - 76px);
}

.wheel-wrap {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 26px;
}

.wheel {
  position: relative;
  display: grid;
  place-items: center;
  width: min(82vw, 470px);
  aspect-ratio: 1;
  border: 16px solid #fff;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffffff 0 15%, transparent 15.5%),
    conic-gradient(
      from -15deg,
      #f7f9fb 0deg 30deg,
      #dde8e3 30deg 60deg,
      #0f766e 60deg 90deg,
      #eef3f7 90deg 120deg,
      #dbe4ee 120deg 150deg,
      #edf1e8 150deg 180deg,
      #0f766e 180deg 210deg,
      #f7f9fb 210deg 240deg,
      #dde8e3 240deg 270deg,
      #eef3f7 270deg 300deg,
      #0f766e 300deg 330deg,
      #edf1e8 330deg 360deg
    );
  box-shadow:
    0 0 0 10px rgba(255, 255, 255, 0.7),
    0 24px 55px rgba(31, 41, 51, 0.16);
  transition: transform 4.2s cubic-bezier(0.13, 0.75, 0.12, 1);
}

.wheel::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 45px rgba(31, 41, 51, 0.08);
  pointer-events: none;
}

.wheel::after {
  content: "";
  z-index: 2;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    inset 0 0 0 10px var(--primary),
    0 8px 20px rgba(31, 41, 51, 0.16);
}

.segment {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 88px;
  margin-left: -44px;
  padding: 7px 9px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 16px rgba(31, 41, 51, 0.08);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(calc(var(--i) * 30deg)) translateY(-168px) rotate(calc(var(--i) * -30deg));
  transform-origin: center;
}

.segment-win {
  color: #fff;
  background: rgba(10, 95, 89, 0.92);
  box-shadow: 0 8px 18px rgba(10, 95, 89, 0.26);
}

.wheel-pointer {
  position: absolute;
  top: -14px;
  z-index: 3;
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 38px solid var(--accent);
  filter: drop-shadow(0 6px 10px rgba(31, 41, 51, 0.2));
}

.admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.admin-login {
  max-width: 460px;
}

.admin-controls {
  display: grid;
  gap: 18px;
}

.admin-grid {
  grid-template-columns: 360px minmax(0, 1fr);
  align-items: start;
}

.stock-list {
  display: grid;
  gap: 12px;
}

.stock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.stock-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stock-controls strong {
  min-width: 2.5ch;
  text-align: center;
  font-size: 1.18rem;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.table-panel {
  min-width: 0;
  padding: 24px;
}

.table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 900;
}

.badge-gold,
.result-gold .ticket {
  color: #5c3900;
  background: #fff4cc;
}

.badge-silver,
.result-silver .ticket {
  color: #3d4652;
  background: #eef2f7;
}

.badge-bronze,
.result-bronze .ticket {
  color: #653512;
  background: #fff0df;
}

.badge-lost,
.result-lost .ticket {
  color: #485264;
  background: #f3f5f8;
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

.result-screen {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 76px);
}

.ticket {
  width: min(100%, 680px);
  padding: clamp(28px, 5vw, 54px);
  text-align: center;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.ticket-visual {
  display: block;
  width: min(100%, 190px);
  max-height: 165px;
  object-fit: contain;
  margin: 0 auto 18px;
  filter: drop-shadow(0 18px 24px rgba(31, 41, 51, 0.18));
}

.result-title {
  font-size: clamp(1.2rem, 3vw, 2.05rem);
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.ticket-visual + .result-title {
  white-space: nowrap;
}

.ticket p {
  white-space: pre-line;
}

.confetti {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.confetti span {
  position: absolute;
  top: -24px;
  left: calc(var(--x) * 1%);
  width: var(--size);
  height: calc(var(--size) * 1.6);
  border-radius: 2px;
  background: var(--confetti-a);
  opacity: 0;
  transform: translateY(-24px) rotate(0deg);
  animation: confetti-fall var(--duration) linear var(--delay) infinite;
}

.confetti span:nth-child(3n + 1) {
  background: var(--confetti-b);
}

.confetti span:nth-child(3n + 2) {
  background: var(--confetti-c);
  border-radius: 999px;
}

.confetti-gold {
  --confetti-a: #f7c948;
  --confetti-b: #d59b16;
  --confetti-c: #fff4bd;
}

.confetti-silver {
  --confetti-a: #d9e2ec;
  --confetti-b: #8a96a3;
  --confetti-c: #ffffff;
}

.confetti-bronze {
  --confetti-a: #d08a4c;
  --confetti-b: #a6602a;
  --confetti-c: #ffd7b0;
}

@keyframes confetti-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -24px, 0) rotate(0deg);
  }

  12% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(36px, 110vh, 0) rotate(var(--spin));
  }
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.ticket dl {
  display: grid;
  gap: 12px;
  margin: 28px 0;
}

.ticket dl > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.ticket dt {
  color: var(--muted);
  font-weight: 800;
}

.ticket dd {
  margin: 0;
  font-weight: 900;
}

@media (max-width: 900px) {
  .hero,
  .game-screen,
  .admin-grid,
  .info-band {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

  .hero-with-form {
    background:
      linear-gradient(180deg, rgba(11, 34, 31, 0.82) 0%, rgba(11, 34, 31, 0.48) 48%, rgba(11, 34, 31, 0.22) 100%),
      url("../images/bg%20sentier%20mobile.png") center / cover no-repeat;
  }

  .game-screen,
  .result-screen {
    background:
      linear-gradient(180deg, rgba(11, 34, 31, 0.84) 0%, rgba(11, 34, 31, 0.52) 48%, rgba(11, 34, 31, 0.26) 100%),
      url("../images/bg%20sentier%20mobile.png") center / cover no-repeat;
  }

  .admin-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .partner-logo {
    top: 12px;
    right: 12px;
    padding: 8px 10px;
  }

  .partner-logo span {
    display: none;
  }

  .partner-logo img {
    width: 104px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero h1,
  .page-panel h1,
  .game-copy h1,
  .admin-heading h1,
  .result-screen h1 {
    font-size: 2.15rem;
  }

  .segment {
    width: 72px;
    margin-left: -36px;
    padding: 6px 7px;
    font-size: 0.6rem;
    transform: rotate(calc(var(--i) * 30deg)) translateY(-34vw) rotate(calc(var(--i) * -30deg));
  }

  .ticket dl > div {
    display: grid;
    text-align: left;
  }
}
