:root {
  color-scheme: dark;
  --bg: #101210;
  --panel: #191d1a;
  --panel-2: #202720;
  --line: #3a443c;
  --text: #f2f0e8;
  --muted: #bbb6a8;
  --gold: #d4a84f;
  --red: #a54242;
  --blue: #4e8aa8;
  --green: #5b9864;
  --black: #0b0c0b;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background:
    linear-gradient(180deg, rgba(10, 12, 10, 0.84), rgba(10, 12, 10, 0.97)),
    url("/assets/lobby-hall.png") center top / cover fixed,
    #101210;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 44px;
  padding: 0 14px;
  color: var(--text);
  background: #252b25;
  cursor: pointer;
}

button:hover {
  border-color: var(--gold);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.primary {
  background: var(--gold);
  color: #17140c;
  border-color: #f0cf7d;
  font-weight: 800;
}

button.danger {
  background: #3b2020;
  border-color: #7d3838;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: #0e100f;
  color: var(--text);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.app-version {
  position: fixed;
  left: 12px;
  bottom: 10px;
  z-index: 6;
  margin: 0;
  padding: 4px 7px;
  border: 1px solid rgba(187, 182, 168, 0.28);
  border-radius: 4px;
  background: rgba(11, 12, 11, 0.78);
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1;
  pointer-events: none;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--gold);
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
}

h2 {
  margin-bottom: 12px;
}

h3 {
  margin-bottom: 8px;
}

.top-actions,
.split-actions,
.join-row,
.row,
.button-row {
  display: flex;
  gap: 10px;
}

.join-row {
  flex: 1;
}

.lobby-header > :first-child {
  min-width: 0;
}

.lobby-header .hint {
  overflow-wrap: anywhere;
}

.copy-join-link {
  margin-top: 8px;
}

.icon-button {
  width: 44px;
  padding: 0;
  font-weight: 900;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, 0.82fr);
  gap: 16px;
  align-items: start;
}

.grid > *,
.lobby-grid > * {
  min-width: 0;
}

.endgame-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.endgame-screen {
  min-height: 340px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  padding: 34px 20px;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(8, 11, 8, 0.44), rgba(8, 11, 8, 0.88)),
    url("/assets/quest-board.png") center / cover;
  text-align: center;
  animation: endgame-enter 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.endgame-screen.good {
  border-color: var(--green);
}

.endgame-screen.evil {
  border-color: var(--red);
}

.endgame-screen.rogue {
  border-color: var(--gold);
}

.endgame-screen h2,
.endgame-screen h3,
.endgame-screen p {
  margin: 0;
}

.endgame-screen h2 {
  font-size: clamp(2rem, 6vw, 3.5rem);
}

.endgame-sigil {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: rgba(10, 13, 10, 0.82);
  color: var(--gold);
  font-size: 2.6rem;
  font-weight: 900;
  box-shadow: inset 0 0 20px rgba(212, 168, 79, 0.18), 0 10px 28px rgba(0, 0, 0, 0.36);
}

.endgame-screen.good .endgame-sigil {
  border-color: var(--green);
  color: #cce8d0;
  box-shadow: inset 0 0 20px rgba(91, 152, 100, 0.2), 0 10px 28px rgba(0, 0, 0, 0.36);
}

.endgame-screen.evil .endgame-sigil {
  border-color: var(--red);
  color: #f3c3c3;
  box-shadow: inset 0 0 20px rgba(165, 66, 66, 0.22), 0 10px 28px rgba(0, 0, 0, 0.36);
}

.assassination-reveal {
  min-height: 340px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  padding: 28px 20px;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(34, 7, 7, 0.54), rgba(8, 8, 8, 0.9)),
    url("/assets/quest-board.png") center / cover;
  text-align: center;
  overflow: hidden;
}

.assassination-reveal h2,
.assassination-reveal p {
  margin: 0;
}

.assassination-stage {
  position: relative;
  width: min(210px, 64vw);
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
}

.assassination-stage.is-double {
  width: min(360px, 88vw);
  aspect-ratio: 1.38 / 1;
}

.assassination-target-cards {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.assassination-target-cards:has(.assassination-target-card:only-child) {
  grid-template-columns: 1fr;
}

.assassination-target-card {
  width: 100%;
  height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(226, 218, 190, 0.48);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(18, 20, 18, 0.18), rgba(8, 9, 8, 0.88)),
    url("/assets/quest-board.png") center / cover;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.52);
  animation: assassination-card-fall 720ms cubic-bezier(0.2, 0.82, 0.22, 1) calc(var(--assassination-delay) + 950ms) both;
}

.assassination-target-card:nth-child(2) {
  animation-delay: calc(var(--assassination-delay) + 1080ms);
}

