:root {
  --bg: #f4f7f9;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #5f6c7b;
  --primary: #005f73;
  --primary-2: #0a9396;
  --danger: #b00020;
  --ok: #166534;
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans", Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 0%, #dff3f6 0, var(--bg) 45%);
}
.booting #authSection,
.booting #appSection {
  display: none !important;
}

.container {
  width: min(960px, 94vw);
  margin: 1rem auto 4rem;
}

.hero {
  margin-bottom: 1rem;
}
.heroTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
#homeIntro {
  border-left: 6px solid #0a9396;
}

h1, h2, h3 { margin: .2rem 0 .7rem; }
.small { color: var(--muted); font-size: .9rem; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(14, 35, 51, .08);
  margin-bottom: 1rem;
  animation: fadeUp .25s ease;
}

.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: 1fr; }
.stack { display: grid; gap: .6rem; }
.row { display: flex; align-items: center; }
.row.space { justify-content: space-between; }

input, textarea, select, button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #c7d2d9;
  padding: .7rem .8rem;
  font-size: 1rem;
}

button {
  background: var(--primary);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-weight: 600;
}

button.secondary { background: #334155; }
button:focus, input:focus, textarea:focus, select:focus, a:focus {
  outline: 3px solid #90e0ef;
  outline-offset: 1px;
}

#questionWrap .choiceBtn {
  text-align: left;
  background: #e8f6f8;
  color: #0f172a;
  transition: transform .1s ease, background .2s ease;
}
#questionWrap .choiceBtn:hover { transform: translateY(-1px); background: #d4f0f4; }

.timerWrap {
  height: 10px;
  background: #dde8ec;
  border-radius: 99px;
  overflow: hidden;
  margin: .6rem 0 1rem;
}
.timerBar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--primary-2), #94d2bd);
  transition: width .8s linear;
}

.hidden { display: none !important; }

.accountToggle {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  background: #0f172a;
  color: #fff;
  padding: .55rem .8rem;
}
.accountIcon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #0a9396;
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
}

.accountPanel {
  position: sticky;
  top: .6rem;
  z-index: 10;
}
.accountCloseBtn {
  width: auto;
  padding: .45rem .7rem;
}
.accountTabs {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin: .2rem 0 .8rem;
}
.tabBtn {
  width: auto;
  background: #e2e8f0;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  padding: .45rem .7rem;
}
.tabBtn.active {
  background: #005f73;
  color: #fff;
  border-color: #005f73;
}
.tabPanel {
  padding-top: .3rem;
}

.settingsCompactRow {
  align-items: end;
  gap: .7rem;
}
.settingsCompactRow label {
  margin: 0;
}
.settingsCompactRow input,
.settingsCompactRow select {
  padding: .5rem .65rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: .65rem .9rem;
  border-radius: 8px;
  min-width: 200px;
  text-align: center;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 24px rgba(2, 8, 23, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.toast.show { opacity: 1; }

.toast.err {
  background: #fee2e2;
  color: #7f1d1d;
  border-color: #fecaca;
}

.ok { color: var(--ok); }
.err { color: var(--danger); }

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

@media (min-width: 860px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
}
