:root {
  color-scheme: dark;
  font-family: Inter, "Helvetica Neue", sans-serif;
  color: #f4faff;
  background: #081525;
  --accent: #6bdbea;
  --muted: #b5c9df;
  --line: #30506d;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(ellipse 80% 33% at 50% 12%, #173c60, transparent);
}

.shell { width: min(100% - 36px, 418px); margin: auto; padding-bottom: 48px; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 20px 0 15px; border-bottom: 1px solid var(--line); margin-bottom: 29px; }
.top a { color: inherit; font-size: 21px; font-weight: 900; letter-spacing: -.8px; text-decoration: none; }
.top span { color: var(--accent); }
.club-logo { display: block; border-radius: 50%; }

h1 { font-size: clamp(36px, 10vw, 53px); line-height: .98; letter-spacing: -.075em; margin: 0; }
h2 { line-height: 1.08; margin: 0; }
p { color: var(--muted); margin: 10px 0 0; line-height: 1.45; }

.cover {
  position: relative;
  height: 229px;
  margin: 0 0 27px;
  border: 1px solid #28516c;
  overflow: hidden;
  border-radius: 19px;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(45deg, transparent 0 17px, #264863 18px 19px),
    #102c45;
}
.front, .back { position: absolute; width: 104px; height: 144px; border-radius: 13px; }
.back { background: #17406a; border: 1px solid #558ab5; transform: translateX(35px) rotate(16deg); }
.front {
  display: grid;
  place-items: center;
  color: #082739;
  background: var(--accent);
  border: 1px solid #b1eff5;
  box-shadow: 0 14px 26px #05111f82;
  transform: translateX(-16px) rotate(-13deg);
}
.front span { font-weight: 950; font-size: 76px; line-height: 1; }
form { margin-top: 25px; }
label { display: block; font-weight: 700; font-size: 14px; margin: 0 0 8px; }

button, input, select, .secondary { font: inherit; }
input, select, button, .secondary { min-height: 48px; border-radius: 10px; }
input, select {
  width: 100%;
  padding: 0 13px;
  color: inherit;
  background: #12263b;
  border: 1px solid #547591;
  font-size: 16px;
}
#pack { margin-bottom: 16px; }
button, .secondary {
  color: inherit;
  font-weight: 750;
  cursor: pointer;
  padding: 0 13px;
  border: 1px solid transparent;
}
button:disabled { opacity: .46; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.primary { color: #082739; background: var(--accent); }
#entry-form .primary { width: 100%; margin-top: 11px; }
.secondary { background: #12263b; border-color: var(--line); font-size: 13px; }
.room-title { display: grid; gap: 14px; margin-bottom: 19px; }
.room-title button { width: 100%; }
#invite-link { margin-bottom: 12px; }

.card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  gap: 18px;
  min-height: clamp(270px, 43svh, 365px);
  overflow: hidden;
  padding: clamp(20px, 6vw, 30px);
  color: #f4faff;
  text-align: center;
  border: 1px solid #5481ae;
  border-radius: 26px;
  background: radial-gradient(ellipse at 50% 10%, #244f77, #102840 70%);
  box-shadow: 0 16px 32px #03101f65;
}
.card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 8px;
  border: 1px solid currentColor;
  border-radius: 19px;
  opacity: .18;
  pointer-events: none;
}
.card-mark {
  width: clamp(67px, 22vw, 92px);
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid #82dcea;
  background: #185277;
  box-shadow: -9px 8px 0 #0b2944, 0 12px 24px #061a2b80;
  color: #c5f5ff;
  transform: rotate(-9deg);
}
.card-mark span { font-size: clamp(36px, 13vw, 56px); font-weight: 850; }
.card-copy { width: 100%; }
.card h2 {
  margin: 0;
  font-size: clamp(25px, 7.5vw, 33px);
  line-height: 1.04;
  letter-spacing: -.05em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.card p { color: inherit; }
#card-description { font-size: 15px; }
#card-label {
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
  margin: 0 0 15px;
}
#card-label:empty, #card-description:empty { display: none; }
.card[data-appearance="waiting"] {
  min-height: 243px;
  box-shadow: none;
  border-color: #30506d;
}
.card[data-appearance="waiting"] .card-mark { width: 48px; box-shadow: -5px 5px 0 #0b2944; }
.card[data-appearance="waiting"] .card-mark span { font-size: 29px; }
.card:is([data-appearance="player"], [data-appearance="impostor"]) {
  display: grid;
  place-items: center;
  grid-template-rows: 1fr;
  animation: card-reveal 180ms ease-out;
}
.card[data-appearance="player"] {
  color: #082739;
  background: radial-gradient(ellipse at 50% 8%, #c0f6fa, #68d9ed 82%);
  border-color: #a6eff9;
}
.card[data-appearance="impostor"] {
  color: #fff;
  background: radial-gradient(ellipse at 50% 8%, #296abb, #12376f 82%);
  border-color: #79a8e8;
}
.card:is([data-appearance="player"], [data-appearance="impostor"]) .card-mark { display: none; }
.card:is([data-appearance="player"], [data-appearance="impostor"]) h2 {
  font-size: clamp(30px, 10vw, 48px);
}
.card-action { width: 100%; margin-top: 14px; min-height: 54px; font-size: 16px; }
.card[data-appearance="player"] + .card-action,
.card[data-appearance="impostor"] + .card-action {
  color: #f4faff;
  background: #12263b;
  border-color: #547591;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@keyframes card-reveal {
  from { opacity: .65; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .card:is([data-appearance="player"], [data-appearance="impostor"]) { animation: none; }
}
.deal-controls { display: grid; grid-template-columns: 116px minmax(0, 1fr); align-items: end; gap: 10px; }
#deal-help { font-size: 14px; }
.roster { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px; }
.roster h2 { font-size: 17px; }
.roster ul { display: grid; gap: 8px; list-style: none; padding: 0; margin: 13px 0 0; }
.status { margin-top: 16px; }
.status.error { color: #ffb6a2; }
.recovery { display: inline-grid; place-items: center; text-decoration: none; margin-top: 12px; }

.host-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 24px; }
.host-nav [aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #082739; }
#private-title { margin-bottom: 17px; font-size: clamp(30px, 8vw, 42px); letter-spacing: -.055em; }
.roster li {
  display: flex;
  min-width: 0;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  background: #132940;
  font-size: 14px;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 4px 13px;
  min-height: 52px;
  border-radius: 10px;
}
.remove-player { min-height: 44px; flex: 0 0 auto; }
dialog {
  width: min(100% - 36px, 390px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: inherit;
  background: #12263b;
}
dialog::backdrop { background: #040b13b8; }
dialog form { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

#private-title { overflow-wrap: anywhere; }
.deal-summary { font-size: 14px; font-weight: 700; }
.recovery-action { width: 100%; margin-top: 20px; }
.invite-qr {
  display: block;
  width: min(100%, 228px);
  height: auto;
  aspect-ratio: 1;
  margin: 18px auto;
  border-radius: 10px;
  background: #fff;
  image-rendering: pixelated;
}
#invite-dialog label, #recovery-dialog label { margin-top: 16px; }
#invite-status:empty, #recovery-status:empty { display: none; }
dialog { max-height: calc(100svh - 30px); overflow: auto; }
