/* Mindsocket Exam Prep — tabletop flash cards */

:root {
  --sat-fallback: 0px;
  --bg:         #070b14;
  --bg2:        #0a1628;
  --bg3:        #0f1c32;
  --purple:     #5b8def; /* steel accent (kept name for selectors) */
  --purple-dim: #3a5f9e;
  --cyan:       #38bdf8;
  --gold:       #c9a227; /* soft gold — use sparingly */
  --rose:       #e879a9;
  --green:      #2dd4a0;
  --red:        #f87171;
  --text:       #e8eef7;
  --muted:      #8b9bb4;
  --border:     rgba(91,141,239,0.18);
  --card:       rgba(10,22,40,0.92);
  --felt:       #0c1614; /* muted slate-green executive desk */
  --nav-h:      64px;
  --hud-h:      72px;
  --bar-h:      72px;
}

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

html, body {
  width: 100%;
  height: 100%;
  height: var(--app-h, 100dvh);
  max-height: var(--app-h, 100dvh);
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  overflow: hidden;
}

button, a { font-family: inherit; }
button { touch-action: manipulation; }
.choice-text { flex: 1; min-width: 0; }

/* ── Atmosphere (fintech desk) — keep #starfield / .nebula hooks ── */
#starfield, #fxCanvas, #fireworks {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#starfield { z-index: 0; }
.nebula {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 55% at 18% 12%, rgba(56,189,248,0.07), transparent 55%),
    radial-gradient(ellipse 70% 50% at 88% 78%, rgba(91,141,239,0.08), transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(201,162,39,0.035), transparent 55%);
}
.nebula::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148,163,184,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 40%, #000 20%, transparent 75%);
  opacity: 0.85;
  animation: nebulaDrift 36s ease-in-out infinite alternate;
}
.nebula::after {
  content: "";
  position: absolute;
  width: 55vw; height: 55vw;
  top: -12vw; right: -8vw;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(56,189,248,0.06) 0%, transparent 68%);
  animation: nebulaDrift 42s ease-in-out infinite alternate-reverse;
}
@keyframes nebulaDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(2vw, 2.5vh) scale(1.04); }
}
#fxCanvas { z-index: 40; }
#fireworks { z-index: 1; }

.page { position: relative; z-index: 2; height: 100%; max-height: 100%; min-height: 0; overflow: hidden; }

/* ── Nav ── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: var(--nav-h);
  background: rgba(7,11,20,0.78);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: Cinzel, serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(56,189,248,0.55);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.7); }
}
.nav-end {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  min-width: 0;
}
.site-nav nav { display: flex; gap: 1.5rem; }
.site-nav nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-nav nav a:hover,
.site-nav nav a[aria-current="page"] { color: var(--text); }
.nav-auth {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.nav-auth a {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  text-decoration: none;
  border: 1px solid rgba(34, 211, 238, 0.32);
  border-radius: 4px;
  padding: 0.28rem 0.65rem;
  max-width: 10.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-auth a.nav-user {
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 500;
  color: var(--text);
  border-color: var(--border);
}
.nav-auth a:hover { border-color: var(--cyan); color: var(--text); }
body.embed .nav-auth,
html.is-standalone .nav-auth { display: none !important; }

body.embed .site-nav { display: none; }
body.embed { --nav-h: 0px; width: 100%; height: 100%; overflow: hidden; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  border: none;
  background: transparent;
  color: var(--text);
}
.btn:focus-visible,
.choice:focus-visible,
.start-btn:focus-visible,
.deck-card:focus-visible,
.fs-toggle:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none !important; }
.btn-primary {
  background: linear-gradient(180deg, rgba(91,141,239,0.95), var(--purple));
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 0 18px rgba(91,141,239,0.28), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #6b9af5, #4a7ad9);
  box-shadow: 0 0 28px rgba(91,141,239,0.45), inset 0 1px 0 rgba(255,255,255,0.16);
  transform: translateY(-1px);
}
.btn-outline {
  color: var(--cyan);
  border: 1px solid rgba(56,189,248,0.35);
  background: rgba(10,22,40,0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn-outline:hover:not(:disabled) {
  background: rgba(56,189,248,0.1);
  border-color: var(--cyan);
  transform: translateY(-1px);
}

/* ── Selector ── */
#selectorView {
  min-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 1.25rem) 1.25rem 2rem;
  overflow: hidden;
}


