:root {
  color-scheme: dark;
  --bg: #080a0f;
  --bg-soft: #0d111a;
  --ink: #f4f7fb;
  --muted: #98a3b7;
  --muted-strong: #c5ccda;
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(148, 163, 184, 0.32);
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --danger: #ef4444;
  --success-bg: rgba(34, 197, 94, 0.12);
  --error-bg: rgba(239, 68, 68, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius-lg: 28px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% -10%, rgba(139, 92, 246, 0.24), transparent 36rem),
    radial-gradient(circle at 88% 5%, rgba(34, 211, 238, 0.16), transparent 30rem),
    linear-gradient(180deg, #0b0f18 0%, var(--bg) 46%, #06070b 100%);
  color: var(--ink);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.72), transparent 72%);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3.2rem, 8vw, 6rem) 1.25rem clamp(2.4rem, 6vw, 4.2rem);
  border-bottom: 1px solid var(--line);
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 8% -35% auto;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.18);
  filter: blur(54px);
}
.hero > div,
.container {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
}

h1,
h2 {
  color: var(--ink);
  letter-spacing: -0.045em;
}
h1 {
  max-width: 940px;
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 6.4rem);
  line-height: 0.9;
}
h2 {
  margin: 0.25rem 0 0.65rem;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  line-height: 1.08;
}
p { line-height: 1.7; }
.intro {
  max-width: 760px;
  margin: 1.35rem 0 0;
  color: var(--muted-strong);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.75;
}
.site-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.15rem;
  color: var(--muted-strong);
}
.site-meta span,
.site-meta a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  background: rgba(3, 7, 18, 0.32);
  backdrop-filter: blur(10px);
}
.site-meta a {
  color: var(--ink);
  text-decoration: none;
}
.site-meta a:hover {
  border-color: var(--accent-2);
  color: white;
}
.brand-icon {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  flex: 0 0 auto;
  vertical-align: -0.16em;
  object-fit: contain;
}
.brand-icon-discord { filter: invert(48%) sepia(75%) saturate(2339%) hue-rotate(219deg) brightness(94%) contrast(102%); }
.container { padding: clamp(1.5rem, 4vw, 3rem) 1.25rem 5rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  align-items: start;
  gap: 1.2rem;
}
.wide_story { grid-template-columns: 1fr; }

.card,
.form-card,
.empty,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.035));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.card {
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}
.media-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: zoom-in;
}
.media-open:hover {
  transform: none;
  filter: none;
  box-shadow: none;
}
.media-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 9rem;
  background: var(--bg-soft);
}
.video-badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(3, 7, 18, 0.76);
  border: 1px solid var(--line-strong);
  color: white;
  font-weight: 850;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.36);
}
.card img,
.card video {
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  display: block;
  background: var(--bg-soft);
}
.wide_story .card img,
.wide_story .card video { max-height: 86vh; }
.empty {
  padding: clamp(2rem, 6vw, 4rem);
  text-align: center;
}
.card p,
.empty p,
.admin-panel p { color: var(--muted-strong); }
.form-note { margin: 0; }

.media-lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.94);
  color: white;
}
.media-lightbox::backdrop { background: rgba(0, 0, 0, 0.86); }
.lightbox-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 3rem);
}
.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
}
.lightbox-close {
  position: fixed;
  z-index: 3;
  top: 1rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 2rem;
  line-height: 1;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line-strong);
}

.admin-panel {
  padding: clamp(1.1rem, 3vw, 1.6rem);
  margin-bottom: 1.25rem;
}
.form-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  background: rgba(12, 17, 28, 0.72);
  box-shadow: none;
}
label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted-strong);
  font-weight: 750;
}
input,
textarea,
select {
  width: 100%;
  padding: 0.9rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  font: inherit;
  color: var(--ink);
  background: rgba(3, 7, 18, 0.68);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
  background: rgba(3, 7, 18, 0.88);
}
input[type="file"] { color: var(--muted-strong); }
button {
  justify-self: start;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #6d5dfc 58%, var(--accent-2));
  color: white;
  padding: 0.88rem 1.25rem;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(139, 92, 246, 0.28);
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}
button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 16px 42px rgba(139, 92, 246, 0.38);
}
button.danger {
  background: linear-gradient(135deg, #dc2626, var(--danger));
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.2);
}
.admin-list { display: grid; gap: 0.75rem; }
.admin-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(3, 7, 18, 0.42);
}
.admin-item span { color: var(--muted); }
.messages { margin-bottom: 1rem; }
.message {
  margin: 0 0 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: var(--radius-md);
  background: var(--success-bg);
  color: #bbf7d0;
}
.message.error {
  border-color: rgba(239, 68, 68, 0.28);
  background: var(--error-bg);
  color: #fecaca;
}
::selection { background: rgba(34, 211, 238, 0.28); }

