@import "./card-badges.css";
@import "./scrollbars.css";

html {
  scrollbar-gutter: stable;
}

:root {
  color-scheme: dark;
  --ink: #f8f2e6;
  --muted: #a8b7ce;
  --gold: #ffc95b;
  --navy: #101d37;
  --line: #ffffff1c;
  font:
    16px/1.55 "Trebuchet MS",
    system-ui,
    sans-serif;
  background: #101d37;
  color: var(--ink);
}
/* Async hand population must not anchor the viewport to the footer. */
html:has(.battle-panel:not([hidden])) {
  overflow-anchor: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: min(320px, 100%);
  background:
    radial-gradient(ellipse at 80% 8%, #34528944, transparent 42%), #101d37;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #8ce5f2;
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
.skip {
  position: fixed;
  left: 12px;
  top: 12px;
  clip-path: inset(50%);
  padding: 12px;
  background: var(--gold);
  color: #101d37;
  z-index: 10;
}
.skip:focus-visible {
  clip-path: none;
}
.header {
  min-height: 96px;
  padding: 20px max(24px, calc((100vw - 1280px) / 2));
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  background: #101d37dd;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.5px;
}
.brand-crown {
  font-size: 40px;
  line-height: 1;
  color: var(--gold);
}
.navigation {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 3px;
  flex-wrap: wrap;
}
.nav-button {
  position: relative;
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--muted);
  background: none;
  font-size: 13px;
  font-weight: 700;
}
.nav-button[aria-current] {
  color: var(--gold);
  background: #ffc95b11;
}
.nav-button:hover {
  color: white;
  background: #ffffff08;
}
.identity {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  font-size: 13px;
  font-weight: 700;
  max-width: 180px;
  overflow-wrap: anywhere;
}
.identity small {
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 2px;
}
.player-profile {
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
}
.profile-avatar {
  display: inline-grid;
  place-items: center;
  width: 1.85em;
  height: 1.85em;
  margin-right: 0.15em;
  border: 1px solid hsl(var(--avatar-hue) 65% 72% / 65%);
  border-radius: 35%;
  background: linear-gradient(
    145deg,
    hsl(var(--avatar-hue) 55% 43%),
    hsl(var(--avatar-hue) 50% 24%)
  );
  box-shadow:
    inset 0 1px 2px #fff4,
    0 2px 4px #0004;
  font-size: 0.85em;
  line-height: 1;
  vertical-align: middle;
}
.profile-ai {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid #b6cae955;
  border-radius: 5px;
  color: #b6cae9;
  font-size: 10px;
  font-weight: normal;
  letter-spacing: normal;
  vertical-align: middle;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 21px;
  border: 1px solid #ffffff30;
  border-radius: 8px;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  color: var(--ink);
  background: #263854;
  transition:
    transform 0.15s,
    background 0.15s;
}
.button:hover {
  background: #354d71;
  transform: translateY(-1px);
}
.button.gold {
  background: var(--gold);
  color: #241c0e;
  border-color: #ffe19a;
  box-shadow:
    0 4px 0 #a97429,
    0 10px 28px #0003;
}
.button.gold:hover {
  background: #ffda85;
}
.button.small {
  padding: 9px 12px;
  font-size: 12px;
}
.site-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px 75px;
  min-height: calc(100svh - 170px);
}
.notice {
  min-height: 22px;
  font-size: 12px;
  color: var(--muted);
  margin: 20px 0 0;
}
.notice.error {
  color: #ffb6b6;
  border-left: 3px solid #ff827c;
  padding-left: 12px;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 40px;
  padding: 46px 0 72px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.8px;
  color: var(--gold);
  margin: 0 0 17px;
}
.hero h1 {
  font-size: clamp(46px, 5.9vw, 78px);
  letter-spacing: -3.5px;
  line-height: 1.04;
  white-space: pre-line;
  margin: 0 0 24px;
  font-weight: 900;
  max-width: 650px;
}
.lede {
  max-width: 480px;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.8;
  margin: 0 0 26px;
}
.hero-links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.text-link {
  font-size: 12px;
  color: #e5eaf4;
  text-decoration: none;
  border-bottom: 1px solid #ffffff38;
  padding-bottom: 3px;
}
.panel {
  background: linear-gradient(120deg, #1d3150, #182943);
  border: 1px solid #ffffff1d;
  border-radius: 14px;
  padding: 30px;
  box-shadow: 0 15px 30px #0001;
}
.help-link {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  padding: 0;
}
.help-guide {
  max-width: 1000px;
  margin: 0 auto;
}
.help-start li + li {
  margin-top: 8px;
}
.help-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 28px 0;
}
.help-topics a {
  color: var(--gold);
  font-size: 14px;
}
.help-sections {
  display: grid;
  gap: 22px;
}
.help-sections section {
  scroll-margin-top: 20px;
}
.help-sections p:last-child {
  margin-bottom: 0;
}
.play-card {
  border-top: 3px solid var(--gold);
}
h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.12;
  letter-spacing: -1.5px;
  margin: 35px 0 20px;
}
h2 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.6px;
  margin: 0 0 25px;
}
h3 {
  font-size: 15px;
  margin: 0 0 5px;
}
p {
  margin-top: 0;
}
.muted {
  font-size: 12px;
  color: var(--muted);
}
label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin: 20px 0;
}
select,
input {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 8px;
  background: #0e2039;
  border: 1px solid #61718b;
  border-radius: 7px;
  color: var(--ink);
  padding: 12px;
  font-size: 13px;
}
select {
  white-space: normal;
}
.rule-note {
  font-size: 11px;
  color: #aebfd5;
  line-height: 1.7;
  border-left: 2px solid #6982aa;
  padding-left: 12px;
  margin: 20px 0 25px;
}
.join {
  width: 100%;
}
footer {
  max-width: 1280px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 24px 40px 32px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #8a9ab3;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
}
footer a {
  letter-spacing: 0;
  font-size: 11px;
  text-decoration: none;
}
.narrow {
  max-width: 620px;
  margin-top: 30px;
}
.your-deck {
  padding: clamp(10px, 2vw, 24px);
  border: 2px solid var(--gold);
  border-radius: 14px;
  background: #081326;
}
.deck-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.deck-controls h3 {
  margin: 0;
}
.selected-deck {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}
.selected-card-shell {
  position: relative;
  min-width: 0;
}
.selected-card-shell:is(:hover, :has(:focus-visible), :has(details[open])) {
  z-index: 10;
}
.selected-deck-card {
  position: relative;
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 7px;
  aspect-ratio: 3 / 4;
}
.selected-card-remove {
  position: absolute;
  bottom: 7px;
  left: 7px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #fff5;
  border-radius: 50%;
  background: #101a29cc;
  color: #fff1df;
  font:
    20px/1 system-ui,
    sans-serif;
}
.selected-card-overlay {
  position: absolute;
  z-index: 3;
  bottom: calc(100% + 8px);
  left: 0;
  width: max(100%, 160px);
  max-width: calc(100vw - 48px);
  padding: 7px;
  border: 1px solid #e5c78b55;
  border-radius: 10px;
  background: #0b162bc9;
  box-shadow: 0 8px 24px #0007;
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition:
    opacity 200ms ease,
    transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 200ms;
}
.selected-card-overlay::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 12px;
}
.selected-card-shell.is-below .selected-card-overlay {
  top: calc(100% + 8px);
  bottom: auto;
}
.selected-card-shell.is-below .selected-card-overlay::after {
  top: auto;
  bottom: 100%;
}
.selected-card-shell:nth-child(4n + 3) .selected-card-overlay,
.selected-card-shell:nth-child(4n) .selected-card-overlay {
  left: auto;
  right: 0;
}
.selected-card-shell:is(:hover, :has(:focus-visible), :has(details[open]))
  .selected-card-overlay {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.selected-card-overlay .card-badges {
  padding: 0;
  background: transparent;
}
@media (hover: none) {
  .selected-card-shell .selected-card-overlay {
    position: static;
    width: 100%;
    max-width: none;
    padding: 4px 0 0;
    border: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }
  .selected-card-overlay::after {
    display: none;
  }
  .selected-card-overlay .card-badges {
    justify-content: flex-end;
  }
  .selected-card-overlay .card-mechanic-details {
    order: -1;
  }
  .selected-card-overlay .card-badge {
    display: none;
  }
  .selected-card-shell:is(:has(details[open]), :has(:focus-visible))
    .selected-card-overlay
    .card-badge {
    display: inline-flex;
  }
}
@media (prefers-reduced-motion: reduce) {
  .selected-card-overlay {
    transition: none;
    transform: none;
  }
}
.selected-deck-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: contain;
}
.selected-deck-card:not(:has(img)) {
  display: grid;
  place-items: center;
  border: 1px dashed #6982aa;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}
.deck-picker {
  margin: 32px 0 20px;
  padding-top: 24px;
  border-top: 1px solid #42516b;
}
summary {
  font-size: 13px;
  color: var(--gold);
  cursor: pointer;
}
.deck-grid {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 20px 12px;
  margin-top: 14px;
}
.available-card {
  min-width: 0;
  overflow-wrap: anywhere;
}
.deck-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 7px;
  overflow: hidden;
  position: relative;
  color: var(--muted);
}
.deck-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: contain;
}
.deck-card > span:not(.card-badges) {
  font-size: 10px;
  font-weight: 900;
  display: block;
  padding: 7px 3px;
  line-height: 1.3;
  min-height: 2.6em;
  overflow-wrap: anywhere;
}
.queue-status {
  color: var(--gold);
  font-size: 14px;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 27px 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
td,
th {
  padding: 15px 10px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
td:nth-child(2) {
  font-weight: 800;
}
.list-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.list-row span {
  color: var(--muted);
  font-size: 12px;
}
.invitation-code {
  margin: 24px 0 0;
  padding: 18px;
  background: #101d37;
  border-radius: 8px;
  overflow-wrap: anywhere;
  color: var(--gold);
}
.battle-panel {
  margin-top: 20px;
}
.live {
  color: #a9e9bc;
}
@media (min-width: 1500px) {
  .hero {
    padding-top: 65px;
    padding-bottom: 85px;
  }
}
@media (max-width: 1050px) {
  .header {
    padding: 16px 24px;
    gap: 16px;
    flex-wrap: wrap;
  }
  .navigation {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
  }
  .identity {
    margin-left: auto;
  }
  .hero {
    gap: 10px;
  }
  .hero h1 {
    font-size: 59px;
  }
  .hero-links {
    gap: 15px;
  }
  .text-link {
    font-size: 11px;
  }
}
@media (max-width: 700px) {
  .header {
    padding: 16px 20px;
  }
  .brand {
    font-size: 15px;
  }
  .brand-crown {
    font-size: 33px;
  }
  .navigation {
    gap: 0;
  }
  .nav-button {
    font-size: 11px;
    padding: 8px;
  }
  .site-main {
    padding: 0 22px 45px;
  }
  .notice {
    font-size: 11px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 40px 0 35px;
  }
  .hero h1 {
    font-size: 58px;
    letter-spacing: -2.8px;
  }
  .hero .lede {
    font-size: 14px;
    max-width: 350px;
  }
  .panel {
    padding: 23px 20px;
  }
  .hero-links {
    gap: 18px;
  }
  .identity {
    font-size: 11px;
    max-width: 125px;
  }
  footer {
    padding: 25px 22px;
    letter-spacing: 1px;
  }
  .narrow {
    margin-top: 25px;
  }
  table {
    font-size: 11px;
  }
  td,
  th {
    padding: 12px 5px;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 2px;
  }
}
@media (max-width: 360px) {
  .header {
    padding: 14px;
  }
  .site-main {
    padding: 0 16px 35px;
  }
  .hero h1 {
    font-size: 49px;
  }
  .nav-button {
    font-size: 10px;
    padding: 8px 6px;
  }
  .brand {
    font-size: 13px;
  }
  .brand-crown {
    font-size: 28px;
  }
  .button.small {
    font-size: 10px;
    padding: 8px;
  }
  .hero-links {
    gap: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Shared account, history and competition surfaces. */
.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}
.history-list,
.competition-list {
  display: grid;
  gap: 20px;
  margin: 25px 0;
}
.match-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}
.match-heading h2 {
  margin-bottom: 12px;
}
.badge {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid #ffffff25;
  border-radius: 7px;
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.gold-badge {
  color: var(--gold);
  border-color: #ffc95b44;
}
.sharing-panel {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 24px;
}
.competition-list {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr));
}
.competition-card h2 {
  overflow-wrap: anywhere;
}
.competition-card .button {
  margin-top: 20px;
  width: 100%;
}
.competition-form {
  max-width: 620px;
  margin: 25px 0;
}
.competition-detail {
  margin: 30px 0;
}
.entrants {
  margin: 28px 0;
}
.entrants .badge {
  margin: 5px 5px 0 0;
}
.bracket {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 20px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}
.fixture {
  background: #101d37;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 17px;
  margin: 14px 0;
}
.fixture p {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.fixture .button {
  font-size: 11px;
  padding: 9px;
}
.fixture .muted {
  font-size: 11px;
}
.sharing-panel input {
  font-size: 12px;
}
.history-match > p {
  overflow-wrap: anywhere;
}

.button.danger {
  background: #622c3c;
  border-color: #e08c91;
  color: #ffebeb;
}

@media (max-width: 1100px) {
  .selected-deck,
  .deck-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .deck-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile browser chrome and keyboards must not squeeze controls off-screen. */
body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.hero > *,
.panel {
  min-width: 0;
}
@media (max-width: 700px) {
  input,
  select,
  .sharing-panel input {
    font-size: 16px;
  }
  .nav-button,
  .button.small,
  .help-link,
  summary {
    min-height: 44px;
  }
  .help-topics a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .hero h1 {
    font-size: clamp(40px, 12vw, 58px);
  }
  footer,
  .list-row {
    flex-wrap: wrap;
  }
}

/* Match the battle's Star Power silhouette without a rectangular backing. */
.selected-deck-card > span.site-card-cost,
.deck-card > span.site-card-cost {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  isolation: isolate;
  width: 36%;
  height: auto;
  aspect-ratio: 1;
  min-height: 0;
  padding: 2px 0 0;
  border: 0;
  background: transparent;
  color: #30200a;
  font:
    900 clamp(14px, 2vw, 24px)/1 system-ui,
    sans-serif;
  letter-spacing: 0;
  text-shadow: none;
}
.site-card-cost::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(145deg, #fff3a9, #f5c542 55%, #d79218);
  clip-path: polygon(
    50% 0%,
    64% 32%,
    100% 36%,
    73% 60%,
    82% 96%,
    50% 78%,
    18% 96%,
    27% 60%,
    0% 36%,
    36% 32%
  );
}

.google-signin-panel {
  margin: 0 0 24px;
  padding: 20px;
  border: 1px solid #ffc95b66;
  border-radius: 16px;
  background: #ffc95b0a;
  min-width: 0;
}
.google-signin-panel h2 {
  margin: 0 0 10px;
  font-size: 22px;
}
.google-signin-panel .eyebrow {
  margin-bottom: 10px;
}
.google-signin-panel .muted {
  line-height: 1.6;
}
#google-signin {
  min-height: 44px;
}
.identity .button {
  margin-top: 6px;
  font-size: 12px;
  padding: 9px 12px;
}

/* The ready deck and the two entry choices share the first screen. */
.hero-links {
  align-items: flex-start;
  gap: 16px;
  margin: 26px 0 20px;
}
.hero-links .join {
  width: auto;
  min-width: 120px;
  height: 40px;
  min-height: 40px;
  padding: 8px 28px;
}
.hero-secondary,
.deck-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
}
.hero-secondary {
  margin: 20px 0;
}
.matchmaking-note {
  max-width: 360px;
  line-height: 1.7;
}
.play-mode {
  color: var(--gold);
}
.hero .play-card {
  padding: 24px;
}
.hero .your-deck {
  padding: 0;
  border: 0;
  background: none;
}
.deck-controls {
  align-items: flex-start;
  gap: 16px;
}
.deck-controls h3 {
  flex-basis: 100%;
  font-size: 24px;
}
.deck-actions {
  gap: 8px;
}
.deck-actions .button {
  font-size: 12px;
  padding: 10px 12px;
  min-height: 44px;
}
.choose-deck {
  border-color: var(--gold);
  color: var(--gold);
}
.deck-memory {
  margin: 16px 0 0;
  line-height: 1.6;
}
.google-signin-panel.compact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 260px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.google-signin-panel.compact #google-signin {
  order: -1;
}
.google-signin-panel.compact p {
  margin: 0;
  font-size: 11px;
}
.signin-caption {
  font-size: 12px;
  color: var(--gold);
}
.profile-history {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.profile-history h2 {
  margin-bottom: 12px;
}
@media (max-width: 1050px) and (min-width: 701px) {
  .hero {
    gap: 24px;
  }
  .hero h1 {
    font-size: 52px;
  }
}
@media (max-width: 700px) {
  .hero {
    padding: 24px 0;
    gap: 24px;
  }
  .hero .play-card {
    padding: 18px 14px;
  }
  .selected-deck {
    gap: 6px;
  }
  .selected-deck-card > span.site-card-cost {
    font-size: clamp(12px, 3vw, 20px);
  }
}

@media (max-width: 700px) {
  .hero h1 {
    margin-bottom: 16px;
  }
  .hero .lede {
    margin-bottom: 16px;
    line-height: 1.6;
  }
  .hero-links {
    margin: 18px 0;
  }
  .hero-secondary {
    margin: 16px 0;
  }
  .matchmaking-note {
    margin-bottom: 0;
  }
}

.promo-banner {
  margin: 1.5rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #080e1b;
}
.promo-banner video {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  margin: auto;
}

/* Native dialog keeps deck editing and keyboard focus together. */
body:has(.deck-dialog[open]) {
  overflow: hidden;
}
.deck-dialog {
  box-sizing: border-box;
  width: min(1040px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--navy);
  color: var(--ink);
  overflow: hidden;
}
.deck-dialog[open] {
  display: flex;
  flex-direction: column;
}
.deck-dialog::backdrop {
  background: #050b18cc;
}
.deck-dialog-header {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}
.deck-dialog-header h2 {
  margin: 0;
}
.deck-dialog-close {
  flex: none;
}
.deck-dialog-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  padding: 24px;
}
.deck-dialog .your-deck {
  margin: 0;
}
.deck-dialog .deck-picker {
  margin-bottom: 0;
}
.deck-dialog .selected-deck {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 600px;
}
.google-signin-panel.compact {
  width: 240px;
  max-width: 100%;
  flex-shrink: 0;
}
.google-signin-panel.compact #google-signin {
  min-height: 40px;
}
.google-signin-panel.compact p:empty {
  display: none;
}
@media (max-width: 640px) {
  .deck-dialog-header {
    padding: 12px 16px;
  }
  .deck-dialog-header h2 {
    font-size: 20px;
  }
  .deck-dialog-body {
    padding: 16px;
  }
  .deck-dialog .selected-deck {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .deck-dialog .deck-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Compact split home: video and entry controls beside the prepared deck. */
.header {
  min-height: 72px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.site-main {
  padding-bottom: 24px;
}
.notice {
  margin-top: 10px;
}
.hero {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 32px;
  padding: 18px 0 24px;
}
.hero-copy {
  min-width: 0;
}
.hero h1 {
  font-size: 36px;
  line-height: 1.06;
  letter-spacing: -1.2px;
  white-space: normal;
  max-width: none;
  margin-bottom: 10px;
}
.hero .eyebrow {
  margin-bottom: 8px;
}
.hero .lede {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
}
.hero-links {
  margin: 14px 0 8px;
  gap: 12px;
}
.hero-secondary {
  margin: 12px 0;
}
.matchmaking-note {
  font-size: 12px;
  line-height: 1.45;
  margin: 10px 0 0;
  max-width: none;
}
.play-mode {
  font-size: 12px;
  margin: 8px 0;
}
.hero .play-card {
  padding: 20px;
  width: 100%;
  max-width: 500px;
  justify-self: end;
}
.deck-memory {
  font-size: 12px;
  margin-top: 10px;
}
.deck-controls h3 {
  font-size: 20px;
}
.promo-banner {
  max-width: 500px;
  margin: 12px 0 14px;
  border-radius: 14px;
}
.promo-banner video {
  aspect-ratio: 16 / 9;
  max-height: none;
}
@media (max-width: 1050px) {
  .hero {
    gap: 20px;
  }
}
@media (max-width: 700px) {
  .header {
    min-height: 0;
    gap: 10px 16px;
    padding: 10px 16px;
  }
  .brand-crown {
    font-size: 28px;
  }
  .nav-button {
    min-height: 40px;
    padding: 8px 10px;
  }
  .site-main {
    padding: 0 16px 24px;
  }
  .notice {
    font-size: 10px;
    margin-top: 6px;
    min-height: 16px;
  }
  .hero {
    grid-template-columns: 1fr;
    padding-top: 8px;
    gap: 12px;
  }
  .hero h1 {
    font-size: 28px;
    line-height: 1.05;
    letter-spacing: -1px;
    margin: 0 0 8px;
  }
  .hero .eyebrow {
    font-size: 9px;
    margin-bottom: 8px;
  }
  .hero .lede {
    font-size: 12px;
    line-height: 1.45;
    margin: 0 0 6px;
  }
  .play-mode {
    font-size: 11px;
    margin: 6px 0;
  }
  .hero-links {
    margin: 10px 0 0;
    gap: 10px;
    align-items: flex-start;
  }
  .hero-links .join {
    min-width: 84px;
    padding: 8px 16px;
    height: 40px;
  }
  .signin-caption {
    font-size: 10px;
  }
  .promo-banner {
    margin: 10px 0 0;
  }
  .hero .play-card {
    padding: 14px;
    max-width: none;
  }
  .hero-secondary {
    margin: 10px 0 0;
    gap: 20px;
  }
  .hero-secondary .text-link {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
  }
  .matchmaking-note {
    font-size: 11px;
    line-height: 1.4;
    margin: 7px 0 0;
  }
  .deck-controls h3 {
    font-size: 18px;
  }
  .deck-controls {
    gap: 8px;
  }
  .deck-actions .button {
    padding: 8px 10px;
  }
}

/* The supplied promo wordmark and palette connect the lobby to its videos. */
.hero-wordmark {
  display: block;
  width: min(100%, 300px);
  height: auto;
}
.brand-wordmark {
  display: block;
  width: 92px;
  height: auto;
}
.header,
.deck-dialog-header {
  background: linear-gradient(110deg, #241334, #101d37 72%);
}
.button.gold {
  background: linear-gradient(#ffec8c, #e6ad37);
  border-color: #ffec8c;
}
.button.gold:hover {
  background: linear-gradient(#fff2ab, #ffc95b);
}
.deck-dialog {
  box-shadow:
    0 24px 90px #05081499,
    0 0 0 1px #d7921e26;
}
@media (max-width: 700px) {
  .brand-wordmark {
    width: 80px;
  }
  .hero-wordmark {
    width: min(100%, 260px);
  }
}
