/* ==========================================================================
   Game: Trivia (parade-trivia)
   Self-contained — every class is prefixed .pt-. The game panel is a dark
   "quiz show" stage in both site themes; each category tints it with --pt-cat.
   ========================================================================== */

.pt {
  --pt-bg: #10132a;
  --pt-card: rgba(255, 255, 255, .06);
  --pt-card-hover: rgba(255, 255, 255, .11);
  --pt-line: rgba(255, 255, 255, .13);
  --pt-text: #fff;
  --pt-sub: rgba(255, 255, 255, .74);
  --pt-good: #19c28f;
  --pt-bad: #ff5c8a;
  --pt-warn: #ffb547;
  --pt-ice: #7fd6ff;
  --pt-gold: #ffd84d;
  --pt-cat: #ffd84d;

  position: relative;
  margin: 10px 0 40px;
  padding: 36px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(60% 70% at 18% -10%, rgba(255, 255, 255, .13), transparent 60%),
    radial-gradient(60% 70% at 82% -10%, rgba(255, 255, 255, .1), transparent 60%),
    radial-gradient(110% 80% at 50% 120%, rgba(91, 61, 245, .5), transparent 60%),
    var(--pt-bg);
  color: var(--pt-text);
  isolation: isolate;
  min-height: 520px;
}
:root[data-theme="dark"] .pt { border: 1px solid var(--line); }

/* Stage floor lights (decorative) */
.pt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--pt-gold) 0 10px, transparent 10px 26px);
  opacity: .35;
}

.pt-screen[hidden] { display: none !important; }
.pt-screen { animation: pt-fade .35s var(--ease); }
@keyframes pt-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.pt-ico {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Shared buttons ---------- */
.pt-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 18px;
  border: 1px solid var(--pt-line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--pt-text);
  font: 600 .875rem/1.2 var(--font);
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.pt-ghost:hover { background: var(--pt-card-hover); }
.pt-ghost--danger { color: var(--pt-sub); }
.pt-ghost--danger.is-confirm { border-color: var(--pt-bad); color: var(--pt-bad); }
.pt-ghost .pt-ico--off { display: none; }
.pt-ghost.is-off .pt-ico--on { display: none; }
.pt-ghost.is-off .pt-ico--off { display: block; }

.pt-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 1px solid var(--pt-line);
  border-radius: 50%;
  background: var(--pt-card);
  color: var(--pt-text);
  cursor: pointer;
  transition: background-color .2s var(--ease);
}
.pt-icon-btn:hover { background: var(--pt-card-hover); }

.pt .btn-pill { min-height: 46px; padding: 11px 24px; }
.pt .btn-pill:not(.btn-pill--hot) { background: var(--brand-soft); color: var(--night); }
.pt button:focus-visible { outline: 3px solid var(--pt-gold); outline-offset: 2px; }

/* ==========================================================================
   Screen 1: categories
   ========================================================================== */
.pt-home__head { display: flex; align-items: flex-start; gap: 22px; max-width: 760px; }

.pt-badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: conic-gradient(from 200deg, #ffb547, #ff5c8a, #a78bfa, #7fd6ff, #19c28f, #ffd84d, #ffb547);
  box-shadow: 0 12px 30px rgba(255, 92, 138, .35);
  animation: pt-wobble 4s ease-in-out infinite;
}
/* question-badge.svg carries its white stroke */
.pt-badge__img {
  width: 52px;
  height: 52px;
  padding: 6px;
  border-radius: 50%;
  background: var(--pt-bg);
}
@keyframes pt-wobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

.pt-kicker {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 216, 77, .14);
  color: var(--pt-gold);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.pt-title { margin: 0 0 8px; font-size: clamp(2rem, 4.4vw, 3rem); letter-spacing: -.035em; line-height: 1.05; }
.pt-lead { margin: 0; color: var(--pt-sub); }

