/* ==========================================================================
   NEXORA TECHSPRINT · ARENA  —  visual system
   Deep-violet / lilac editorial theme (reference: nexora-one-plum.vercel.app)
   Type: Chakra Petch (display) · Space Grotesk (body) · Share Tech Mono (data)
   ========================================================================== */

:root {
  color-scheme: light;

  /* core palette */
  --ink: #150e2a;
  --ink-soft: #372a55;
  --muted: #6a5e8c;
  --muted-2: #8b7ea8;
  --paper: #f8f6ff;
  --paper-2: #f2edff;
  --white: #ffffff;

  --p: #5b21b6;
  --p-bright: #7c3aed;
  --p-glow: #a855f7;
  --deep: #22104e;
  --deep-2: #16083a;
  --lilac: #c4b5fd;
  --lilac-2: #d8c8ff;
  --lilac-soft: #eee9ff;

  --line: #ddd3f8;
  --line-soft: #ebe5fb;

  --green: #178a5f;
  --green-soft: #e9f8f0;
  --red: #c0335a;
  --red-soft: #fff0f4;
  --amber: #9a6a1f;
  --amber-soft: #fff6e6;

  --shadow-xs: 0 1px 2px #220f4d08;
  --shadow-sm: 0 6px 18px -10px #2a116029;
  --shadow-md: 0 18px 40px -24px #2a11603d;
  --shadow-lg: 0 36px 80px -40px #1c0b4a4d;
  --ring: 0 0 0 3px #a855f733;

  --radius-s: 10px;
  --radius: 14px;
  --radius-l: 20px;
  --radius-xl: 28px;

  --font-body: "Space Grotesk", "Segoe UI", system-ui, -apple-system,
    BlinkMacSystemFont, sans-serif;
  --font-display: "Chakra Petch", "Space Grotesk", system-ui, sans-serif;
  --font-mono: "Share Tech Mono", ui-monospace, "SFMono-Regular", monospace;

  /* global type scale — every rem is 16px (was 12–14px before) */
  --fs-body: 1rem;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 1rem/1.65 var(--font-body);
  font-feature-settings: "ss01" 1;
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
button,
a,
input,
select,
textarea,
summary {
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--p-bright);
  outline-offset: 3px;
  border-radius: 6px;
}
a {
  color: var(--p);
  text-decoration: none;
}
a:hover {
  color: var(--p-bright);
}
h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--ink);
}
h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 0.4rem;
  letter-spacing: -0.8px;
}
h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}
h3 {
  font-size: 1.06rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
p {
  margin-bottom: 0.75rem;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.tiny {
  font-size: 0.78rem;
}
.prewrap {
  white-space: pre-wrap;
}

/* ---------------------------------------------------------------- labels */
.eyebrow {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 2.4px;
  color: var(--p);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

/* ------------------------------------------------------------------ logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 3px;
  font-size: 1.32rem;
  color: var(--ink);
}
.logo small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 2.6px;
  font-weight: 600;
  color: var(--muted-2);
  margin-top: 2px;
}
.brand-logo {
  display: block;
  width: 2.9rem;
  height: 2.9rem;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px #4c1d9540);
  flex-shrink: 0;
}
.brand-logo.big {
  width: 6rem;
  height: 6rem;
  margin-bottom: 1rem;
}
.initial-loading-inner {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
}
.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  background: linear-gradient(145deg, #7c3aed, #4c1d95);
  box-shadow: 0 10px 24px -12px #4c1d95cc, inset 0 1px 0 #ffffff3d;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------- buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  background: linear-gradient(150deg, #7c3aed, #5b21b6);
  color: #fff;
  border-radius: 999px;
  padding: 0.78rem 1.5rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: 0 12px 26px -14px #4c1d95b8, inset 0 1px 0 #ffffff42;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px -16px #4c1d95cc, inset 0 1px 0 #ffffff42;
}
.button.secondary {
  background: #fff;
  color: var(--p);
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
}
.button.secondary:hover:not(:disabled) {
  border-color: var(--lilac);
  background: #fbf9ff;
}
.button.danger {
  background: linear-gradient(150deg, #d2496b, #a92a4c);
  box-shadow: 0 12px 26px -14px #a92a4c99, inset 0 1px 0 #ffffff33;
}
.button.sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}
.button.full {
  width: 100%;
}
.text-button {
  border: 0;
  background: none;
  color: var(--p);
  font-size: 0.94rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}
.text-button:hover {
  border-bottom-color: var(--lilac);
}
.button-row {
  display: flex;
  gap: 0.6rem;
}

/* ---------------------------------------------------------------- layout */
.row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.spread {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 0.85rem;
}
.wrap {
  flex-wrap: wrap;
}
.hidden {
  display: none !important;
}

.card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-l);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------- pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: var(--lilac-soft);
  color: var(--p);
  border: 1px solid #ddd0fb;
  white-space: nowrap;
}
.pill.live {
  background: linear-gradient(120deg, #7c3aed, #a855f7);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px -12px #7c3aedcc;
}
.pill.live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px #ffffff55;
  animation: pulse 1.8s ease-in-out infinite;
}
.pill.ready {
  background: #f3f0fa;
  color: var(--muted);
  border-color: var(--line-soft);
}
.pill.paused {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: #f1dfbc;
}
.pill.locked,
.pill.ended,
.pill.disabled {
  background: #f2f0f7;
  color: #6c6180;
  border-color: #e3ddf0;
}
.pill.correct {
  background: var(--green-soft);
  color: var(--green);
  border-color: #c6e9d7;
}
.pill.purple {
  background: #f0e9ff;
  color: var(--p);
  border-color: #ddd0fb;
  font-variant-numeric: tabular-nums;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* -------------------------------------------------------------- notices */
.notice {
  border: 1px solid var(--line);
  background: linear-gradient(120deg, #f7f3ff, #fdfcff);
  border-left: 3px solid var(--p-glow);
  border-radius: var(--radius-s);
  padding: 0.85rem 1.1rem;
  font-size: 0.94rem;
  color: var(--ink-soft);
  margin: 0.85rem 0;
}
.notice.warning {
  background: var(--amber-soft);
  border-color: #f0e0bf;
  border-left-color: #e0a53c;
  color: #6f5014;
}
.notice.danger {
  background: var(--red-soft);
  border-color: #f7d5df;
  border-left-color: #d2496b;
  color: #7c2338;
}
.notice.success {
  background: var(--green-soft);
  border-color: #c9ecda;
  border-left-color: #33a877;
  color: #145c41;
}

/* ---------------------------------------------------------------- forms */
label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: #4a3d68;
  margin: 0.9rem 0 0.45rem;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 0.78rem 0.95rem;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  font-family: var(--font-body);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:hover,
textarea:hover,
select:hover {
  border-color: var(--lilac);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--p-bright);
  box-shadow: var(--ring);
  outline: none;
}
textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.6;
}
textarea::placeholder,
input::placeholder {
  color: #a99cc2;
}
input[type="checkbox"] {
  width: auto;
  accent-color: var(--p-bright);
}
.form-footer {
  margin-top: 1.35rem;
}
.form-help {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}
.form-help.after {
  margin-bottom: 0;
}

/* --------------------------------------------------------- initial state */
.initial-loading {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  background:
    radial-gradient(60rem 40rem at 15% -10%, #ede7ff 0%, transparent 60%),
    radial-gradient(50rem 30rem at 95% 110%, #f3ecff 0%, transparent 55%),
    var(--paper);
  font-size: 1.05rem;
}

/* =======================================================================
   SIGN IN
   ======================================================================= */
.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 47% 53%;
}

/* left: deep violet showcase */
.login-story {
  position: relative;
  padding: 3.2rem 3.6rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(
      70rem 50rem at 10% 0%,
      #7c3aed 0%,
      #4c1d90 34%,
      transparent 66%
    ),
    radial-gradient(50rem 40rem at 90% 100%, #a855f7 0%, transparent 58%),
    linear-gradient(160deg, #2a1059 0%, #16083a 70%);
}
.login-story::before {
  content: "";
  position: absolute;
  inset: -30% -30% auto auto;
  width: 44rem;
  height: 44rem;
  border-radius: 50%;
  border: 1px solid #ffffff1f;
  box-shadow: 0 0 0 1px #ffffff0d inset;
}
.login-story::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(#ffffff0a 1px, transparent 1px),
    linear-gradient(90deg, #ffffff0a 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(70% 60% at 50% 40%, #000 20%, transparent 100%);
  pointer-events: none;
}
.login-story .logo,
.login-story .logo small {
  color: #fff;
  position: relative;
  z-index: 2;
}
.login-story .logo small {
  color: #cbb6ff;
}
/* On the dark rail the mark sits on a soft light plate so it stays legible */
.login-story .brand-logo,
.sidebar .brand-logo {
  background: #ffffff;
  border-radius: 0.85rem;
  padding: 0.22rem;
  box-shadow: 0 10px 24px -12px #000000aa, 0 0 0 1px #ffffff33;
  filter: none;
}
.login-story .logo-mark {
  background: #ffffff1a;
  border: 1px solid #ffffff33;
  box-shadow: none;
  backdrop-filter: blur(6px);
}
.story-content {
  position: relative;
  z-index: 2;
  margin: auto 0;
  padding: 2rem 0;
}
.story-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  color: #d9c8ff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 2.6px;
  border: 1px solid #ffffff26;
  background: #ffffff12;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  backdrop-filter: blur(6px);
}
.story-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 3.4vw, 3.5rem);
  line-height: 1.03;
  letter-spacing: -1.6px;
  margin: 1.5rem 0 1.1rem;
  color: #fff;
  text-transform: none;
}
.story-content h1 span {
  background: linear-gradient(100deg, #e9d5ff, #a855f7 60%, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.story-content > p {
  color: #c9b9e8;
  font-size: 1rem;
  max-width: 25rem;
  line-height: 1.85;
}
.story-illustration {
  display: flex;
  align-items: flex-end;
  gap: 0.8rem;
  margin: 2.4rem 0 1.6rem;
  height: 8.5rem;
}
.story-illustration i {
  display: block;
  width: 2.7rem;
  height: 3.4rem;
  border-radius: 0.6rem;
  background: linear-gradient(160deg, #ffffff2e, #ffffff0a);
  border: 1px solid #ffffff40;
  transform: rotate(-13deg);
  box-shadow: 0 20px 40px -22px #00000080;
  backdrop-filter: blur(2px);
}
.story-illustration i:nth-child(2) {
  height: 4.8rem;
}
.story-illustration i:nth-child(3) {
  height: 6.2rem;
}
.story-illustration i:nth-child(4) {
  height: 8rem;
  background: linear-gradient(160deg, #c4b5fd, #7c3aed);
  border-color: #ffffff66;
}
.story-caption {
  font-size: 0.78rem;
  color: #b6a3dd;
  letter-spacing: 0.6px;
}
.story-foot {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  color: #b9a6e3;
  font-size: 0.75rem;
  letter-spacing: 2.4px;
  text-transform: uppercase;
}

/* right: sign-in form */
.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background:
    radial-gradient(48rem 30rem at 100% 0%, #f1eaff 0%, transparent 60%),
    var(--paper);
}
.login-box {
  max-width: 27rem;
  width: 100%;
}
.login-box h2 {
  font-size: 1.85rem;
  letter-spacing: -0.8px;
  margin-bottom: 1.5rem;
}
.login-box > p {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1.4rem;
}
.role-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #eee9fb;
  border: 1px solid #e4dcf8;
  border-radius: 999px;
  padding: 0.3rem;
  gap: 0.25rem;
  margin-bottom: 1.4rem;
}
.role-tab {
  border: 0;
  background: none;
  border-radius: 999px;
  padding: 0.62rem 0.4rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: #7d6e9c;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.role-tab:hover {
  color: var(--p);
}
.role-tab.active {
  background: linear-gradient(150deg, #7c3aed, #5b21b6);
  color: #fff;
  box-shadow: 0 10px 22px -14px #4c1d95cc;
}
.login-box .button.full {
  width: 100%;
  margin-top: 0.35rem;
}
.privacy {
  border-top: 1px solid var(--line-soft);
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  font-size: 0.8rem;
  color: var(--muted-2);
  line-height: 1.8;
}
.field-icon {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 0.8rem;
  background: var(--lilac-soft);
  color: var(--p);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.steps-inline {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  margin: 1.2rem 0;
  font-size: 0.82rem;
  color: var(--muted-2);
}
.steps-inline b {
  color: var(--p);
  font-weight: 600;
}

/* =======================================================================
   APP SHELL
   ======================================================================= */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 16.5rem;
  padding: 1.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  z-index: 10;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(34rem 26rem at 0% 0%, #6d28d9 0%, transparent 62%),
    linear-gradient(180deg, #241151 0%, #170838 60%, #12062e 100%);
  border-right: 1px solid #ffffff14;
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(#ffffff09 1px, transparent 1px),
    linear-gradient(90deg, #ffffff09 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(180deg, #000, transparent 75%);
  pointer-events: none;
}
.sidebar .logo {
  position: relative;
  color: #fff;
  padding: 0 0.6rem;
  margin-bottom: 2.6rem;
}
.sidebar .logo small {
  color: #b9a6e3;
}
.sidebar .logo-mark {
  background: #ffffff1f;
  border: 1px solid #ffffff33;
  box-shadow: none;
}
.nav-label {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 2.4px;
  color: #a48fce;
  margin: 0 0.85rem 0.85rem;
}
.nav-list {
  position: relative;
  display: grid;
  gap: 0.35rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.78rem 0.9rem;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #c8b9e8;
  font-size: 0.96rem;
  font-weight: 500;
  border-radius: 0.75rem;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.nav-item > span {
  font-size: 1.15rem;
  width: 1.4rem;
  line-height: 1;
  text-align: center;
  opacity: 0.9;
}
.nav-item:hover {
  background: #ffffff12;
  color: #fff;
}
.nav-item.active {
  background: linear-gradient(
    100deg,
    #ffffff24 0%,
    #ffffff10 60%,
    transparent 100%
  );
  border-color: #ffffff2e;
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 1px 0 #ffffff1f;
}
.nav-item.active::after {
  content: "";
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c4b5fd;
  box-shadow: 0 0 10px 2px #a855f7aa;
}
.nav-tail {
  position: relative;
  margin-top: auto;
  padding: 1.4rem 0.85rem 0;
  border-top: 1px solid #ffffff1a;
}
.help-block {
  background: #ffffff10;
  border: 1px solid #ffffff1f;
  border-radius: 0.85rem;
  padding: 0.9rem;
  margin-bottom: 1.2rem;
}
.help-block strong {
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.3rem;
  color: #fff;
}
.help-block p {
  font-size: 0.8rem;
  line-height: 1.7;
  color: #b9a6e3;
  margin: 0;
}
.session-label {
  font-family: var(--font-display);
  font-size: 0.66rem;
  letter-spacing: 1.8px;
  color: #9c86c9;
}
.app-body {
  margin-left: 16.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(70rem 40rem at 100% -10%, #efe8ff 0%, transparent 55%),
    var(--paper);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  height: 4.8rem;
  padding: 0 2.2rem;
  border-bottom: 1px solid var(--line-soft);
  background: #ffffffee;
  backdrop-filter: blur(14px) saturate(1.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.breadcrumb {
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted-2);
}
.breadcrumb strong {
  font-weight: 600;
  color: var(--ink);
  margin-left: 0.7rem;
}
.top-user {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #ede4ff, #d8c8ff);
  color: var(--p);
  border: 1px solid #d9c9fb;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.top-user strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}
.top-user small {
  display: block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted-2);
}
.mode-label {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1.6px;
  background: var(--amber-soft);
  border: 1px solid #f0e0bf;
  padding: 0.34rem 0.65rem;
  border-radius: 999px;
  color: var(--amber);
}
main.content {
  padding: 2.2rem 2.2rem 3rem;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.7rem;
}
.page-heading h1 {
  font-size: 1.9rem;
  margin-bottom: 0.25rem;
}
.page-heading p {
  font-size: 0.98rem;
  color: var(--muted);
  margin: 0;
}
.footer {
  padding: 1.1rem 2.2rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted-2);
  gap: 1rem;
}
.connection {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted-2);
}
.connection::before {
  content: "";
  width: 7px;
  height: 7px;
  background: #35b57f;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #35b57f2e;
}

/* ---------------------------------------------------------------- stats */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat {
  position: relative;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-l);
  padding: 1.15rem 1.35rem;
  box-shadow: var(--shadow-sm);
}
.stat::after {
  content: "";
  position: absolute;
  right: -3rem;
  top: -3rem;
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  background: radial-gradient(circle, #a855f71f, transparent 70%);
}
.stat-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 0.35rem;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.25;
}
.stat-value small {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--muted-2);
  margin-left: 0.5rem;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0 1rem;
}
.section-heading h2 {
  font-size: 1.15rem;
  margin: 0;
}
.section-heading > span {
  font-size: 0.85rem;
  color: var(--muted-2);
}

/* =======================================================================
   LOBBY
   ======================================================================= */
.lobby-welcome {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 2rem 2.2rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  margin-bottom: 1.5rem;
  color: #fff;
  background:
    radial-gradient(40rem 24rem at 12% 0%, #7c3aed 0%, transparent 60%),
    radial-gradient(30rem 20rem at 95% 120%, #a855f7 0%, transparent 55%),
    linear-gradient(150deg, #2a1059, #16083a 75%);
  box-shadow: 0 30px 60px -40px #2a1059cc;
}
.lobby-welcome::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(#ffffff0d 1px, transparent 1px),
    linear-gradient(90deg, #ffffff0d 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(80% 70% at 60% 40%, #000 10%, transparent 90%);
}
.lobby-welcome > * {
  position: relative;
}
.lobby-welcome .eyebrow {
  color: #cbb6ff;
}
.lobby-welcome h2 {
  color: #fff;
  font-size: 1.85rem;
  letter-spacing: -0.6px;
  margin-bottom: 0.4rem;
}
.lobby-welcome p {
  color: #c3b1e6;
  font-size: 1rem;
  max-width: 32rem;
  margin: 0;
}
.lobby-symbol {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  margin-right: 1rem;
  border: 1px solid #ffffff33;
  background: #ffffff12;
  backdrop-filter: blur(4px);
  align-self: center;
}
.lobby-symbol::before {
  content: "";
  position: absolute;
  inset: -0.85rem;
  border: 1px dashed #ffffff2e;
  border-radius: 50%;
}
.lobby-symbol > span {
  font-family: var(--font-display);
  font-size: 3.4rem;
  color: #fff;
  font-weight: 700;
  font-style: italic;
  text-shadow: 0 0 26px #a855f7aa;
}
.rounds-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
.round-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease,
    border-color 0.2s ease;
}
.round-card:hover {
  transform: translateY(-3px);
  border-color: var(--lilac);
  box-shadow: var(--shadow-md);
}
.round-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #7c3aed, #a855f7, #c4b5fd);
  opacity: 0.85;
}
.round-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0;
}
.round-icon {
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 1rem;
  background: linear-gradient(150deg, #f2ebff, #e4d8ff);
  border: 1px solid #ded1fa;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: var(--p);
  box-shadow: inset 0 1px 0 #fff;
}
.round-card-body {
  padding: 1.1rem 1.5rem 1.5rem;
}
.round-card h2 {
  font-size: 1.35rem;
}
.round-card p {
  font-size: 0.95rem;
  color: var(--muted);
  min-height: 3rem;
}
.round-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  color: var(--muted-2);
  font-size: 0.85rem;
  margin: 1rem 0;
}
.round-bottom {
  border-top: 1px solid var(--line-soft);
  padding-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}
.waiting-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--p-glow);
  display: inline-block;
  margin-right: 0.4rem;
  animation: pulse 1.8s ease-in-out infinite;
}
.lobby-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.lobby-step {
  display: flex;
  gap: 0.7rem;
}
.step-circle {
  display: grid;
  place-items: center;
  background: var(--lilac-soft);
  color: var(--p);
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}
.lobby-step b {
  font-size: 0.92rem;
  display: block;
  margin-bottom: 0.1rem;
  font-weight: 600;
}
.lobby-step p {
  font-size: 0.85rem;
  color: var(--muted-2);
  margin: 0;
}

/* =======================================================================
   ROUND CHROME (both rounds)
   ======================================================================= */
.round-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.round-header h1 {
  font-size: 1.95rem;
  margin: 0;
  letter-spacing: -1px;
}
.round-header .eyebrow {
  margin-bottom: 0.35rem;
}
.time-box {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.6rem 1rem 0.6rem 0.75rem;
  border-radius: 999px;
  box-shadow: var(--shadow-xs);
}
.time-box small {
  display: block;
  font-family: var(--font-display);
  font-size: 0.66rem;
  letter-spacing: 1.6px;
  color: var(--muted-2);
}
.timer {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  color: var(--p);
  line-height: 1.2;
}
.progress-line {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.85rem;
  color: var(--muted-2);
  margin: 1rem 0;
}
.progress-track {
  height: 6px;
  border-radius: 99px;
  flex: 1;
  background: #ece6fa;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #7c3aed, #c4b5fd);
  transition: width 0.4s ease;
}
.progress-fill[data-level="0"] {
  width: 0;
}
.progress-fill[data-level="1"] {
  width: 14.28%;
}
.progress-fill[data-level="2"] {
  width: 28.57%;
}
.progress-fill[data-level="3"] {
  width: 42.85%;
}
.progress-fill[data-level="4"] {
  width: 57.14%;
}
.progress-fill[data-level="5"] {
  width: 71.42%;
}
.progress-fill[data-level="6"] {
  width: 85.71%;
}
.progress-fill[data-level="7"] {
  width: 100%;
}
.round-footer {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
  padding-top: 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.save-label {
  font-size: 0.85rem;
  color: var(--muted-2);
}
.answer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}
.prompt {
  white-space: pre-wrap;
  font-size: 1.06rem;
  line-height: 1.9;
  color: var(--ink-soft);
  margin: 1.3rem 0 1.6rem;
}
.prompt code {
  font-family: var(--font-mono);
  background: var(--lilac-soft);
  color: var(--p);
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
}
.answer-card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-l);
  padding: 1.7rem;
  box-shadow: var(--shadow-sm);
}
.answer-card h2 {
  font-size: 1.4rem;
}
.question-meta {
  font-family: var(--font-display);
  font-size: 0.76rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted-2);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-top: 0.6rem;
}
.read-only {
  border: 1px dashed var(--line);
  border-radius: var(--radius-s);
  padding: 1.2rem;
  color: var(--muted-2);
  font-size: 0.95rem;
  text-align: center;
  margin-top: 1.2rem;
}
.answer-text {
  min-height: 6.5rem;
  font-size: 1.05rem;
}

/* start / lock screens */
.start-screen {
  max-width: 44rem;
  margin: 2rem auto;
  text-align: center;
  padding: 2.6rem;
}
.start-screen .round-icon {
  margin: 0 auto 1.4rem;
  width: 4.2rem;
  height: 4.2rem;
  font-size: 1.9rem;
  border-radius: 1.3rem;
}
.start-screen h2 {
  font-size: 1.7rem;
}
.start-screen p {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.85;
}
.start-screen .notice {
  text-align: left;
}
.rule-check {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  text-align: left;
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
  background: #faf7ff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-s);
  padding: 0.95rem 1.05rem;
  margin: 1.2rem 0;
  cursor: pointer;
}
.rule-check input {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  accent-color: var(--p-bright);
}
.rule-check b {
  font-weight: 600;
  color: var(--p);
}
#begin-round {
  min-width: 16rem;
}
.lock-screen {
  background: linear-gradient(160deg, #fff8fa, #fff);
  border-color: #f4dbe3;
}
.lock-screen .round-icon {
  color: var(--red);
  background: var(--red-soft);
  border-color: #f4d5df;
}
.result-value {
  font-family: var(--font-display);
  font-size: 3.4rem;
  line-height: 1.1;
  letter-spacing: -2px;
  color: var(--p);
  font-weight: 700;
  margin: 1.2rem 0 0.5rem;
}

/* =======================================================================
   MYSTERY MACHINE
   ======================================================================= */

/* main mystery banner */
.main-mystery {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 1.7rem 1.9rem;
  color: #fff;
  background:
    radial-gradient(38rem 22rem at 8% 0%, #7c3aed 0%, transparent 62%),
    radial-gradient(30rem 20rem at 100% 130%, #a855f7 0%, transparent 58%),
    linear-gradient(150deg, #2a1059, #16083a 78%);
  box-shadow: 0 28px 60px -42px #2a1059dd;
  text-align: center;
}
.main-mystery::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(#ffffff0d 1px, transparent 1px),
    linear-gradient(90deg, #ffffff0d 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(85% 80% at 50% 30%, #000 5%, transparent 95%);
  pointer-events: none;
}
.main-mystery > * {
  position: relative;
}
.main-mystery .row {
  justify-content: center;
}
.main-mystery .eyebrow {
  color: #cbb6ff;
  font-size: 0.74rem;
  margin-bottom: 0.6rem;
}
.main-mystery .pill.purple {
  background: #ffffff1f;
  border-color: #ffffff33;
  color: #efe7ff;
  backdrop-filter: blur(4px);
}
.main-mystery h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.6vw, 2.35rem);
  letter-spacing: -0.8px;
  color: #fff;
  margin: 0.35rem auto 0.85rem;
  max-width: 44rem;
}
.main-mystery p {
  color: #cbb9ea;
  font-size: 1.02rem;
  line-height: 1.9;
  white-space: pre-wrap;
  max-width: 52rem;
  margin: 0 auto;
}
.mystery-progress {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}
.mystery-pip {
  width: 2.4rem;
  height: 0.4rem;
  border-radius: 99px;
  background: #ffffff2b;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.mystery-pip.done {
  background: #c4b5fd;
  box-shadow: 0 0 14px #a855f7cc;
}

/* the board: 4 locked / unlocked clue cards + working area */
.mystery-board {
  display: grid;
  gap: 1.4rem;
  margin-top: 1.4rem;
}
.clue-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.95rem;
}
.clue-card {
  position: relative;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border-radius: var(--radius-l);
  border: 1px solid var(--line-soft);
  background: #fff;
  padding: 1.05rem 1.15rem 1.15rem;
  box-shadow: var(--shadow-xs);
  font-family: var(--font-body);
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
  min-height: 7.4rem;
}
.clue-card .cc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.clue-card .cc-index {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--p);
}
.clue-card .cc-state {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-display);
  font-size: 0.66rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted-2);
  border: 1px solid var(--line-soft);
  background: #f7f4fd;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
}
.clue-card .cc-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.2px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.clue-card .cc-clue {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--p);
  letter-spacing: 0.5px;
  overflow-wrap: anywhere;
}
.clue-card .cc-foot {
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--muted-2);
}
.clue-card .cc-lock {
  position: absolute;
  right: 1.05rem;
  top: 50%;
  transform: translateY(-40%);
  font-size: 1.15rem;
  color: #bda9df;
  opacity: 0.9;
}

