:root {
  --bg: #050808;
  --bg-deep: #07100d;
  --surface: #0c1613;
  --surface-soft: #111f1a;
  --surface-strong: #153127;
  --ink: #e6fff2;
  --ink-soft: #99b6a9;
  --accent: #39ff9b;
  --accent-2: #0ea56a;
  --warm: #80ffd0;
  --line: #1f3b31;
  --danger: #ff3f68;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-soft: 0 22px 50px rgba(0, 0, 0, 0.5);
  --shadow-strong: 0 34px 78px rgba(0, 0, 0, 0.62);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  line-height: 1.45;
}

h1,
h2,
h3,
.brand {
  font-family: "Sora", "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  position: relative;
  animation: page-enter 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image: linear-gradient(155deg, rgba(57, 255, 155, 0.12), transparent 36%),
    repeating-linear-gradient(45deg, rgba(125, 255, 196, 0.028) 0, rgba(125, 255, 196, 0.028) 2px, transparent 2px, transparent 9px);
  pointer-events: none;
}

.page-dashboard::before {
  background-image: radial-gradient(circle at 16% 10%, rgba(57, 255, 155, 0.16), rgba(57, 255, 155, 0) 40%),
    linear-gradient(130deg, #040808 0%, #07110d 45%, #040707 100%);
}

.page-dashboard::after {
  content: "";
  position: fixed;
  inset: -6%;
  z-index: -2;
  pointer-events: none;
  background-image: linear-gradient(110deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.5)),
    url("/images/anonymous.png"),
    repeating-linear-gradient(118deg, rgba(72, 255, 171, 0.055) 0, rgba(72, 255, 171, 0.055) 2px, transparent 2px, transparent 12px);
  background-repeat: no-repeat, no-repeat, repeat;
  background-size: cover, min(70vw, 1020px), cover;
  background-position: center, 76% 54%, center;
  opacity: 0.18;
}

.ambient {
  position: fixed;
  z-index: -2;
  filter: blur(5px);
  pointer-events: none;
}

.ambient-moss {
  width: 480px;
  height: 480px;
  top: -180px;
  right: -60px;
  border-radius: 58% 42% 50% 50%;
  background: radial-gradient(circle at 35% 30%, rgba(195, 44, 60, 0.24), rgba(195, 44, 60, 0));
}

.ambient-sand {
  width: 560px;
  height: 560px;
  bottom: -220px;
  left: -140px;
  border-radius: 45% 55% 62% 38%;
  background: radial-gradient(circle at 62% 44%, rgba(225, 75, 88, 0.2), rgba(225, 75, 88, 0));
}

.site-header,
.dash-header {
  width: min(1180px, calc(100% - 3rem));
  margin: 1.3rem auto;
  border: 1px solid rgba(105, 114, 133, 0.34);
  background: rgba(19, 24, 33, 0.86);
  border-radius: 18px;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 9px 30px rgba(0, 0, 0, 0.34);
}

.brand {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--accent), var(--warm));
  box-shadow: 0 0 0 6px rgba(57, 255, 155, 0.2);
}

.main-nav {
  display: flex;
  gap: 1.2rem;
  color: var(--ink-soft);
  font-weight: 500;
}

.main-nav a {
  transition: color 0.2s ease;
}

.main-nav a:hover {
  color: var(--ink);
}

.page-auth-only .site-header {
  width: min(560px, calc(100% - 1.4rem));
  justify-content: center;
}

.page-auth-only::before {
  background-image: linear-gradient(130deg, rgba(2, 6, 8, 0.98), rgba(3, 10, 12, 0.94)),
    repeating-linear-gradient(124deg, rgba(132, 164, 152, 0.08) 0, rgba(132, 164, 152, 0.08) 2px, transparent 2px, transparent 11px);
}

.page-auth-only::after {
  content: "";
  position: fixed;
  inset: -4%;
  z-index: -2;
  pointer-events: none;
  background-image: linear-gradient(108deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.62)),
    url("/images/anonymous.png");
  background-repeat: no-repeat, no-repeat;
  background-size: cover, min(76vw, 1120px);
  background-position: center, 70% 52%;
  opacity: 0.32;
  animation: anonymous-flicker 6.4s ease-in-out infinite, anonymous-drift 16s ease-in-out infinite;
}