.section-kicker {
  margin: 0 0 0.6rem;
  color: #fb7185;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 900;
}

.wheel-section {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(280px, 0.78fr);
  grid-template-areas:
    "copy result"
    "wheel result";
  gap: clamp(1rem, 3vw, 1.7rem);
  align-items: center;
  margin-bottom: 1.25rem;
  padding: clamp(1.1rem, 3vw, 1.65rem);
  border: 1px solid rgba(255, 228, 232, 0.18);
  border-radius: 32px;
  background:
    radial-gradient(circle at 9% 8%, rgba(251, 113, 133, 0.18), transparent 17rem),
    radial-gradient(circle at 90% 16%, rgba(255, 255, 255, 0.11), transparent 18rem),
    linear-gradient(135deg, rgba(34, 13, 24, 0.96), rgba(10, 13, 22, 0.94) 48%, rgba(48, 18, 31, 0.90));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255,255,255,.10);
  overflow: hidden;
}

.wheel-copy {
  grid-area: copy;
  max-width: 720px;
  padding: 0.15rem 0.2rem 0;
}
.wheel-copy h2 { max-width: none; }
.wheel-copy p:last-child,
.wheel-result p { color: var(--muted-strong); }
.wheel-copy .section-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  margin-bottom: 0.85rem;
  padding: 0.38rem 0.8rem;
  border: 1px solid rgba(251, 113, 133, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.wheel-game {
  grid-area: wheel;
  position: relative;
  width: min(100%, 30rem);
  aspect-ratio: 1;
  margin: 0 auto 0.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  filter: none;
}
.wheel-game-large { width: min(100%, 30rem); }
.wheel-game::before {
  content: "";
  position: absolute;
  top: -0.55rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  width: 2.05rem;
  height: 2.45rem;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  background: linear-gradient(180deg, #fff 0%, #f9a8b8 32%, #e11d48 100%);
  filter: none;
}
.fate-wheel {
  position: absolute;
  inset: 0.5rem;
  display: block;
  width: calc(100% - 1rem);
  height: calc(100% - 1rem);
  border-radius: 50%;
  background: var(--wheel-gradient);
  border: 0;
  box-shadow: none;
  transition: transform 900ms cubic-bezier(.16,.76,.24,1);
  user-select: none;
  pointer-events: none;
  overflow: hidden;
}
.fate-wheel::before {
  content: "";
  position: absolute;
  inset: 0.28rem;
  z-index: 0;
  border-radius: inherit;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.34) 0 1.1deg, transparent 1.1deg calc(360deg / var(--slice-count)));
  opacity: 0.58;
}
.fate-wheel::after {
  content: "";
  position: absolute;
  inset: 0.65rem;
  border-radius: inherit;
  border: 0;
  box-shadow: none;
  pointer-events: none;
}
.wheel-slice-label {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%) rotate(var(--slice-angle)) translateY(-8.15rem) rotate(90deg);
  transform-origin: center;
  width: 5.1rem;
  min-height: 1.15rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: clamp(0.64rem, 1.1vw, 0.76rem);
  font-weight: 950;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-transform: none;
  text-align: center;
  text-shadow: 0 2px 2px rgba(0,0,0,.60), 0 0 0.55rem rgba(0,0,0,.30);
}
.wheel-slice-label .brand-icon {
  width: 0.72em;
  height: 0.72em;
  filter: inherit;
}
.wheel-slice-text { display: inline-block; }
.wheel-game::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: 3.65rem;
  height: 3.65rem;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #111827;
  border: 0;
  box-shadow: none;
  pointer-events: none;
}
.wheel-spin {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 7;
  width: 2.9rem;
  height: 2.9rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: transparent;
  color: white;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-size: 0.68rem;
  line-height: 1;
  text-align: center;
  box-shadow: none;
}
.wheel-spin:hover,
.wheel-spin:focus-visible {
  transform: translate(-50%, -50%);
  filter: brightness(1.08);
}
.wheel-spin:disabled { opacity: .72; cursor: wait; }