.pt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 28px 0 26px;
}
.pt-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.pt-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--pt-line);
  border-radius: var(--radius-pill);
  background: var(--pt-card);
}
.pt-chip__label { color: var(--pt-sub); font-size: .78rem; font-weight: 500; }
.pt-chip strong { color: var(--pt-gold); font-size: 1rem; }
.pt-toolbar__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.pt-subtitle { margin: 0 0 14px; font-size: 1rem; letter-spacing: .06em; text-transform: uppercase; color: var(--pt-sub); }

.pt-stages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pt-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--pt-line);
  border-radius: var(--radius-md);
  background: var(--pt-card);
  background: linear-gradient(160deg, color-mix(in srgb, var(--pt-cat) 16%, transparent), transparent 55%), var(--pt-card);
  color: var(--pt-text);
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: transform .2s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease);
}
.pt-stage::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--pt-cat);
}
.pt-stage:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--pt-cat); background-color: var(--pt-card-hover); }
.pt-stage.is-cleared { border-color: rgba(25, 194, 143, .5); }
.pt-stage.is-locked { cursor: not-allowed; opacity: .5; }

.pt-stage__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pt-stage__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--pt-cat);
  color: #14122b;
}
.pt-stage__icon .pt-ico { width: 24px; height: 24px; }
.pt-stage.is-locked .pt-stage__icon { background: rgba(255, 255, 255, .14); color: var(--pt-text); }
.pt-stage__num { color: var(--pt-sub); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.pt-stage__body { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.pt-stage__name { font-size: 1.08rem; font-weight: 700; line-height: 1.3; }
.pt-stage__blurb { color: var(--pt-sub); font-size: .82rem; line-height: 1.45; }
.pt-stage__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--pt-line);
}
.pt-stage__best { color: var(--pt-sub); font-size: .78rem; font-weight: 600; }

.pt-star { color: rgba(255, 255, 255, .22); font-size: 1.05rem; line-height: 1; }
.pt-star.is-on { color: var(--pt-gold); text-shadow: 0 0 12px rgba(255, 216, 77, .5); }

.pt-noscript { margin: 16px 0 0; padding: 14px 18px; border-radius: var(--radius-sm); background: rgba(255, 92, 138, .15); }

/* ==========================================================================
   Screen 2: playing
   ========================================================================== */
.pt-play { position: relative; }

.pt-hud { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 14px; }
.pt-hud__cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--pt-cat);
  color: #14122b;
  font-size: .85rem;
  font-weight: 700;
}
.pt-hud__cat .pt-ico { width: 18px; height: 18px; }
.pt-hud__stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-left: auto; }
.pt-hud__btns { display: flex; gap: 8px; }

.pt-stat { display: flex; flex-direction: column; line-height: 1.2; }
.pt-stat__label { color: var(--pt-sub); font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.pt-stat strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.pt-mult {
  display: inline-block;
  margin-left: 2px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--pt-warn);
  color: #3a2300;
  font-size: .75rem;
  font-style: normal;
  vertical-align: 2px;
  animation: pt-pop .35s var(--ease);
}
.pt-mult[hidden] { display: none; }
.pt-stat--streak.is-hot strong { color: var(--pt-warn); }

/* Progress dots */
.pt-dots { display: flex; gap: 6px; margin: 0 0 22px; padding: 0; list-style: none; }
.pt-dot { flex: 1; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .12); transition: background-color .3s var(--ease); }
.pt-dot.is-now { background: var(--pt-cat); box-shadow: 0 0 10px var(--pt-cat); }
.pt-dot.is-good { background: var(--pt-good); }
.pt-dot.is-bad { background: var(--pt-bad); }

.pt-board { max-width: 880px; margin: 0 auto; }

/* Question card with countdown ring */
.pt-card {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 22px 24px;
  border: 1px solid var(--pt-line);
  border-left: 5px solid var(--pt-cat);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .05);
}
.pt-card.is-in { animation: pt-fade .4s var(--ease); }

