:root {
  --bg: #07050c;
  --surface: #100c18;
  --surface-hover: #151020;
  --border: #241a35;
  --border-active: #55318a;
  --purple: #8045ed;
  --purple-hover: #925dff;
  --text: #f4f1f8;
  --muted: #a59ab5;
  --success: #79d6b1;
  --pending: #c7aeff;
  --off: #958da0;
  --focus: #d2bcff;
  --radius: 0;
  --container: 960px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

body.nav-open {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 5, 12, 0.96);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-family: "FS Ostro", "Ostro", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: -0.045em;
  text-transform: none;
}

.brand span {
  text-shadow: 0 0 18px rgba(128, 69, 237, 0.42);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.nav-menu a:not(.btn) {
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.nav-menu a:not(.btn):hover,
.nav-menu a[aria-current="page"]:not(.btn) {
  color: var(--text);
  background: var(--surface);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
}

.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
  display: block;
  width: 18px;
  height: 2px;
  margin-inline: auto;
  border-radius: 2px;
  background: currentColor;
  transition: transform 140ms ease, opacity 140ms ease;
}

.nav-toggle::before,
.nav-toggle::after {
  content: "";
}

.nav-toggle::before {
  transform: translateY(-5px);
}

.nav-toggle::after {
  transform: translateY(5px);
}

.nav-toggle[aria-expanded="true"] span {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"]::before {
  transform: translateY(2px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"]::after {
  transform: translateY(-2px) rotate(-45deg);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-active);
  border-radius: 0;
  padding: 0.65rem 1rem;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
  background: var(--surface);
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.btn:hover {
  border-color: var(--purple-hover);
  background: var(--surface-hover);
}

.btn-primary {
  border-color: var(--purple);
  background: var(--purple);
}

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

.btn-cta {
  min-height: 50px;
  border-color: #9f73ff;
  background: linear-gradient(135deg, #8045ed, #4f1eb1 60%, #1b0d2d);
  box-shadow: 0 0 24px rgba(128, 69, 237, 0.38);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-cta:hover {
  box-shadow: 0 0 32px rgba(146, 93, 255, 0.55);
}

.hero,
.page-header {
  padding: clamp(3.2rem, 8vw, 5rem) 0 clamp(2rem, 5vw, 3rem);
}

.hero h1,
.page-header h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(2.3rem, 6vw, 3.8rem);
  line-height: 1.06;
  letter-spacing: -0.055em;
}

.hero p,
.page-header p {
  max-width: 540px;
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1.03rem;
}

.page-title-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-title-actions h1 {
  margin: 0;
}

.page-title-actions .actions {
  flex-shrink: 0;
}

.actions,
.auth-state {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: min(100%, 360px);
}

.auth-state {
  align-items: stretch;
  width: auto;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 0.55rem 0.8rem;
  color: var(--success);
  background: rgba(121, 214, 177, 0.08);
  font-size: 0.9rem;
  font-weight: 700;
}

.section {
  padding: 0 0 clamp(2.5rem, 6vw, 4rem);
}

.section h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 54px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 0.95rem;
  background: var(--surface);
  font-weight: 600;
}

.link-card::after {
  content: "→";
  color: var(--muted);
}

.link-card:hover {
  border-color: var(--border-active);
  background: var(--surface-hover);
}

.panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 0.75rem;
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reward-hero {
  background: radial-gradient(circle at top left, rgba(128, 69, 237, 0.2), transparent 34%), var(--bg);
}

.reward-actions {
  width: min(100%, 520px);
}

.section-intro {
  max-width: 640px;
  margin-bottom: 1rem;
}

.section-intro h2,
.section-intro p {
  margin: 0;
}

.section-intro h2 {
  margin-bottom: 0.4rem;
}

.section-intro p {
  color: var(--muted);
  font-size: 0.94rem;
}

.steps-grid,
.reward-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.reward-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.step-card,
.reward-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--surface);
}

.step-card {
  display: grid;
  align-content: start;
  gap: 0.45rem;
}

.step-number {
  color: var(--purple-hover);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.step-card h3,
.reward-card h3,
.step-card p,
.reward-card p {
  margin: 0;
}

.step-card h3,
.reward-card h3 {
  font-size: 0.98rem;
}

.step-card p,
.reward-card p {
  color: var(--muted);
  font-size: 0.92rem;
}

.reward-card {
  display: grid;
  gap: 0.75rem;
}

.reward-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.status-row,
.info-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  min-height: 55px;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
}

.status-row:last-child,
.info-row:last-child {
  border-bottom: 0;
}

.status-row a,
.info-row a {
  color: var(--purple-hover);
}

.status {
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  color: var(--pending);
  background: rgba(128, 69, 237, 0.14);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.status.off {
  color: var(--off);
  background: rgba(149, 141, 160, 0.1);
}

.status.live {
  color: var(--success);
  background: rgba(121, 214, 177, 0.1);
}

.giveaway-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border-active);
  background: linear-gradient(135deg, rgba(128, 69, 237, 0.2), rgba(16, 12, 24, 0.96) 44%, rgba(121, 214, 177, 0.1));
  box-shadow: 0 0 42px rgba(128, 69, 237, 0.18);
}