/* not yet reachable */
.clue-card.locked {
  background: repeating-linear-gradient(
      -45deg,
      #fbf9ff,
      #fbf9ff 9px,
      #f7f3ff 9px,
      #f7f3ff 18px
    );
  border-style: dashed;
  border-color: #ddd3f8;
  cursor: not-allowed;
  color: var(--muted-2);
}
.clue-card.locked .cc-title {
  color: #8d7fac;
}
/* currently solvable — the pulsing one */
.clue-card.current {
  border-color: var(--p-bright);
  background: linear-gradient(160deg, #ffffff 30%, #f6f0ff);
  box-shadow: 0 18px 40px -26px #7c3aedcc, 0 0 0 3px #a855f71a;
  transform: translateY(-2px);
}
.clue-card.current .cc-state {
  background: linear-gradient(120deg, #7c3aed, #a855f7);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px -10px #7c3aed;
}
.clue-card.current .cc-state::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.6s ease-in-out infinite;
}
.clue-card button {
  all: unset;
  position: absolute;
  inset: 0;
  cursor: pointer;
}
.clue-card.current::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid #a855f7;
  opacity: 0;
  animation: card-glow 2.6s ease-out infinite;
  pointer-events: none;
}
@keyframes card-glow {
  0% {
    opacity: 0.55;
    transform: scale(1);
  }
  70% {
    opacity: 0;
    transform: scale(1.015);
  }
  100% {
    opacity: 0;
    transform: scale(1.015);
  }
}
.clue-card.current:hover {
  box-shadow: 0 24px 44px -26px #7c3aeddd, 0 0 0 3px #a855f733;
}
/* the main mystery card sits under the four clue cards, full width */
.clue-card.final {
  grid-column: 1 / -1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(120deg, #faf6ff, #fff);
  border-color: #e5d9fb;
}
.clue-card.final .cc-top {
  margin: 0;
  flex: 0 0 auto;
  gap: 0.6rem;
}
.clue-card.final .cc-title {
  flex: 1 1 14rem;
  margin: 0;
}
.clue-card.final .cc-foot {
  margin: 0;
  flex: 0 0 auto;
}
.clue-card.final.current {
  background: linear-gradient(120deg, #f7f0ff, #fff);
}
/* solved */
.clue-card.solved {
  background: linear-gradient(160deg, #f4fdf8, #fff);
  border-color: #c9e9d8;
}
.clue-card.solved .cc-state {
  background: var(--green-soft);
  border-color: #c9e9d8;
  color: var(--green);
}
.clue-card.solved .cc-index {
  color: var(--green);
}

/* the working area */
.mystery-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.stage-main {
  min-width: 0;
}
.stage-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-l);
  padding: 1.7rem;
  box-shadow: var(--shadow-sm);
}
.stage-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #7c3aed, #a855f7, #c4b5fd);
}
.stage-card.final {
  background: linear-gradient(160deg, #fffdf7, #fff);
  border-color: #f0e2c4;
}
.stage-card.final::before {
  background: linear-gradient(90deg, #d4a027, #f5cf76, #d4a027);
}
.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 1.05rem;
}
.stage-head h2 {
  font-size: 1.45rem;
  margin: 0.25rem 0 0;
}
.stage-locked {
  text-align: center;
  padding: 2.6rem 1.5rem;
  color: var(--muted-2);
}
.stage-locked .lock-glyph {
  width: 3.6rem;
  height: 3.6rem;
  margin: 0 auto 1rem;
  border-radius: 1.1rem;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: var(--lilac-soft);
  color: var(--p);
}
.stage-locked h3 {
  font-size: 1.2rem;
  color: var(--ink);
}
.stage-locked p {
  max-width: 26rem;
  margin: 0 auto;
  font-size: 0.96rem;
}

/* side rail with collected clues */
.clue-rail {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-l);
  padding: 1.35rem 1.25rem;
  background: linear-gradient(170deg, #faf7ff, #fff);
  box-shadow: var(--shadow-xs);
  align-self: start;
}
.clue-rail h3 {
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}
.clue-rail > p {
  font-size: 0.88rem;
  color: var(--muted-2);
  line-height: 1.7;
}
.clue {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--p-glow);
  border-radius: var(--radius-s);
  padding: 0.85rem 0.95rem;
  margin: 0.7rem 0;
  display: flex;
  gap: 0.8rem;
  align-items: center;
  box-shadow: var(--shadow-xs);
}
.clue-number {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 0.55rem;
  background: linear-gradient(150deg, #f1e8ff, #ddd0fb);
  color: var(--p);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.clue small {
  display: block;
  font-family: var(--font-display);
  font-size: 0.66rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted-2);
}
.clue strong {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--p);
  overflow-wrap: anywhere;
}
.clue-placeholder {
  padding: 0.85rem 0.95rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-s);
  font-size: 0.88rem;
  color: var(--muted-2);
  margin: 0.7rem 0;
  background: #fdfbff;
}
.clue-join {
  text-align: center;
  font-size: 0.85rem;
  color: #b8a2cf;
  margin: 0.7rem 0;
}
.mystery-history {
  margin-top: 1.2rem;
  font-size: 0.92rem;
  color: var(--muted-2);
}
.mystery-history summary {
  cursor: pointer;
  font-weight: 500;
}
.history-item {
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-s);
  margin-top: 0.7rem;
}
.history-item strong {
  display: block;
  font-size: 0.88rem;
  font-family: var(--font-display);
  color: var(--ink-soft);
}
.history-item p {
  font-size: 0.9rem;
  white-space: pre-wrap;
  margin: 0.35rem 0;
  color: var(--muted-2);
}


