/* Lioness Hub Trivia: pink theme
   Palette: blush (page), petal (soft fills), rose (accents), berry (actions), plum (text), gold (crown touches) */

:root {
  --blush: #fff3f7;
  --petal: #ffdce8;
  --petal-deep: #f9bcd3;
  --rose: #e0457f;
  --berry: #a6124b;
  --berry-dark: #85093a;
  --plum: #3a1126;
  --plum-soft: #7a4f63;
  --gold: #c8962a;
  --card: #ffffff;
  --ok: #12704f;
  --ok-bg: #dcf5e9;
  --bad: #a8261c;
  --bad-bg: #fde3e0;

  --font-ui: "Montserrat", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-read: "Lora", Georgia, "Times New Roman", serif;

  --radius-card: 28px;
  --radius-btn: 16px;
  --shadow-card: 0 18px 40px -22px rgba(166, 18, 75, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-ui);
  color: var(--plum);
  background: var(--blush);
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
}

/* One quiet decorative shape: a big petal circle with a thin gold ring */
.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.backdrop::before {
  content: "";
  position: absolute;
  width: min(80vw, 640px);
  aspect-ratio: 1;
  right: -18vw;
  top: -22vw;
  border-radius: 50%;
  background: var(--petal);
}
.backdrop::after {
  content: "";
  position: absolute;
  width: min(80vw, 640px);
  aspect-ratio: 1;
  right: -14vw;
  top: -18vw;
  border-radius: 50%;
  border: 2px solid var(--gold);
  opacity: 0.55;
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  padding: 28px 20px 12px;
  flex: 1;
}

.brand { text-align: center; margin-bottom: 22px; }
.brand img {
  width: min(380px, 78%);
  height: auto;
  display: inline-block;
}

.screen { animation: enter 0.45s ease both; }
.screen[hidden] { display: none; }

@keyframes enter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Start ---------- */
#screen-start { text-align: center; padding: 8px 4px 24px; }

.tagline {
  margin: 0 0 10px;
  font-family: var(--font-read);
  font-style: italic;
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--berry);
}

h1 {
  margin: 0 auto 14px;
  max-width: 14ch;
  font-family: var(--font-read);
  font-weight: 700;
  font-size: clamp(2.2rem, 7.4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.lede {
  margin: 0 auto 26px;
  max-width: 44ch;
  font-size: 1.02rem;
  color: var(--plum-soft);
}

.rules {
  list-style: none;
  margin: 0 auto 30px;
  padding: 0;
  display: flex;
  flex-direction: column;
  width: fit-content;
  gap: 8px;
  text-align: left;
  font-size: 0.98rem;
}
.rules li { display: flex; align-items: baseline; gap: 12px; }
.rules strong {
  min-width: 2.2ch;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--berry);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.status { min-height: 1.4em; margin: 14px 0 0; font-size: 0.9rem; color: var(--plum-soft); }
.status.error { color: var(--bad); font-weight: 600; }
.best { margin: 12px 0 0; font-size: 0.9rem; color: var(--plum-soft); }
.best strong { color: var(--berry); }
.hint { margin: 14px 0 0; font-size: 0.88rem; color: var(--plum-soft); }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 26px;
  border-radius: var(--radius-btn);
  transition: transform 0.12s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}
.btn:focus-visible, .opt:focus-visible, a:focus-visible, .q-text:focus-visible {
  outline: 3px solid var(--plum);
  outline-offset: 3px;
}
.btn-primary {
  background: var(--berry);
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(166, 18, 75, 0.8);
}
.btn-primary:hover:not(:disabled) { background: var(--berry-dark); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { background: var(--petal-deep); color: var(--plum-soft); box-shadow: none; cursor: progress; }
.btn-lg { font-size: 1.12rem; padding: 17px 40px; min-width: 220px; }
.btn-ghost {
  background: var(--petal);
  color: var(--berry);
}
.btn-ghost:hover { background: var(--petal-deep); }

/* ---------- Game header ---------- */
.meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 0.95rem;
}
.meta p { margin: 0; }
.meta-q { font-weight: 700; }
.meta-score { color: var(--plum-soft); }
.meta-score strong { color: var(--berry); font-size: 1.15rem; margin-left: 4px; font-variant-numeric: tabular-nums; }

.progress {
  height: 10px;
  border-radius: 999px;
  background: var(--petal-deep);
  overflow: hidden;
  margin-bottom: 18px;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--berry);
  transition: width 0.4s ease;
}

/* ---------- Question card ---------- */
.q-card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--petal);
}

.q-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}
.q-cat {
  margin: 0;
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--petal);
  color: var(--berry);
  font-size: 0.8rem;
  font-weight: 700;
}