.giveaway-media {
  background: #08050d;
}

.giveaway-image {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.goal-meter {
  overflow: hidden;
  border: 1px solid rgba(121, 214, 177, 0.28);
  background: rgba(121, 214, 177, 0.08);
  box-shadow: inset 0 0 18px rgba(7, 5, 12, 0.8);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}

.goal-meter span {
  display: block;
  width: var(--progress);
  min-width: max-content;
  padding: 0.38rem 0.75rem;
  color: var(--success);
  background: linear-gradient(90deg, rgba(121, 214, 177, 0.28), rgba(128, 69, 237, 0.58));
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 0 18px rgba(121, 214, 177, 0.18);
}

.giveaway-content {
  display: grid;
  align-content: center;
  gap: 0.75rem;
  padding: clamp(0.9rem, 3vw, 1.4rem);
}

.giveaway-content h2,
.giveaway-content p {
  margin: 0;
}

.giveaway-content h2 {
  font-size: clamp(1.65rem, 3vw, 2rem);
  line-height: 1.02;
  letter-spacing: -0.075em;
  white-space: nowrap;
}

.giveaway-content p {
  color: var(--muted);
  font-size: clamp(0.86rem, 1.65vw, 0.98rem);
  white-space: nowrap;
}

.giveaway-content a:not(.btn) {
  color: var(--success);
  font-weight: 800;
}

.faq-list {
  display: grid;
  gap: 0.6rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
  background: var(--surface);
}

.faq-item h2,
.faq-item h3 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.btn-twitch {
  gap: 0.5rem;
  border-color: #9147ff;
  background: #9147ff;
  width: auto;
}

.btn-twitch:hover {
  border-color: #772ce8;
  background: #772ce8;
}

.btn-twitch svg {
  flex-shrink: 0;
}

.form-section {
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

.form-locked {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--border);
  background: var(--surface);
}

.form-locked p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.participation-form {
  display: grid;
  gap: 1.15rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--border-active);
  background: var(--surface);
  box-shadow: 0 0 32px rgba(128, 69, 237, 0.1);
}

.form-field {
  display: grid;
  gap: 0.4rem;
}

.form-field label:first-child {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.required {
  margin-left: 0.2rem;
  color: var(--purple-hover);
}

.form-field input[type="text"],
.form-field input[type="url"],
.form-field input[type="number"] {
  min-height: 48px;
  border: 1px solid var(--border-active);
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  color: var(--text);
  background: rgba(7, 5, 12, 0.7);
  font-size: 0.94rem;
  font-family: inherit;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.form-field input[type="text"]:focus,
.form-field input[type="url"]:focus,
.form-field input[type="number"]:focus {
  outline: none;
  border-color: var(--purple-hover);
  box-shadow: 0 0 0 2px rgba(128, 69, 237, 0.3);
}

.form-field input::placeholder {
  color: var(--muted);
}

.hint {
  color: var(--pending);
  font-size: 0.82rem;
}

.hint a {
  color: var(--purple-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 72px;
  height: 72px;
  border: 2px solid var(--border-active);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: border-color 120ms ease, background 120ms ease;
  flex-direction: column;
}

.upload-btn:hover {
  border-color: var(--purple-hover);
  background: var(--surface-hover);
}

.upload-btn span {
  font-size: 0.72rem;
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.form-field-check {
  margin-top: 0.25rem;
}

.check-label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--muted);
}

.check-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--purple);
  cursor: pointer;
}

.form-error {
  padding: 0.7rem 1rem;
  border: 1px solid rgba(237, 69, 69, 0.4);
  background: rgba(237, 69, 69, 0.08);
  color: #ff8080;
  font-size: 0.9rem;
}

.form-success {
  padding: 0.7rem 1rem;
  border: 1px solid rgba(121, 214, 177, 0.4);
  background: rgba(121, 214, 177, 0.08);
  color: var(--success);
  font-size: 0.9rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: auto;
  padding: 1.35rem 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-row a {
  color: var(--purple-hover);
}

@media (max-width: 900px) {
  .giveaway-content h2,
  .giveaway-content p {
    white-space: normal;
  }

  .steps-grid,
  .reward-grid {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: grid;
    place-items: center;
  }

  .giveaway-card {
    grid-template-columns: 1fr;
  }

  .nav-menu {
    position: fixed;
    inset: 68px 1rem auto;
    display: grid;
    gap: 0.35rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.65rem;
    background: var(--bg);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease, transform 140ms ease;
  }

  .nav-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-menu a,
  .nav-menu .btn {
    justify-content: flex-start;
    width: 100%;
  }
}

@media (max-width: 620px) {
  .container {
    width: min(100% - 1rem, var(--container));
  }

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

  .status-row,
  .info-row,
  .reward-card-header {
    align-items: start;
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .reward-card-header {
    flex-direction: column;
  }

  .footer-row,
  .page-title-actions,
  .actions,
  .auth-state {
    align-items: stretch;
    flex-direction: column;
  }

  .actions,
  .auth-state,
  .actions .btn,
  .auth-state .btn,
  .auth-state .user-chip {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