.pt-clock {
  --pt-time: var(--pt-good);
  position: relative;
  flex: none;
  width: 70px;
  height: 70px;
}
.pt-clock.is-warn   { --pt-time: var(--pt-warn); }
.pt-clock.is-danger { --pt-time: var(--pt-bad); }
.pt-clock.is-frozen { --pt-time: var(--pt-ice); }
.pt-clock svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pt-clock circle { fill: none; stroke-width: 4; }
.pt-clock__track { stroke: rgba(255, 255, 255, .12); }
.pt-clock__ring { stroke: var(--pt-time); stroke-linecap: round; transition: stroke .3s var(--ease); }
.pt-clock__num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--pt-time);
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.pt-clock.is-danger .pt-clock__num { animation: pt-pulse .5s ease-in-out infinite alternate; }
.pt-clock.is-frozen svg { filter: drop-shadow(0 0 6px var(--pt-ice)); }
@keyframes pt-pulse { to { transform: scale(1.12); } }

.pt-question {
  margin: 0;
  font-size: clamp(1.2rem, 2.5vw, 1.65rem);
  line-height: 1.35;
  letter-spacing: -.015em;
  outline: none;
}

.pt-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.pt-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 62px;
  padding: 12px 16px;
  border: 2px solid var(--pt-line);
  border-radius: 16px;
  background: var(--pt-card);
  color: var(--pt-text);
  font: 600 1rem/1.35 var(--font);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .15s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), opacity .2s var(--ease);
}
.pt-option:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--pt-cat); background: var(--pt-card-hover); }
.pt-option:active:not(:disabled) { transform: translateY(0); }
.pt-option:disabled { cursor: default; }
.pt-option__key {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  font-size: .85rem;
  font-weight: 700;
}
.pt-option__text { min-width: 0; overflow-wrap: anywhere; }
.pt-option.is-correct { border-color: var(--pt-good); background: rgba(25, 194, 143, .2); animation: pt-pop .35s var(--ease); }
.pt-option.is-correct .pt-option__key { background: var(--pt-good); color: #06281d; }
.pt-option.is-wrong { border-color: var(--pt-bad); background: rgba(255, 92, 138, .18); animation: pt-shake .4s ease; }
.pt-option.is-wrong .pt-option__key { background: var(--pt-bad); color: #3a0716; }
.pt-option.is-dim { opacity: .45; }
.pt-option.is-removed { opacity: .18; text-decoration: line-through; }

@keyframes pt-pop { 50% { transform: scale(1.04); } }
@keyframes pt-shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Lifelines */
.pt-lifelines { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pt-life {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  color: var(--pt-text);
  font: 600 .82rem/1.2 var(--font);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), opacity .2s var(--ease);
}
.pt-life strong { color: var(--pt-gold); font-weight: 800; }
.pt-life .pt-ico { width: 16px; height: 16px; color: var(--pt-gold); }
.pt-life:hover:not(:disabled) { border-color: var(--pt-gold); background: rgba(255, 216, 77, .1); }
.pt-life:disabled { cursor: not-allowed; opacity: .36; }
.pt-life.is-used { text-decoration: line-through; }

/* Feedback + fact */
.pt-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .07);
  box-shadow: inset 4px 0 0 var(--pt-good);
  animation: pt-fade .3s var(--ease);
}
.pt-feedback[hidden] { display: none; }
.pt-feedback.is-bad { box-shadow: inset 4px 0 0 var(--pt-bad); }
.pt-feedback__body { flex: 1 1 320px; min-width: 0; }
.pt-feedback__title { margin: 0 0 4px; font-size: 1.05rem; font-weight: 700; }
.pt-feedback.is-good .pt-feedback__title { color: var(--pt-good); }
.pt-feedback.is-bad .pt-feedback__title { color: var(--pt-bad); }
.pt-feedback__answer { margin: 0 0 4px; font-weight: 600; }
.pt-feedback__answer[hidden] { display: none; }
.pt-feedback__fact { margin: 0; color: var(--pt-sub); font-size: .9rem; }
.pt-feedback__tag {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 216, 77, .16);
  color: var(--pt-gold);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.pt-feedback__next { flex: none; }