.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--purple);
  font-weight: 500;
  margin-bottom: 1rem;
}
#selectorView h1 {
  font-family: Cinzel, serif;
  font-size: clamp(2rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #fff 0%, var(--purple) 50%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.85rem;
}
.lede {
  font-family: "Playfair Display", serif;
  font-style: italic;
  color: var(--muted);
  max-width: 36rem;
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}
.deck-carousel {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: min(100%, 1120px);
  max-width: 100%;
}
.deck-track {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2.4rem 0;
  outline: none;
  mask-image: linear-gradient(to right, transparent 0, #000 4%, #000 96%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 4%, #000 96%, transparent 100%);
}
.deck-track::-webkit-scrollbar { display: none; }
.deck-grid {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem;
  width: max-content;
  justify-content: flex-start;
  padding-inline: calc(50% - 74px);
}
.carousel-btn {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(56,189,248,0.35);
  background: rgba(10,22,40,0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--cyan);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 3;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s, transform 0.2s;
}
.carousel-btn svg { width: 22px; height: 22px; display: block; }
.carousel-btn:hover:not(:disabled) {
  background: rgba(56,189,248,0.12);
  border-color: var(--cyan);
  transform: translateY(-1px);
}
.carousel-btn:disabled { opacity: 0.28; cursor: default; transform: none; }
.carousel-btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
.deck-card {
  flex: 0 0 148px;
  width: 148px;
  aspect-ratio: 5 / 7;
  transform-origin: center center;
  scroll-snap-align: center;
  transform: scale(var(--s, 0.75));
  opacity: var(--o, 0.72);
  z-index: var(--z, 1);
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.04), transparent 40%),
    radial-gradient(ellipse at 50% 20%, color-mix(in srgb, var(--deck) 28%, transparent), transparent 60%),
    var(--card);
  color: var(--text);
  cursor: pointer;
  padding: 1.4rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35), 0 0 0 1px rgba(91,141,239,0.08);
  transition: box-shadow 0.25s;
  position: relative;
  overflow: hidden;
  will-change: transform;
}
.deck-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid color-mix(in srgb, var(--deck) 45%, transparent);
  border-radius: 8px;
  pointer-events: none;
}
.deck-card:hover {
  transform: rotate(-1deg) scale(calc(var(--s, 1) * 1.04));
  box-shadow: 0 20px 50px rgba(0,0,0,0.45), 0 0 30px color-mix(in srgb, var(--deck) 35%, transparent);
}
.deck-glyph {
  width: 56px; height: 56px;
  border-radius: 50%;
  margin-top: 1.2rem;
  background: radial-gradient(circle at 35% 30%, #fff, var(--deck) 45%, #0f1c32);
  box-shadow: 0 0 22px color-mix(in srgb, var(--deck) 55%, transparent);
}
.deck-card.has-art {
  padding: 10px 10px 0.85rem;
  gap: 0.4rem;
}
.deck-card.has-art::before { display: none; }
.deck-art {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--deck) 35%, transparent),
    0 0 22px color-mix(in srgb, var(--deck) 40%, transparent);
}
.deck-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.deck-card.has-art h2 {
  margin-top: 0.15rem;
  padding: 0 0.2rem;
  font-size: 0.98rem;
}
.deck-card.has-art .count {
  padding: 0 0.2rem;
}

/* Per-deck color scheme while playing */
html.has-deck-theme #gameView .btn-primary {
  background: var(--deck);
  box-shadow: 0 0 18px color-mix(in srgb, var(--deck) 45%, transparent);
}
html.has-deck-theme #gameView .btn-primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--deck) 82%, #000);
  box-shadow: 0 0 28px color-mix(in srgb, var(--deck) 55%, transparent);
}
html.has-deck-theme #gameView .btn-outline {
  color: var(--deck);
  border-color: color-mix(in srgb, var(--deck) 42%, transparent);
}
html.has-deck-theme #gameView .btn-outline:hover:not(:disabled) {
  background: color-mix(in srgb, var(--deck) 10%, transparent);
  border-color: var(--deck);
}
html.has-deck-theme #gameView .card-type { color: var(--deck); }
html.has-deck-theme #gameView .choice-letter {
  background: color-mix(in srgb, var(--deck) 28%, transparent);
}
html.has-deck-theme #gameView .choice:hover:not(:disabled) {
  background: color-mix(in srgb, var(--deck) 14%, transparent);
  border-color: color-mix(in srgb, var(--deck) 45%, transparent);
}
html.has-deck-theme #gameView .play-card::before {
  border-color: color-mix(in srgb, var(--deck) 35%, transparent);
}
html.has-deck-theme #gameView .deck-title {
  text-shadow: 0 0 18px color-mix(in srgb, var(--deck) 40%, transparent);
}
html.has-deck-theme .nebula::after {
  background: radial-gradient(ellipse, color-mix(in srgb, var(--deck) 16%, transparent) 0%, transparent 70%);
}
.deck-card h2 {
  font-family: Cinzel, serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  margin-top: auto;
}
.deck-card .count {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.error { color: var(--rose); margin-top: 1.5rem; }

/* ── Game table ── */
#gameView {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  padding-top: calc(var(--nav-h) + max(env(safe-area-inset-top, 0px), var(--sat-fallback, 0px)));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 1.25rem;
  gap: 0.75rem;
  z-index: 5;
  min-height: var(--hud-h);
}
.deck-title {
  font-family: Cinzel, serif;
  font-size: clamp(0.95rem, 2.4vw, 1.35rem);
  letter-spacing: 0.08em;
  text-align: center;
  font-weight: 600;
}
.counter {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.counter .label {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
}
.counter .value { font-family: Cinzel, serif; font-size: 1.55rem; font-weight: 700; }
.counter.incorrect { align-items: flex-start; color: var(--red); }
.counter.correct { align-items: flex-end; color: var(--green); text-align: right; }
.counter.bump .value { animation: bump 0.35s ease; }
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  padding: 0.5rem 1rem 0.75rem;
  perspective: 1200px;
}

