* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --violet: #8b5cff; --blue: #3d8bff; --cyan: #46e6ff; --pink: #ff4fa3;
  --green: #35f0a0; --red: #ff4f7b; --gold: #ffcf5a; --muted: #a9a6c8;
}
html { background: #05050d; }
html, body {
  margin: 0; height: 100%; color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  overscroll-behavior: none; user-select: none; -webkit-user-select: none;
}
body {
  min-height: 100dvh; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  overflow: hidden;
}
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, #1d1045 0%, transparent 65%), #05050d; }
.bg i { position: absolute; width: 80vw; height: 80vw; border-radius: 50%; filter: blur(70px); opacity: .45; animation: drift 10s ease-in-out infinite alternate; }
.bg .g1 { background: #6d2cff; top: -30vw; left: -30vw; }
.bg .g2 { background: #0a62ff; bottom: -30vw; right: -30vw; animation-delay: -5s; }
@keyframes drift { to { transform: translate(15vw, 10vw) scale(1.2); } }
body[data-result="ok"][data-view="result"] .bg { background: radial-gradient(ellipse at 50% 35%, #0d5a3c 0%, transparent 70%), #05050d; }
body[data-result="bad"][data-view="result"] .bg { background: radial-gradient(ellipse at 50% 35%, #5a0d2a 0%, transparent 70%), #05050d; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; }
.brand { font-weight: 900; letter-spacing: 3px; font-size: 12px; }
.brand span { color: #b58aff; font-size: 18px; margin-right: 6px; text-shadow: 0 0 12px var(--violet); }
.me { --c: var(--violet); font-weight: 800; font-size: 13px; padding: 6px 12px; border-radius: 99px;
  background: color-mix(in srgb, var(--c) 25%, transparent); border: 1px solid var(--c); max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room { font-weight: 900; letter-spacing: 3px; font-size: 12px; color: var(--cyan); padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(70,230,255,.35); }
#code { letter-spacing: 6px; text-transform: uppercase; }
#code::placeholder { letter-spacing: normal; text-transform: none; }
.banner { position: fixed; top: 0; left: 0; right: 0; z-index: 9; text-align: center; padding: 10px;
  background: var(--gold); color: #1a1000; font-weight: 800; font-size: 14px; }

.view { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px 20px 28px; text-align: center; animation: in .45s cubic-bezier(.2,.8,.2,1) both; }
.view[hidden] { display: none; }
@keyframes in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
h2 { font-size: 30px; font-weight: 900; margin: 18px 0 8px; letter-spacing: .5px; }
p { color: var(--muted); font-size: 16px; line-height: 1.5; margin: 6px 0; }

/* join */
.hero .eyebrow { color: #b58aff; letter-spacing: 5px; font-size: 11px; font-weight: 800; }
.hero h1 { font-size: 48px; line-height: 1; font-weight: 900; margin: 14px 0 10px; letter-spacing: 2px; }
.hero h1 span { background: linear-gradient(100deg, #c9a4ff, #6e9eff, #e0b7ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
form { width: 100%; max-width: 380px; margin-top: 34px; display: flex; flex-direction: column; gap: 14px; }
input { width: 100%; font: inherit; font-size: 20px; font-weight: 700; text-align: center; color: #fff;
  padding: 18px; border-radius: 16px; border: 1px solid rgba(181,138,255,.4); background: rgba(10,8,30,.75); outline: none; user-select: text; -webkit-user-select: text; }
input:focus { border-color: #b58aff; box-shadow: 0 0 0 4px rgba(139,92,255,.25); }
.cta { font: inherit; font-size: 18px; font-weight: 900; letter-spacing: 4px; color: #fff; border: none; border-radius: 16px; padding: 19px;
  background: linear-gradient(110deg, #7a3ce6, #3e65d9); box-shadow: 0 0 30px rgba(117,66,224,.6); }
.cta:active { transform: scale(.97); }
.cta:disabled { opacity: .5; }
.error { color: #ff9cb4; font-weight: 700; min-height: 20px; }

/* waiting */
.avatar { --c: var(--violet); border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #0a0620;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.7), transparent 45%), var(--c); box-shadow: 0 0 40px var(--c); }
.avatar.big { width: 120px; height: 120px; font-size: 44px; animation: pop .6s cubic-bezier(.2,.8,.2,1.6) both; }
@keyframes pop { from { transform: scale(.3); } }
.pulse { margin-top: 30px; width: 14px; height: 14px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 16px var(--cyan); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.8); opacity: .4; } }

/* question */
#v-question { justify-content: flex-start; padding-top: 4px; }
.q-meta { width: 100%; display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 800; letter-spacing: 2px; color: var(--muted); }
.chip { color: var(--cyan); border: 1px solid rgba(70,230,255,.4); padding: 4px 10px; border-radius: 99px; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timebar { width: 100%; height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); margin: 12px 0; overflow: hidden; }
.timebar i { display: block; height: 100%; transform-origin: left; background: linear-gradient(90deg, #b58aff, #46a6ff); box-shadow: 0 0 12px #8b5cff; }
.timebar i.urgent { background: var(--red); box-shadow: 0 0 12px var(--red); }
.q-emoji { font-size: 52px; letter-spacing: 6px; margin: 2px 0 6px; filter: drop-shadow(0 0 14px rgba(139,92,255,.6)); animation: pop .5s cubic-bezier(.2,.8,.2,1.6) both; }
.q-text { color: #fff; font-size: 17px; font-weight: 700; margin: 4px 0 14px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.answers { flex: 1; width: 100%; display: grid; grid-template-columns: 1fr; grid-auto-rows: 1fr; gap: 12px; }
.ans { --c: var(--violet); font: inherit; color: #fff; display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 10px 16px 10px 10px; border-radius: 18px; border: 2px solid var(--c);
  background: linear-gradient(100deg, color-mix(in srgb, var(--c) 40%, #0a0820), #0a0820);
  box-shadow: 0 0 18px color-mix(in srgb, var(--c) 35%, transparent);
  transition: transform .15s, opacity .3s, filter .3s; min-height: 64px; animation: in .4s cubic-bezier(.2,.8,.2,1.3) both; }
.ans:nth-child(2) { animation-delay: .05s } .ans:nth-child(3) { animation-delay: .1s } .ans:nth-child(4) { animation-delay: .15s }
.ans:active { transform: scale(.96); }
.ans .l { flex-shrink: 0; width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; background: var(--c); color: #0a0620; font-weight: 900; font-size: 26px; }
.ans .t { font-size: 18px; font-weight: 800; line-height: 1.2; }
.ans-0 { --c: #8b5cff; } .ans-1 { --c: #3d8bff; } .ans-2 { --c: #22d3c5; } .ans-3 { --c: #ff4fa3; }
.ans.picked { transform: scale(1.03); box-shadow: 0 0 40px var(--c); }
.ans.dim { opacity: .25; filter: grayscale(.8); }

/* locked */
.locked-letter { --c: var(--violet); width: 150px; height: 150px; border-radius: 34px; display: grid; place-items: center;
  font-size: 80px; font-weight: 900; color: #0a0620; background: var(--c); box-shadow: 0 0 60px var(--c); animation: pop .5s cubic-bezier(.2,.8,.2,1.6) both; }
.locked-letter.ans-0 { --c: #8b5cff; } .locked-letter.ans-1 { --c: #3d8bff; } .locked-letter.ans-2 { --c: #22d3c5; } .locked-letter.ans-3 { --c: #ff4fa3; }
.locked-letter:not([class*="ans-"]) { color: #fff; background: rgba(255,255,255,.08); box-shadow: none; }

/* result */
.result-icon { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; font-size: 86px; font-weight: 900; animation: pop .6s cubic-bezier(.2,.8,.2,1.6) both; }
.result-icon.ok { background: var(--green); color: #052a1b; box-shadow: 0 0 70px var(--green); }
.result-icon.bad { background: var(--red); color: #2a0510; box-shadow: 0 0 70px var(--red); }
.points { font-size: 52px; font-weight: 900; color: var(--gold); text-shadow: 0 0 24px rgba(255,207,90,.6); animation: pop .6s .2s both; }
.stats { display: flex; gap: 14px; margin-top: 22px; width: 100%; max-width: 380px; }
.stats div { flex: 1; padding: 14px; border-radius: 16px; background: rgba(10,8,30,.7); border: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; gap: 4px; }
.stats span { font-size: 11px; letter-spacing: 2px; color: var(--muted); font-weight: 800; }
.stats b { font-size: 26px; }

.trophy { font-size: 110px; animation: pop .7s cubic-bezier(.2,.8,.2,1.6) both; filter: drop-shadow(0 0 30px rgba(255,207,90,.7)); }

@media (min-height: 760px) { .ans .t { font-size: 20px; } .q-emoji { font-size: 52px; letter-spacing: 6px; margin: 2px 0 6px; filter: drop-shadow(0 0 14px rgba(139,92,255,.6)); animation: pop .5s cubic-bezier(.2,.8,.2,1.6) both; }
.q-text { font-size: 19px; } }