/* ---- banner states -------------------------------------------------- */
.main-mystery.locked-banner {
  padding: 2.2rem 1.9rem;
}
.main-mystery.locked-banner .mm-lock {
  font-size: 2rem;
  color: #cbb6ff;
  margin-bottom: 0.4rem;
  opacity: 0.85;
}
.main-mystery.solved-open {
  box-shadow: 0 30px 70px -40px #7c3aedcc, 0 0 0 1px #a855f733 inset;
}
.main-mystery.solved-open.armed h2 {
  background: linear-gradient(100deg, #fff, #e9d5ff 55%, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- connectors between clue cards ---------------------------------- */
.clue-row {
  position: relative;
}
.clue-card {
  position: relative;
  z-index: 1;
}
.clue-link {
  position: absolute;
  top: 50%;
  right: -0.95rem;
  width: 0.95rem;
  height: 2px;
  background: #d9d0ee;
  transform: scaleX(0);
  transform-origin: left center;
  transition: background 0.3s ease;
  z-index: 0;
}
.clue-link::after {
  content: "";
  position: absolute;
  right: -3px;
  top: -2.5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: inherit;
  transform: scale(0);
}
.clue-card.solved .clue-link,
.clue-link.half,
.clue-link.both {
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  transform: scaleX(1);
  animation: link-draw 0.55s ease forwards;
  box-shadow: 0 0 10px #a855f788;
}
.clue-link.both::after,
.clue-link.half::after {
  transform: scale(1);
  animation: spark 1.6s ease-in-out infinite;
}
@keyframes link-draw {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
@keyframes spark {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

/* newly unlocked clue celebrates */
.clue-card.current {
  animation: unlock-pop 0.6s cubic-bezier(0.2, 0.9, 0.2, 1.2);
}
@keyframes unlock-pop {
  0% {
    transform: translateY(6px) scale(0.97);
    opacity: 0.4;
  }
  60% {
    transform: translateY(-3px) scale(1.015);
    opacity: 1;
  }
  100% {
    transform: translateY(-2px) scale(1);
  }
}
.clue-card.is-viewing {
  box-shadow: 0 0 0 2px #a855f755, 0 18px 40px -26px #7c3aedcc;
}
.clue-card .cc-lock-icon {
  margin-right: 0.25rem;
}

/* ---- collapsed clue chain (all found) ------------------------------- */
.clue-chain {
  margin-top: 1.4rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-l);
  background: linear-gradient(120deg, #faf6ff, #fff);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-xs);
}
.chain-track {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}
.chain-node {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 999px;
  border: 1px solid #e2d6fb;
  background: #fff;
  padding: 0.35rem 0.85rem 0.35rem 0.4rem;
  box-shadow: var(--shadow-xs);
  animation: chain-in 0.45s ease backwards;
}
.chain-node:nth-child(1) {
  animation-delay: 0.05s;
}
.chain-node:nth-child(3) {
  animation-delay: 0.15s;
}
.chain-node:nth-child(5) {
  animation-delay: 0.25s;
}
.chain-node:nth-child(7) {
  animation-delay: 0.35s;
}
@keyframes chain-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.94);
  }
}
.chain-num {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(150deg, #7c3aed, #5b21b6);
}
.chain-val {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--p);
  letter-spacing: 0.5px;
  max-width: 12rem;
  overflow-wrap: anywhere;
}
.chain-node.final {
  border-color: #e6c67a;
  background: linear-gradient(120deg, #fffaf0, #fff);
}
.chain-node.final .chain-num {
  background: linear-gradient(150deg, #e0a53c, #b4791a);
}
.chain-node.final .chain-val {
  font-family: var(--font-display);
  letter-spacing: 0;
}
.chain-arrow {
  width: 1.6rem;
  height: 2px;
  background: linear-gradient(90deg, #b794f4, #7c3aed);
  position: relative;
  animation: link-draw 0.5s ease backwards;
}
.chain-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -3px;
  border-left: 6px solid #7c3aed;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

/* ---- stage tweaks --------------------------------------------------- */
.mystery-stage.single {
  grid-template-columns: minmax(0, 1fr);
}
.stage-head-side {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.stage-close {
  font-size: 0.88rem;
  color: var(--muted-2);
}
.stage-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: linear-gradient(180deg, #fdfbff, #fff);
  border-style: dashed;
}
.stage-empty .lock-glyph {
  width: 3.6rem;
  height: 3.6rem;
  margin: 0 auto 1rem;
  border-radius: 1.1rem;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: var(--lilac-soft);
  color: var(--p);
}
.stage-empty h3 {
  font-size: 1.2rem;
  color: var(--ink);
}
.stage-empty p {
  max-width: 30rem;
  margin: 0 auto;
  font-size: 0.98rem;
  color: var(--muted);
}
.stage-card[data-stage] {
  animation: stage-in 0.4s ease;
}
@keyframes stage-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* =======================================================================
   TECH DOMINO — ivory staircase, left to right; question card below
   ======================================================================= */
.domino-arena {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
  margin-top: 1.2rem;
}
.domino-rail {
  border: 1px solid #e9e2d4;
  border-radius: var(--radius-l);
  padding: 1.25rem 1.5rem 1.5rem;
  background:
    radial-gradient(34rem 18rem at 50% 100%, #f5ecd64d, transparent 70%),
    linear-gradient(180deg, #ffffff, #fdfbf7);
  box-shadow: var(--shadow-xs);
  container-type: inline-size;
}
.domino-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.domino-rail-head h3 {
  margin: 0;
  font-size: 1.1rem;
}
.domino-rail-note {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.86rem;
  color: var(--muted-2);
}
.domino-stack {
  /* Fallback for browsers without container-query units. */
  --u: min(0.7vw, 0.6rem);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: calc(var(--u) * 0.7);
  padding: calc(var(--u) * 4) var(--u) calc(var(--u) * 6.5);
}
@supports (width: 1cqw) {
  .domino-stack {
    --u: min(1cqw, 0.6rem);
  }
}
@supports not (width: 1cqw) {
  @media (max-width: 860px) {
    .domino-stack {
      --u: min(0.95vw, 0.6rem);
    }
  }
}

/* One upright domino. Size and baseline rise together from 1 to 7. */
.domino-tile {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  width: calc(var(--w) + var(--depth));
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  text-align: center;
  color: var(--muted);
  transform: translateY(var(--rise));
  -webkit-tap-highlight-color: transparent;
}
.domino-tile:nth-child(1) {
  --w: calc(var(--u) * 7.2);
  --h: calc(var(--u) * 14.4);
  --depth: calc(var(--u) * 1.35);
  --rise: calc(var(--u) * 5.4);
}
.domino-tile:nth-child(2) {
  --w: calc(var(--u) * 7.9);
  --h: calc(var(--u) * 16.8);
  --depth: calc(var(--u) * 1.5);
  --rise: calc(var(--u) * 4.5);
}
.domino-tile:nth-child(3) {
  --w: calc(var(--u) * 8.6);
  --h: calc(var(--u) * 19.2);
  --depth: calc(var(--u) * 1.65);
  --rise: calc(var(--u) * 3.6);
}
.domino-tile:nth-child(4) {
  --w: calc(var(--u) * 9.3);
  --h: calc(var(--u) * 21.6);
  --depth: calc(var(--u) * 1.8);
  --rise: calc(var(--u) * 2.7);
}
.domino-tile:nth-child(5) {
  --w: calc(var(--u) * 10);
  --h: calc(var(--u) * 24);
  --depth: calc(var(--u) * 1.95);
  --rise: calc(var(--u) * 1.8);
}
.domino-tile:nth-child(6) {
  --w: calc(var(--u) * 10.7);
  --h: calc(var(--u) * 26.4);
  --depth: calc(var(--u) * 2.1);
  --rise: calc(var(--u) * 0.9);
}
.domino-tile:nth-child(7) {
  --w: calc(var(--u) * 11.4);
  --h: calc(var(--u) * 28.8);
  --depth: calc(var(--u) * 2.25);
  --rise: 0px;
}
.domino-box {
  position: relative;
  display: block;
  width: var(--w);
  height: var(--h);
  flex-shrink: 0;
  filter: drop-shadow(0 calc(var(--u) * 0.8) calc(var(--u) * 0.7) #4a3a181f);
  transition: filter 0.25s ease;
}
.domino-box::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -18%;
  bottom: calc(var(--u) * -1.1);
  height: calc(var(--u) * 1.5);
  border-radius: 50%;
  background: radial-gradient(ellipse, #43361c2e, #43361c12 55%, transparent 72%);
  pointer-events: none;
}
.dv-face {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  overflow: hidden;
  border: clamp(1px, calc(var(--u) * 0.16), 2px) solid #cbbb87;
  border-radius: clamp(3px, calc(var(--u) * 0.7), 8px);
  background: linear-gradient(160deg, #fff9e8 0%, #f7edcf 58%, #f0e3bd 100%);
  box-shadow: inset 0 1px 0 #fffdf4, inset 1px 0 0 #fff8e3;
}
.dv-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 100%;
  z-index: 1;
  width: var(--depth);
  border: 1px solid #bda974;
  border-left: 0;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, #d8c795, #e6d7ac 55%, #d2bf8a);
  transform: skewY(-34deg);
  transform-origin: left top;
}
.dv-top {
  position: absolute;
  left: 0;
  top: calc(var(--depth) * -0.675);
  z-index: 3;
  width: 100%;
  height: calc(var(--depth) * 0.675);
  border: 1px solid #cbbb87;
  border-radius: 2px;
  background: linear-gradient(180deg, #fffbea, #efe2b8);
  transform: skewX(-55deg);
  transform-origin: left bottom;
}
.dv-divider {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  height: clamp(2px, calc(var(--u) * 0.42), 4px);
  transform: translateY(-50%);
  border-radius: 1px;
  background: #302b22;
  box-shadow: 0 1px 0 #ffffff80;
}
.dv-num {
  position: absolute;
  left: 0;
  right: 0;
  top: 25%;
  transform: translateY(-50%);
  padding: 0;
  background: none;
  border-radius: 0;
  font-family: var(--font-display);
  font-size: clamp(0.78rem, calc(var(--u) * 2.7), 1.65rem);
  font-weight: 700;
  line-height: 1;
  color: #3a3020;
}
.dv-state {
  position: absolute;
  left: 0;
  right: 0;
  top: 75%;
  transform: translateY(-50%);
  font-size: clamp(0.7rem, calc(var(--u) * 2.3), 1.4rem);
  font-weight: 700;
  line-height: 1;
  color: var(--green);
}
.domino-meta {
  display: grid;
  gap: 0.15rem;
  justify-items: center;
  width: calc(100% + var(--u) * 1.5);
  min-height: 2.5rem;
  margin-top: calc(var(--u) * 1.8);
}
.dt-name {
  font-family: var(--font-display);
  font-size: clamp(0.58rem, calc(var(--u) * 1.25), 0.8rem);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted-2);
}
.dt-time {
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, calc(var(--u) * 1.55), 1rem);
  letter-spacing: 0.3px;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--p);
}
.domino-tile:hover .domino-box {
  filter: drop-shadow(0 calc(var(--u) * 1.1) calc(var(--u) * 0.9) #4a3a1833)
    brightness(1.02);
}
.domino-tile:hover .dt-name {
  color: var(--p);
}
.domino-tile.solved .dv-face {
  border-color: #a8cbb5;
}
.domino-tile.solved .dt-time {
  color: var(--green);
}
.domino-tile.expired .dv-face {
  border-color: #d8cfba;
  background: repeating-linear-gradient(
    -45deg,
    #faf6ea,
    #faf6ea 6px,
    #f0ead9 6px,
    #f0ead9 12px
  );
}
.domino-tile.expired .dv-num,
.domino-tile.expired .dv-state,
.domino-tile.expired .dt-time {
  color: #9a8f78;
}
.domino-tile.active .dv-face {
  border-color: var(--p-bright);
  box-shadow: inset 0 1px 0 #fffdf4, 0 0 0 2px #a855f72e;
}
.domino-tile.active .dv-num,
.domino-tile.active .dt-name {
  color: var(--p);
}
.domino-tile.active .dt-time {
  background: var(--lilac-soft);
  color: var(--p);
}
.domino-tile:disabled {
  opacity: 0.55;
}

/* the problem card sliding out of the clicked domino */
.domino-work {
  min-width: 0;
  width: 100%;
  max-width: 62rem;
  justify-self: center;
  perspective: 1400px;
}
.domino-stage {
  transform-origin: left center;
}
.domino-stage.domino-in {
  animation: domino-card-in 0.62s cubic-bezier(0.18, 0.9, 0.22, 1.05);
}
.domino-stage.domino-out {
  animation: domino-card-out 0.6s cubic-bezier(0.5, 0, 0.9, 0.4) forwards;
}
@keyframes domino-card-in {
  0% {
    opacity: 0;
    transform: perspective(1400px) rotateY(-26deg) translateX(-46px)
      scale(0.9);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: perspective(1400px) rotateY(0deg) translateX(0) scale(1);
  }
}
@keyframes domino-card-out {
  0% {
    opacity: 1;
    transform: perspective(1400px) rotateY(0) translateX(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: perspective(1400px) rotateY(-18deg) translateX(-38px)
      scale(0.92);
  }
}
.domino-question-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.2rem;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 1.1rem;
  flex-wrap: wrap;
}
.domino-question-head h2 {
  margin: 0.35rem 0 0;
  font-size: 1.5rem;
}
.domino-time {
  padding: 0.6rem 1rem;
  background: linear-gradient(160deg, #f6f1ff, #fff);
  border: 1px solid #e6dbfa;
  border-radius: var(--radius-s);
  text-align: center;
  min-width: 8rem;
}
.domino-time small {
  display: block;
  font-family: var(--font-display);
  font-size: 0.64rem;
  letter-spacing: 1.6px;
  color: var(--muted-2);
}
.domino-time .timer {
  font-size: 1.55rem;
}
.domino-empty-inner {
  text-align: center;
  padding: 2.6rem 1rem;
  color: var(--muted);
}
.domino-empty-inner h3 {
  font-size: 1.35rem;
  color: var(--ink);
}
.domino-empty-inner p {
  max-width: 26rem;
  margin: 0 auto;
  font-size: 1rem;
}

/* =======================================================================/* =======================================================================
   ORGANIZER / ADMIN
   ======================================================================= */
.two-column {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.3rem;
  align-items: start;
}
.registration-card h2 {
  font-size: 1.3rem;
}
.registration-card > p {
  font-size: 0.95rem;
  color: var(--muted);
}
.link-output {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #faf6ff, #fff);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-top: 1.2rem;
}
.link-output label {
  margin: 0 0 0.5rem;
}
.link-output textarea {
  min-height: 5.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: #fff;
  word-break: break-all;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  text-align: left;
}
th {
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--muted-2);
  font-weight: 600;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  background: #faf8ff;
}
th,
td {
  padding: 0.85rem 0.85rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
tbody tr:hover td {
  background: #fcfaff;
}
td strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 600;
}
td small {
  font-size: 0.82rem;
  color: var(--muted-2);
  display: block;
}
.table-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}
.round-control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
.control-card {
  position: relative;
  overflow: hidden;
  padding: 1.6rem;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-sm);
}
.control-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #7c3aed, #c4b5fd);
}
.control-card h2 {
  font-size: 1.35rem;
  margin-top: 1rem;
}
.control-card p {
  font-size: 0.95rem;
  color: var(--muted);
}
.control-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}
.control-info {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.6px;
  color: var(--muted-2);
  margin: 0.9rem 0;
}
.audit-list {
  max-height: 24rem;
  overflow: auto;
}
.audit-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.88rem;
  color: var(--muted-2);
  overflow-wrap: anywhere;
}
.audit-item b {
  font-family: var(--font-display);
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
  text-transform: capitalize;
}
.audit-item p {
  margin: 0.25rem 0 0;
  white-space: pre-wrap;
  font-size: 0.9rem;
  color: var(--muted);
}
.audit-item small {
  color: var(--muted-2);
  font-size: 0.82rem;
}
.rank {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--p);
  font-variant-numeric: tabular-nums;
}
.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 2.6rem 1.5rem;
  text-align: center;
  color: var(--muted-2);
  font-size: 1rem;
  background: #fdfbff;
}
.account-card {
  max-width: 40rem;
}
.log-categories {
  margin-bottom: 1.1rem;
}
#log-entries {
  max-height: none;
}
#older-logs {
  margin-top: 1.2rem;
}
.staff-presence {
  margin-bottom: 1.1rem;
}