.start-btn {
  font-family: Cinzel, serif;
  font-size: 1.15rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 1rem 2.4rem;
  border-radius: 999px;
  border: 1px solid rgba(91,141,239,0.42);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), transparent 42%),
    radial-gradient(circle at 50% 0%, rgba(91,141,239,0.42), rgba(10,22,40,0.92));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0 28px rgba(91,141,239,0.32), inset 0 1px 0 rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 6;
}
.stage-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  z-index: 6;
}
.start-rules {
  margin: 0 1rem 0.35rem;
  max-width: 28rem;
  text-align: center;
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  line-height: 1.45;
  color: var(--muted);
}
.start-btn:hover { box-shadow: 0 0 48px rgba(91,141,239,0.65); transform: translateY(-2px); }
.start-btn-secondary {
  font-size: 0.92rem;
  letter-spacing: 0.16em;
  padding: 0.78rem 1.8rem;
  background: rgba(10,22,40,0.78);
  border-color: rgba(56,189,248,0.4);
  box-shadow: 0 0 22px rgba(56,189,248,0.18);
}
.start-btn-secondary:hover { box-shadow: 0 0 36px rgba(56,189,248,0.35); }

.play-card {
  width: min(92vw, 820px, calc((62vh) * 1.5));
  aspect-ratio: 3 / 2;
  max-height: min(62vh, 520px, 100%);
  min-height: 0;
  border-radius: 18px;
  background:
    linear-gradient(165deg, rgba(255,255,255,0.08), transparent 35%),
    linear-gradient(180deg, #122038 0%, #0a1628 100%);
  border: 1px solid rgba(201, 162, 39, 0.22);
  box-shadow:
    0 0 0 1px rgba(91,141,239,0.25),
    0 24px 60px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.08);
  padding: 1.1rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 8;
  overflow: hidden;
  transform-origin: center center;
}
.play-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 12px;
  border: 1px solid rgba(91,141,239,0.22);
  pointer-events: none;
}
.play-card.is-correct {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(45,212,160,0.5), 0 0 40px rgba(45,212,160,0.35), 0 24px 60px rgba(0,0,0,0.55);
}
.play-card.is-wrong {
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(248,113,113,0.5), 0 0 36px rgba(248,113,113,0.3), 0 24px 60px rgba(0,0,0,0.55);
}
.card-type {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.card-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.15rem;
  padding-bottom: 0.35rem;
  scrollbar-gutter: stable;
}
.card-scroll::-webkit-scrollbar {
  width: 8px;
}
.card-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}
.card-prompt {
  font-family: "Playfair Display", serif;
  font-size: clamp(0.95rem, 2.1vw, 1.35rem);
  font-weight: 600;
  line-height: 1.32;
  margin-bottom: 0.65rem;
}
.choices {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow: visible;
  flex: none;
  min-height: 0;
}
.card-scroll-hint {
  position: absolute;
  right: 1.05rem;
  bottom: 0.55rem;
  z-index: 3;
  pointer-events: none;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.78);
  background: rgba(7, 11, 20, 0.72);
  border: 1px solid rgba(91, 141, 239, 0.28);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.card-scroll-hint[hidden] { display: none !important; }
