/* WAO — Wrong Answer Only • Created by oviich */
:root {
  --bg-1: #1d0b45;
  --bg-2: #0d0522;
  --card: rgba(255, 255, 255, 0.07);
  --card-strong: rgba(255, 255, 255, 0.12);
  --line: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --muted: #c4b5fd;
  --accent: #a855f7;
  --yellow: #facc15;
  --green: #22c55e;
  --red: #f43f5e;
  --a: #3b82f6;
  --b: #f59e0b;
  --c: #14b8a6;
  --d: #8b5cf6;
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, 'Noto Sans', 'Noto Sans Arabic', sans-serif;
  color: var(--text);
  background: radial-gradient(120% 80% at 50% 0%, #3b1a87 0%, var(--bg-1) 45%, var(--bg-2) 100%) fixed;
  background-color: var(--bg-2);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }

.screen {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 16px 16px 44px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.center { align-items: center; justify-content: center; text-align: center; }
.muted { color: var(--muted); }
.enter > * { animation: rise 0.35s ease both; }
.enter > *:nth-child(2) { animation-delay: 0.04s; }
.enter > *:nth-child(3) { animation-delay: 0.08s; }
.enter > *:nth-child(4) { animation-delay: 0.12s; }
.enter > *:nth-child(5) { animation-delay: 0.16s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes pulse { 50% { transform: scale(1.05); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.pulse { animation: pulse 1.6s ease-in-out infinite; }

.credit {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 8px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

/* ───────── shared bits ───────── */
.logo { width: clamp(90px, 22vw, 150px); height: auto; border-radius: 28%; box-shadow: 0 12px 40px rgba(124, 58, 237, 0.45); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.panel h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card-strong); font-size: 14px; font-weight: 600; white-space: nowrap; }
.btn { border: 0; border-radius: 14px; padding: 12px 18px; font-weight: 800; background: var(--card-strong); transition: transform 0.08s, filter 0.15s; }
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 8px 24px rgba(34, 197, 94, 0.35); }
.btn.big { font-size: 20px; padding: 16px 24px; width: 100%; }
.btn.icon { padding: 8px 12px; font-size: 16px; }
.btn.danger { background: rgba(244, 63, 94, 0.25); }

.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: var(--accent); display: inline-grid; place-items: center; font-weight: 800; font-size: 16px; }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.avatar.xl { width: 84px; height: 84px; font-size: 30px; }

/* ───────── lobby ───────── */
.hero { display: flex; align-items: center; gap: 18px; justify-content: center; text-align: left; padding-top: 8px; }
.hero h1 { font-size: clamp(40px, 9vw, 64px); font-weight: 900; letter-spacing: 0.02em; line-height: 1; }
.hero .tagline { color: var(--muted); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 14px; margin-top: 6px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.how div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; font-size: 14px; line-height: 1.35; }
.how b { display: block; font-size: 22px; margin-bottom: 4px; }
.players-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.player-chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--card-strong); font-weight: 600; }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.settings-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.settings-grid select, .settings-grid .value { background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); border-radius: 10px; padding: 10px; color: var(--text); font-weight: 700; font-size: 15px; }
.waiting { text-align: center; color: var(--muted); font-weight: 600; padding: 12px; }

/* ───────── game ───────── */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.topbar .spacer { flex: 1; }
.score-pill { background: rgba(250, 204, 21, 0.18); color: var(--yellow); }

.question-card {
  position: relative;
  text-align: center;
  padding: clamp(18px, 4vw, 32px) 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #ede9fe);
  color: #1e1038;
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.85), 0 18px 50px rgba(0, 0, 0, 0.45);
}
.question-card .instruction {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 14px;
  border-radius: 999px;
  background: #1e1038;
  color: var(--yellow);
  font-weight: 800;
  font-size: clamp(13px, 2.6vw, 16px);
  letter-spacing: 0.03em;
}
.question-card .question { font-size: clamp(26px, 6vw, 46px); font-weight: 900; line-height: 1.15; overflow-wrap: anywhere; }

