* { box-sizing: border-box; font-family: Inter, Arial, sans-serif; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 10%, rgba(66, 133, 244, 0.12), transparent 38%),
    radial-gradient(circle at 90% 20%, rgba(52, 168, 83, 0.10), transparent 32%),
    #f5f7fb;
  color: #111;
}
body[data-theme="dark"] {
  background:
    radial-gradient(circle at 10% 10%, rgba(66, 133, 244, 0.20), transparent 38%),
    radial-gradient(circle at 90% 20%, rgba(52, 168, 83, 0.18), transparent 32%),
    #0a1020;
  color: #eaf0ff;
}
.auth-wrap { min-height: 100vh; display: grid; place-items: center; }
.card { background: rgba(255,255,255,.88); border-radius: 16px; padding: 18px; box-shadow: 0 14px 40px rgba(15,27,63,.14); backdrop-filter: blur(8px); }
body[data-theme="dark"] .card { background: rgba(18, 26, 47, .75); box-shadow: 0 14px 40px rgba(0,0,0,.34); }
form.card { width: min(420px, 94vw); display: grid; gap: 10px; }
input, button { padding: 10px 12px; border: 1px solid #d6dcea; border-radius: 10px; }
body[data-theme="dark"] input { background: #121d35; color: #f1f5ff; border-color: #2d3d66; }
button { background: #2f6bff; color: #fff; cursor: pointer; border: none; }
.link-btn { text-align: center; display: block; text-decoration: none; margin-top: 4px; }
.error { color: #c21d1d; margin: 0; }
.layout { padding-bottom: 72px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px; background: rgba(255,255,255,.84); box-shadow: 0 2px 12px rgba(0,0,0,.04); backdrop-filter: blur(8px); }
body[data-theme="dark"] .topbar { background: rgba(14, 22, 38, .8); }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.ghost-btn { background: transparent; color: inherit; border: 1px solid #a8b8de; }
.tab { display: none; padding: 14px; }
.tab.active { display: block; }
.tests-grid { display: grid; gap: 10px; }
.test-card { background: rgba(255,255,255,.9); color: #111; text-align: left; display: grid; gap: 4px; }
body[data-theme="dark"] .test-card { background: rgba(17, 28, 52, .82); color: #eaf0ff; }
.player { margin-top: 14px; background: rgba(255,255,255,.9); padding: 14px; border-radius: 14px; }
body[data-theme="dark"] .player { background: rgba(17, 28, 52, .82); }
.hidden { display: none; }
.question { font-weight: 700; margin-bottom: 10px; }
.options { display: grid; gap: 8px; }
.options .opt,
button.opt {
  padding: 10px;
  border: 1px solid #ccd3e3;
  border-radius: 10px;
  background: #fff !important;
  color: #111827 !important;
  cursor: pointer;
}
body[data-theme="dark"] .options .opt,
body[data-theme="dark"] button.opt {
  background: #172544;
  color: #eaf0ff;
  border-color: #2e426d;
}
.options .opt.correct,
button.opt.correct {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d !important;
}
.options .opt.wrong,
button.opt.wrong {
  background: #fee2e2;
  border-color: #dc2626;
  color: #7f1d1d !important;
}
body[data-theme="dark"] .options .opt.correct,
body[data-theme="dark"] button.opt.correct {
  background: #14532d;
  border-color: #22c55e;
  color: #dcfce7 !important;
}
body[data-theme="dark"] .options .opt.wrong,
body[data-theme="dark"] button.opt.wrong {
  background: #7f1d1d;
  border-color: #ef4444;
  color: #fee2e2 !important;
}
.bottom-menu { position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; padding: 8px; background: rgba(255,255,255,.9); box-shadow: 0 -2px 12px rgba(0,0,0,.08); backdrop-filter: blur(8px); }
body[data-theme="dark"] .bottom-menu { background: rgba(13, 22, 40, .92); }
.bottom-menu button { background: #edf2ff; color: #19357d; }
.bottom-menu button.active { background: #2f6bff; color: #fff; }
.top-item { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.9); margin-bottom: 8px; border-radius: 12px; padding: 10px; }
body[data-theme="dark"] .top-item { background: rgba(17, 28, 52, .82); }
.top-item img, .avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.profile-card { width: min(500px, 96vw); display: grid; gap: 10px; }
.notify { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: #0f9d58; color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 30; }
.ok { margin: 12px; padding: 10px; background: #e7f9ef; border: 1px solid #8fd6b3; border-radius: 10px; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 8px; }