/* checkbox confirmation block (replaces typed confirmations) */
.confirm-box {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #fbf8ff, #fff);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem;
  margin: 1.15rem 0 0;
}
.confirm-check {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.97rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
  cursor: pointer;
}
.confirm-check input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  margin: 0.1rem 0 0;
  accent-color: var(--p-bright);
}
.confirm-check .cc-label b {
  color: var(--p);
  font-weight: 600;
}
.confirm-check .cc-label small {
  display: block;
  color: var(--muted-2);
  font-size: 0.84rem;
  margin-top: 0.15rem;
}

/* ------------------------------------------------------- scoreboards */
.scoreboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 1.2rem;
}
.scoreboard h2 {
  font-size: 1.2rem;
  margin: 0;
}
.scoreboard .score-cell {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--p);
}
.scoreboard tr.is-mine td {
  background: #f6f0ff;
}
.scoreboard tr.is-mine td:first-child {
  box-shadow: inset 3px 0 0 var(--p-bright);
}
.my-round-score {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0.6rem 0 0.2rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: linear-gradient(120deg, #f4ecff, #fff);
  border: 1px solid #e3d6fb;
}
.my-round-score span {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted-2);
}
.my-round-score b {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--p);
}
.my-round-score small {
  color: var(--muted-2);
  font-size: 0.82rem;
}

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed;
  bottom: 1.4rem;
  right: 1.4rem;
  left: auto;
  transform: none;
  pointer-events: none;
  padding: 0.85rem 1.25rem;
  color: #fff;
  background: linear-gradient(150deg, #7c3aed, #4c1d95);
  border: 1px solid #ffffff2e;
  border-radius: 999px;
  font-size: 0.95rem;
  box-shadow: 0 20px 44px -22px #2a1059cc;
  max-width: min(90vw, 40rem);
  z-index: 100;
}
.toast.error {
  background: linear-gradient(150deg, #d2496b, #96213f);
}

/* ----------------------------------------------------------------- dialogs */
dialog {
  width: min(34rem, 92vw);
  padding: 1.9rem;
  border-radius: var(--radius-l);
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
  box-shadow: 0 40px 120px -40px #1c0b4a66;
}
dialog::backdrop {
  background: #1b0b3d66;
  backdrop-filter: blur(6px);
}
dialog p {
  font-size: 0.98rem;
  color: var(--muted);
  line-height: 1.85;
}
dialog .button-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.rules-details {
  font-size: 0.92rem;
  color: var(--muted-2);
  margin-top: 1.1rem;
  border-top: 1px dashed var(--line);
  padding-top: 0.9rem;
}
.rules-details summary {
  cursor: pointer;
  color: var(--p);
  font-weight: 500;
}
.rules-details p {
  white-space: pre-wrap;
  line-height: 1.9;
  margin-top: 0.7rem;
}
.build-note {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 0.9rem 0 0;
}

/* ------------------------------------------------------------ responsive */
@media (min-width: 1700px) {
  main.content {
    padding: 2.8rem 3.4rem 3.5rem;
  }
  .topbar,
  .footer {
    padding-left: 3.4rem;
    padding-right: 3.4rem;
  }
  .mystery-stage {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  }
}
@media (max-width: 1250px) {
  .clue-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mystery-stage {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 1150px) {
  .login-story {
    padding: 2.4rem;
  }
  .sidebar {
    width: 14.5rem;
    padding: 1.6rem 0.8rem;
  }
  .app-body {
    margin-left: 14.5rem;
  }
  .topbar,
  .footer {
    padding-left: 1.6rem;
    padding-right: 1.6rem;
  }
  main.content {
    padding: 1.6rem 1.6rem 2.4rem;
  }
  .domino-arena {
    gap: 1rem;
  }
  .two-column {
    grid-template-columns: 1fr;
  }
  .top-user .mode-label {
    display: none;
  }
}
@media (max-width: 900px) {
  .login-layout {
    grid-template-columns: 1fr;
  }
  .login-story {
    padding: 2rem 1.6rem;
    min-height: auto;
  }
  .story-content,
  .story-foot,
  .story-illustration {
    display: none;
  }
  .login-main {
    padding: 2.2rem 1.4rem;
  }
}
@media (max-width: 860px) {
  .sidebar {
    position: relative;
    width: 100%;
    padding: 1.1rem 1.1rem 0.8rem;
    border-right: 0;
    border-bottom: 1px solid #ffffff1f;
  }
  .sidebar .logo {
    margin: 0 0 0.9rem;
    padding: 0;
  }
  .nav-list {
    display: flex;
    overflow-x: auto;
    gap: 0.35rem;
    padding-bottom: 0.2rem;
  }
  .nav-item {
    width: auto;
    white-space: nowrap;
    font-size: 0.9rem;
    padding: 0.55rem 0.75rem;
  }
  .nav-item.active::after {
    display: none;
  }
  .nav-label,
  .nav-tail {
    display: none;
  }
  .nav-item > span {
    font-size: 1rem;
  }
  .app-body {
    margin: 0;
  }
  .topbar {
    height: 4rem;
    padding: 0 1rem;
  }
  .breadcrumb {
    font-size: 0.72rem;
  }
  .top-user {
    gap: 0.5rem;
  }
  .top-user strong {
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .top-user small {
    display: none;
  }
  .avatar {
    width: 2.1rem;
    height: 2.1rem;
  }
  main.content {
    padding: 1.3rem 1.1rem 2.2rem;
  }
  .rounds-grid,
  .round-control-grid {
    grid-template-columns: 1fr;
  }
  .clue-row {
    grid-template-columns: 1fr;
  }
  .lobby-welcome {
    padding: 1.5rem;
    grid-template-columns: 1fr;
  }
  .lobby-symbol {
    width: 4.6rem;
    height: 4.6rem;
    margin: 0;
    justify-self: start;
  }
  .lobby-symbol > span {
    font-size: 2.2rem;
  }
  .lobby-welcome h2 {
    font-size: 1.5rem;
  }
  .stats {
    gap: 0.7rem;
  }
  .stat {
    padding: 0.9rem 1rem;
  }
  .stat-value {
    font-size: 1.35rem;
  }
  .stat-value small {
    display: block;
    margin: 0;
    font-size: 0.78rem;
  }
  .domino-arena {
    grid-template-columns: 1fr;
  }
  .domino-rail {
    padding: 1rem 0.85rem 1.15rem;
  }
  .domino-stack {
    gap: calc(var(--u) * 0.45);
    padding-top: calc(var(--u) * 3);
  }
  .domino-meta {
    min-height: 2.2rem;
  }
  .dt-name {
    letter-spacing: 0.2px;
  }
  .clue-link {
    display: none;
  }
  .clue-card.final {
    flex-direction: column;
    align-items: flex-start;
  }
  .round-header {
    align-items: flex-start;
  }
  .round-header h1 {
    font-size: 1.55rem;
  }
  .time-box {
    padding: 0.5rem 0.85rem 0.5rem 0.6rem;
  }
  .time-box .timer {
    font-size: 1.25rem;
  }
  .lobby-steps {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .footer {
    padding: 1rem 1.1rem;
    flex-direction: column;
    gap: 0.3rem;
  }
  .answer-card,
  .stage-card,
  .card {
    padding: 1.2rem;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
  }
  .page-heading h1 {
    font-size: 1.55rem;
  }
  .start-screen {
    padding: 1.7rem 1.2rem;
  }
  .domino-question-head {
    gap: 0.7rem;
  }
  .domino-time {
    min-width: 6.5rem;
  }
  .domino-time .timer {
    font-size: 1.25rem;
  }
  dialog {
    padding: 1.4rem;
  }
}
@media (max-width: 600px) {
  .domino-rail {
    padding: 0.9rem 0.65rem 1rem;
  }
  .domino-rail-note {
    font-size: 0.78rem;
  }
  .dt-name {
    display: none;
  }
  .domino-meta {
    min-height: 1.4rem;
    margin-top: calc(var(--u) * 2.2);
  }
  .dt-time {
    padding: 0.08rem 0.15rem;
    font-size: clamp(0.62rem, calc(var(--u) * 1.9), 0.8rem);
    letter-spacing: 0;
  }
}
@media (max-width: 460px) {
  .lobby-welcome {
    grid-template-columns: 1fr;
  }
  .lobby-symbol {
    display: none;
  }
  .round-header {
    flex-wrap: wrap;
  }
  .time-box {
    width: 100%;
    justify-content: space-between;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stats .stat:last-child {
    grid-column: 1/-1;
  }
  .answer-actions,
  .round-footer {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .answer-actions .button {
    width: 100%;
  }
  .breadcrumb {
    display: none;
  }
  .topbar {
    justify-content: flex-end;
  }
  .top-user {
    width: 100%;
  }
  .top-user .text-button {
    margin-left: auto;
  }
  .round-bottom {
    flex-wrap: wrap;
  }
  .section-heading {
    align-items: flex-start;
  }
  .round-card p {
    min-height: 0;
  }
  .role-tab {
    font-size: 0.78rem;
    padding: 0.55rem 0.2rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