.wheel-complete {
  grid-area: wheel;
  min-height: 15rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.55rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  text-align: center;
  border: 1px solid rgba(255, 228, 232, 0.14);
  border-radius: 50%;
  background: rgba(6, 8, 14, 0.52);
}
.wheel-complete h3,
.wheel-complete p { margin: 0; }
.wheel-complete p { max-width: 18rem; color: var(--muted-strong); }

.wheel-result {
  grid-area: result;
  min-height: 100%;
  padding: clamp(1rem, 2.5vw, 1.25rem);
  border: 1px solid rgba(255, 228, 232, 0.16);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.035)),
    rgba(6, 8, 14, 0.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 1rem 2.2rem rgba(0,0,0,.22);
}
.wheel-result h3 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.wheel-media {
  margin-top: 0.9rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.08);
}
.wheel-media:empty { display: none; }
.wheel-media .contact-link {
  display: inline-flex;
  margin: 0.9rem;
}
.wheel-media img,
.wheel-media video {
  display: block;
  width: 100%;
  max-height: 22rem;
  object-fit: contain;
}
.wheel-meta {
  margin-bottom: 0;
  font-size: 0.92rem;
  color: #fecdd3 !important;
}

.locked-grid .card:not(.locked-card) {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
  align-items: stretch;
  min-height: 0;
}
.locked-grid .unlocked-info-card {
  grid-template-columns: 1fr;
}
.locked-grid .card:not(.locked-card) .media-open {
  min-width: 0;
  height: 100%;
}
.locked-grid .card:not(.locked-card) .media-frame {
  min-height: 0;
  height: 100%;
}
.locked-grid .card:not(.locked-card) img,
.locked-grid .card:not(.locked-card) video {
  height: 100%;
  max-height: 18rem;
  object-fit: cover;
}
.unlocked-copy {
  min-width: 0;
  padding: clamp(0.85rem, 2.5vw, 1.2rem);
  display: grid;
  align-content: center;
  gap: 0.42rem;
}
.unlocked-copy .section-kicker,
.unlocked-copy h3,
.unlocked-copy p {
  margin: 0;
}
.unlocked-copy .section-kicker {
  font-size: clamp(0.72rem, 2.5vw, 0.88rem);
  line-height: 1.2;
}
.unlocked-copy h3 {
  font-size: clamp(1.15rem, 5.2vw, 1.75rem);
  line-height: 1.08;
}
.unlocked-copy p {
  line-height: 1.35;
}
.unlocked-copy .wheel-meta {
  margin-top: 0.15rem;
  font-size: clamp(0.82rem, 3.4vw, 0.98rem);
  line-height: 1.3;
}

.locked-gallery-intro p { color: var(--muted-strong); }
.locked-grid { opacity: 0.96; }
.locked-card {
  min-height: 14rem;
  display: grid;
  place-items: stretch;
}
.locked-frame {
  min-height: 14rem;
  display: grid;
  place-items: center;
  gap: 0.5rem;
  padding: clamp(1.2rem, 4vw, 2rem);
  text-align: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(251, 113, 133, 0.18), transparent 7rem),
    linear-gradient(135deg, rgba(3, 7, 18, 0.86), rgba(15, 23, 42, 0.72));
}
.locked-frame h3 {
  margin: 0;
  letter-spacing: -0.02em;
}
.locked-frame p {
  max-width: 18rem;
  margin: 0;
  color: var(--muted-strong);
}
.lock-icon {
  width: 4rem;
  height: 4rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(251, 113, 133, 0.28);
  background: rgba(3, 7, 18, 0.62);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36), 0 0 34px rgba(251, 113, 133, 0.16);
  font-size: 1.7rem;
}

@media (max-width: 940px) {
  .wheel-section {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "wheel"
      "result";
  }
  .wheel-game { max-width: 24rem; }
  .wheel-slice-label {
    transform: translate(-50%, -50%) rotate(var(--slice-angle)) translateY(-6.55rem) rotate(90deg);
    width: 4.55rem;
    font-size: 0.63rem;
  }
  .wheel-game::after { width: 3.25rem; height: 3.25rem; }
  .wheel-spin { width: 2.6rem; height: 2.6rem; font-size: 0.62rem; }
  .locked-grid .card:not(.locked-card) { grid-template-columns: 1fr; }
  .locked-grid .card:not(.locked-card) img,
  .locked-grid .card:not(.locked-card) video {
    height: auto;
    max-height: 42vh;
    object-fit: contain;
  }
}

@media (max-width: 720px) {
  .hero { padding-top: 3rem; }
  .admin-item {
    align-items: flex-start;
    flex-direction: column;
  }
}
