:root {
  color-scheme: dark;
  font-family: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  font-weight: 400;
  --bg: #05070f;
  --bg-card: rgba(12, 16, 26, 0.9);
  --bg-secondary: rgba(22, 26, 40, 0.95);
  --text: #fef9f3;
  --muted: #c9d4ef;
  --accent: #9be7c4;
  --accent-strong: #f76c6c;
  --gold: #f5d78c;
  --cranberry: #e8465b;
  --danger: #ff9378;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 10% 20%, rgba(23, 38, 60, 0.8) 0%, rgba(5, 7, 15, 0.95) 55%),
    linear-gradient(145deg, rgba(32, 48, 78, 0.6), rgba(7, 11, 18, 0.9));
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: 2.5rem 1.2rem 4.5rem;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.25) 1px, transparent 1px);
  background-size: 160px 160px;
  opacity: 0.4;
  animation: drift 40s linear infinite;
}

body::after {
  background-image: radial-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px);
  background-size: 120px 120px;
  animation-duration: 60s;
  opacity: 0.2;
}

@keyframes drift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(200px);
  }
}

.page {
  width: min(1200px, 100%);
}

.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin: 0.5rem 0 1rem;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0 auto;
  max-width: 52ch;
  color: var(--muted);
}

.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  background: linear-gradient(110deg, rgba(155, 231, 196, 0.18), rgba(247, 108, 108, 0.18));
  color: var(--gold);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  border: 1px solid rgba(245, 215, 140, 0.4);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
}

.content--spacious {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
}

.content--spacious .callout--support {
  grid-column: 1 / -1;
}

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

.garland {
  display: flex;
  justify-content: space-between;
  margin: 0 auto 2.5rem;
  max-width: 600px;
  position: relative;
  padding: 0 1rem;
}

.garland::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(245, 215, 140, 0.2), rgba(155, 231, 196, 0.4), rgba(247, 108, 108, 0.2));
  border-radius: 999px;
}

.garland span {
  width: 16px;
  height: 24px;
  border-radius: 50% 50% 55% 55%;
  background: var(--accent-strong);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
  animation: twinkle 1.8s ease-in-out infinite;
}

.garland span:nth-child(odd) {
  background: var(--accent);
  animation-delay: 0.3s;
}

.garland span:nth-child(3n) {
  background: var(--gold);
  animation-delay: 0.6s;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.5;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(4px);
  }
}

.quiz-question {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.quiz-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.quiz-btn {
  flex: 1 1 160px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--text);
  padding: 0.9rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: border 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.quiz-btn:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
  background: rgba(245, 215, 140, 0.12);
}

.quiz-hint {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.quiz-feedback {
  min-height: 1.2rem;
  margin-top: 1rem;
  font-weight: 600;
}

.quiz-feedback.correct {
  color: var(--accent);
}

.quiz-feedback.incorrect {
  color: var(--danger);
}

.legal {
  display: flex;
  flex-direction: column;
  gap: 1.9rem;
}

.legal-section {
  padding: 0 0.15rem;
}

.legal .section-heading {
  margin-bottom: 0.9rem;
}

.legal .pill {
  background: transparent;
  border-color: rgba(245, 215, 140, 0.25);
}

.legal .legal-list {
  margin: 0.25rem 0 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

.legal .legal-list li {
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
}

.legal .legal-list strong {
  color: var(--text);
}

.card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: clamp(1.6rem, 4vw, 2.7rem);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.callout {
  border-width: 2px;
}

.callout--danger {
  border-color: rgba(255, 147, 120, 0.5);
  box-shadow: 0 18px 40px rgba(255, 147, 120, 0.18);
}

.callout--danger .info-text {
  color: var(--danger);
  font-weight: 600;
}

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

.pill {
  background: rgba(245, 215, 140, 0.12);
  color: var(--gold);
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(245, 215, 140, 0.25);
}

.pill--accent {
  background: rgba(247, 108, 108, 0.18);
  color: var(--accent);
  border-color: rgba(247, 108, 108, 0.3);
}

.rules ol {
  margin: 0 0 1rem;
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.rules li {
  background: var(--bg-secondary);
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-list li {
  background: var(--bg-secondary);
  padding: 1rem 1.15rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  line-height: 1.5;
}

.detail-list strong {
  display: block;
  margin-bottom: 0.15rem;
  letter-spacing: -0.01em;
}

.info-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  font-weight: 600;
  font-size: 0.95rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

input[type='text'] {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 1rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input[type='text']:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 215, 140, 0.25);
}

textarea {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 1rem;
  resize: vertical;
  min-height: 120px;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 215, 140, 0.25);
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.checkbox {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.95rem;
}

.checkbox input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

button {
  border: none;
  border-radius: 18px;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--cranberry), var(--accent-strong));
  color: #ffe9e6;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 15px 35px rgba(247, 108, 108, 0.35);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(247, 108, 108, 0.45);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.2rem;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 600;
  color: #ffe9e6;
  background: linear-gradient(135deg, var(--cranberry), var(--accent-strong));
  box-shadow: 0 15px 35px rgba(247, 108, 108, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.button-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(247, 108, 108, 0.45);
}

.button-link--ghost {
  background: transparent;
  color: var(--gold);
  border-style: dashed;
  border-color: rgba(245, 215, 140, 0.5);
  box-shadow: none;
}

.button-link--ghost:hover {
  background: rgba(245, 215, 140, 0.1);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.bedrock-toggle {
  margin-top: 0.5rem;
  background: transparent;
  border: 1px dashed rgba(245, 215, 140, 0.4);
  color: var(--gold);
  box-shadow: none;
}

.bedrock-toggle[aria-expanded='true'] {
  background: rgba(245, 215, 140, 0.12);
  border-style: solid;
}

.bedrock-panel {
  margin-top: 1.4rem;
  padding: 1.25rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(17, 22, 34, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.bedrock-panel h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
  font-size: 1.2rem;
}

.bedrock-panel form {
  margin-top: 1rem;
}

#feedback {
  min-height: 1.4em;
  margin: 0;
  font-weight: 500;
}

#feedback.success {
  color: var(--accent);
}

#feedback.error {
  color: var(--danger);
}

#bedrock-feedback {
  min-height: 1.4em;
  margin: 0;
  font-weight: 500;
}

#bedrock-feedback.success {
  color: var(--accent);
}

#bedrock-feedback.error {
  color: var(--danger);
}

footer {
  text-align: center;
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

footer::before {
  content: '✨';
  display: block;
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
  opacity: 0.8;
}

footer a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 215, 140, 0.4);
  padding-bottom: 0.05rem;
}

footer a:hover {
  color: var(--accent);
  border-color: rgba(155, 231, 196, 0.6);
}

@media (max-width: 640px) {
  body {
    padding: 1.5rem 1rem 3rem;
  }

  .card {
    border-radius: 18px;
  }

  .content--two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .content--spacious {
    grid-template-columns: 1fr;
  }
}

/* Quiz overlay */
#quiz-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(5, 7, 15, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 200;
}

#quiz-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.quiz-dialog {
  width: min(480px, 100%);
  transform: translateY(25px);
  animation: slideUp 0.35s ease forwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(35px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.quiz-active #rules-card,
body.quiz-active footer,
body.quiz-active .form-card {
  filter: blur(8px);
  opacity: 0;
  pointer-events: none;
}

body.quiz-active .garland {
  opacity: 0.2;
}