.play-card.has-more-below::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  height: 2.4rem;
  border-radius: 0 0 12px 12px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(180deg, transparent 0%, rgba(10, 22, 40, 0.88) 78%);
}
.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  text-align: left;
  width: 100%;
  padding: 0.42rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(91,141,239,0.16);
  background: rgba(10,22,40,0.55);
  color: var(--text);
  cursor: pointer;
  font-size: clamp(0.78rem, 1.5vw, 0.92rem);
  line-height: 1.35;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.choice:hover:not(:disabled) {
  background: rgba(91,141,239,0.12);
  border-color: rgba(91,141,239,0.4);
}
.choice:disabled { cursor: default; }
.choice-letter {
  flex: 0 0 1.5rem;
  height: 1.5rem;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(91,141,239,0.22);
  color: #fff;
}
.choice.is-correct {
  border-color: var(--green);
  background: rgba(45,212,160,0.14);
}
.choice.is-correct .choice-letter { background: var(--green); color: #052e1a; }
.choice.is-wrong {
  border-color: var(--red);
  background: rgba(248,113,113,0.12);
}
.choice.is-wrong .choice-letter { background: var(--red); color: #3f0d0d; }

.choice.is-correct::after,
.choice.is-wrong::after {
  flex: 0 0 1.35rem;
  width: 1.35rem;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin-left: auto;
  align-self: center;
  pointer-events: none;
}
.choice.is-correct::after {
  content: "✓";
  color: var(--green);
  text-shadow: 0 0 10px rgba(45,212,160,0.55);
}
.choice.is-wrong::after {
  content: "✕";
  color: var(--red);
  text-shadow: 0 0 10px rgba(248,113,113,0.45);
}

/* card fly animations */
.play-card.draw-in {
  animation: drawIn 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes drawIn {
  from { transform: translateY(42vh) scale(0.22) rotate(-8deg); opacity: 0.3; }
  to   { transform: none; opacity: 1; }
}
.play-card.fly-correct {
  animation: flyCorrect 0.7s cubic-bezier(0.4, 0, 0.7, 1) forwards;
}
@keyframes flyCorrect {
  0%   { transform: scale(1) rotate(0); opacity: 1; }
  25%  { transform: scale(1.04) rotate(2deg); }
  100% { transform: translate(38vw, -42vh) scale(0.12) rotate(18deg); opacity: 0; }
}
.play-card.fly-back {
  animation: flyBack 0.65s cubic-bezier(0.4, 0, 0.7, 1) forwards;
}
@keyframes flyBack {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: translateY(38vh) scale(0.18) rotate(6deg); opacity: 0; }
}

.sparkle {
  position: fixed;
  width: 8px; height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 12;
  animation: spark 0.7s ease-out forwards;
}
@keyframes spark {
  from { transform: translate(0,0) scale(1); opacity: 1; }
  to   { transform: translate(var(--sx), var(--sy)) scale(0); opacity: 0; }
}

/* table + pile */
.table {
  position: relative;
  left: auto; right: auto;
  bottom: auto;
  height: 150px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  z-index: 4;
  flex-shrink: 0;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(28, 48, 42, 0.5), transparent 60%),
    linear-gradient(to top, rgba(12,22,20,0.9), transparent 70%);
}
.pile {
  position: relative;
  width: 150px;
  height: 100px;
  margin-bottom: 8px;
}
.pile-card {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 92px;
  height: 62px;
  margin-left: -46px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(45deg, rgba(91,141,239,0.18) 0 5px, transparent 5px 10px),
    linear-gradient(160deg, #1a2d4a, #0f1c32);
  border: 1px solid rgba(201,162,39,0.32);
  box-shadow: 0 6px 14px rgba(0,0,0,0.45);
  transform-origin: center bottom;
}
.pile-card::after {
  content: "M";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: Cinzel, serif;
  font-weight: 700;
  color: rgba(255,255,255,0.55);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}
.pile-count {
  position: absolute;
  left: 50%;
  bottom: 108px;
  transform: translateX(-50%);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.deal-card {
  position: fixed;
  width: 88px;
  height: 124px;
  border-radius: 10px;
  z-index: 30;
  pointer-events: none;
  background:
    repeating-linear-gradient(45deg, rgba(91,141,239,0.2) 0 6px, transparent 6px 12px),
    linear-gradient(160deg, #1a2d4a, #0f1c32);
  border: 1px solid rgba(201,162,39,0.35);
  box-shadow: 0 10px 24px rgba(0,0,0,0.4);
  animation: dealFly 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
@keyframes dealFly {
  0%   { transform: translate(-50%, -50%) rotate(var(--r0)) scale(0.6); opacity: 0; }
  25%  { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--r1)) scale(0.7); opacity: 0.2; }
}

.bottom-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 1.25rem;
  gap: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: rgba(7,11,20,0.72);
  backdrop-filter: blur(12px);
  z-index: 6;
  min-height: var(--bar-h);
}
.stats {
  justify-self: start;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}
.stats strong { color: var(--text); font-weight: 600; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; justify-self: end; }

/* ── Clear overlay ── */
.clear-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7,11,20,0.55);
  text-align: center;
  padding: 2rem;
}
.clear-overlay[hidden] { display: none !important; }
.clear-copy { position: relative; z-index: 2; }
.clear-copy h2 {
  font-family: Cinzel, serif;
  font-size: clamp(2rem, 6vw, 3.4rem);
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #fff, var(--gold), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0.4rem 0 1rem;
}
.clear-copy p { color: var(--muted); margin-bottom: 1.5rem; }
.clear-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.cheers {
  position: fixed;
  font-size: 1.4rem;
  animation: cheerUp 1.6s ease-out forwards;
  pointer-events: none;
}
@keyframes cheerUp {
  from { transform: translateY(0) scale(0.6); opacity: 1; }
  to   { transform: translateY(-80px) scale(1.3); opacity: 0; }
}

