:root {
  --bg-top: #06111d;
  --bg-mid: #0b1a2a;
  --bg-bottom: #13263a;
  --panel: rgba(8, 18, 31, 0.72);
  --panel-strong: rgba(9, 22, 37, 0.92);
  --panel-soft: rgba(255, 255, 255, 0.035);
  --text: #f6f7fb;
  --muted: #9db0c4;
  --primary: #ff9152;
  --primary-strong: #ffb36c;
  --primary-soft: rgba(255, 145, 82, 0.14);
  --accent: #72e1cf;
  --accent-soft: rgba(114, 225, 207, 0.14);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  --success: rgba(74, 225, 193, 0.14);
  --error: rgba(255, 100, 84, 0.14);
  --warning: rgba(255, 195, 105, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(114, 225, 207, 0.14), transparent 22%),
    radial-gradient(circle at 85% 10%, rgba(255, 145, 82, 0.16), transparent 24%),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.03), transparent 35%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 48%, var(--bg-bottom) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.3), transparent 85%);
  opacity: 0.18;
}

button,
input,
a {
  font: inherit;
}

a {
  color: inherit;
}

.site-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3.5rem;
}

.hero-panel,
.panel,
.cookie-banner,
.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero-panel::before,
.panel::before,
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 30%, transparent 70%, rgba(255, 255, 255, 0.03));
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  border-radius: 36px;
  padding: 1.8rem;
  margin-bottom: 1.5rem;
  background:
    radial-gradient(circle at top right, rgba(255, 145, 82, 0.14), transparent 28%),
    radial-gradient(circle at left center, rgba(114, 225, 207, 0.12), transparent 30%),
    var(--panel-strong);
}

.eyebrow,
.view-kicker,
.info-label,
.ad-label,
.footer-kicker {
  margin: 0 0 0.6rem;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-weight: 800;
}

.hero-copy h1,
.panel-title,
.section-heading h3,
.contact-panel h3,
.explanation-box h3,
.footer-column h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.hero-copy {
  max-width: 58ch;
}