.assassination-target-card span {
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.assassination-target-card strong {
  overflow-wrap: anywhere;
  font-size: clamp(1.35rem, 6vw, 2rem);
}

.assassination-blade {
  position: absolute;
  z-index: 1;
  width: 14px;
  height: 122%;
  display: grid;
  place-items: center;
  border: 1px solid #f1eee3;
  border-radius: 999px;
  background: linear-gradient(90deg, #605f5b, #ffffff 52%, #706d66);
  color: transparent;
  box-shadow: 0 0 18px rgba(255, 238, 224, 0.72), 0 0 28px rgba(165, 30, 30, 0.8);
  opacity: 0;
  transform: translate(120px, -130px) rotate(42deg) scaleY(0.78);
  animation: assassination-strike 600ms cubic-bezier(0.16, 0.94, 0.2, 1) calc(var(--assassination-delay) + 280ms) both;
}

.assassination-confirm-dialog {
  width: min(390px, calc(100% - 24px));
  border-color: var(--red);
  background: #1a1010;
  color: var(--paper);
}

.assassination-confirm {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 24px 22px;
  text-align: center;
}

.assassination-confirm h2,
.assassination-confirm p {
  margin: 0;
}

.assassination-confirm-mark {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: #f3c3c3;
  font-size: 2.4rem;
  font-weight: 900;
  transform: rotate(45deg);
}

.assassination-mode-actions,
.messenger-target-options {
  width: 100%;
  display: grid;
  gap: 10px;
}

.assassination-mode-actions button {
  min-height: 58px;
}

.messenger-target-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid rgba(244, 222, 176, 0.26);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.messenger-target-option:has(input:checked) {
  border-color: var(--red);
  background: rgba(132, 33, 33, 0.26);
}

.messenger-target-option input {
  width: 20px;
  height: 20px;
  accent-color: var(--red);
}

.endgame-reason {
  max-width: 620px;
  color: var(--muted);
}

.endgame-winners {
  width: min(100%, 620px);
  margin-top: 8px;
}

.endgame-winners ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.endgame-winners li {
  display: grid;
  gap: 2px;
  padding: 9px;
  border-top: 1px solid rgba(242, 240, 232, 0.24);
  background: rgba(11, 13, 11, 0.56);
}

.endgame-winners span {
  color: var(--muted);
  font-size: 0.82rem;
}

.leader-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.leader-selection span {
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 800;
}

.panel {
  background: color-mix(in srgb, var(--panel), transparent 2%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.intro-panel {
  position: relative;
  overflow: hidden;
  max-width: 560px;
  margin: 9vh auto 0;
  border-color: rgba(212, 168, 79, 0.58);
  background:
    linear-gradient(135deg, rgba(12, 15, 12, 0.76), rgba(12, 15, 12, 0.94)),
    url("/assets/lobby-hall.png") center / cover;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.36);
}

.intro-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.intro-panel > * {
  position: relative;
}

.home-screen .app-shell {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

.home-screen .topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  min-height: 88px;
  padding: 18px 32px;
}

.home-screen .topbar h1 {
  display: none;
}

.landing-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  align-items: end;
  padding: 132px max(32px, calc((100% - 1120px) / 2 + 32px)) 56px;
  overflow: hidden;
  background: url("/assets/lobby-hall.png") center / cover;
}

.landing-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: rgba(7, 10, 8, 0.55);
}

.landing-content {
  width: min(100%, 560px);
  animation: landing-enter 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.landing-content .eyebrow {
  margin-bottom: 8px;
  font-size: 0.86rem;
}

.landing-title {
  margin: 0;
  color: #f4deb0;
  font-size: 6.5rem;
  line-height: 0.9;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.52);
}

.landing-subtitle {
  max-width: 360px;
  margin: 20px 0 30px;
  color: #f2f0e8;
  font-size: 1.2rem;
  line-height: 1.35;
}

.landing-menu,
.landing-form {
  display: grid;
  gap: 10px;
  width: min(100%, 420px);
}

.landing-menu[hidden],
.landing-form[hidden] {
  display: none;
}

.landing-action {
  min-height: 56px;
  padding: 0 18px;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: left;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
}

.landing-form {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.landing-form label {
  grid-column: 1 / -1;
  color: #f2f0e8;
}

.landing-form .primary {
  min-width: 180px;
}

.landing-back {
  width: 44px;
  padding: 0;
  font-size: 1.25rem;
}

.landing-message {
  min-height: 1.35em;
  margin: 14px 0 0;
  color: #f4c0c0;
  font-size: 0.92rem;
}

@keyframes landing-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hint,
.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.code-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  color: var(--gold);
  background: linear-gradient(135deg, #211b0d, #12150f);
  box-shadow: inset 0 0 0 1px rgba(240, 207, 125, 0.14), 0 6px 18px rgba(0, 0, 0, 0.22);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.players-list,
.history-list,
.role-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.participants-disclosure {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 16, 13, 0.72);
  overflow: hidden;
}

.participants-disclosure summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 1.18rem;
  font-weight: 900;
  list-style: none;
}

.participants-disclosure summary::-webkit-details-marker {
  display: none;
}

.participants-disclosure summary::after {
  content: "+";
  margin-left: auto;
  color: var(--gold);
  font-size: 1.35rem;
  font-weight: 400;
}

.participants-disclosure[open] summary {
  border-bottom: 1px solid var(--line);
}

.participants-disclosure[open] summary::after {
  content: "-";
}

.participants-disclosure summary b {
  min-width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(212, 168, 79, 0.5);
  border-radius: 999px;
  color: var(--gold);
  font-size: 0.78rem;
}

.participants-disclosure .players-list {
  padding: 10px;
  animation: participants-open 180ms ease-out both;
}

@keyframes participants-open {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.player-item,
.history-item,
.role-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(30, 37, 30, 0.92), rgba(15, 18, 15, 0.96));
}