[hidden] { display: none !important; }

/* embed compactness */
body.embed #selectorView { padding-top: 2rem; }
body.embed #gameView { padding-top: 0; }

@media (max-width: 720px) {
  :root { --hud-h: 64px; --bar-h: 72px; }
  .deck-card { flex-basis: 132px; width: 132px; }
  .deck-grid { padding-inline: calc(50% - 66px); }
  .carousel-btn { width: 36px; height: 36px; }
  .play-card {
    aspect-ratio: auto;
    width: min(94vw, 820px);
    max-height: 100%;
    min-height: 0;
  }
  .bottom-bar {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0.55rem 0.9rem 0.75rem;
  }
  .stats { justify-self: center; }
  .actions { justify-self: stretch; justify-content: stretch; }
  .actions .btn { flex: 1; padding: 0.6rem 0.5rem; }
  .hud { padding: 0 0.75rem; }
  .counter .value { font-size: 1.25rem; }
  .stage { padding-bottom: 0.5rem; }
  .table { height: 118px; }
}


/* Touch / tablet / short screens: keep the bottom bar on-screen.
   Desktop pointer layouts are unchanged above. */
@media (pointer: coarse), (max-width: 720px) {
  body:has(#gameView:not([hidden])) {
    --nav-h: 0px;
  }
  body:has(#gameView:not([hidden])) .site-nav {
    display: none;
  }
  :root { --hud-h: 56px; --bar-h: 72px; }
  #gameView {
    display: flex;
    flex-direction: column;
  }
  .hud,
  .table,
  .bottom-bar { flex: 0 0 auto; }
  .stage {
    flex: 1 1 0%;
    min-height: 0;
    padding: 0.4rem 0.75rem 0.5rem;
  }
  .table {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    height: 118px;
    flex-basis: 118px;
  }
  .hud { padding-top: 0.2rem; }
  .play-card {
    aspect-ratio: auto;
    width: min(94vw, 820px, 100%);
    max-height: 100%;
    min-height: 0;
  }
  .card-prompt { font-size: clamp(0.9rem, 2.4vh, 1.2rem); margin-bottom: 0.45rem; }
  .choices { gap: 0.32rem; }
  .choice { padding: 0.36rem 0.5rem; }
  .bottom-bar {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0.45rem 0.8rem max(0.55rem, env(safe-area-inset-bottom));
  }
  .stats { justify-self: center; }
  .actions { justify-self: stretch; justify-content: stretch; }
  .actions .btn { flex: 1; padding: 0.6rem 0.5rem; }
  .fs-toggle { justify-self: stretch; width: 100%; }
  .hud { padding: 0 0.75rem; }
  .counter .value { font-size: 1.2rem; }
}