.hero-copy h1 {
  font-size: clamp(2.9rem, 7vw, 5rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.hero-subtitle,
.panel-copy,
.challenge-copy,
.legal-copy p,
.contact-panel p,
.empty-panel p,
.info-card p,
.level-card p,
.footer-copy,
.footer-column p,
.footer-column a,
.footer-bottom p {
  color: var(--muted);
  line-height: 1.72;
}

.hero-subtitle {
  max-width: 50ch;
  margin: 1rem 0 0;
  font-size: 1.02rem;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
  min-width: 300px;
}

.top-nav a,
.ghost-link {
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.045);
  border-radius: 999px;
  padding: 0.8rem 1rem;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.top-nav a:hover,
.ghost-link:hover,
.footer-column a:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.app-shell {
  margin-bottom: 2rem;
}

.panel {
  border-radius: 34px;
  padding: 1.5rem;
  background:
    radial-gradient(circle at top left, rgba(114, 225, 207, 0.08), transparent 24%),
    rgba(8, 18, 31, 0.76);
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.panel-title {
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  letter-spacing: -0.03em;
}

.stats-group {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stats-pill {
  margin: 0;
  padding: 0.95rem 1.05rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(114, 225, 207, 0.18), rgba(114, 225, 207, 0.08));
  color: var(--text);
  border: 1px solid rgba(114, 225, 207, 0.18);
}

.ghost-button,
.primary-button,
.level-card {
  border-radius: 18px;
  border: 1px solid transparent;
}

.ghost-button,
.primary-button {
  min-height: 3.15rem;
  padding: 0.95rem 1.15rem;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: var(--border);
}

.ghost-button:hover:not(:disabled),
.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.primary-button {
  color: #08111f;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 16px 34px rgba(255, 145, 82, 0.18);
}

.ghost-button:disabled,
.primary-button:disabled,
.level-card[disabled] {
  cursor: not-allowed;
  opacity: 0.62;
}

.intro-grid,
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.info-card,
.contact-panel,
.legal-copy,
.empty-panel,
.ad-card,
.explanation-box {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 1.3rem;
}

.info-card {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.info-card strong,
.contact-panel strong {
  display: block;
  font-size: 1.22rem;
  margin-bottom: 0.55rem;
}

.levels-section {
  margin-top: 1rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.05rem;
}

.section-heading p,
.legal-copy p,
.contact-panel p,
.empty-panel p,
.info-card p {
  margin: 0.45rem 0 0;
}

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

.level-card {
  width: 100%;
  text-align: left;
  min-height: 185px;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
  color: var(--text);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.level-card:not([disabled]):hover {
  transform: translateY(-4px);
  border-color: rgba(255, 145, 82, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 145, 82, 0.1), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.04);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

.level-card.solved {
  border-color: rgba(114, 225, 207, 0.3);
  background:
    linear-gradient(180deg, rgba(114, 225, 207, 0.1), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.04);
}

.level-card.locked {
  background: rgba(255, 255, 255, 0.022);
}

.level-topline {
  display: block;
  color: var(--accent);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.level-card strong {
  display: block;
  font-size: 1.08rem;
  margin-bottom: 0.4rem;
}

.level-footer,
.challenge-meta,
.actions-row,
.completion-row,
.cookie-actions,
.pagination-bar,
.pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.level-footer {
  margin-top: 1rem;
  color: var(--muted);
}

.pagination-bar {
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pagination-pages {
  justify-content: center;
}

.pagination-nav {
  min-width: 110px;
}

.page-button {
  min-width: 3rem;
  min-height: 3rem;
  padding: 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.page-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.page-button.active {
  color: #08111f;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 14px 28px rgba(255, 145, 82, 0.16);
}

.status-dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.status-dot.open {
  background: var(--primary);
}

.status-dot.solved {
  background: var(--accent);
}

.status-dot.locked {
  background: rgba(255, 255, 255, 0.28);
}

.lock-mark {
  margin-left: auto;
}

.challenge-layout {
  display: grid;
  gap: 1rem;
}

.challenge-meta {
  margin-bottom: 0.15rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #ffd5bb;
  border: 1px solid rgba(255, 145, 82, 0.18);
}

.badge.subtle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border-color: var(--border);
}

.challenge-copy {
  margin: 0;
  font-size: 1.08rem;
}

.answer-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
}

.answer-form input {
  min-height: 3.4rem;
  padding: 0 1rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  outline: none;
}

.answer-form input:focus {
  border-color: rgba(255, 145, 82, 0.35);
  box-shadow: 0 0 0 3px rgba(255, 145, 82, 0.08);
}

.hint-stack {
  display: grid;
  gap: 0.75rem;
}

.hint-box {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 195, 105, 0.24);
  background: rgba(255, 195, 105, 0.08);
  color: #ffe0b3;
  line-height: 1.65;
}

.feedback-box {
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.feedback-box.success {
  background: var(--success);
}

.feedback-box.error {
  background: var(--error);
}

.feedback-box.warning {
  background: var(--warning);
}

.legal-copy,
.contact-panel,
.empty-panel {
  max-width: 860px;
}

.legal-copy p:first-child,
.contact-panel p:first-child {
  margin-top: 0;
}

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-radius: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 145, 82, 0.1), transparent 28%),
    radial-gradient(circle at top right, rgba(114, 225, 207, 0.1), transparent 26%),
    rgba(8, 18, 31, 0.92);
}

.footer-inner {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.4rem 0 1.4rem;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 1.5rem;
}

.footer-brand {
  max-width: 34ch;
}

.footer-mark {
  margin: 0 0 0.8rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #ffd4b2;
}

.footer-copy {
  margin: 0;
}

.footer-column {
  display: grid;
  align-content: start;
  gap: 0.8rem;
}

.footer-column h3 {
  font-size: 1rem;
}

.footer-column a,
.footer-column p {
  margin: 0;
  text-decoration: none;
}

.footer-bottom {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  margin-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-bottom p {
  margin: 0;
}

.cookie-banner {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  width: min(420px, calc(100% - 2rem));
  border-radius: 26px;
  padding: 1rem;
  z-index: 20;
}

.cookie-banner strong {
  display: block;
  margin-bottom: 0.45rem;
}

.cookie-banner p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.cookie-actions {
  margin-top: 1rem;
  justify-content: space-between;
}

.success-animate {
  animation: successPulse 1.15s ease;
}

@keyframes successPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  }

  35% {
    transform: scale(1.015);
    box-shadow: 0 0 0 1px rgba(114, 225, 207, 0.24), 0 0 40px rgba(114, 225, 207, 0.22);
  }

  70% {
    transform: scale(0.995);
    box-shadow: 0 0 0 1px rgba(114, 225, 207, 0.18), 0 0 24px rgba(114, 225, 207, 0.16);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  }
}

.hidden {
  display: none !important;
}

@media (max-width: 920px) {
  .hero-panel,
  .view-header,
  .section-heading {
    flex-direction: column;
  }

  .top-nav,
  .stats-group {
    justify-content: flex-start;
  }

  .intro-grid,
  .contact-grid,
  .levels-grid,
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .pagination-pages {
    justify-content: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: min(100%, calc(100% - 1rem));
    padding-top: 0.85rem;
    padding-bottom: 2rem;
  }

  .hero-panel {
    border-radius: 26px;
    padding: 1rem;
  }

  .intro-grid,
  .contact-grid,
  .levels-grid,
  .answer-form,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .top-nav {
    min-width: auto;
    width: 100%;
  }

  .top-nav a,
  .ghost-link,
  .ghost-button,
  .primary-button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .cookie-banner {
    left: 0.5rem;
    width: auto;
  }

  .footer-inner {
    width: min(100%, calc(100% - 1rem));
    padding: 1.8rem 0 1.2rem;
    gap: 1.1rem;
  }
}
