:root {
  color-scheme: light;
  --ink: #0a1220;
  --ink-2: #141f30;
  --paper: #f8f4ea;
  --paper-2: #eeebe3;
  --white: #fffefa;
  --line: #cbd0c7;
  --muted: #69717d;
  --acid: #ff6b4a;
  --acid-dark: #d9482e;
  --blue: #3155d9;
  --blue-soft: #e5eaff;
  --red: #ec3e37;
  --green: #13a66d;
  --display: "Arial Narrow", "Avenir Next Condensed", "Roboto Condensed", Impact, sans-serif;
  --body: "Avenir Next", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--body);
}

* { box-sizing: border-box; }
html { background: var(--paper-2); }
body { min-height: 100vh; margin: 0; overflow-x: hidden; color: var(--ink); background: var(--paper-2); }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; opacity: .34; pointer-events: none; background-image: linear-gradient(rgba(10,18,32,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(10,18,32,.045) 1px, transparent 1px); background-size: 48px 48px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .46; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.topbar { position: sticky; top: 0; z-index: 30; height: 64px; padding: 0 max(24px, calc((100vw - 1440px) / 2)); display: flex; align-items: center; justify-content: space-between; color: var(--ink); border-bottom: 1px solid var(--ink); background: rgba(248,244,234,.96); backdrop-filter: blur(18px); }
.brand { height: 100%; display: inline-flex; align-items: center; flex: none; text-decoration: none; }
.brand img { width: auto; }
.brand-logo { display: block; height: 56px; }
.brand-icon { display: none; height: 50px; }
.current-identity { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.current-identity strong { max-width: 280px; overflow: hidden; padding: 7px 11px 6px; color: white; background: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.drawer-trigger { min-height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; color: white; border: 1px solid var(--ink); background: var(--blue); font-size: .7rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.drawer-trigger:hover { color: var(--ink); background: var(--acid); }
.drawer-trigger span { font-size: 1rem; line-height: 1; }
.app-shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 28px; }
.view { animation: view-enter .38s cubic-bezier(.2,.8,.2,1); }
@keyframes view-enter { from { opacity: 0; transform: translateY(12px); } }
@keyframes player-enter { from { opacity: 0; transform: translateX(-16px); } }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 7px rgba(255,107,74,0); } }

.drawer-backdrop { position: fixed; inset: 64px 0 0; z-index: 38; background: rgba(10,18,32,.42); backdrop-filter: blur(2px); }
.side-drawer { position: fixed; top: 64px; bottom: 0; left: 0; z-index: 40; width: min(470px, calc(100vw - 28px)); color: var(--ink); border-right: 1px solid var(--ink); background: var(--paper); box-shadow: 14px 0 0 rgba(10,18,32,.12); transform: translateX(calc(-100% - 18px)); transition: transform .24s cubic-bezier(.2,.8,.2,1); }
.side-drawer.open { transform: translateX(0); }
.drawer-head { min-height: 62px; display: flex; align-items: stretch; justify-content: space-between; border-bottom: 1px solid var(--ink); background: var(--white); }
.drawer-tabs { display: flex; align-items: stretch; }
.drawer-tab { padding: 0 24px; color: var(--muted); border: 0; border-right: 1px solid var(--line); background: transparent; font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.drawer-tab.active { color: white; background: var(--blue); }
.drawer-tab span { display: inline-grid; place-items: center; min-width: 19px; height: 19px; margin-left: 5px; color: var(--ink); border-radius: 50%; background: var(--acid); font-size: .6rem; }
.drawer-close { width: 62px; color: var(--ink); border: 0; border-left: 1px solid var(--ink); background: var(--paper); font-size: 1.8rem; line-height: 1; }
.drawer-close:hover { color: white; background: var(--ink); }
.drawer-content { height: calc(100% - 62px); overflow-y: auto; padding: 22px 22px 38px; }
.drawer-count { margin: 0 0 10px; color: var(--muted); font-size: .72rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.side-drawer .availability-controls { margin-top: 0; }
.side-drawer .available-list { grid-template-columns: 1fr; max-height: none; overflow: visible; padding-right: 0; }

.media-prejoin { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow-y: auto; padding: 24px; background: rgba(10,18,32,.88); backdrop-filter: blur(12px); }
.media-prejoin-card { width: min(880px,100%); padding: clamp(18px,3vw,34px); border: 1px solid var(--ink); background: var(--paper); box-shadow: 12px 12px 0 var(--acid); }
.media-prejoin-head { display: flex; justify-content: center; margin-bottom: 14px; text-align: center; }
.media-prejoin-head > p { margin: 0; font-size: .78rem; line-height: 1.45; }
.media-preview { position: relative; width: min(680px,100%); aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; margin: 0 auto; color: white; border: 1px solid var(--ink); background: #000; }
.media-preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.media-preview video.mirrored { transform: scaleX(-1); }
.media-prejoin-actions { display: flex; justify-content: center; gap: 9px; margin-top: 14px; }
.media-prejoin-confirm { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.media-prejoin-confirm .button { width: auto; }
.media-strip { margin-bottom: 20px; border: 1px solid var(--ink); background: var(--ink); box-shadow: 6px 6px 0 rgba(10,18,32,.16); }
.media-strip-head { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 14px; border-bottom: 1px solid var(--ink); background: var(--white); }
.media-strip-head .eyebrow { margin-bottom: 3px; }
.media-strip-head h2 { font-size: 1.25rem; }
.media-strip-controls { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.media-status { color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.button.device-off { color: white; border-color: var(--red); background: var(--red); }
.button.active { color: white; background: var(--blue); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); align-content: start; gap: 9px; padding: 10px; background: var(--ink); }
.media-grid > .muted { grid-column: 1 / -1; align-self: center; color: #b9c1cf; text-align: center; }
.media-tile { position: relative; min-height: 135px; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; color: white; border: 2px solid transparent; background: #17243b; }
.media-tile.offline { color: #9da6b5; background: #111b2b; }
.media-tile.offline .media-avatar { filter: grayscale(1); opacity: .55; }
.media-tile.speaking { border-color: var(--acid); box-shadow: inset 0 0 0 2px var(--ink); }
.media-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; background: #000; }
.media-tile.has-video video { opacity: 1; }
.media-tile.has-video .media-avatar { visibility: hidden; }
.media-tile.local video { transform: scaleX(-1); }
.media-avatar { display: grid; place-items: center; width: 72px; height: 72px; color: var(--ink); border-radius: 50%; background: var(--acid); font-family: var(--display); font-size: 1.5rem; font-weight: 900; }
.media-tile-label { position: absolute; top: 8px; right: 8px; left: 8px; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; background: rgba(10,18,32,.82); backdrop-filter: blur(8px); }
.media-tile-label strong { min-width: 0; overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.media-tile-label span { flex: none; color: #b9c1cf; font-size: .58rem; font-weight: 800; text-transform: uppercase; }
.media-tile-controls { position: absolute; bottom: 10px; left: 50%; z-index: 2; display: flex; gap: 8px; transform: translateX(-50%); }
.media-device-control { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; color: white; border: 1px solid rgba(255,255,255,.72); border-radius: 50%; background: rgba(10,18,32,.82); box-shadow: 0 3px 12px rgba(0,0,0,.24); backdrop-filter: blur(8px); }
.media-device-control:hover { background: var(--blue); }
.media-device-control.active { background: var(--blue); }
.media-device-control.device-off { border-color: var(--red); background: var(--red); }
.media-device-control svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.media-audio { position: absolute; width: 0; height: 0; overflow: hidden; }

.eyebrow { margin: 0 0 9px; color: var(--blue); font-size: .68rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--display); }
h2 { margin: 0; font-size: 1.65rem; line-height: 1; letter-spacing: -.015em; text-transform: uppercase; }

#welcome-view { position: relative; min-height: calc(100vh - 120px); display: grid; grid-template-columns: minmax(300px, .72fr) minmax(520px, 1.28fr); gap: clamp(34px, 5vw, 82px); align-items: center; padding: clamp(30px, 4.5vw, 68px); color: var(--ink); background: var(--paper); border: 1px solid var(--ink); box-shadow: 9px 9px 0 var(--acid); }
.welcome-copy { position: relative; z-index: 1; max-width: 760px; }
.welcome-copy .eyebrow { color: var(--blue); }
.welcome-copy h1 { margin: 0; font-size: clamp(3.2rem, 6.2vw, 6.6rem); line-height: .82; letter-spacing: -.045em; text-transform: uppercase; }
.welcome-copy h1 span { display: inline-block; color: var(--blue); }
.welcome-copy > p:last-child { max-width: 520px; margin: 26px 0 0; color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.home-workspace { position: relative; z-index: 2; min-width: 0; }
.home-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin-bottom: 14px; }
.home-action { min-height: 116px; display: grid; align-content: space-between; justify-items: start; padding: 14px; color: var(--ink); text-align: left; border: 1px solid var(--ink); background: var(--white); box-shadow: 3px 3px 0 rgba(10,18,32,.12); transition: transform .16s, box-shadow .16s, background .16s; }
.home-action:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--ink); }
.home-action.active { background: var(--acid); box-shadow: 4px 4px 0 var(--ink); }
.home-action > span { color: var(--blue); font-family: var(--display); font-size: .72rem; font-weight: 900; }
.home-action strong { font-family: var(--display); font-size: 1.18rem; line-height: 1; text-transform: uppercase; }
.home-action small { color: var(--muted); font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.home-action.active small { color: #6c2015; }
.home-flow { max-height: min(600px, calc(100vh - 130px)); overflow-y: auto; margin-bottom: 14px; padding: 24px; box-shadow: 6px 6px 0 var(--blue); }
.home-flow-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.flow-close { width: 34px; height: 34px; color: var(--ink); border: 1px solid var(--ink); background: transparent; font-size: 1.25rem; line-height: 1; }
.flow-close:hover { color: white; background: var(--ink); }
.code-input { height: 68px; font-family: var(--display); font-size: 2rem; font-weight: 900; letter-spacing: .18em; text-align: center; text-transform: uppercase; }
.home-help { margin: -6px 0 19px; font-size: .78rem; line-height: 1.45; }
.resume-panel { min-height: 235px; padding: 22px; }
.resume-panel .panel-heading { margin-bottom: 14px; }
.resume-panel .panel-heading > strong { color: var(--blue); font-family: var(--display); font-size: 1.8rem; }
.my-auctions { display: grid; gap: 7px; max-height: 272px; overflow-y: auto; padding: 2px 5px 5px 2px; }
.my-auction { width: 100%; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 11px; color: var(--ink); text-align: left; border: 1px solid var(--line); background: var(--paper); }
.my-auction:hover { border-color: var(--ink); background: white; }
.my-auction-code { min-width: 76px; padding: 8px 7px 6px; color: white; background: var(--blue); font-family: var(--display); font-weight: 900; letter-spacing: .1em; text-align: center; }
.my-auction-copy { min-width: 0; }
.my-auction-copy strong, .my-auction-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-auction-copy strong { font-size: .84rem; }
.my-auction-copy small { margin-top: 4px; color: var(--muted); font-size: .67rem; text-transform: uppercase; }
.auction-status { padding: 6px 7px 5px; color: var(--muted); border: 1px solid currentColor; font-size: .58rem; font-weight: 900; text-transform: uppercase; }
.auction-status.running { color: var(--green); }
.auction-status.completed { color: var(--blue); }
.join-code-badge { display: inline-block; margin: 0 0 18px; padding: 8px 10px 6px; color: white; background: var(--blue); font-family: var(--display); letter-spacing: .14em; }

.panel { border: 1px solid var(--ink); border-radius: 3px; background: var(--white); box-shadow: 6px 6px 0 rgba(10,18,32,.12); }
.form-panel { position: relative; z-index: 2; color: var(--ink); box-shadow: 8px 8px 0 var(--blue); }
.form-panel, .lobby-grid > .panel, .join-layout { padding: 28px; }
.panel-heading { margin-bottom: 24px; }
.panel-heading.inline { display: flex; align-items: center; justify-content: space-between; }
.panel-heading.inline > strong, #participant-count { font-family: var(--display); font-size: 2rem; }

label { display: grid; gap: 7px; margin-bottom: 17px; color: #39414d; font-size: .73rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
input, select { width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid #aeb5ae; border-radius: 2px; outline: none; color: var(--ink); background: white; transition: border-color .16s, box-shadow .16s, transform .16s; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 3px 3px 0 var(--blue-soft); transform: translate(-1px,-1px); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.button { min-height: 46px; padding: 0 17px; border: 1px solid var(--ink); border-radius: 2px; font-size: .78rem; font-weight: 900; letter-spacing: .025em; text-transform: uppercase; transition: color .16s, background .16s, box-shadow .16s, transform .16s; }
.button:not(:disabled):hover { transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--ink); }
.button:active { transform: translate(0,0); box-shadow: none; }
.button.primary { width: 100%; display: flex; justify-content: space-between; align-items: center; color: var(--ink); background: var(--acid); }
.button.primary:hover { color: white; background: var(--acid-dark); }
.button.primary:disabled { color: #768066; background: #d7ddc5; }
.button.secondary { color: var(--ink); background: var(--white); }
.button.secondary:hover { color: white; background: var(--ink); }
.form-error { min-height: 17px; margin: 9px 0 0; color: var(--red); font-size: .78rem; font-weight: 700; }

.section-header, .auction-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.auction-header { justify-content: flex-end; margin-bottom: 10px; }
.section-header h1 { margin: 0; font-size: clamp(3rem, 6vw, 5.5rem); line-height: .82; letter-spacing: -.035em; text-transform: uppercase; }
.code-pill { padding: 9px 12px 7px; color: var(--ink); border: 1px solid var(--ink); background: var(--acid); font-family: var(--display); font-size: 1.1rem; font-weight: 900; letter-spacing: .12em; }
.role-badge { display: inline-grid; place-items: center; width: 42px; height: 42px; color: var(--ink); background: var(--acid); font-family: var(--display); font-size: 1.15rem; font-weight: 900; }

.lobby-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: 18px; }
.inline-form { display: flex; gap: 9px; }
.inline-form .button { flex: none; }
.participant-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.participant-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 68px; padding: 11px 13px; border: 1px solid #c9cec7; background: var(--paper); }
.participant-index { display: grid; place-items: center; width: 34px; height: 34px; color: white; background: var(--ink); font-family: var(--display); font-weight: 900; }
.participant-item strong, .participant-item small { display: block; }
.participant-item small { margin-top: 2px; color: var(--muted); font-size: .69rem; text-transform: uppercase; }
.participant-item.occupied { border-color: var(--ink); background: white; }
.participant-item.current { outline: 3px solid var(--acid); outline-offset: -3px; }
.participant-item.pending { color: #919892; border-style: dashed; }
.participant-item.pending { grid-template-columns: 34px minmax(0, 1fr); }
.access-link-button { min-height: 29px; padding: 0 8px; color: var(--blue); border: 1px solid currentColor; background: transparent; font-size: .61rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.access-link-button:hover { color: white; border-color: var(--blue); background: var(--blue); }
.presence-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; color: var(--muted); font-size: .6rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.presence-badge i { width: 7px; height: 7px; border-radius: 50%; background: #9aa19d; }
.presence-badge.live { color: var(--green); }
.presence-badge.live i { background: var(--green); box-shadow: 0 0 0 4px rgba(19,166,109,.13); }
.summary-panel { background: var(--blue); color: white; box-shadow: 6px 6px 0 var(--acid); }
.summary-panel .eyebrow { color: white; }
.summary-panel dl { margin: 0 0 24px; }
.summary-panel dl div { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,.14); }
.summary-panel dt { color: #9ea8b6; font-size: .78rem; text-transform: uppercase; }
.summary-panel dd { margin: 0; font-family: var(--display); font-size: 1.1rem; font-weight: 900; }
.invite-box { margin-top: 23px; padding-top: 19px; border-top: 1px solid #d6dad3; }

.auction-layout { display: grid; grid-template-columns: minmax(0,1fr); gap: 28px; }
.stage { position: relative; overflow: hidden; padding: 26px; color: white; border-color: #263246; background: #17243d; box-shadow: 7px 7px 0 var(--acid); }
.stage::before { content: "ASTA"; position: absolute; top: 14px; right: 18px; color: rgba(255,255,255,.035); font-family: var(--display); font-size: 5rem; font-weight: 900; line-height: 1; pointer-events: none; }
.stage .eyebrow { color: var(--acid); }
.waiting-lot { min-height: 188px; display: grid; place-content: center; text-align: center; }
.waiting-lot h2 { font-size: clamp(1.8rem, 3vw, 2.8rem); }
.waiting-lot .button { width: auto; justify-content: center; }
.waiting-lot .text-button { margin-top: 14px; }
#active-lot { position: relative; padding: 10px 0; }
#active-lot > .form-error:empty { display: none; }
#active-lot:not(.hidden) .player-card { animation: player-enter .35s cubic-bezier(.2,.8,.2,1); }
.lot-navigation { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.lot-navigation.compact { margin-top: 11px; }
.lot-navigation.compact .button { min-width: 116px; }
.stage .button.secondary { color: white; border-color: #465268; background: transparent; }
.stage .button.secondary:hover { color: var(--ink); background: var(--acid); box-shadow: 4px 4px 0 #465268; }
.current-lot-grid { display: grid; grid-template-columns: minmax(390px, 1.35fr) minmax(190px, .48fr) minmax(250px, .68fr); gap: 0; align-items: stretch; }
.player-card { min-height: 190px; display: grid; grid-template-columns: 154px minmax(0,1fr); align-items: center; gap: 24px; padding-right: 28px; }
.player-card img { width: 154px; height: 176px; object-fit: contain; border: 1px solid rgba(255,255,255,.18); border-radius: 0; background: #202c40; box-shadow: 6px 6px 0 rgba(255,107,74,.88); }
.player-card h1 { margin: 8px 0 0; overflow-wrap: anywhere; color: white; font-size: clamp(3rem, 5.2vw, 5.8rem); line-height: .82; letter-spacing: -.025em; text-transform: uppercase; }
.player-card .muted { margin: 14px 0 0; color: #98a3b2; font-size: 1rem; }
.player-meta { display: flex; align-items: center; gap: 12px; }
.player-meta .eyebrow { margin: 0; }
.bid-display { display: grid; place-content: center; padding: 20px; text-align: center; border-left: 1px solid #344157; border-right: 1px solid #344157; background: rgba(255,255,255,.025); }
.bid-display span, .bid-display p { color: #98a3b2; }
.bid-display span { font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.bid-display strong { display: block; margin: 6px 0; color: var(--acid); font-family: var(--display); font-size: 4.5rem; line-height: .9; }
.bid-display p { margin: 3px 0 0; font-size: .82rem; }
.bid-action { display: grid; align-content: center; padding-left: 28px; text-align: center; }
.timer { color: var(--acid); font-family: var(--display); font-variant-numeric: tabular-nums; font-size: 4.5rem; font-weight: 900; line-height: .9; letter-spacing: -.03em; }
.timer.waiting { position: relative; display: inline-flex; justify-self: center; align-items: center; gap: 9px; color: #c7ced7; font-family: var(--body); font-size: .73rem; letter-spacing: .12em; text-transform: uppercase; }
.timer.waiting::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 0 rgba(255,107,74,.45); animation: live-pulse 1.6s infinite; }
.timer.danger { color: #ff5c55; }
.bid-form { display: grid; grid-template-columns: minmax(0,1fr) 118px; gap: 8px; margin-top: 14px; }
.bid-form .button { justify-content: center; }
.stage input, .stage select { border-color: #465268; }

.nomination-box { position: relative; z-index: 1; margin: 24px -26px -26px; padding: 24px 26px 26px; color: var(--ink); border-top: 1px solid var(--ink); background: var(--paper); }
.nomination-box .eyebrow { color: var(--blue); }
.search-results { display: grid; gap: 7px; margin-top: 10px; }
.search-result { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); background: white; }
.search-result p { margin: 0; }
.search-result small { color: var(--muted); }
.availability-controls { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 17px; padding: 12px 14px; border: 1px solid var(--ink); background: white; }
.availability-controls label { display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
.availability-controls input { width: 17px; min-height: 17px; accent-color: var(--blue); }
.requests-status { margin: 13px 0 0; padding: 10px 12px; color: #075d3c; border-left: 4px solid var(--green); background: #e5f5ec; font-size: .78rem; font-weight: 800; }
.requests-status.closed { color: var(--muted); border-left-color: #9da49d; background: #e4e5df; }
.drawer-search { margin: 16px 0 2px; }
.drawer-search input { min-width: 0; }
.assignment-form { margin-top: 13px; padding: 15px; border: 1px solid var(--blue); background: var(--blue-soft); box-shadow: 4px 4px 0 rgba(52,87,255,.18); }
.assignment-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.assignment-heading .eyebrow { margin-bottom: 4px; }
.assignment-fields { display: grid; grid-template-columns: minmax(180px,1fr) 130px 130px; gap: 9px; align-items: end; margin-top: 13px; }
.assignment-fields label { margin: 0; }
.assignment-fields .button { width: 100%; justify-content: center; }
.role-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0 11px; }
.role-tab { min-width: 78px; height: 45px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 0 11px; color: var(--muted); border: 1px solid #aeb5ae; border-radius: 0; background: white; font-weight: 900; }
.role-tab small { font-size: .66rem; font-variant-numeric: tabular-nums; }
.role-tab.active { color: var(--ink); border-color: var(--ink); background: var(--acid); box-shadow: 3px 3px 0 var(--ink); transform: translate(-2px,-2px); }
.available-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; max-height: 340px; overflow-y: auto; padding-right: 3px; }
.available-player { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 10px 11px; border: 1px solid #c4c9c2; background: white; transition: border-color .15s, transform .15s; }
.available-player:hover { border-color: var(--ink); transform: translateY(-1px); }
.available-player > div { min-width: 0; }
.available-player-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.available-player-title strong { min-width: 0; }
.available-role-badge { flex: none; display: inline-grid; place-items: center; width: 23px; height: 23px; color: white; font-size: .66rem; font-weight: 900; }
.available-role-badge.role-p { background: #9b6b00; }
.available-role-badge.role-d { background: #08734a; }
.available-role-badge.role-c { background: #264fcb; }
.available-role-badge.role-a { background: #c73732; }
.search-match { padding: 0 1px; color: inherit; background: #ffd85a; box-shadow: inset 0 -1px 0 #8a6720; }
.available-player strong, .available-player small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.available-player small { margin-top: 3px; color: var(--muted); font-size: .69rem; }
.available-player .requesters { color: var(--blue); font-weight: 800; white-space: normal; }
.available-player.current { border-color: var(--blue); background: var(--blue-soft); }
.available-player .button { flex: none; min-height: 34px; padding: 0 9px; font-size: .68rem; }
.available-actions { display: flex; flex: none; gap: 5px; }
.preference-button { min-width: 36px; padding: 0 8px !important; color: #8a6720 !important; border-color: #b8943b !important; font-size: 1rem !important; }
.preference-button.active { color: var(--ink) !important; background: #ffd85a !important; }
.preferences-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.preferences-heading .button { min-height: 34px; padding: 0 10px; font-size: .62rem; }
.preferences-help { margin: 0 0 18px; font-size: .78rem; line-height: 1.5; }
#preferences-list { display: grid; grid-template-columns: 1fr; max-height: none; overflow: visible; }

.teams-section { min-width: 0; }
.teams-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 13px; }
.team-switcher { display: none; }
.teams-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(286px,1fr); gap: 10px; overflow-x: auto; padding: 0 6px 14px 0; scroll-snap-type: x proximity; }
.team-column { min-height: 0; overflow: hidden; border: 1px solid var(--ink); border-radius: 2px; background: var(--white); box-shadow: 4px 4px 0 rgba(10,18,32,.12); scroll-snap-align: start; }
.team-column.current { outline: 4px solid var(--acid); outline-offset: -4px; }
.team-header { min-height: 88px; display: flex; align-items: flex-start; justify-content: space-between; padding: 17px; color: white; border-bottom: 1px solid var(--ink); background: var(--ink); }
.team-column.current .team-header { color: var(--ink); background: var(--acid); }
.team-header .eyebrow { color: var(--acid); }
.team-column.current .team-header .eyebrow { color: #6c2015; }
.team-header h3 { margin: 0; font-size: 1.3rem; line-height: 1; text-transform: uppercase; }
.team-header .presence-badge.offline { color: #9ca7b5; }
.team-column.current .team-header .presence-badge.offline { color: #6c2015; }
.team-access { display: grid; justify-items: end; gap: 8px; }
.team-header .access-link-button { color: var(--acid); border-color: currentColor; }
.team-header .access-link-button:hover { color: var(--ink); background: var(--acid); }
.team-column.current .team-header .access-link-button { color: var(--ink); }
.team-column.current .team-header .access-link-button:hover { color: white; border-color: var(--ink); background: var(--ink); }
.you-badge { display: inline-block; margin-left: 7px; padding: 3px 5px 2px; color: var(--ink); background: var(--acid); font-family: var(--body); font-size: .55rem; font-style: normal; font-weight: 900; line-height: 1; vertical-align: 3px; text-transform: uppercase; }
.team-column.current .you-badge { color: white; background: var(--ink); }
.team-credits { display: grid; text-align: right; }
.team-credits strong { color: var(--acid); font-family: var(--display); font-size: 2rem; line-height: .85; }
.team-column.current .team-credits strong { color: var(--ink); }
.team-credits span { margin-top: 4px; color: #9ca7b5; font-size: .6rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.team-column.current .team-credits span { color: #6c2015; }
.roster-role { --role: #626b77; --role-soft: #eff0eb; margin: 9px; overflow: hidden; border: 1px solid #d1d4ce; background: white; }
.roster-role.role-p { --role: #9b6b00; --role-soft: #fff1b8; }
.roster-role.role-d { --role: #08734a; --role-soft: #dff3e8; }
.roster-role.role-c { --role: #264fcb; --role-soft: #e3e9ff; }
.roster-role.role-a { --role: #c73732; --role-soft: #ffe5e1; }
.roster-role > header { min-height: 36px; display: flex; justify-content: space-between; align-items: center; padding: 6px 9px; color: var(--role); border-bottom: 2px solid var(--role); background: var(--role-soft); font-size: .66rem; font-weight: 900; letter-spacing: .055em; text-transform: uppercase; }
.roster-role > header span { display: flex; align-items: center; gap: 7px; }
.roster-role > header b { display: grid; place-items: center; width: 23px; height: 23px; color: white; background: var(--role); font-size: .68rem; }
.roster-role > header strong { min-width: 34px; padding: 3px 5px; text-align: center; }
.roster-list { padding: 4px 10px 7px; }
.roster-player { display: flex; justify-content: space-between; padding: 7px 0; color: #4d5661; border-bottom: 1px solid #e4e6e1; font-size: .78rem; }
.roster-player:last-child { border-bottom: 0; }
.roster-player strong { color: var(--role); }
.roster-player.empty-slot { color: #aeb4ae; border-bottom-style: dashed; }
.roster-player.empty-slot strong { color: #c5cac4; }

.text-button { padding: 4px 0; color: var(--muted); border: 0; background: transparent; font-size: .76rem; font-weight: 800; letter-spacing: .035em; text-decoration: none; text-transform: uppercase; }
.text-button:hover { color: var(--ink); }
.stage .text-button { color: #aeb7c4; }
.stage .text-button:hover { color: white; }
.danger-action { color: var(--red); }
.stage .danger-action { color: #ff655f; }
.danger-action:hover, .stage .danger-action:hover { color: #ff655f; }
.header-actions { display: flex; gap: 16px; }
.join-layout { width: min(540px,100%); margin: 9vh auto 0; box-shadow: 8px 8px 0 var(--acid); }
.join-layout h1 { margin: 0 0 25px; font-size: clamp(2.4rem,5vw,4rem); line-height: .9; text-transform: uppercase; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: 390px; padding: 13px 16px; color: white; border: 1px solid var(--acid); border-radius: 0; background: var(--ink); box-shadow: 5px 5px 0 var(--acid); font-size: .8rem; font-weight: 800; }
.confirm-dialog { width: min(444px, calc(100% - 30px)); padding: 0; color: var(--ink); border: 1px solid var(--ink); border-radius: 3px; background: var(--white); box-shadow: 9px 9px 0 var(--acid); }
.confirm-dialog::backdrop { background: rgba(10,18,32,.66); }
.confirm-card { display: grid; gap: 11px; padding: 26px 26px 22px; }
.confirm-card h2 { margin: 0; font-family: var(--display); font-size: 1.85rem; line-height: 1; text-transform: uppercase; letter-spacing: -.01em; }
.confirm-card p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: .87rem; line-height: 1.45; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 9px; }
.confirm-actions .button { min-width: 128px; display: flex; justify-content: center; }
.confirm-actions .button.accept { color: var(--ink); background: var(--acid); }
.confirm-actions .button.accept:hover { color: white; background: var(--acid-dark); }
.confirm-actions .button.accept.danger { color: white; border-color: var(--red); background: var(--red); }
.confirm-actions .button.accept.danger:hover { color: white; background: #c9302a; }

@media (max-width: 1080px) {
  #welcome-view { grid-template-columns: minmax(260px,.62fr) minmax(470px,1.38fr); gap: 32px; padding: 40px; }
  .current-lot-grid { grid-template-columns: 1fr 1fr; }
  .player-card { grid-column: 1 / -1; padding: 0 0 22px; }
  .bid-display { border-left: 0; }
  .bid-action { padding-left: 22px; }
  .available-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 820px) {
  #welcome-view, .lobby-grid { grid-template-columns: 1fr; }
  #welcome-view { min-height: auto; }
  #welcome-view::after { display: none; }
  .welcome-copy { max-width: 620px; }
  .home-workspace { width: 100%; }
  .teams-board { grid-auto-columns: minmax(280px,65vw); }
  .team-switcher { display: flex; gap: 7px; overflow-x: auto; margin: 0 -2px 11px; padding: 2px 2px 7px; scrollbar-width: none; }
  .team-switcher::-webkit-scrollbar { display: none; }
  .team-switcher button { flex: none; min-height: 36px; padding: 0 12px; color: var(--muted); border: 1px solid #aeb5ae; background: var(--white); font-size: .68rem; font-weight: 850; text-transform: uppercase; }
  .team-switcher button.active { color: white; border-color: var(--blue); background: var(--blue); box-shadow: 3px 3px 0 var(--acid); }
  .assignment-fields { grid-template-columns: 1fr 110px; }
  .assignment-fields .button { grid-column: 1 / -1; }
  .media-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 640px) {
  body::before { background-size: 32px 32px; }
  .app-shell { width: min(100% - 20px,1440px); padding: 16px 0 20px; }
  .topbar { height: 58px; gap: 8px; padding: 0 11px; }
  .drawer-backdrop { top: 58px; }
  .side-drawer { top: 58px; width: min(440px, calc(100vw - 14px)); }
  .drawer-content { padding: 16px 14px 30px; }
  .brand-logo { display: none; }
  .brand-icon { display: block; }
  .current-identity > span { display: none; }
  .current-identity { min-width: 0; }
  .current-identity strong { max-width: 35vw; }
  .drawer-trigger { min-width: 74px; width: auto; min-height: 38px; padding: 0 10px; justify-content: center; overflow: visible; color: white; gap: 6px; white-space: nowrap; }
  .drawer-trigger span { color: white; font-size: .92rem; }
  .media-prejoin { padding: 10px; }
  .media-prejoin-card { padding: 18px 14px; box-shadow: 5px 5px 0 var(--acid); }
  .media-prejoin-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .media-prejoin-confirm { align-items: stretch; flex-direction: column-reverse; }
  .media-prejoin-confirm .button { width: 100%; }
  .media-strip-head { align-items: flex-start; flex-direction: column; }
  .media-strip-controls { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .media-strip-controls .media-status { grid-column: 1 / -1; }
  .media-grid { grid-template-columns: 1fr 1fr; }
  .media-tile { min-height: 145px; }
  #welcome-view { gap: 30px; padding: 30px 20px; box-shadow: 5px 5px 0 var(--acid); }
  .welcome-copy h1 { font-size: clamp(3.1rem,16vw,5rem); }
  .welcome-copy > p:last-child { margin-top: 18px; font-size: .95rem; }
  .home-actions { grid-template-columns: 1fr; }
  .home-action { min-height: 82px; grid-template-columns: 30px minmax(0,1fr); align-items: center; align-content: center; gap: 3px 9px; }
  .home-action > span { grid-row: 1 / 3; }
  .home-action small { grid-column: 2; }
  .resume-panel { min-height: 200px; padding: 17px; }
  .my-auction { grid-template-columns: auto minmax(0,1fr); }
  .auction-status { display: none; }
  .form-panel, .lobby-grid > .panel, .join-layout { padding: 20px; }
  .form-row, .participant-list, .current-lot-grid { grid-template-columns: 1fr; }
  .section-header { align-items: flex-start; margin-bottom: 18px; }
  .section-header h1 { font-size: clamp(2.8rem,14vw,4.3rem); }
  .section-header .code-pill { margin-top: 4px; }
  .participant-item { min-height: 62px; }
  .inline-form { display: grid; grid-template-columns: 1fr; }
  .inline-form .button { width: 100%; }
  .auction-header { min-height: 30px; margin-bottom: 5px; }
  .header-actions { gap: 12px; }
  .stage { padding: 16px; box-shadow: 4px 4px 0 var(--acid); }
  .stage::before { font-size: 3.5rem; }
  .waiting-lot { min-height: 166px; padding: 14px 0; }
  #active-lot { padding: 0; }
  .player-card { min-height: 0; grid-template-columns: 92px minmax(0,1fr); gap: 15px; padding-bottom: 17px; }
  .player-card img { width: 92px; height: 110px; box-shadow: 4px 4px 0 var(--acid); }
  .player-card h1 { font-size: clamp(2.35rem,12vw,4rem); }
  .player-card .muted { margin-top: 9px; font-size: .82rem; }
  .role-badge { width: 34px; height: 34px; font-size: 1rem; }
  .bid-display { padding: 18px 8px; border: 0; border-top: 1px solid #344157; border-bottom: 1px solid #344157; }
  .bid-display strong { font-size: 4rem; }
  .bid-action { padding: 18px 0 0; }
  .timer { font-size: 3.5rem; }
  .bid-form { grid-template-columns: minmax(0,1fr) 112px; }
  .lot-navigation.compact .button { min-width: 0; padding: 0 11px; }
  .nomination-box { margin-right: -16px; margin-bottom: -16px; margin-left: -16px; padding: 20px 16px 18px; }
  .available-list { grid-template-columns: 1fr; max-height: 400px; }
  .assignment-fields { grid-template-columns: 1fr; }
  .assignment-fields .button { grid-column: auto; }
  .role-tabs { display: grid; grid-template-columns: repeat(4,1fr); }
  .role-tab { min-width: 0; padding: 0 6px; }
  .available-player { align-items: flex-start; }
  .available-actions { flex-direction: column; }
  .teams-board { width: calc(100vw - 10px); margin-right: -10px; grid-auto-columns: minmax(280px,87vw); gap: 9px; padding-right: 10px; scroll-snap-type: x mandatory; }
  .team-column { min-height: 0; scroll-snap-align: start; }
  .team-header { min-height: 80px; padding: 14px; }
  .toast { right: 11px; bottom: 11px; left: 11px; max-width: none; text-align: center; }
  .confirm-card { padding: 20px 18px 18px; }
  .confirm-actions { flex-direction: column-reverse; }
  .confirm-actions .button { width: 100%; }
}

@media (max-width: 390px) {
  .app-shell { width: min(100% - 14px,1440px); }
  .media-grid { grid-template-columns: 1fr; }
  #welcome-view { padding: 26px 15px; }
  .form-panel, .lobby-grid > .panel, .join-layout { padding: 16px; }
  .player-card { grid-template-columns: 76px minmax(0,1fr); gap: 11px; }
  .player-card img { width: 76px; height: 94px; }
  .bid-form { grid-template-columns: 1fr; }
  .lot-navigation { flex-direction: column; }
  .teams-board { grid-auto-columns: 91vw; }
}