@media (pointer: coarse) and (orientation: landscape), (max-height: 500px) {
  :root { --hud-h: 48px; }
  .stage { padding: 0.25rem 0.6rem 0.35rem; }
  .table { height: 96px; flex-basis: 96px; }
  .play-card { padding: 0.7rem 0.85rem 0.65rem; }
  .card-type { margin-bottom: 0.15rem; }
  .bottom-bar {
    grid-template-columns: auto 1fr auto;
    padding: 0.3rem 0.7rem max(0.35rem, env(safe-area-inset-bottom));
    gap: 0.4rem 0.6rem;
  }
  .stats { justify-self: start; font-size: 0.8rem; }
  .fs-toggle { justify-self: center; width: auto; }
  .actions { justify-self: end; justify-content: flex-end; flex-wrap: nowrap; }
  .actions .btn { flex: 0 1 auto; padding: 0.5rem 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  html:not(.force-motion) *,
  html:not(.force-motion) *::before,
  html:not(.force-motion) *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html:not(.force-motion) .nebula::before,
  html:not(.force-motion) .nebula::after,
  html:not(.force-motion) .logo-dot { animation: none !important; }
}

html.force-motion .play-card,
html.force-motion .deal-card,
html.force-motion .sparkle {
  animation-play-state: running !important;
}

/* ── Embed builder extras ── */
.embed-builder {
  min-height: 100%;
  overflow: auto;
  padding: calc(var(--nav-h) + 2rem) 1.5rem 3rem;
  max-width: 980px;
  margin: 0 auto;
}
.embed-builder h1 {
  font-family: Cinzel, serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
.embed-builder .lede { margin-bottom: 1.75rem; }
.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}
.controls label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.controls input,
.controls select,
.snippet {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}
.snippet {
  width: 100%;
  min-height: 7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  resize: vertical;
  margin: 0.75rem 0;
}
.preview-wrap {
  width: 100%;
  height: min(70vh, 640px);
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}
.note { color: var(--muted); font-size: 0.85rem; margin: 0.5rem 0 1rem; }
.copy-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.copied { color: var(--green); font-size: 0.85rem; }

body.builder { overflow: auto; }
body.builder .page { height: auto; min-height: 100%; }

/* ── Full screen toggle (bottom bar) ── */
.fs-toggle { justify-self: center; }
html.no-fs .fs-toggle,
body.no-fs .fs-toggle { display: none !important; }
html.no-fs .bottom-bar,
body.no-fs .bottom-bar { grid-template-columns: 1fr auto; }

:root:fullscreen,
:root:-webkit-full-screen,
html.is-fs {
  --nav-h: 0px;
}
:root:fullscreen .site-nav,
:root:-webkit-full-screen .site-nav,
html.is-fs .site-nav {
  display: none;
}
html.is-fs, html.is-fs body {
  width: 100%;
  height: var(--app-h, 100dvh);
  max-height: var(--app-h, 100dvh);
  overflow: hidden;
}


html.is-standalone,
html.is-fs {
  --nav-h: 0px;
  --sat-fallback: 62px;
}
@media (min-width: 768px) {
  html.is-standalone,
  html.is-fs { --sat-fallback: 32px; }
}
html.is-standalone .hud,
html.is-fs .hud { padding-top: 0.15rem; }
html.is-standalone .site-nav { display: none; }
html.is-standalone .fs-toggle { display: none !important; }
html.is-standalone .bottom-bar,
html.is-standalone.no-fs .bottom-bar { grid-template-columns: 1fr auto; }

.home-hint {
  margin-top: 1.25rem;
  max-width: 28rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}
.home-hint kbd {
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cyan);
}