.timer { height: 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.timer-fill { height: 100%; width: 100%; border-radius: inherit; background: var(--green); transition: background-color 0.3s; }
.timer-row { display: flex; justify-content: space-between; font-weight: 700; color: var(--muted); font-size: 14px; margin-top: -6px; }
.timer-text { font-variant-numeric: tabular-nums; color: var(--text); }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: clamp(64px, 12vw, 92px);
  padding: 12px 14px;
  border: 0;
  border-radius: 16px;
  text-align: start;
  font-size: clamp(17px, 3.4vw, 23px);
  font-weight: 800;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.08s, opacity 0.2s, filter 0.2s;
}
.answer:nth-child(1) { background: var(--a); }
.answer:nth-child(2) { background: var(--b); }
.answer:nth-child(3) { background: var(--c); }
.answer:nth-child(4) { background: var(--d); }
.answer:not(:disabled):hover { filter: brightness(1.12); transform: translateY(-2px); }
.answer:disabled { cursor: default; }
.answer .letter { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(0, 0, 0, 0.25); font-size: 18px; }
.answer .text { flex: 1; overflow-wrap: anywhere; }
.answer .tag { position: absolute; top: -9px; inset-inline-end: 10px; padding: 2px 8px; border-radius: 999px; background: #fff; color: #1e1038; font-size: 12px; font-weight: 900; }
.answers.locked .answer:not(.chosen) { opacity: 0.35; }
.answer.chosen { outline: 4px solid #fff; outline-offset: 2px; }
.answers.reveal .answer { opacity: 1; }
.answers.reveal .answer.truth { background: rgba(34, 197, 94, 0.22); box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.6); color: #bbf7d0; }
.answers.reveal .answer.lie { background: var(--red); box-shadow: 0 0 0 4px #fff, 0 0 40px rgba(244, 63, 94, 0.7); animation: pop 0.45s ease both; }
.answers.reveal .answer .mark { font-size: 24px; flex: none; }
.answers.reveal .answer .mark.x { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--red); font-size: 20px; font-weight: 900; }

.strip { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.strip .who { position: relative; opacity: 0.4; transition: opacity 0.2s; }
.strip .who.done { opacity: 1; }
.strip .who .lock { position: absolute; right: -4px; bottom: -4px; font-size: 14px; }

.reveal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fact { font-size: 16px; line-height: 1.4; }
.result-list { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.result-row { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.result-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delta { font-weight: 900; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.you-banner { text-align: center; font-size: clamp(20px, 4.5vw, 28px); font-weight: 900; }
.you-banner.good { color: var(--green); animation: pop 0.5s ease both; }
.you-banner.bad { color: var(--red); animation: shake 0.45s ease both; }

/* ───────── countdown ───────── */
.count { font-size: clamp(110px, 30vw, 220px); font-weight: 900; line-height: 1; animation: pop 0.5s ease both; text-shadow: 0 10px 50px rgba(168, 85, 247, 0.8); }

/* ───────── final ───────── */
.final h1 { text-align: center; font-size: clamp(30px, 7vw, 48px); font-weight: 900; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; }
.podium .spot { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 31%; max-width: 200px; text-align: center; }
.podium .spot .name { font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .block { width: 100%; border-radius: 14px 14px 4px 4px; display: grid; place-items: center; font-size: 30px; font-weight: 900; padding: 8px 0; }
.podium .p1 .block { height: 130px; background: linear-gradient(180deg, #facc15, #ca8a04); }
.podium .p2 .block { height: 96px; background: linear-gradient(180deg, #e2e8f0, #94a3b8); }
.podium .p3 .block { height: 72px; background: linear-gradient(180deg, #fdba74, #c2410c); }
.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.award { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.award .icon { font-size: 30px; }
.award .title { font-weight: 900; margin-top: 4px; }
.award .who { color: var(--muted); font-size: 14px; margin-top: 2px; }
.actions { display: flex; gap: 10px; }
.actions .btn { flex: 1; }

/* ───────── banners ───────── */
.banner { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 10; padding: 8px 16px; border-radius: 999px; background: #1e1038; border: 1px solid var(--line); font-weight: 700; }
.banner[hidden] { display: none; }

/* ───────── small screens (phones, picture-in-picture) ───────── */
@media (max-width: 560px) {
  .how, .settings-grid, .reveal-grid { grid-template-columns: 1fr; }
  .answers { grid-template-columns: 1fr; gap: 8px; }
  .hero { flex-direction: column; text-align: center; }
}
@media (max-height: 420px) {
  .screen { gap: 8px; padding-top: 8px; }
  .question-card { padding: 12px; }
  .answer { min-height: 48px; }
  .strip, .credit { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
