@font-face {
  font-family: "Matchday";
  src: url("desktop-poster-type.woff2?v=592b2672ec47") format("woff2");
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

html[data-layout="desktop"] body.clubhouse-home {
  --poster-ink: #071e42;
  --poster-paper: #fff5e3;
  --poster-cyan: #08e4ed;
  --poster-display: "Matchday", Impact, "Arial Narrow", sans-serif;
  --poster-nav: clamp(98px, 24svh, 280px);
  --poster-footer: clamp(48px, 7svh, 76px);
  --poster-edge: clamp(4px, .43vw, 8px);
  --poster-cut: min(4.8vw, 8.4svh);
  --poster-gear: clamp(45px, 4.5vw, 72px);
  --poster-corner: clamp(12px, 1.55vw, 32px);

  #boot {
    background: var(--poster-ink);
  }
  #boot .boot-hud {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    width: 100%;
    max-width: none;
    height: 100%;
    padding: 0;
  }
  #html-lobby:not(.room-view):has(#home-card:not(.is-hidden)) .lobby-hero {
    background: #091422;
  }
  #boot .boot-hud::before {
    background: var(--poster-paper) url("desktop-matchday-home.webp?v=b5b8c6679229") center / cover no-repeat;
    content: "";
    position: absolute;
    inset: 0 0 calc(var(--poster-nav) + var(--poster-footer)) 0;
  }
  #boot .home-brand,
  #html-lobby:not(.room-view) .lobby-hero h1.home-brand {
    position: absolute;
    z-index: 1;
    top: -1.6vw;
    left: 1.1vw;
    width: min(50vw, 1050px);
    max-width: none;
    margin: 0;
    padding: 0;
    transform: none;
    filter: none;
    background: none;
  }
  #boot .boot-dock {
    position: relative;
    align-self: center;
    display: grid;
    align-content: center;
    width: min(84vw, 430px);
    min-height: calc(var(--poster-nav) + var(--poster-footer));
    margin: 0;
    padding: .75rem 0;
    box-sizing: border-box;
  }
  #boot :is(.boot-tip, .boot-status, .boot-pct) { color: var(--poster-paper); }
  #boot .boot-bar { background: #203d5f; border-color: #83c6cf; }
  #boot .boot-bar > i { background: var(--poster-cyan); }

  #html-lobby {
    padding: 0;
    background: #d5edf4;
  }
  #html-lobby:not(.room-view):has(#home-card:not(.is-hidden)) {
    background: var(--poster-ink);
  }
  #html-lobby:not(.room-view) .lobby-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(90px, 1fr) auto;
    justify-items: stretch;
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-width: none;
    min-height: max(300px, 100%);
    height: 100%;
    margin: 0;
    padding: 0;
  }
  #html-lobby:not(.room-view) .lobby-hero {
    position: relative;
    height: auto;
    min-height: 0;
    max-width: none;
    width: 100%;
    padding: 0;
    margin: 0;
    overflow: hidden;
  }
  #html-lobby:not(.room-view) #home-card:not(.is-hidden) {
    display: grid;
    position: static;
    grid-template-columns: 47% 26% 27%;
    grid-template-rows: var(--poster-nav) var(--poster-footer);
    align-items: stretch;
    justify-content: stretch;
    gap: 0;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--poster-ink);
    box-shadow: none;
    isolation: auto;
  }

  #html-lobby:not(.room-view) .home-identity {
    position: absolute;
    top: var(--poster-corner);
    right: calc(var(--poster-corner) + var(--poster-gear) + clamp(14px, 1.9vw, 36px));
    z-index: 2;
    display: grid;
    justify-items: start;
    align-content: center;
    align-items: center;
    gap: 0;
    min-height: var(--poster-gear);
    max-width: 28%;
    padding-right: clamp(11px, 1.7vw, 30px);
    border-right: clamp(2px, .19vw, 4px) solid var(--poster-ink);
    color: var(--poster-ink);
  }
  #html-lobby:not(.room-view) .home-name {
    display: flex;
    justify-content: flex-start;
    gap: 0;
    width: 100%;
    max-width: none;
  }
  #html-lobby:not(.room-view) #lobby-name {
    height: 1.1em;
    min-width: 2.1ch;
    max-width: calc(100% - 38px);
    margin: 0;
    padding: 0 2px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--poster-ink);
    font: italic 900 clamp(20px, 2.65vw, 42px)/1 var(--poster-display);
    text-align: left;
    box-shadow: none;
  }
  #html-lobby:not(.room-view) #lobby-name:focus { border-bottom-color: var(--poster-ink); }
  #html-lobby:not(.room-view) #home-edit-name {
    order: -1;
    position: relative;
    width: clamp(34px, 3vw, 52px);
    height: clamp(34px, 3vw, 52px);
    min-width: 0;
    padding: 5px;
    margin: 0 4px 0 0;
    color: inherit;
  }
  #html-lobby:not(.room-view) #home-edit-name svg {
    position: absolute;
    z-index: 1;
    width: 40%;
    height: 40%;
    right: -1px;
    bottom: -9px;
    border-radius: 4px;
    background: var(--poster-paper);
    stroke-width: 3;
  }
  #html-lobby:not(.room-view) .home-guest {
    min-height: 0;
    margin: -2px 0 0 calc(clamp(34px, 3vw, 52px) + 6px);
    padding: 0;
    border: 0;
    color: inherit;
    font: italic 800 clamp(15px, 1.9vw, 30px)/1 'Nunito', system-ui, sans-serif;
  }
  #html-lobby:not(.room-view) .home-guest svg {
    position: absolute;
    top: 50%;
    left: 0;
    display: block;
    width: clamp(34px, 3vw, 52px);
    height: clamp(34px, 3vw, 52px);
    transform: translateY(-50%);
    pointer-events: none;
  }
  &.home-menu-active:has(#home-card:not(.is-hidden)) #mobile-settings {
    position: fixed;
    top: var(--poster-corner);
    right: var(--poster-corner);
  }
  &.home-menu-active:has(#home-card:not(.is-hidden)) #mobile-settings #mobile-settings-toggle {
    width: var(--poster-gear);
    height: var(--poster-gear);
    padding: 2px;
    border: clamp(2px, .22vw, 4px) solid var(--poster-ink);
    border-radius: 24%;
    background: var(--poster-paper);
    color: var(--poster-ink);
    box-shadow: none;
  }
  &.home-menu-active:has(#home-card:not(.is-hidden)) #mobile-settings #mobile-settings-toggle .home-gear {
    width: 100%;
    height: 100%;
  }
  &.home-menu-active:has(#home-card:not(.is-hidden)) #mobile-settings #mobile-settings-panel {
    top: calc(var(--poster-gear) + 8px);
  }

  #html-lobby:not(.room-view) .home-secondary { display: contents; }
  #html-lobby:not(.room-view) .home-secondary::after { display: none; }
  #html-lobby:not(.room-view) :is(#lobby-play, #home-private, #guest-wardrobe) {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    grid-row: 1;
    width: calc(100% + var(--poster-cut) - var(--poster-edge));
    min-width: 0;
    max-width: none;
    height: auto;
    min-height: 0;
    margin: var(--poster-edge) 0;
    padding: 0 calc(var(--poster-cut) / 2);
    box-sizing: border-box;
    border: 0;
    border-radius: 0;
    clip-path: polygon(var(--poster-cut) 0, 100% 0, calc(100% - var(--poster-cut)) 100%, 0 100%);
    background: var(--poster-paper);
    color: var(--poster-ink);
    box-shadow: none;
    text-shadow: none;
    text-transform: none;
    letter-spacing: -.01em;
    -webkit-tap-highlight-color: transparent;
    transition: filter .12s ease;
  }
  #html-lobby:not(.room-view) #lobby-play {
    grid-column: 1;
    gap: .16em;
    margin-left: calc(0px - var(--poster-cut) / 2);
    width: calc(100% + 1.5 * var(--poster-cut) - var(--poster-edge));
    background: var(--poster-cyan);
    font: italic 900 clamp(32px, min(7vw, 12.5svh), 138px)/1 var(--poster-display);
  }
  #html-lobby:not(.room-view) #lobby-play svg {
    width: .98em;
    height: .98em;
    stroke-width: 3.6;
    stroke-linecap: square;
  }
  #html-lobby:not(.room-view) :is(#home-private, #guest-wardrobe) {
    flex-direction: column;
    grid-column: 2;
    gap: 0;
    font: italic 900 clamp(20px, min(3.15vw, 5.9svh), 60px)/.95 var(--poster-display);
  }
  #html-lobby:not(.room-view) #guest-wardrobe {
    grid-column: 3;
    width: 100%;
    background: var(--poster-paper);
  }
  #html-lobby:not(.room-view) .home-menu-action > img,
  #html-lobby:not(.room-view) .home-menu-action .wardrobe-entry-icon {
    display: block;
    flex: 0 1 auto;
    width: min(14vw, 20svh);
    height: min(14vw, 16svh);
    min-height: 0;
    object-fit: contain;
    pointer-events: none;
  }
  #html-lobby:not(.room-view) .home-menu-action .wardrobe-entry-copy { flex: 0 0 auto; }
  #html-lobby:not(.room-view) :is(#lobby-play, #home-private, #guest-wardrobe):hover:not(:disabled) {
    filter: brightness(1.06);
    transform: none;
  }
  #html-lobby:not(.room-view) :is(#lobby-play, #home-private, #guest-wardrobe):active:not(:disabled) {
    filter: brightness(.89);
    transform: none;
    box-shadow: none;
  }
  #html-lobby:not(.room-view) :is(#lobby-play, #home-private, #guest-wardrobe):focus-visible {
    outline: none;
    text-decoration: underline;
    text-decoration-thickness: .07em;
    text-underline-offset: .1em;
    box-shadow: inset 0 0 0 5px var(--poster-ink);
  }
  #html-lobby:not(.room-view) :is(#lobby-play, #guest-wardrobe):disabled {
    filter: saturate(.4);
    opacity: .7;
  }

  #html-lobby:not(.room-view) #how-to-play,
  #html-lobby:not(.room-view) .home-account-links {
    align-self: stretch;
    display: flex;
    grid-row: 2;
    align-items: center;
    min-height: 0;
    margin: 0;
    border-top: var(--poster-edge) solid var(--poster-paper);
    border-radius: 0;
    color: var(--poster-paper);
    background: var(--poster-ink);
    font: italic 900 clamp(18px, min(2.15vw, 4.5svh), 39px)/1 var(--poster-display);
    letter-spacing: 0;
    text-decoration: none;
    text-shadow: none;
  }
  #html-lobby:not(.room-view) #how-to-play {
    grid-column: 1;
    justify-content: flex-start;
    padding: 0 0 0 clamp(13px, 2.7vw, 54px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    box-shadow: none;
  }
  #html-lobby:not(.room-view) #how-to-play > span { display: none; }
  #html-lobby:not(.room-view) .home-account-links {
    grid-column: 2 / 4;
    justify-content: flex-end;
    gap: 0;
    padding-right: clamp(9px, 2.7vw, 54px);
  }
  #html-lobby:not(.room-view) .home-account-links a {
    align-items: center;
    min-height: 0;
    height: 63%;
    padding: 0 clamp(8px, 1.5vw, 28px);
    color: inherit;
    font: inherit;
    text-decoration: none;
  }
  #html-lobby:not(.room-view) .home-account-links a + a { border-left: 2px solid currentColor; }
  #html-lobby:not(.room-view) .home-account-links a:last-child { padding-right: 0; }
  #html-lobby:not(.room-view) :is(#how-to-play, .home-account-links a):is(:hover, :focus-visible) {
    color: var(--poster-cyan);
    text-decoration: underline;
    text-underline-offset: .14em;
  }
  #html-lobby:not(.room-view) .account-sync-status {
    position: absolute;
    bottom: 0;
    left: 28%;
    right: 33%;
    display: grid;
    place-content: center;
    min-height: calc(var(--poster-footer) - var(--poster-edge));
    margin: 0;
    color: #bee3e9;
    font: 800 clamp(11px, .9vw, 15px)/1.2 'Nunito', system-ui, sans-serif;
    pointer-events: none;
  }
  #html-lobby .account-sync-status:empty,
  #html-lobby.room-view .account-sync-status { display: none; }
  #html-lobby:not(.room-view) #friends-panel[open] {
    position: absolute;
    z-index: 4;
    bottom: calc(var(--poster-nav) + var(--poster-footer) + 8px);
    left: clamp(8px, calc(60% - 160px), calc(100% - min(92vw, 320px) - 8px));
    width: min(92vw, 320px);
    max-height: max(100px, calc(100% - var(--poster-nav) - var(--poster-footer) - 20px));
    overflow-y: auto;
    box-sizing: border-box;
    margin: 0;
    border: 3px solid var(--poster-ink);
    border-radius: 9px;
    background: var(--poster-paper);
    box-shadow: 4px 5px 0 var(--poster-ink);
  }
  #html-lobby:not(.room-view) #friends-panel .lobby-friends-body { padding: 12px; }
  #html-lobby:not(.room-view) #friends-panel #lobby-host,
  #html-lobby:not(.room-view) #friends-panel #lobby-join {
    border: 2px solid var(--poster-ink);
    border-radius: 5px;
    background: var(--poster-cyan);
    color: var(--poster-ink);
    box-shadow: none;
    text-shadow: none;
    font: italic 900 23px/1 var(--poster-display);
  }
  #html-lobby:not(.room-view) #friends-panel #lobby-join { background: white; }
  #html-lobby:not(.room-view) #friends-panel #lobby-code { border: 2px solid var(--poster-ink); border-radius: 5px; }
  #html-lobby:not(.room-view) #flow-status:not([hidden]) {
    position: absolute;
    left: 12px;
    bottom: calc(var(--poster-nav) + var(--poster-footer) + 12px);
    max-width: min(88vw, 360px);
    padding: 10px;
    border-radius: 6px;
    background: var(--poster-paper);
    color: var(--poster-ink);
  }

  /* Keep the live queue centered when it replaces the action dock. */
  #html-lobby:has(#queue-panel:not(.is-hidden)) .lobby-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    height: auto;
    padding: 16px;
  }
  #html-lobby:has(#queue-panel:not(.is-hidden)) .lobby-hero { display: none; }
  #html-lobby:has(#queue-panel:not(.is-hidden)) #queue-panel { margin: 0; }
}

