
:root {
  --bg-1: #0c1020;
  --bg-2: #151b33;
  --line: rgba(255,255,255,.12);
  --text: #f8f9ff;
  --muted: #cad2f7;
  --brand: #e60000;
  --brand2: #ff6f61;
  --shadow: 0 22px 48px rgba(0,0,0,.28);
  --radius: 24px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 100% 0%, rgba(230,0,0,.22), transparent 28%),
    radial-gradient(circle at 0% 18%, rgba(0,153,255,.14), transparent 24%),
    linear-gradient(160deg, var(--bg-1) 0%, #12172b 48%, var(--bg-2) 100%);
}
#confettiCanvas { position: fixed; inset: 0; pointer-events: none; z-index: 90; }
.shell { width: min(100%, 920px); margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px calc(114px + env(safe-area-inset-bottom)); }
.hero { border-radius: 28px; padding: 18px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.05)); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.hero__top { display: flex; justify-content: space-between; gap: 12px; }
.eyebrow { margin: 0 0 6px; color: #ffb3b3; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.7rem, 5vw, 2.3rem); line-height: 1.02; }
.subtitle { margin: 10px 0 0; color: var(--muted); }
.hero__badge { align-self: start; padding: 10px 14px; border-radius: 999px; background: rgba(230,0,0,.18); border: 1px solid rgba(255,255,255,.12); font-weight: 800; }
.hero__stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 16px; }
.stat { border-radius: 18px; padding: 14px; text-align: center; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.05); }
.stat span { display: block; font-size: 1.45rem; font-weight: 800; }
.stat small { color: var(--muted); }
#app { margin-top: 18px; }
.panel { border-radius: var(--radius); padding: 18px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.05)); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: var(--text); padding: 10px 14px; border-radius: 999px; cursor: pointer; font-size: .92rem; }
.chip.active { background: rgba(230,0,0,.18); border-color: rgba(255,255,255,.22); }
.meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .92rem; margin-bottom: 14px; }
.cardBase { position: relative; overflow: hidden; border-radius: 24px; min-height: 360px; border: 1px solid rgba(255,255,255,.12); background: linear-gradient(160deg, rgba(255,255,255,.10), rgba(255,255,255,.05)); }
.cardBase::after { content: ''; position: absolute; right: -28px; bottom: -28px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(255,111,97,.20), transparent 70%); }
.label { display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.08); font-size: .86rem; font-weight: 700; }
.flipScene { perspective: 1200px; min-height: 360px; }
.flipInner { position: relative; min-height: 360px; transform-style: preserve-3d; transition: transform .6s ease; }
.flipInner.flipped { transform: rotateY(180deg); }
.flipFace { position: absolute; inset: 0; padding: 18px; border-radius: 24px; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: linear-gradient(160deg, rgba(19,25,48,.99), rgba(26,33,62,.99)); }
.flipFace h2 { margin: 14px 0 10px; font-size: 1.12rem; line-height: 1.35; }
.flipFront { z-index: 2; }
.flipBack { transform: rotateY(180deg); z-index: 1; overflow: auto; }
.cardText { white-space: pre-wrap; line-height: 1.56; }
.actions { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 16px; }
.btn { appearance: none; border: none; border-radius: 16px; padding: 14px 16px; font: inherit; font-weight: 800; cursor: pointer; transition: transform .12s ease; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; }
.btn.secondary { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.14); }
.btn.option { width: 100%; text-align: left; background: rgba(255,255,255,.06); color: #fff; border: 1px solid rgba(255,255,255,.08); white-space: pre-wrap; line-height: 1.5; }
.btn.option.correct { background: rgba(36,194,109,.16); border-color: rgba(36,194,109,.55); }
.btn.option.wrong { background: rgba(255,96,120,.16); border-color: rgba(255,96,120,.55); }
.btn.full { width: 100%; }
.progress { height: 10px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; margin-bottom: 16px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #ffb347); width: 0%; transition: width .25s ease; }
.grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.statCard { border-radius: 20px; padding: 16px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.statCard strong { display: block; font-size: 1.55rem; }
.list { display: grid; gap: 10px; margin-top: 16px; }
.listItem { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.05); }
.pill { min-width: 68px; text-align: center; padding: 8px 10px; border-radius: 999px; background: rgba(255,255,255,.08); }
.badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.badgeCard { padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.badgeCard.unlocked { border-color: rgba(255,207,92,.45); background: rgba(255,207,92,.12); }
.note { margin-top: 12px; color: var(--muted); font-size: .9rem; }
.searchBox { display: grid; gap: 10px; margin-top: 16px; }
.input, .select { width: 100%; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: var(--text); border-radius: 16px; padding: 14px 16px; font: inherit; }
.searchResults { display: grid; gap: 10px; margin-top: 14px; }
.resultCard { border-radius: 18px; padding: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.resultCard h3 { margin: 8px 0; font-size: 1rem; }
.quickActions { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin-top: 16px; }
.empty { padding: 24px 10px; text-align: center; color: var(--muted); }
.bottomNav { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 100; width: min(calc(100% - 24px), 940px); display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; padding: 10px; border-radius: 26px; background: rgba(10,13,25,.82); border: 1px solid rgba(255,255,255,.10); backdrop-filter: blur(16px); box-shadow: var(--shadow); }
.bottomNav__btn { appearance: none; border: none; background: transparent; color: var(--muted); border-radius: 18px; padding: 14px 10px; font: inherit; font-weight: 800; cursor: pointer; }
.bottomNav__btn--active { background: rgba(255,255,255,.08); color: #fff; }
@media (max-width: 900px) { .bottomNav { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 700px) { .bottomNav { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px) { .hero__top { flex-direction: column; } .hero__stats, .grid, .grid3, .actions, .quickActions { grid-template-columns: 1fr; } .cardBase, .flipScene, .flipInner { min-height: 420px; } }