/* ── Felt overlays (leaderboard + profile) — same wealth-desk language as the table ── */
.felt-overlay {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 11, 20, 0.72);
  padding: 1.25rem;
}
.felt-overlay[hidden] { display: none !important; }
.felt-panel {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
  max-height: min(86dvh, 860px);
  overflow: auto;
  text-align: left;
  padding: 1.4rem 1.5rem 1.25rem;
  border-radius: 16px;
  background:
    linear-gradient(165deg, rgba(255,255,255,0.05), transparent 40%),
    var(--card);
  border: 1px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(91,141,239,0.18),
    0 24px 60px rgba(0,0,0,0.55),
    0 0 40px rgba(91,141,239,0.12);
}
.felt-panel-narrow { width: min(440px, 100%); }
.felt-panel h2 {
  font-family: Cinzel, serif;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #fff, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0.15rem 0 0.55rem;
}
.felt-legend,
.felt-note,
.felt-quiet,
.felt-empty {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 0.85rem;
}
.felt-empty,
.felt-quiet {
  font-family: "Playfair Display", serif;
  font-style: italic;
}
.felt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.5rem 0 1rem;
}
.felt-you {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(56,189,248,0.28);
  background: rgba(56,189,248,0.06);
}
.felt-you strong {
  font-family: Cinzel, serif;
  font-size: 1.35rem;
  color: var(--cyan);
}
.felt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin: 0.4rem 0 1rem;
}
.felt-table th,
.felt-table td {
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid rgba(91,141,239,0.14);
  text-align: left;
}
.felt-table th {
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.felt-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.felt-table .rank { color: var(--muted); width: 1.6rem; }
.felt-table td.who {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.felt-table tr.is-you td { color: var(--cyan); }
.felt-avatar,
.felt-avatar-fallback {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  box-shadow: 0 0 12px rgba(91,141,239,0.25);
  background:
    radial-gradient(circle at 30% 25%, var(--cyan), transparent 45%),
    radial-gradient(circle at 70% 75%, var(--purple), #070b14);
}
.felt-avatar-lg { width: 72px; height: 72px; }
.felt-avatar-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0.75rem 0 0.35rem;
}
.felt-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.felt-input {
  background: rgba(10,22,40,0.9);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
}
.felt-input:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.felt-upload { cursor: pointer; }
body.embed .felt-overlay { padding: 0.75rem; }
body.embed .felt-panel { padding: 1rem 1.05rem; }

/* ── Post-answer feedback panel (prose-friendly, felt language) ── */
.feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem 1.25rem calc(var(--bar-h) + 1.1rem);
  background: rgba(7, 11, 20, 0.42);
  pointer-events: auto;
}
.feedback-overlay[hidden] { display: none !important; }
.feedback-panel {
  position: relative;
  z-index: 2;
  width: min(520px, 100%);
  max-height: min(38dvh, 320px);
  overflow: auto;
  text-align: left;
  padding: 1rem 1.2rem 1rem;
  border-radius: 14px;
  background:
    linear-gradient(165deg, rgba(255,255,255,0.05), transparent 40%),
    var(--card);
  border: 1px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(91,141,239,0.18),
    0 18px 48px rgba(0,0,0,0.55),
    0 0 28px rgba(91,141,239,0.12);
}
.feedback-overlay.is-correct .feedback-panel {
  border-color: rgba(45,212,160,0.45);
  box-shadow:
    0 0 0 1px rgba(45,212,160,0.35),
    0 18px 48px rgba(0,0,0,0.55),
    0 0 32px rgba(45,212,160,0.18);
}
.feedback-overlay.is-wrong .feedback-panel {
  border-color: rgba(248,113,113,0.4);
  box-shadow:
    0 0 0 1px rgba(248,113,113,0.28),
    0 18px 48px rgba(0,0,0,0.55),
    0 0 28px rgba(248,113,113,0.14);
}
.feedback-panel h2 {
  font-family: Cinzel, serif;
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  letter-spacing: 0.06em;
  margin: 0.1rem 0 0.45rem;
  color: var(--text);
}
.feedback-overlay.is-correct .feedback-panel h2 {
  background: linear-gradient(135deg, #fff, var(--green), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.feedback-overlay.is-wrong .feedback-panel h2 {
  background: linear-gradient(135deg, #fff, var(--rose), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.feedback-body {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0 0 0.85rem;
}
.feedback-body p { margin: 0 0 0.45rem; }
.feedback-body p:last-child { margin-bottom: 0; }
.feedback-congrats {
  color: var(--text);
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 1.02rem;
}
.feedback-detail { color: var(--muted); }
.feedback-overlay.is-correct .feedback-detail {
  color: #c8d4e6;
  line-height: 1.55;
}

/* Confetti behind play-card / feedback panel, above stage backdrop */
.feedback-confetti {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}
.feedback-confetti[hidden] { display: none !important; }
/* Soft gold radial flash behind pieces (CSS-only) */
.feedback-confetti.is-bursting::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 28%;
  width: min(220px, 55%);
  height: min(220px, 55%);
  transform: translate(-50%, -50%) scale(0.35);
  border-radius: 50%;
  background:
    radial-gradient(circle,
      rgba(240, 216, 120, 0.55) 0%,
      rgba(201, 162, 39, 0.28) 32%,
      rgba(56, 189, 248, 0.12) 55%,
      transparent 72%);
  animation: confettiFlash 0.75s ease-out forwards;
  pointer-events: none;
  z-index: 0;
}
.confetti-piece {
  position: absolute;
  z-index: 1;
  width: 8px;
  height: 11px;
  border-radius: 1px;
  opacity: 0.95;
  animation: confettiBurst var(--dur, 2.6s) cubic-bezier(0.15, 0.75, 0.25, 1) var(--delay, 0s) forwards;
  will-change: transform, opacity;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.18);
}
.confetti-piece.is-rect {
  width: 8px;
  height: 11px;
  border-radius: 1px;
}
.confetti-piece.is-circle {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.confetti-piece.is-ribbon {
  width: 3px;
  height: 14px;
  border-radius: 1px;
}
@keyframes confettiFlash {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35);
  }
  35% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.55);
  }
}
/* One-shot: radial burst near origin, then fall with drift + spin */
@keyframes confettiBurst {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(0.55);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  28% {
    transform: translate3d(var(--bx, 40px), var(--by, -36px), 0)
      rotate(calc(var(--spin, 420deg) * 0.32)) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate3d(
        calc(var(--bx, 40px) + var(--drift, 24px)),
        calc(var(--by, -36px) + var(--fall, 480px)),
        0
      )
      rotate(var(--spin, 420deg)) scale(0.82);
    opacity: 0;
  }
}
html.force-motion .confetti-piece {
  animation: confettiBurst var(--dur, 2.6s) cubic-bezier(0.15, 0.75, 0.25, 1) var(--delay, 0s) forwards;
}
@media (prefers-reduced-motion: reduce) {
  html:not(.force-motion) .confetti-piece { animation: none; opacity: 0.55; }
  html:not(.force-motion) .feedback-confetti.is-bursting::before { animation: none; opacity: 0; }
}