.auth-only-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-only-shell {
  width: min(480px, calc(100% - 1.4rem));
  display: grid;
  gap: 0.9rem;
}

.page-auth-only .ambient {
  display: none;
}

.page-auth-only .auth-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.page-auth-only .auth-tabs {
  gap: 0.7rem;
  margin-bottom: 0.25rem;
}

.page-auth-only .auth-tab {
  border: none;
  background: rgba(13, 20, 26, 0.82);
  color: #cfd8df;
  border-radius: 10px;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.page-auth-only .auth-tab.is-active {
  background: rgba(33, 14, 20, 0.85);
  color: #fff1f1;
}

.page-auth-only .auth-form {
  margin-top: 0.85rem;
}

.page-auth-only input {
  border: none;
  background: rgba(7, 14, 20, 0.78);
  color: #e9f1f6;
  box-shadow: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.page-auth-only input:focus {
  border: none;
  box-shadow: none;
  outline: none;
}

.page-auth-only .button {
  border: none;
  border-radius: 10px;
  background: rgba(12, 21, 29, 0.86);
  color: #e8eff4;
  text-shadow: none;
  box-shadow: none;
}

.page-auth-only .button::before {
  display: none;
}

.page-auth-only .button:hover {
  transform: none;
  background: rgba(28, 14, 19, 0.86);
  box-shadow: none;
}

.auth-mini-copy {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(172deg, rgba(31, 37, 48, 0.95), rgba(22, 27, 37, 0.95));
  padding: 1.1rem 1.2rem;
}

.auth-mini-copy h1 {
  margin: 0.36rem 0 0.2rem;
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.auth-mini-copy p {
  margin: 0;
  color: var(--ink-soft);
}

.hero,
.feature-grid,
.auth-shell {
  width: min(1180px, calc(100% - 3rem));
  margin: 0 auto;
}

.hero {
  margin-top: 2.4rem;
  background: linear-gradient(152deg, rgba(31, 37, 48, 0.9), rgba(24, 29, 38, 0.9));
  border: 1px solid rgba(68, 76, 94, 0.45);
  border-radius: var(--radius-lg);
  padding: 3.2rem clamp(1.4rem, 2.4vw, 3rem);
  box-shadow: var(--shadow-soft);
}

.kicker {
  margin: 0;
  color: var(--accent-2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.hero h1 {
  margin: 0.8rem 0 1rem;
  max-width: 780px;
  font-size: clamp(1.9rem, 3.9vw, 3.6rem);
  line-height: 1.08;
}

.hero-copy {
  margin: 0;
  max-width: 680px;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  margin-top: 1.7rem;
  flex-wrap: wrap;
}

.hero-metrics {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 0.9rem;
}

.hero-metrics article {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(28, 34, 45, 0.92);
  padding: 0.9rem 1rem;
}

.hero-metrics span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.hero-metrics strong {
  font-size: 1.02rem;
}

.button {
  position: relative;
  border: 1px solid rgba(94, 255, 183, 0.45);
  border-radius: 12px;
  padding: 0.68rem 1.22rem;
  background: linear-gradient(165deg, rgba(18, 40, 31, 0.94), rgba(8, 16, 13, 0.96));
  color: #dfffea;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(74, 255, 176, 0.3);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.22s ease, opacity 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 0 0 1px rgba(12, 65, 43, 0.65) inset, 0 14px 28px rgba(0, 0, 0, 0.42), 0 0 24px rgba(41, 255, 163, 0.14);
}

.button::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(120deg, transparent 0%, rgba(145, 255, 212, 0.5) 36%, transparent 60%);
  transform: translateX(-120%);
  opacity: 0.4;
  transition: transform 0.35s ease;
  pointer-events: none;
}

.button:hover {
  transform: translateY(-2px);
  border-color: rgba(140, 255, 210, 0.78);
  box-shadow: 0 0 0 1px rgba(85, 255, 190, 0.62) inset, 0 16px 32px rgba(0, 0, 0, 0.5), 0 0 30px rgba(79, 255, 183, 0.22);
}

.button:hover::before {
  transform: translateX(130%);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  border-color: rgba(98, 126, 116, 0.38);
  box-shadow: none;
}

.button-outline {
  border-color: rgba(126, 210, 175, 0.45);
  background: linear-gradient(160deg, rgba(21, 33, 28, 0.78), rgba(12, 19, 17, 0.88));
  box-shadow: 0 0 0 1px rgba(28, 54, 44, 0.8) inset;
}

.button-quiet {
  border-color: rgba(118, 139, 132, 0.4);
  background: linear-gradient(170deg, rgba(19, 25, 23, 0.92), rgba(12, 17, 15, 0.94));
  color: #cae7d8;
  box-shadow: 0 0 0 1px rgba(16, 33, 27, 0.92) inset;
}

.button-danger {
  border-color: rgba(255, 99, 124, 0.52);
  background: linear-gradient(160deg, rgba(64, 18, 28, 0.9), rgba(31, 11, 17, 0.94));
  color: #ffe7ec;
  box-shadow: 0 0 0 1px rgba(79, 16, 28, 0.74) inset;
}

.button-danger:hover {
  border-color: rgba(255, 132, 155, 0.72);
  box-shadow: 0 0 0 1px rgba(129, 28, 48, 0.78) inset, 0 16px 32px rgba(0, 0, 0, 0.5), 0 0 28px rgba(255, 90, 123, 0.2);
}

.feature-grid {
  margin-top: 1.3rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature-grid article {
  background: rgba(24, 29, 39, 0.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.2rem;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.feature-grid article:hover {
  transform: translateY(-3px);
  box-shadow: 0 17px 30px rgba(0, 0, 0, 0.35);
}

.feature-grid h2 {
  margin: 0;
  font-size: 1.05rem;
}

.feature-grid p {
  margin: 0.55rem 0 0;
  color: var(--ink-soft);
}

.auth-shell {
  margin-top: 1.35rem;
  margin-bottom: 3rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.2rem;
}

.auth-copy {
  padding: 2rem;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(172deg, rgba(31, 37, 48, 0.9), rgba(23, 29, 40, 0.9));
}

.auth-copy h2 {
  margin: 0.8rem 0;
  font-size: clamp(1.5rem, 2.4vw, 2.3rem);
}

.auth-copy p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 48ch;
}

.auth-card {
  border-radius: 22px;
  border: 1px solid rgba(74, 84, 105, 0.45);
  background: rgba(21, 26, 35, 0.94);
  box-shadow: var(--shadow-strong);
  padding: 1.2rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.auth-tab {
  border: 1px solid var(--line);
  background: rgba(33, 40, 53, 0.92);
  color: var(--ink-soft);
  border-radius: 12px;
  padding: 0.58rem 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-tab.is-active {
  color: var(--ink);
  background: rgba(195, 44, 60, 0.2);
  border-color: rgba(195, 44, 60, 0.55);
}

.auth-form {
  display: none;
  margin-top: 1rem;
  gap: 0.8rem;
}

.auth-form.is-active {
  display: grid;
  animation: rise-in 0.28s ease;
}

.auth-form label,
.stack-form label {
  display: grid;
  gap: 0.34rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 500;
}

input,
select {
  border: 1px solid rgba(109, 121, 145, 0.42);
  border-radius: 12px;
  padding: 0.72rem 0.78rem;
  background: #10141c;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(195, 44, 60, 0.8);
  box-shadow: 0 0 0 3px rgba(195, 44, 60, 0.2);
}

.auth-message {
  margin: 0.9rem 0 0;
  min-height: 1.2rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.auth-message.is-error {
  color: var(--danger);
}

.auth-message.is-success {
  color: var(--accent-2);
}

.dash-header {
  margin-top: 1rem;
}

.dash-userbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dash-user {
  margin: 0;
  font-weight: 600;
}

.dash-userbox small {
  color: var(--ink-soft);
}

.dash-layout {
  width: min(1250px, calc(100% - 3rem));
  margin: 0 auto 1.4rem;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: start;
}

.page-dashboard .dash-header {
  display: none;
}

.page-dashboard .panel-side {
  display: none;
}

.page-dashboard .dash-layout {
  width: calc(100% - 2rem);
  margin: 0.9rem 1rem 2rem;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 2rem;
}

.page-dashboard .panel {
  border: none;
  background: transparent;
  box-shadow: none;
}

.page-dashboard .panel-rooms,
.page-dashboard .panel-game {
  padding: 0;
}

.page-dashboard .question-shell {
  border: none;
  background: transparent;
  padding: 0;
  min-height: 200px;
}

.page-dashboard .room-card,
.page-dashboard .meta-pill,
.page-dashboard .badge-light,
.page-dashboard .answer-btn,
.page-dashboard .timer-track {
  border: none;
}

.page-dashboard .room-card,
.page-dashboard .meta-pill,
.page-dashboard .badge-light {
  background: linear-gradient(160deg, rgba(18, 31, 26, 0.62), rgba(11, 20, 17, 0.58));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.page-dashboard .panel-head {
  margin-bottom: 0.8rem;
}

.page-dashboard .panel-game {
  font-size: 1.08rem;
}

.page-dashboard .panel-head h2 {
  font-size: clamp(1.6rem, 2.3vw, 2.25rem);
}

.page-dashboard .panel-actions .button {
  padding: 0.78rem 1.15rem;
  font-size: 1rem;
}

.page-dashboard .category-picker {
  font-size: 0.95rem;
}

.page-dashboard .category-picker select {
  min-width: 200px;
  padding: 0.62rem 0.72rem;
  font-size: 0.98rem;
}

.page-dashboard .room-meta {
  margin-top: 1rem;
  gap: 0.62rem;
}

.page-dashboard .meta-pill,
.page-dashboard .badge-light {
  padding: 0.48rem 0.84rem;
  font-size: 0.96rem;
}

.page-dashboard .question-shell {
  min-height: 300px;
}

.page-dashboard .question-card h3 {
  font-size: 2rem;
  margin-bottom: 0.45rem;
}

.page-dashboard .question-card p {
  font-size: 1.15rem;
  line-height: 1.58;
  margin: 0.7rem 0 1rem;
}

.page-dashboard .status-strip {
  font-size: 1.14rem;
  line-height: 1.58;
}

.page-dashboard .timer-wrap,
.page-dashboard .timer-track,
.page-dashboard #timerFill,
.page-dashboard #timerText {
  display: none !important;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(21, 26, 35, 0.95);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.34);
}

.panel-rooms,
.panel-side {
  padding: 1rem;
}

.panel-game {
  padding: 1.1rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.panel-head h2 {
  font-size: 1.02rem;
  margin: 0;
}

.badge-light {
  padding: 0.3rem 0.72rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-weight: 700;
  color: var(--ink-soft);
  background: rgba(16, 24, 21, 0.92);
}

.stack-form {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.68rem;
}

.split-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.rooms-list {
  margin-top: 1rem;
  display: grid;
  gap: 0.7rem;
}

.room-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.78rem;
  background: rgba(29, 35, 46, 0.92);
  display: grid;
  gap: 0.36rem;
}

.room-card h3 {
  margin: 0;
  font-size: 0.96rem;
}

.room-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.87rem;
}

.room-card-actions {
  margin-top: 0.3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

.room-code {
  font-family: "Sora", sans-serif;
  font-size: 0.82rem;
  color: var(--accent-2);
}

.panel-actions {
  display: inline-flex;
  gap: 0.5rem;
}

.page-dashboard .host-only {
  display: none !important;
}

.page-dashboard.is-district .host-only:not([hidden]) {
  display: inline-flex !important;
}

.category-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.category-picker select {
  min-width: 170px;
  border: 1px solid rgba(95, 113, 130, 0.46);
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  background: rgba(11, 18, 24, 0.85);
  color: var(--ink);
}

.category-picker select:disabled {
  opacity: 0.6;
}

.room-meta {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.44rem;
}

.meta-pill {
  padding: 0.34rem 0.62rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--ink-soft);
  background: rgba(15, 23, 20, 0.9);
}

.question-shell {
  margin-top: 0.85rem;
  border: 1px solid rgba(79, 92, 114, 0.45);
  background: linear-gradient(175deg, rgba(26, 32, 43, 0.95), rgba(20, 25, 34, 0.95));
  border-radius: 18px;
  min-height: 340px;
  padding: 1rem;
}

.empty-state {
  color: var(--ink-soft);
  margin: 0;
}

.question-card h3 {
  margin: 0;
  font-size: 1.18rem;
}

.question-card p {
  margin: 0.5rem 0 0.9rem;
  color: var(--ink-soft);
}

.answers-grid {
  display: grid;
  gap: 0.62rem;
}

.answer-btn {
  text-align: left;
  border: 1px solid rgba(105, 198, 160, 0.4);
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(15, 30, 24, 0.9), rgba(10, 19, 16, 0.95));
  padding: 0.76rem 0.78rem;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.answer-btn:hover {
  border-color: rgba(135, 255, 206, 0.76);
  background: linear-gradient(165deg, rgba(20, 40, 32, 0.92), rgba(12, 22, 18, 0.95));
  transform: translateY(-2px);
}

.answer-btn.is-locked {
  opacity: 0.75;
  cursor: not-allowed;
}

.answer-btn.is-correct {
  border-color: rgba(195, 44, 60, 0.75);
  background: rgba(195, 44, 60, 0.26);
}

.answer-btn.is-wrong {
  border-color: rgba(170, 72, 70, 0.42);
  background: rgba(225, 181, 179, 0.32);
}

.status-strip {
  margin-top: 0.88rem;
  color: var(--ink-soft);
}

.timer-wrap {
  margin-top: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.timer-track {
  flex: 1;
  height: 9px;
  border-radius: 999px;
  background: rgba(64, 74, 93, 0.34);
  overflow: hidden;
}

#timerFill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  transition: width 0.18s linear;
}

.side-block + .side-block {
  margin-top: 0.95rem;
}

.leaderboard {
  margin: 0.68rem 0 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.45rem;
}

.leaderboard li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-soft);
}

.leaderboard strong {
  color: var(--ink);
  font-weight: 600;
}

.toast-stack {
  margin-top: 0.7rem;
  max-height: 230px;
  overflow: auto;
  display: grid;
  gap: 0.48rem;
}

.toast-item {
  border-radius: 12px;
  padding: 0.55rem 0.62rem;
  font-size: 0.88rem;
  border: 1px solid var(--line);
  background: rgba(34, 41, 54, 0.92);
  animation: rise-in 0.3s ease;
}

.toast-item.success {
  border-color: rgba(90, 255, 180, 0.48);
  background: rgba(63, 180, 127, 0.2);
}

.toast-item.warning {
  border-color: rgba(255, 82, 114, 0.56);
  background: rgba(170, 32, 57, 0.28);
}

.toast-item.error {
  border-color: rgba(255, 109, 120, 0.65);
  background: rgba(255, 109, 120, 0.2);
}

.page-loader {
  position: fixed;
  inset: 0;
  background: rgba(13, 16, 23, 0.94);
  display: grid;
  place-content: center;
  gap: 0.8rem;
  z-index: 100;
}

.page-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.eliminated-overlay {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 45%, rgba(255, 61, 82, 0.9), rgba(106, 8, 20, 0.98));
}

.eliminated-overlay-inner {
  text-align: center;
}

.eliminated-overlay-inner p {
  margin: 0;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(3.4rem, 11vw, 9.4rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff3f5;
  text-shadow: 0 10px 48px rgba(57, 0, 10, 0.7), 0 0 24px rgba(255, 198, 208, 0.36);
}

.eliminated-overlay.is-active {
  opacity: 1;
  animation: eliminated-flash 2.35s ease forwards;
}

.role-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 230;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease;
  background: radial-gradient(circle at center, rgba(5, 12, 12, 0.5), rgba(1, 4, 4, 0.88));
}

.role-reveal-overlay.is-active {
  opacity: 1;
}

.role-reveal-content {
  width: min(900px, calc(100% - 2rem));
  border-radius: 20px;
  border: 1px solid rgba(130, 168, 153, 0.24);
  background: linear-gradient(160deg, rgba(8, 15, 14, 0.94), rgba(7, 12, 13, 0.94));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  text-align: center;
  transform: scale(0.92) translateY(18px);
  opacity: 0;
}

.role-reveal-overlay.is-active .role-reveal-content {
  animation: role-reveal-pop 0.48s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.role-reveal-phase {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: clamp(0.78rem, 1.8vw, 1rem);
  color: rgba(198, 222, 213, 0.74);
}

.role-reveal-title {
  margin: 0.45rem 0 0.28rem;
  font-family: "Sora", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 7vw, 5.2rem);
  line-height: 1.04;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #f1fff8;
  text-shadow: 0 0 18px rgba(129, 255, 199, 0.24), 0 10px 28px rgba(0, 0, 0, 0.55);
}

.role-reveal-word {
  margin: 0.2rem 0 0;
  font-size: clamp(0.92rem, 2.4vw, 1.2rem);
  color: rgba(210, 229, 223, 0.88);
}

.role-reveal-overlay.is-undercover .role-reveal-title {
  color: #ff93aa;
  text-shadow: 0 0 20px rgba(255, 77, 118, 0.38), 0 10px 28px rgba(0, 0, 0, 0.58);
}

.role-reveal-overlay.is-civil .role-reveal-title {
  color: #8dffd0;
}

.role-reveal-overlay.phase-word .role-reveal-content {
  border-color: rgba(163, 232, 205, 0.38);
}

.role-reveal-overlay.phase-word .role-reveal-title {
  animation: role-word-pulse 0.72s ease;
}

.duo-celebration {
  margin-top: 1.1rem;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(95, 228, 167, 0.46);
  background: linear-gradient(150deg, rgba(19, 41, 31, 0.86), rgba(12, 28, 23, 0.78));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(74, 222, 152, 0.2) inset;
  animation: duo-celebration-glow 1.7s ease-in-out infinite;
}

.duo-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: rgba(138, 255, 205, 0.9);
}

.duo-winners {
  margin-top: 0.62rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.winner-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(120, 255, 200, 0.54);
  background: linear-gradient(170deg, rgba(30, 65, 50, 0.92), rgba(17, 38, 31, 0.94));
  color: #e9fff4;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.26);
}

.loader-ring {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(107, 119, 145, 0.32);
  border-top-color: rgba(57, 255, 155, 0.95);
  border-radius: 50%;
  animation: spin 0.95s linear infinite;
  justify-self: center;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes eliminated-flash {
  0% {
    opacity: 0;
    transform: scale(1.06);
    filter: saturate(1);
  }

  18% {
    opacity: 1;
    transform: scale(1);
    filter: saturate(1.2);
  }

  72% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.02);
    filter: saturate(0.8);
  }
}

@keyframes role-reveal-pop {
  from {
    transform: scale(0.92) translateY(18px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@keyframes role-word-pulse {
  0% {
    transform: scale(0.88);
    opacity: 0;
  }

  55% {
    transform: scale(1.05);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes duo-celebration-glow {
  0%,
  100% {
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(74, 222, 152, 0.2) inset;
  }

  50% {
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(99, 255, 188, 0.48) inset, 0 0 28px rgba(92, 255, 173, 0.25);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes anonymous-flicker {
  0%,
  18%,
  22%,
  54%,
  58%,
  100% {
    opacity: 0.35;
    filter: brightness(1) contrast(1.1);
  }

  20% {
    opacity: 0.48;
    filter: brightness(1.18) contrast(1.22);
  }

  56% {
    opacity: 0.5;
    filter: brightness(1.25) contrast(1.26);
  }
}

@keyframes anonymous-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1.01);
  }

  50% {
    transform: translate3d(-1.5%, 1%, 0) scale(1.035);
  }

  100% {
    transform: translate3d(0, 0, 0) scale(1.01);
  }
}

@media (max-width: 1080px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }

  .page-dashboard .dash-layout {
    width: calc(100% - 2rem);
    margin: 0.8rem 1rem 1.4rem;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .panel-rooms,
  .panel-side {
    order: 2;
  }

  .panel-game {
    order: 1;
  }
}

@media (max-width: 780px) {
  .site-header,
  .dash-header,
  .hero,
  .feature-grid,
  .auth-shell,
  .dash-layout {
    width: calc(100% - 1.3rem);
  }

  .page-dashboard .dash-layout {
    width: calc(100% - 1.3rem);
    margin: 0.6rem 0.65rem 1.2rem;
  }

  .site-header,
  .dash-header {
    margin-top: 0.7rem;
  }

  .auth-only-main {
    min-height: 100vh;
    padding-bottom: 1.2rem;
  }

  .main-nav {
    display: none;
  }

  .hero {
    margin-top: 1rem;
    padding: 1.4rem 1rem;
  }

  .hero-metrics,
  .feature-grid,
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .question-shell {
    min-height: 280px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-actions {
    width: 100%;
  }

  .panel-actions .button {
    flex: 1;
  }
}
