:root {
  --red: #e2382c;
  --red-dark: #c42a1f;
  --green: #2fa84f;
  --ink: #1f2430;
  --muted: #5c6470;
  --line: #d9dde3;
  --font-head: "Baloo 2", "Montserrat", system-ui, sans-serif;
  --font-body: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --header-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--red);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #e2382c 0 45%, #f4b21c 55%, #45b95a 62%, #2d9a44 100%);
  background-image: url("/assets/bg.webp");
  background-size: cover;
  background-position: center 40%;
}

.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 56px);
  transition: background .3s, backdrop-filter .3s;
}
.header.is-solid {
  background: rgba(196, 42, 31, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 16px rgba(0, 0, 0, .18);
}
.brand { display: flex; align-items: center; gap: 14px; color: #fff; }
.brand__logo { height: 48px; width: auto; }

.btn-rules {
  border: 0;
  background: #fff;
  color: var(--red);
  font: 700 13px/1 var(--font-body);
  letter-spacing: .04em;
  padding: 11px 22px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
  transition: transform .15s, box-shadow .15s;
}
.btn-rules:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, .22); }

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: calc(var(--header-h) + 24px) 16px 40px;
  position: relative;
}
.hero__stage {
  position: sticky;
  top: calc(var(--header-h) + 8px);
  width: min(920px, 96vw);
  margin: auto 0;
  transform: translateY(calc(var(--p, 0) * 55vh)) scale(calc(1 - var(--p, 0) * .45));
  opacity: calc(1 - var(--p, 0) * 1.1);
  transform-origin: 50% 100%;
  will-change: transform, opacity;
  pointer-events: none;
}
.hero__chars {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .28));
  animation: enter 1s cubic-bezier(.2, .9, .3, 1.2) both, run 1.1s ease-in-out 1s infinite;
}
@keyframes enter {
  from { opacity: 0; transform: translateY(80px) scale(.9); }
  to { opacity: 1; transform: none; }
}
@keyframes run {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-9px) rotate(-.6deg); }
  75% { transform: translateY(-7px) rotate(.6deg); }
}

.hero__hint {
  margin-top: 28px;
  color: #fff;
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.hero__arrow { font-size: 22px; animation: bounce 1.4s ease-in-out infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

.register {
  padding: 40px 16px 80px;
  display: flex;
  justify-content: center;
}
.card {
  width: min(600px, 100%);
  background: #fff;
  border-radius: 32px;
  padding: clamp(28px, 5vw, 52px) clamp(20px, 5vw, 56px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
  animation: enter .8s cubic-bezier(.2, .9, .3, 1.1) both;
}
.card__title {
  margin: 0;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(26px, 4vw, 34px);
  color: var(--red);
  line-height: 1.15;
}
.card__sub { margin: 10px 0 30px; text-align: center; color: var(--ink); font-size: 15px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.field__label::before { content: "* "; color: var(--red); }
.field input, .field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: 500 14px var(--font-body);
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231f2430' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.field select:invalid { color: #9aa1ab; }
.field input::placeholder { color: #9aa1ab; }
.field input:focus, .field select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(226, 56, 44, .15); }
.form.was-validated .field input:invalid, .form.was-validated .field select:invalid,
.was-validated .field input:invalid, .was-validated .field select:invalid { border-color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form__error {
  margin: 20px 0 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fdecea;
  color: var(--red-dark);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.btn-submit {
  display: block;
  margin: 28px auto 0;
  border: 0;
  background: var(--red);
  color: #fff;
  font: 700 15px/1 var(--font-body);
  letter-spacing: .04em;
  padding: 17px 40px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(226, 56, 44, .35);
  transition: transform .15s, background .15s, box-shadow .15s;
}
.btn-submit:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-submit:disabled { opacity: .6; cursor: wait; transform: none; }

.footer { text-align: center; color: rgba(255, 255, 255, .85); font-size: 13px; padding: 0 16px 28px; }

.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fade .2s both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal__box {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 28px;
  padding: 40px 32px 32px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  animation: pop .35s cubic-bezier(.2, .9, .3, 1.3) both;
}
.modal__box--wide { width: min(640px, 100%); text-align: left; max-height: 85vh; overflow: auto; }
.modal__box--wide .modal__title { text-align: center; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__icon { font-size: 56px; line-height: 1; }
.modal__title { margin: 14px 0 8px; font-family: var(--font-head); font-weight: 800; font-size: 28px; color: var(--red); }
.modal__text { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.modal__body { color: var(--ink); font-size: 15px; line-height: 1.65; }

@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .brand__logo { height: 38px; }
  .btn-rules { padding: 9px 16px; font-size: 12px; }
  .hero { padding-bottom: 28px; }
  .hero__stage { top: calc(var(--header-h) + 4px); }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .card { border-radius: 24px; }
  .hero__hint { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__chars, .hero__arrow, .card, .modal, .modal__box { animation: none; }
  .hero__stage { transform: none; opacity: 1; }
  html { scroll-behavior: auto; }
}