/* ── User feedback (card / game report) ── */
.card-report-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  z-index: 4;
  border: 0;
  background: transparent;
  color: rgba(148, 163, 184, 0.72);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
}
.card-report-btn:hover,
.card-report-btn:focus-visible {
  color: rgba(226, 232, 240, 0.95);
  background: rgba(91, 141, 239, 0.12);
  outline: none;
}

.feedback-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  margin-top: 0.15rem;
  padding-right: 6.5rem; /* room for the corner link */
}
.feedback-footer .clear-actions {
  margin: 0;
}
.feedback-report-btn {
  position: absolute;
  right: 0;
  bottom: 0.05rem;
  z-index: 3;
  border: 0;
  background: transparent;
  color: rgba(148, 163, 184, 0.72);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
}
.feedback-report-btn:hover,
.feedback-report-btn:focus-visible {
  color: rgba(226, 232, 240, 0.95);
  background: rgba(91, 141, 239, 0.12);
  outline: none;
}

.report-link {
  display: block;
  margin: 0.15rem auto 0.35rem;
  border: 0;
  background: transparent;
  color: rgba(148, 163, 184, 0.55);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  padding: 0.2rem 0.4rem;
}
.report-link:hover,
.report-link:focus-visible {
  color: rgba(226, 232, 240, 0.85);
  outline: none;
}
.report-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 4, 15, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.report-overlay[hidden] { display: none !important; }
.report-panel {
  position: relative;
  width: min(92vw, 440px);
  max-height: min(86vh, 640px);
  overflow: auto;
  border-radius: 16px;
  padding: 1.25rem 1.3rem 1.15rem;
  background:
    linear-gradient(165deg, rgba(255,255,255,0.07), transparent 40%),
    linear-gradient(180deg, #122038 0%, #0a1628 100%);
  border: 1px solid rgba(91, 141, 239, 0.28);
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
.report-close {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  border: 0;
  background: transparent;
  color: rgba(148, 163, 184, 0.85);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}
.report-panel .eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}
.report-panel h2 {
  margin: 0 0 0.35rem;
  font-family: Cinzel, serif;
  font-size: 1.25rem;
  font-weight: 600;
}
.report-lede {
  margin: 0 0 0.85rem;
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.92rem;
  line-height: 1.4;
}
.report-meta {
  margin: 0 0 0.9rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(7, 11, 20, 0.55);
  border: 1px solid rgba(91, 141, 239, 0.18);
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(226, 232, 240, 0.82);
  word-break: break-word;
}
.report-meta code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  color: #7dd3fc;
}
.report-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.9);
}
.report-label select,
.report-label textarea,
.report-label input[type="email"] {
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  background: rgba(7, 11, 20, 0.65);
  border: 1px solid rgba(91, 141, 239, 0.22);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
}
.report-label textarea { resize: vertical; min-height: 6.5rem; }
.report-label select:focus,
.report-label textarea:focus,
.report-label input:focus {
  outline: none;
  border-color: rgba(91, 141, 239, 0.55);
  box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.15);
}
.report-hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
}
.report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.35rem;
}
.report-status {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  line-height: 1.35;
}
.report-status.is-error { color: #fca5a5; }
.report-status.is-ok { color: #6ee7b7; }