@media (max-width: 720px) {
  html[data-layout="desktop"] body.clubhouse-home {
    --poster-cut: 3.4vw;
    #html-lobby:not(.room-view) .home-identity { max-width: 33%; }
    #html-lobby:not(.room-view) .account-sync-status {
      bottom: calc(var(--poster-nav) + var(--poster-footer) + 6px);
      left: 8px;
      right: auto;
      min-height: 0;
      max-width: 44%;
      padding: 3px 6px;
      border-radius: 3px;
      background: var(--poster-paper);
      color: var(--poster-ink);
    }
  }
}

/* A narrow desktop window retains the poster and all three actions. */
@media (max-width: 520px) {
  html[data-layout="desktop"] body.clubhouse-home {
    --poster-nav: clamp(148px, 31svh, 208px);
    --poster-cut: 4vw;
    #html-lobby:not(.room-view) #home-card:not(.is-hidden) {
      grid-template-columns: 1fr 1fr;
      grid-template-rows: calc(var(--poster-nav) * .42) calc(var(--poster-nav) * .58) var(--poster-footer);
    }
    #html-lobby:not(.room-view) #lobby-play {
      grid-column: 1 / 3;
      width: 100%;
      margin: var(--poster-edge) 0 0;
      clip-path: none;
      font-size: clamp(32px, 9vw, 46px);
    }
    #html-lobby:not(.room-view) :is(#home-private, #guest-wardrobe) {
      grid-row: 2;
      font-size: clamp(18px, 4.8vw, 24px);
    }
    #html-lobby:not(.room-view) #home-private { grid-column: 1; }
    #html-lobby:not(.room-view) #guest-wardrobe { grid-column: 2; }
    #html-lobby:not(.room-view) .home-menu-action > img,
    #html-lobby:not(.room-view) .home-menu-action .wardrobe-entry-icon {
      width: min(20vw, 77px);
      height: min(14svh, 68px);
    }
    #html-lobby:not(.room-view) :is(#how-to-play, .home-account-links) { grid-row: 3; font-size: clamp(15px, 4.3vw, 21px); }
    #html-lobby:not(.room-view) .home-account-links { grid-column: 1 / 3; justify-self: end; }
    #html-lobby:not(.room-view) .lobby-hero { background-position: 66% center; }
    #html-lobby:not(.room-view) .home-identity {
      max-width: 37%;
      padding: 2px 5px;
      border: 0;
      border-radius: 4px;
      background: var(--poster-paper);
    }
    #html-lobby:not(.room-view) .home-guest {
      margin-left: 6px;
      font-size: 13px;
    }
    #html-lobby:not(.room-view) .home-guest svg { display: none; }
    #html-lobby:not(.room-view) #home-edit-name { order: 0; width: 24px; height: 26px; }
    #html-lobby:not(.room-view) #home-edit-name svg { inset: 4px; width: 18px; height: 18px; background: none; }
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-layout="desktop"] body.clubhouse-home #html-lobby button { transition: none; }
}