/* The timer ring is the one memorable element */
.timer, .score-ring {
  position: relative;
  flex: none;
}
.timer { width: 72px; height: 72px; }
.timer svg, .score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.ring-bg { fill: none; stroke: var(--petal); stroke-width: 9; }
.ring-fg {
  fill: none;
  stroke: var(--rose);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
}
.timer-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--plum);
}
.timer.low .ring-fg { stroke: var(--berry); }
.timer.low .timer-num { color: var(--berry); animation: pulse 1s ease-in-out infinite; }
.timer.stopped .ring-fg { stroke: var(--petal-deep); }

@keyframes pulse { 50% { transform: scale(1.14); } }

.q-text {
  margin: 6px 0 18px;
  font-family: var(--font-read);
  font-weight: 600;
  font-size: clamp(1.3rem, 4.6vw, 1.7rem);
  line-height: 1.3;
  text-wrap: balance;
}
.q-text:focus { outline: none; }

.options { display: grid; gap: 10px; }

.opt {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 62px;
  padding: 11px 16px 11px 12px;
  text-align: left;
  font-family: var(--font-ui);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--plum);
  background: var(--blush);
  border: 2px solid var(--petal);
  border-radius: 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}
.opt .letter {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--petal);
  color: var(--berry);
  font-weight: 800;
  font-size: 0.95rem;
}
.opt .text { flex: 1; overflow-wrap: anywhere; }
.opt .mark { flex: none; font-size: 1.25rem; font-weight: 800; width: 1.4em; text-align: center; }

@media (hover: hover) {
  .opt:hover:not(:disabled) { border-color: var(--rose); background: #fff; }
}
.opt:active:not(:disabled) { transform: scale(0.99); }
.opt:disabled { cursor: default; }

.opt.correct { border-color: var(--ok); background: var(--ok-bg); }
.opt.correct .letter { background: var(--ok); color: #fff; }
.opt.correct .mark { color: var(--ok); }

.opt.wrong { border-color: var(--bad); background: var(--bad-bg); animation: nudge 0.38s ease; }
.opt.wrong .letter { background: var(--bad); color: #fff; }
.opt.wrong .mark { color: var(--bad); }

.opt.dim { opacity: 0.55; }

@keyframes nudge {
  20% { transform: translateX(-6px); }
  50% { transform: translateX(5px); }
  80% { transform: translateX(-2px); }
}

.feedback {
  min-height: 1.6em;
  margin: 14px 2px 0;
  font-weight: 700;
  font-size: 0.98rem;
}
.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--bad); }
.feedback.time { color: var(--berry); }

.q-actions { display: flex; justify-content: flex-end; min-height: 54px; margin-top: 8px; }
.q-actions .btn[hidden] { display: none; }

/* ---------- Result ---------- */
#screen-result { text-align: center; padding: 4px 4px 28px; }
.score-ring { width: 190px; height: 190px; margin: 0 auto 18px; }
.score-ring .ring-fg { stroke: var(--berry); transition: stroke-dashoffset 1.1s cubic-bezier(.2,.7,.2,1); }
.score-ring .ring-bg { stroke-width: 7; }
.score-ring .ring-fg { stroke-width: 7; }
.score-num {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-read);
  font-weight: 700;
  font-size: 3.6rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.score-num small { font-size: 1.4rem; color: var(--plum-soft); font-weight: 500; }

.result-title { max-width: 18ch; font-size: clamp(2rem, 6.4vw, 2.8rem); margin-bottom: 10px; }
.result-sub { margin: 0 auto 22px; max-width: 42ch; color: var(--plum-soft); }

.tally {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 0 0 18px;
}
.tally div {
  min-width: 96px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--petal);
  border-radius: 18px;
}
.tally dt { font-size: 0.8rem; color: var(--plum-soft); font-weight: 600; }
.tally dd { margin: 2px 0 0; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.tally div:nth-child(1) dd { color: var(--ok); }
.tally div:nth-child(2) dd { color: var(--bad); }
.tally div:nth-child(3) dd { color: var(--berry); }
#screen-result .btn { margin-top: 20px; }

/* ---------- Footer ---------- */
.foot {
  position: relative;
  z-index: 1;
  padding: 18px 20px 26px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--plum-soft);
}
.foot p { margin: 0; }
.foot a { color: var(--berry); font-weight: 600; }

/* ---------- Larger screens ---------- */
@media (min-width: 640px) {
  .app { padding-top: 40px; }
  .q-card { padding: 30px 32px 24px; }
  .timer { width: 84px; height: 84px; }
  .timer-num { font-size: 1.9rem; }
  .options { grid-template-columns: 1fr 1fr; gap: 12px; }
  .opt { min-height: 78px; padding-right: 18px; }
}

/* ---------- Small phones ---------- */
@media (max-width: 380px) {
  .app { padding-left: 14px; padding-right: 14px; }
  .q-card { padding: 18px 14px 16px; }
  .opt { font-size: 0.96rem; gap: 10px; }
  .opt .letter { width: 34px; height: 34px; }
  .tally { gap: 8px; }
  .tally div { min-width: 84px; padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