/* Pause overlay hides the question */
.pt-play.is-paused .pt-board,
.pt-play.is-paused .pt-dots { filter: blur(14px); pointer-events: none; user-select: none; }
.pt-paused { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; }
.pt-paused[hidden] { display: none; }
.pt-paused__card {
  max-width: 400px;
  padding: 28px;
  border: 1px solid var(--pt-line);
  border-radius: var(--radius-md);
  background: rgba(16, 19, 42, .95);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
  text-align: center;
}
.pt-paused__title { margin: 0 0 6px; font-size: 1.6rem; }
.pt-paused__card p { margin: 0 0 20px; color: var(--pt-sub); font-size: .9rem; }
.pt-paused__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ==========================================================================
   Screen 3: results
   ========================================================================== */
.pt-result { max-width: 640px; margin: 0 auto; padding: 10px 0; text-align: center; }
.pt-result__stars { display: flex; justify-content: center; gap: 10px; margin-bottom: 8px; }
.pt-star--big { font-size: clamp(3rem, 9vw, 4.25rem); opacity: 0; animation: pt-star-in .5s var(--ease) forwards; }
@keyframes pt-star-in {
  from { opacity: 0; transform: scale(.3) rotate(-30deg); }
  to   { opacity: 1; transform: none; }
}
.pt-result__title { margin: 0 0 6px; font-size: clamp(1.8rem, 4vw, 2.5rem); }
.pt-result__new {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  background: var(--pt-gold);
  color: var(--night);
  font-size: .8rem;
  font-weight: 700;
}
.pt-result__new[hidden] { display: none; }
.pt-result__text { margin: 0 auto 24px; max-width: 460px; color: var(--pt-sub); }
.pt-result__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 26px; }
.pt-result__stats div { padding: 14px 8px; border: 1px solid var(--pt-line); border-radius: var(--radius-sm); background: var(--pt-card); }
.pt-result__stats dt { color: var(--pt-sub); font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.pt-result__stats dd { margin: 2px 0 0; font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pt-result__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pt-result__actions [hidden] { display: none; }

/* ==========================================================================
   How-to-play section (site theme)
   ========================================================================== */
.pt-guide { margin: 0 0 56px; }
.pt-guide .section-head__title { margin-bottom: 22px; }
.pt-guide__item {
  height: 100%;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.pt-guide__item h3 { margin: 12px 0 6px; font-size: 1.05rem; }
.pt-guide__item p { margin: 0; color: var(--sub); font-size: .9rem; }
.pt-guide__num {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--onbrand);
  font-weight: 700;
}
.pt-guide__back { margin: 24px 0 0; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 767.98px) {
  .pt { padding: 24px 20px; min-height: 0; }
  .pt-options { grid-template-columns: 1fr; }
  .pt-result__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-hud__stats { margin-left: 0; order: 3; width: 100%; justify-content: space-between; }
  .pt-hud__btns { margin-left: auto; }
}
@media (max-width: 575.98px) {
  .pt { margin-left: -4px; margin-right: -4px; padding: 22px 16px; border-radius: var(--radius-md); }
  .pt-home__head { flex-direction: column; gap: 16px; }
  .pt-badge { width: 60px; height: 60px; border-radius: 18px; }
  .pt-badge__img { width: 42px; height: 42px; }
  .pt-toolbar { flex-direction: column; align-items: stretch; }
  .pt-toolbar__actions .pt-ghost { flex: 1; }
  .pt-stages { grid-template-columns: 1fr; }
  .pt-card { gap: 14px; padding: 16px; }
  .pt-clock { width: 56px; height: 56px; }
  .pt-clock__num { font-size: 1.1rem; }
  .pt-option { min-height: 54px; font-size: .95rem; }
  .pt-feedback__next { width: 100%; }
  .pt-life { flex: 1 1 auto; justify-content: center; padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .pt-badge, .pt-mult, .pt-clock.is-danger .pt-clock__num { animation: none; }
  .pt-screen, .pt-card.is-in, .pt-feedback, .pt-option.is-correct, .pt-option.is-wrong { animation: none; }
  .pt-star--big { opacity: 1; animation: none; }
  .pt-stage, .pt-option { transition: none; }
}