.player-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.seat {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(212, 168, 79, 0.38);
  background: radial-gradient(circle at 35% 30%, #3b4639, #1a201a);
  color: var(--gold);
  font-weight: 900;
  flex: 0 0 auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.pill.good {
  color: #cce8d0;
  border-color: var(--green);
  background: rgba(91, 152, 100, 0.14);
}

.pill.evil {
  color: #f3c3c3;
  border-color: var(--red);
  background: rgba(165, 66, 66, 0.16);
}

.table {
  aspect-ratio: 1.25 / 1;
  min-height: 260px;
  position: relative;
  border: 1px solid rgba(212, 168, 79, 0.5);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse at center, rgba(212, 168, 79, 0.22), rgba(17, 20, 17, 0.46) 42%, rgba(8, 10, 8, 0.88) 90%),
    url("/assets/lobby-hall.png") center / cover;
  box-shadow: inset 0 0 54px rgba(0, 0, 0, 0.55), 0 12px 30px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.table-center {
  position: absolute;
  inset: 31%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(212, 168, 79, 0.62);
  border-radius: 999px;
  color: var(--gold);
  text-align: center;
  font-weight: 900;
  background: rgba(13, 16, 13, 0.68);
  box-shadow: inset 0 0 22px rgba(212, 168, 79, 0.12);
}

.table-player {
  position: absolute;
  width: 116px;
  max-width: 116px;
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 6px;
  border: 1px solid rgba(212, 168, 79, 0.32);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(40, 49, 40, 0.96), rgba(18, 22, 18, 0.98));
  box-shadow: 0 7px 15px rgba(0, 0, 0, 0.3);
  text-align: center;
  font-size: 0.84rem;
  transform: translate(-50%, -50%);
}

.table-player strong,
.table-player small,
.player-main strong,
.endgame-winners strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.table-player strong {
  width: 100%;
  line-height: 1.15;
}

.table-player.draggable {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.table-player.dragging {
  z-index: 3;
  cursor: grabbing;
  border-color: var(--gold);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.table-hint {
  margin: 9px 0 0;
}

.remove-player {
  width: 30px;
  min-height: 30px;
  padding: 0;
  border-color: #7d3838;
  background: #3b2020;
  color: #f3c3c3;
  font-size: 1.1rem;
  line-height: 1;
}

.card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: linear-gradient(180deg, #222921, #111411);
}

.card p,
.role-reveal p,
.role-reveal-info span,
.role-reveal-info small {
  overflow-wrap: anywhere;
}

.card.good {
  border-color: var(--green);
}

.card.evil {
  border-color: var(--red);
}

.card-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.role-illustration {
  width: min(100%, 340px);
  aspect-ratio: 1 / 1;
  margin: 0 auto 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: #111411;
  background-repeat: no-repeat;
  background-size: 300% 200%;
  background-position: 0 0;
}

.role-thumb {
  width: 56px;
  height: 56px;
  grid-row: span 2;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: #111411;
  background-repeat: no-repeat;
  background-size: 300% 200%;
  background-position: 0 0;
}

.good-1,
.good-2,
.good-3,
.good-4,
.good-5,
.good-6 {
  background-image: url("/assets/good-roles.png");
}

.evil-1,
.evil-2,
.evil-3,
.evil-4,
.evil-5,
.evil-6 {
  background-image: url("/assets/evil-roles.png");
}

.good-1,
.evil-1 {
  background-position: 0 0;
}

.good-2,
.evil-2 {
  background-position: 50% 0;
}

.good-3,
.evil-3 {
  background-position: 100% 0;
}

.good-4,
.evil-4 {
  background-position: 0 100%;
}

.good-5,
.evil-5 {
  background-position: 50% 100%;
}

.good-6,
.evil-6 {
  background-position: 100% 100%;
}

/* Portraits have differing native ratios, so preserve every edge of the artwork. */
.role-merlin,
.role-percival,
.role-servant,
.role-assassin,
.role-minion,
.role-morgana,
.role-mordred,
.role-oberon,
.role-lancelot-good,
.role-lancelot-evil,
.role-lunatic,
.role-brute,
.role-revealer,
.role-cleric,
.role-trickster,
.role-troublemaker,
.role-untrustworthy-servant,
.role-messenger-senior,
.role-messenger-junior,
.role-messenger-evil,
.role-sorcerer-good,
.role-sorcerer-evil,
.role-rogue-good,
.role-rogue-evil {
  background-color: #0c100e;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.role-merlin { background-image: url("/assets/roles/merlin.png"); }
.role-percival { background-image: url("/assets/roles/percival.png"); }
.role-servant { background-image: url("/assets/roles/servant.png"); }
.role-assassin { background-image: url("/assets/roles/assassin.png"); }
.role-minion { background-image: url("/assets/roles/minion.png"); }
.role-morgana { background-image: url("/assets/roles/morgana.png"); }
.role-mordred { background-image: url("/assets/roles/mordred.png"); }
.role-oberon { background-image: url("/assets/roles/oberon.png"); }
.role-lancelot-good { background-image: url("/assets/roles/lancelot-good.png"); }
.role-lancelot-evil { background-image: url("/assets/roles/lancelot-evil.png"); }
.role-lunatic { background-image: url("/assets/roles/lunatic.png"); }
.role-brute { background-image: url("/assets/roles/brute.png"); }
.role-revealer { background-image: url("/assets/roles/revealer.png"); }
.role-cleric { background-image: url("/assets/roles/cleric.png"); }
.role-trickster { background-image: url("/assets/roles/trickster.png"); }
.role-troublemaker { background-image: url("/assets/roles/troublemaker.png"); }
.role-untrustworthy-servant { background-image: url("/assets/roles/untrustworthy-servant.png"); }
.role-messenger-senior { background-image: url("/assets/roles/messenger-senior.png"); }
.role-messenger-junior { background-image: url("/assets/roles/messenger-junior.png"); }
.role-messenger-evil { background-image: url("/assets/roles/messenger-evil.png"); }
.role-sorcerer-good { background-image: url("/assets/roles/sorcerer-good.png"); }
.role-sorcerer-evil { background-image: url("/assets/roles/sorcerer-evil.png"); }
.role-rogue-good { background-image: url("/assets/roles/rogue-good.png"); }
.role-rogue-evil { background-image: url("/assets/roles/rogue-evil.png"); }

.quest-board {
  position: relative;
  min-height: 350px;
  padding: 16px;
  border: 1px solid rgba(212, 168, 79, 0.55);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(10, 12, 10, 0.2), rgba(10, 12, 10, 0.78)),
    url("/assets/quest-board.png") center / cover;
  overflow: hidden;
}

.quest-reveal {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 24px;
  background: rgba(8, 10, 8, 0.92);
  text-align: center;
}

.quest-reveal h2 {
  margin: 0;
  text-align: center;
}

.quest-reveal .eyebrow,
.quest-reveal .muted {
  margin: 0;
}

.quest-reveal-cards {
  width: 100%;
  min-height: 140px;
  display: grid;
  grid-template-columns: repeat(auto-fit, 96px);
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.quest-result-card {
  box-sizing: border-box;
  width: 96px;
  aspect-ratio: 2 / 3;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171913 center / 100% 100% no-repeat;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  background-position: 50% 50%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.quest-result-card.scheduled {
  opacity: 0;
  transform: translateY(18px) scale(0.9);
  animation: quest-card-enter 550ms cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms) both;
}

.quest-result-card.success {
  border-color: var(--green);
  background-image: linear-gradient(180deg, rgba(15, 46, 22, 0.18), rgba(7, 20, 10, 0.72)), url("/assets/quest-success.png");
  color: #e4f4e7;
}

.quest-result-card.fail {
  border-color: var(--red);
  background-image: linear-gradient(180deg, rgba(70, 16, 16, 0.16), rgba(35, 7, 7, 0.76)), url("/assets/quest-failure.png");
  color: #ffe4e4;
}

.quest-result-card.magic {
  border-color: #8d74d8;
  background-image: linear-gradient(180deg, rgba(64, 37, 106, 0.2), rgba(24, 13, 52, 0.74)), url("/assets/quest-magic.png");
  color: #eee8ff;
}

.quest-result-card.good-message,
.quest-result-card.rogue-success {
  border-color: #5b9864;
  color: #e4f4e7;
}

.quest-result-card.good-message {
  background-image: linear-gradient(180deg, rgba(21, 78, 43, 0.22), rgba(7, 28, 16, 0.78)), url("/assets/quest-good-message.png");
}

.quest-result-card.evil-message {
  background-image: linear-gradient(180deg, rgba(94, 27, 27, 0.2), rgba(38, 8, 8, 0.8)), url("/assets/quest-evil-message.png");
}

.quest-result-card.rogue-success {
  background-image: linear-gradient(180deg, rgba(21, 78, 43, 0.2), rgba(7, 28, 16, 0.8)), url("/assets/quest-rogue-success.png");
}

.quest-result-card.rogue-fail {
  background-image: linear-gradient(180deg, rgba(94, 27, 27, 0.2), rgba(38, 8, 8, 0.8)), url("/assets/quest-rogue-fail.png");
}

.quest-result-card.evil-message,
.quest-result-card.rogue-fail {
  border-color: #a54242;
  color: #ffe4e4;
}

.result-sigil {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 1.35rem;
  font-weight: 900;
}

.history-quest-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.history-quest-card {
  box-sizing: border-box;
  width: 54px;
  min-height: 0;
  aspect-ratio: 2 / 3;
  position: relative;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #171913 center / 100% 100% no-repeat;
  background-position: 50% 50%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  color: #f7f3e8;
  box-shadow: inset 0 -36px 20px rgba(0, 0, 0, 0.64);
  text-align: center;
}

.history-quest-card b {
  position: absolute;
  left: 50%;
  bottom: 29px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  margin: 0;
  border: 1px solid currentColor;
  border-radius: 999px;
  transform: translateX(-50%);
}

.history-quest-card small {
  position: absolute;
  right: 2px;
  bottom: 7px;
  left: 2px;
  display: block;
  overflow: hidden;
  color: inherit;
  font-size: 0.54rem;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-quest-card.success { background-image: url("/assets/quest-success.png"); color: #e4f4e7; }
.history-quest-card.fail { background-image: url("/assets/quest-failure.png"); color: #ffe4e4; }
.history-quest-card.magic { background-image: url("/assets/quest-magic.png"); color: #eee8ff; }
.history-quest-card.good-message { background-image: url("/assets/quest-good-message.png"); color: #e4f4e7; }
.history-quest-card.evil-message { background-image: url("/assets/quest-evil-message.png"); color: #ffe4e4; }
.history-quest-card.rogue-success { background-image: url("/assets/quest-rogue-success.png"); color: #e4f4e7; }
.history-quest-card.rogue-fail { background-image: url("/assets/quest-rogue-fail.png"); color: #ffe4e4; }

.board-heading,
.current-expedition {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.board-heading h2 {
  margin-bottom: 0;
}

.leader-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  max-width: min(100%, 280px);
  padding: 5px 10px 5px 5px;
  border: 1px solid rgba(212, 168, 79, 0.78);
  border-radius: 999px;
  background: rgba(22, 19, 11, 0.86);
  color: #f4deb0;
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: inset 0 0 16px rgba(212, 168, 79, 0.14), 0 6px 18px rgba(0, 0, 0, 0.22);
}

.leader-sigil {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #f0cf7d;
  border-radius: 999px;
  background: #5c4619;
  color: #fff2cf;
  font-size: 0.78rem;
}

.leader-chip span {
  color: #d8c79c;
}

.leader-chip strong {
  min-width: 0;
  overflow: hidden;
  color: #fff4d9;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 30px 0 24px;
}

.mission-space {
  min-height: 126px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 8px 4px;
  border: 1px solid rgba(242, 240, 232, 0.3);
  border-radius: 50%;
  background: rgba(14, 17, 14, 0.78);
  color: var(--muted);
  text-align: center;
}

.mission-space strong {
  font-size: 0.78rem;
}

.mission-space small {
  min-height: 15px;
  font-size: 0.68rem;
}

.mission-space .failure-rule {
  min-height: 25px;
  max-width: 82px;
  color: #f0cf7d;
  line-height: 1.15;
}

.mission-number {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-weight: 900;
}

.mission-space.current {
  color: #f5d987;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 79, 0.18);
}

.mission-space.success {
  color: #d9f2de;
  border-color: var(--green);
  background: rgba(27, 79, 37, 0.82);
}

.mission-space.failure {
  color: #f4d0d0;
  border-color: var(--red);
  background: rgba(96, 25, 25, 0.84);
}

.current-expedition {
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(242, 240, 232, 0.28);
  border-radius: var(--radius);
  background: rgba(10, 12, 10, 0.75);
}

.current-expedition span {
  color: var(--muted);
  text-align: right;
  font-size: 0.9rem;
}

.module-sigils {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.module-sigil {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(212, 168, 79, 0.45);
  border-radius: 999px;
  background: rgba(10, 12, 10, 0.8);
  color: #d8c79c;
  font-size: 0.76rem;
  font-weight: 900;
}

.module-sigil.is-active {
  border-color: var(--gold);
  background: #58431a;
  color: #fff2cf;
  box-shadow: 0 0 0 3px rgba(212, 168, 79, 0.15);
}

.module-sigil.lady { border-color: var(--blue); color: #c3e4f3; }
.module-sigil.messengers { border-color: var(--green); color: #d0ead5; }
.module-sigil.rogues { border-color: #8d74d8; color: #e8e1ff; }
.module-sigil.plotCards { border-color: var(--red); color: #f4d0d0; }

.secret-result {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(212, 168, 79, 0.44);
  border-radius: var(--radius);
  background: rgba(10, 12, 10, 0.78);
  color: var(--muted);
  font-size: 0.82rem;
}

.secret-result {
  color: var(--text);
}

.game-scene-enter {
  animation: parchment-unfurl 680ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transform-origin: center top;
}

@keyframes parchment-unfurl {
  from {
    clip-path: inset(44% 0 44% 0);
    opacity: 0.25;
    transform: scaleY(0.22);
  }
  to {
    clip-path: inset(0 0 0 0);
    opacity: 1;
    transform: scaleY(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-scene-enter {
    animation: none;
  }
}

.loyalty-guide {
  display: grid;
  grid-template-columns: minmax(128px, 0.52fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 178px;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid rgba(212, 168, 79, 0.48);
  border-radius: var(--radius);
  background: #111411;
}

.loyalty-guide.compact {
  min-height: 132px;
}

.loyalty-art {
  min-height: 100%;
  background:
    linear-gradient(90deg, rgba(9, 14, 18, 0.08), rgba(17, 20, 17, 0.16)),
    url("/assets/loyalty-check.png") center / cover;
}

.loyalty-copy {
  align-self: center;
  padding: 14px 16px 14px 0;
}

.loyalty-copy .eyebrow,
.loyalty-copy h3,
.loyalty-copy p {
  margin: 0;
}

.loyalty-copy h3 {
  margin-top: 4px;
  font-size: 1.05rem;
}

.loyalty-copy p:not(.eyebrow) {
  margin-top: 8px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.expedition-history {
  margin-top: 16px;
}

.history-item.expedition.success {
  border-color: rgba(91, 152, 100, 0.75);
}

.history-item.expedition.failure {
  border-color: rgba(165, 66, 66, 0.75);
}

.public-votes {
  margin-top: 14px;
}

.public-vote {
  border-color: rgba(212, 168, 79, 0.5);
}

.phase-banner {
  border-left: 4px solid var(--gold);
  padding: 10px 12px;
  background: #171913;
  border-radius: var(--radius);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.check-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #1d241d, #111411);
  color: var(--text);
}

.check-card input {
  width: 18px;
  min-height: 18px;
}

.check-card:has(input:checked) {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(212, 168, 79, 0.2);
}

.check-card.selected {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(212, 168, 79, 0.2);
}

.check-card span {
  display: grid;
  gap: 3px;
}

.check-card small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.check-card.role-choice.good {
  border-left: 3px solid var(--green);
}

.check-card.role-choice.evil {
  border-left: 3px solid var(--red);
}

.check-card.is-disabled {
  opacity: 0.48;
  filter: grayscale(0.45);
}

.role-selection-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.game-setup {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 12px;
  border: 1px solid rgba(212, 168, 79, 0.42);
  border-radius: var(--radius);
  background: rgba(23, 27, 21, 0.76);
}

.game-setup-heading,
.faction-setup,
.mission-setup-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
}

.game-setup-heading h3,
.game-setup-heading span {
  margin: 0;
}

.game-setup-heading span {
  color: var(--muted);
  font-size: 0.8rem;
}

.faction-setup {
  align-items: stretch;
}

.faction-setup label,
.mission-setup-row label {
  min-width: 0;
  flex: 1;
}

.faction-setup input,
.mission-setup-row input {
  min-width: 0;
  text-align: center;
}

.mission-setup-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mission-setup-row {
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(187, 182, 168, 0.14);
}

.mission-setup-row > strong {
  flex: 0 0 28px;
  color: #f4deb0;
}

.faction-counter,
.role-faction-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.faction-counter {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #151915;
}

.faction-counter.good {
  border-color: var(--green);
  color: #cce8d0;
}

.faction-counter.evil {
  border-color: var(--red);
  color: #f3c3c3;
}

.faction-counter b {
  font-size: 1.06rem;
}

.role-faction-group {
  margin-top: 16px;
}

.role-faction-heading {
  margin-bottom: 8px;
}

.role-faction-heading h3 {
  margin: 0;
}

.role-faction-heading span {
  color: var(--muted);
  font-size: 0.84rem;
}

.test-mode {
  margin-top: 12px;
}

.compact-check {
  margin-top: 10px;
}

.message {
  min-height: 26px;
  margin-top: 10px;
  color: #f0cf7d;
}

.connection-status {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #141714;
  font-size: 0.72rem;
  font-weight: 800;
}

.connection-status.online {
  color: #cce8d0;
  border-color: var(--green);
}

.connection-status.offline,
.connection-status.reconnecting {
  color: #f0cf7d;
  border-color: var(--gold);
}

dialog {
  width: min(680px, calc(100dvw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.role-reveal-dialog {
  width: min(430px, calc(100dvw - 24px));
  border-color: var(--gold);
  background: #121512;
}

.role-hidden-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 280px;
  padding: 26px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(11, 14, 11, 0.6), rgba(11, 14, 11, 0.92)),
    url("/assets/quest-board.png") center / cover;
  text-align: center;
}

.role-hidden-card h2,
.role-hidden-card p {
  margin: 0;
}

.card-privacy-button {
  width: 100%;
  margin-top: 14px;
}

.private-lady-memory {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  background: rgba(15, 25, 23, 0.88);
}

.private-lady-memory.good { border-left-color: var(--green); }
.private-lady-memory.evil { border-left-color: var(--red); }

.private-lady-memory .eyebrow,
.private-lady-memory strong,
.private-lady-memory small {
  margin: 0;
}

.private-lady-memory small {
  color: var(--muted);
  line-height: 1.35;
}

.private-lancelot-memory,
.lancelot-alert {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(212, 168, 79, 0.7);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  background: rgba(49, 37, 12, 0.42);
}

.private-lancelot-memory.good { border-left-color: var(--green); }
.private-lancelot-memory.evil { border-left-color: var(--red); }

.private-lancelot-memory .eyebrow,
.private-lancelot-memory strong,
.private-lancelot-memory small,
.lancelot-alert .eyebrow,
.lancelot-alert h3,
.lancelot-alert p {
  margin: 0;
}

.private-lancelot-memory small,
.lancelot-alert p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.4;
}

.private-messenger-memory {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(86, 136, 193, 0.5);
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  background: rgba(12, 24, 39, 0.62);
}

.private-messenger-memory .eyebrow,
.private-messenger-memory strong,
.private-messenger-memory small {
  margin: 0;
}

.private-messenger-memory small {
  color: var(--muted);
  line-height: 1.35;
}

.lancelot-alert h3 {
  color: #f4deb0;
}

.quest-card-dialog {
  width: min(390px, calc(100% - 24px));
  border-color: var(--gold);
  background: #121512;
}

.quest-card-confirm {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
}

.quest-card-confirm h2,
.quest-card-confirm p {
  margin: 0;
}

.quest-card-confirm-art {
  width: 142px;
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 6px;
  background-position: 50% 50%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.46);
}

.quest-card-confirm-art span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: rgba(10, 12, 10, 0.82);
  font-size: 1.7rem;
  font-weight: 900;
}

.quest-card-confirm-art.success {
  border-color: var(--green);
  background-image: linear-gradient(180deg, rgba(15, 46, 22, 0.12), rgba(7, 20, 10, 0.72)), url("/assets/quest-success.png");
  color: #e4f4e7;
}

.quest-card-confirm-art.fail {
  border-color: var(--red);
  background-image: linear-gradient(180deg, rgba(70, 16, 16, 0.12), rgba(35, 7, 7, 0.76)), url("/assets/quest-failure.png");
  color: #ffe4e4;
}

.quest-card-confirm-actions {
  width: 100%;
  justify-content: center;
}

.turn-action-dialog {
  width: min(470px, calc(100% - 24px));
  padding: 0;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: #111510;
  color: var(--paper);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.72);
}

.turn-action-dialog::backdrop {
  background: rgba(3, 5, 3, 0.78);
}

.turn-action {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 22px;
  text-align: center;
}

.turn-action h2,
.turn-action p {
  margin: 0;
}

.turn-action-team {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(212, 168, 79, 0.46);
  border-radius: 6px;
  background: rgba(212, 168, 79, 0.08);
  color: var(--paper);
}

.turn-action-team small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.pending-voters {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(212, 168, 79, 0.46);
  border-radius: 6px;
  background: rgba(212, 168, 79, 0.08);
  color: var(--paper);
}

.pending-voters strong {
  color: var(--gold);
}

.pending-voters span {
  overflow-wrap: anywhere;
}

.mission-team-members {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.mission-team-member {
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(226, 218, 190, 0.2);
  border-radius: 999px;
  background: rgba(7, 10, 8, 0.55);
  color: var(--paper);
  font-size: 0.84rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.mission-team-member.was-on-previous-quest {
  border-color: rgba(109, 196, 129, 0.72);
  background: rgba(20, 89, 42, 0.48);
  color: #bcefc7;
}

.turn-action-buttons,
.turn-card-grid {
  width: 100%;
  display: grid;
  gap: 10px;
}

.turn-action-buttons {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.turn-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.turn-player-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.lady-result-dialog {
  width: min(390px, calc(100% - 24px));
  border-color: var(--blue);
  background: #101714;
}

.lady-result {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 22px;
  text-align: center;
}

.lady-result h2,
.lady-result p {
  margin: 0;
}

.lady-result-sigil {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: rgba(8, 12, 10, 0.82);
  font-size: 2.2rem;
  font-weight: 900;
}

.lady-result-sigil.good { color: #cce8d0; border-color: var(--green); }
.lady-result-sigil.evil { color: #f3c3c3; border-color: var(--red); }

.recruitment-notice-dialog {
  width: min(390px, calc(100% - 24px));
  border-color: var(--red);
  background: #1a0f10;
  color: var(--paper);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.78), inset 0 0 54px rgba(145, 26, 26, 0.2);
}

.recruitment-notice {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 26px 22px;
  text-align: center;
}

.recruitment-notice h2,
.recruitment-notice p {
  margin: 0;
}

.recruitment-notice-sigil {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 2px solid var(--red);
  border-radius: 50%;
  background: rgba(90, 14, 17, 0.5);
  color: #f3c3c3;
  font-size: 2.2rem;
  font-weight: 900;
  box-shadow: 0 0 24px rgba(165, 66, 66, 0.45);
}

.easter-egg-dialog {
  width: min(390px, calc(100% - 24px));
  border-color: var(--red);
  background: #1c0b0b;
  color: #ffe4e4;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.78), inset 0 0 54px rgba(145, 26, 26, 0.22);
}

.easter-egg-dialog::backdrop {
  background: rgba(10, 2, 2, 0.84);
}

.easter-egg {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 26px 22px;
  text-align: center;
}

.easter-egg p {
  margin: 0;
}

.easter-egg-title {
  color: #ffb0a7;
  font-size: clamp(1.45rem, 7vw, 2.1rem);
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.74);
}

.module-owner-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.turn-card-choice {
  position: relative;
  min-height: 128px;
  display: grid;
  align-content: end;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: #171913;
  background-position: 50% 50%;
  background-size: cover;
  background-repeat: no-repeat;
  color: #f7f3e8;
  font-size: 1rem;
  text-shadow: 0 2px 8px #000;
  box-shadow: inset 0 -52px 30px rgba(0, 0, 0, 0.68);
}

.turn-card-choice.success { border-color: var(--green); background-image: url("/assets/quest-success.png"); }
.turn-card-choice.fail { border-color: var(--red); background-image: url("/assets/quest-failure.png"); }
.turn-card-choice.magic { border-color: #8d74d8; background-image: url("/assets/quest-magic.png"); }
.turn-card-choice.good-message { border-color: #5b9864; background-image: url("/assets/quest-good-message.png"); }
.turn-card-choice.evil-message { border-color: #a54242; background-image: url("/assets/quest-evil-message.png"); }
.turn-card-choice.rogue-success { border-color: #5b9864; background-image: url("/assets/quest-rogue-success.png"); }
.turn-card-choice.rogue-fail { border-color: #a54242; background-image: url("/assets/quest-rogue-fail.png"); }

.role-reveal {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18px;
  text-align: center;
  animation: role-reveal-enter 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.role-reveal .eyebrow,
.role-reveal p,
.role-reveal h2 {
  margin: 0;
}

.role-reveal-art {
  width: min(100%, 270px);
  aspect-ratio: 1 / 1;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background-color: #111411;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.role-reveal-info {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #181d18;
}

.role-reveal-info small,
.role-reveal-info span {
  color: var(--muted);
}

@keyframes role-reveal-enter {
  from { opacity: 0; transform: translateY(18px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes endgame-enter {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes assassination-strike {
  0% { opacity: 0; transform: translate(120px, -130px) rotate(42deg) scaleY(0.78); }
  30% { opacity: 1; }
  78% { opacity: 1; transform: translate(0, 0) rotate(42deg) scaleY(1); }
  100% { opacity: 0; transform: translate(-38px, 42px) rotate(42deg) scaleY(1); }
}

@keyframes assassination-card-fall {
  0% { filter: saturate(1); transform: rotate(0deg) scale(1); }
  45% { filter: saturate(0.35) contrast(1.3); transform: rotate(-3deg) scale(0.98); }
  100% { filter: grayscale(1) brightness(0.38); opacity: 0.38; transform: translateY(18px) rotate(-8deg) scale(0.95); }
}

@keyframes board-reveal-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes quest-card-enter {
  from { opacity: 0; transform: translateY(26px) rotateY(72deg) scale(0.82); }
  to { opacity: 1; transform: translateY(0) rotateY(0) scale(1); }
}

.modal {
  padding: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
}

.modal-body {
  padding: 16px;
}

.modal-body a {
  color: var(--gold);
}

.empty {
  min-height: 90px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 820px), (pointer: coarse) {
  .app-shell {
    padding: 12px;
  }

  .home-screen .topbar {
    min-height: 70px;
    padding: 12px 18px;
  }

  .landing-hero {
    min-height: 100svh;
    align-items: end;
    padding: 104px 22px 36px;
    background-position: 58% center;
  }

  .landing-title {
    font-size: 4.2rem;
  }

  .landing-subtitle {
    margin: 16px 0 24px;
    font-size: 1.05rem;
  }

  .landing-menu,
  .landing-form {
    width: 100%;
  }

  .landing-form .primary {
    min-width: 0;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .lobby-grid {
    grid-template-columns: 1fr;
  }

  .endgame-detail-grid {
    grid-template-columns: 1fr;
  }

  .split-actions,
  .join-row,
  .button-row,
  .leader-selection {
    flex-direction: column;
  }

  .leader-selection {
    align-items: stretch;
  }

  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .lobby-header {
    align-items: flex-start !important;
    flex-wrap: wrap;
  }

  .lobby-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .faction-setup,
  .mission-setup-row {
    align-items: stretch;
  }

  .table-player {
    width: min(94px, 25vw);
    max-width: min(94px, 25vw);
    font-size: 0.76rem;
  }

  .role-illustration {
    width: min(100%, 290px);
  }

  .quest-reveal {
    padding: 12px;
  }

  .quest-result-card {
    width: 62px;
    font-size: 0.72rem;
  }

  .quest-reveal-cards {
    grid-template-columns: repeat(auto-fit, 62px);
  }

  .turn-action {
    padding: 18px;
  }

  .turn-card-choice {
    min-height: 112px;
  }

  .result-sigil {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .quest-board {
    min-height: 0;
  }

  .loyalty-guide {
    grid-template-columns: 1fr;
  }

  .loyalty-art {
    min-height: 150px;
  }

  .loyalty-copy {
    padding: 0 14px 14px;
  }

  .board-heading,
  .current-expedition {
    align-items: flex-start;
    flex-direction: column;
  }

  .current-expedition span {
    text-align: left;
  }

  .mission-track {
    gap: 5px;
    margin: 18px 0;
  }

  .mission-space {
    min-height: 86px;
    border-radius: var(--radius);
  }

  .mission-space strong,
  .mission-space small {
    font-size: 0.62rem;
  }
}
