/* The live auction: the 3D room, the player card on your table, the paddle and the side panels. */
.auction-grid { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: var(--s4); display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: var(--s4); align-items: start; }
.stage { display: grid; gap: var(--s3); }

.stage .room-frame { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: var(--c-black); line-height: 1.4; }
.room-view { position: absolute; inset: 0; }
.room-view canvas { display: block; width: 100%; height: 100%; object-fit: cover; }

/* The player card, lying on your table */
.lot { position: absolute; z-index: 1; left: 50%; bottom: var(--s2); width: min(54%, 430px); transform: translateX(-50%); display: grid; gap: 6px; padding: var(--s3); overflow: hidden; border: 1px solid var(--c-paper); border-radius: var(--r); box-shadow: 0 8px 24px rgb(0 0 0 / 0.5); }
.lot.is-paused > :not(.stamp) { opacity: 0.6; }
.lot.bump .bid-amount { animation: bump 240ms var(--tick); }
@keyframes bump { 40% { transform: translateY(-3px); } }
.lot-meta { display: flex; flex-wrap: wrap; gap: var(--s1); max-height: 22px; overflow: hidden; }
.lot-name { font-size: var(--t-xl); line-height: 1; overflow-wrap: anywhere; }
.lot-rates { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--s1); }
.lot-rate { padding: var(--s1) 2px; border-radius: var(--r-small); background: var(--c-panel); text-align: center; cursor: help; }
.lot-rate strong { display: block; font: 700 26px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.lot-rate span { font-size: var(--t-micro); color: var(--muted); }
.lot-sub { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1); color: var(--fg-2); font-size: 13px; }
.lot-sub b { color: var(--c-paper); }
.lot-bid { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); }
.bid-box { display: grid; }
.bid-label { font-size: var(--t-micro); color: var(--muted); }
.bid-amount { display: inline-block; font: 700 32px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.bid-leader { display: inline-flex; align-items: center; gap: var(--s2); min-height: 32px; font-size: 14px; text-align: right; }

.clock { display: flex; align-items: center; gap: var(--s2); }
.clock-track { flex: 1; height: 8px; border-radius: var(--r-small); overflow: hidden; background: var(--c-panel); }
.clock-bar { height: 100%; width: 100%; transform-origin: left; background: var(--c-paper); }
.lot.is-low .clock-bar { background: var(--c-red); }
.clock-secs { min-width: 2ch; text-align: right; font: 700 18px/1 var(--font-display); }
.lot.is-low .clock-secs { color: var(--bad); animation: pulse 0.5s ease-in-out infinite; }

.stamp { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--s2); background: rgb(17 20 15 / 0.92); visibility: hidden; pointer-events: none; }
.stamp.is-on { visibility: visible; }
.stamp b { font: 700 var(--t-2xl)/1 var(--font-display); text-transform: uppercase; padding: var(--s1) var(--s4); border: 4px solid currentColor; border-radius: var(--r); transform: rotate(-4deg); }
.stamp.is-on b { animation: stamp 200ms var(--tick); }
.stamp span { color: var(--c-paper); font-size: 15px; }
.stamp-sold { color: var(--c-mint); }
.stamp-unsold { color: var(--c-steel); }
@keyframes stamp { from { transform: rotate(-4deg) scale(1.6); } }

.next-strip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); padding: var(--s2) var(--s3); }
.next-strip small { font: 500 var(--t-micro)/1.1 var(--font-label); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.next-strip b { font-size: 15px; }
.next-strip span { color: var(--fg-2); font-size: 14px; }
.next-strip .next-rating { margin-left: auto; font: 500 15px/1.1 var(--font-label); color: var(--c-paper); }

.paddle-area { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--s2) var(--s4); align-items: center; padding: var(--s3); }
.paddle-info { display: grid; gap: var(--s2); }
.wallet { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }
.wallet small { display: block; font-size: var(--t-micro); color: var(--muted); }
.wallet b { font: 500 18px/1.1 var(--font-label); }
.paddle { min-height: 76px; display: grid; place-content: center; gap: 2px; border: 1px solid var(--c-paper); border-radius: var(--r); background: var(--c-paper); color: var(--c-ink); cursor: pointer; }
.paddle small { font: 500 13px/1.1 var(--font-label); text-transform: uppercase; letter-spacing: 0.06em; }
.paddle b { font: 700 var(--t-xl)/1 var(--font-display); }
.paddle:hover:not(:disabled) { background: var(--c-white); }
.paddle:active:not(:disabled) { transform: translateY(2px); }
.paddle:disabled { cursor: not-allowed; background: var(--c-panel); border-color: var(--line); color: var(--muted); }
.paddle-hint { font-size: 14px; color: var(--muted); }
.lot-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.panels-btn { display: none; }

.side { position: sticky; top: 64px; padding: var(--s2) var(--s3) var(--s3); }
.side .tabs { margin-top: 0; }
.tab-panel { margin-top: var(--s3); max-height: calc(100dvh - 170px); overflow-y: auto; }
.tab-panel .feed-list { max-height: calc(100dvh - 250px); min-height: 200px; }

/* Full screen: the room fills everything, and every other part sits inside it. */
body.room-immersive { overflow: hidden; }
.auction.is-immersive { --panel-space: 372px; position: fixed; inset: 0; z-index: 20; min-height: 0; background: var(--c-black); }
.auction.is-immersive.is-panels-closed { --panel-space: 0px; }
.is-immersive .panels-btn { display: inline-flex; }
.is-immersive .topbar { position: absolute; inset: 0 0 auto; z-index: 3; background: rgb(17 20 15 / 0.86); }
.is-immersive .auction-grid { position: absolute; inset: 0; display: block; max-width: none; padding: 0; }
.is-immersive .stage { position: absolute; inset: 0; display: block; }
.is-immersive .stage .room-frame { position: absolute; inset: 0; aspect-ratio: auto; border: 0; border-radius: 0; }
.is-immersive .lot { left: calc((100% - var(--panel-space)) / 2); bottom: var(--s3); width: min(400px, 40%); }
.is-immersive .next-strip { position: absolute; z-index: 2; top: 62px; left: var(--s3); max-width: min(640px, calc(100% - var(--panel-space) - 24px)); background: rgb(17 20 15 / 0.86); }
.is-immersive .paddle-area { display: contents; }
/* One stack in the corner, so however the buttons wrap they push the rest up instead of covering it. */
.is-immersive .paddle-info { position: absolute; z-index: 2; left: var(--s3); bottom: var(--s3); width: 236px; display: flex; flex-direction: column; gap: var(--s2); }
.is-immersive .wallet, .is-immersive .paddle-hint { padding: 6px var(--s3); border-radius: var(--r); background: rgb(17 20 15 / 0.86); }
.is-immersive .wallet { gap: var(--s2); justify-content: space-between; flex-wrap: nowrap; }
.is-immersive .wallet .crest { display: none; }
.is-immersive .paddle-hint { order: -1; color: var(--fg-2); }
.is-immersive .paddle-hint:empty { display: none; }
.is-immersive .lot-actions .btn { min-height: 44px; padding: 0 var(--s3); font-size: 14px; }
.is-immersive .paddle { position: absolute; z-index: 2; right: calc(var(--panel-space) + var(--s3)); bottom: var(--s3); width: 200px; min-height: 60px; }
.is-immersive .paddle b { font-size: 24px; }
.is-immersive .side { position: absolute; z-index: 2; top: 62px; right: var(--s3); bottom: var(--s3); width: 350px; display: flex; flex-direction: column; background: rgb(45 51 44 / 0.95); }
.is-immersive.is-panels-closed .side { display: none; }
.is-immersive .tab-panel { flex: 1; min-height: 0; max-height: none; }
.is-immersive .tab-panel .feed { height: 100%; }
.is-immersive .tab-panel .feed-list { flex: 1; max-height: none; min-height: 0; }

.teams-board { display: grid; gap: var(--s2); }
.team-row { border-radius: var(--r-small); background: var(--surface-2); border-left: 4px solid var(--team-bright); }
.team-row summary { display: flex; align-items: center; gap: var(--s2); padding: var(--s2); cursor: pointer; list-style: none; }
.team-row summary::-webkit-details-marker { display: none; }
.team-row summary > * { pointer-events: none; }
.team-row-name { display: grid; flex: 1; min-width: 0; line-height: 1.2; }
.team-row-name b, .team-row-name small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-row-stats { display: grid; justify-items: end; line-height: 1.2; }
.team-row > .btn { margin: 0 var(--s2) var(--s2); }
.team-row > div > p { padding: 0 var(--s2) var(--s2); }
.squad-list { list-style: none; margin: 0; padding: 0 var(--s2) var(--s2); display: grid; gap: 2px; font-size: 14px; }
.squad-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--s2); align-items: center; }
.squad-gaps { margin-bottom: var(--s3); }
.gaps-warn, .gaps-ok { margin: 0; padding: var(--s2); border-radius: var(--r-small); background: var(--surface-2); font-size: 14px; }
.gaps-warn { color: var(--bad); }
.gaps-ok { color: var(--good); }
.xi .gaps-warn { margin: 0 var(--s2) var(--s2); }

.upcoming { list-style: none; margin: 0; padding: 0; display: grid; }
.upcoming li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: var(--s2); align-items: center; padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.up-no { display: grid; place-items: center; height: 22px; border-radius: var(--r-small); background: var(--c-black); font: 600 var(--t-micro)/1.1 var(--font-micro); }
.up-who { display: grid; min-width: 0; line-height: 1.25; }
.up-who small { color: var(--fg-2); font-size: 13px; }
.up-rating { font: 500 15px/1.2 var(--font-label); text-align: right; }

.needs { display: grid; gap: var(--s3); }
.need-card { padding: var(--s2); border-radius: var(--r-small); background: var(--surface-2); border-left: 4px solid var(--team-bright); }
.need-card.is-mine { outline: 1px solid var(--c-paper); }
.need-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.need-head b { font: 500 16px/1.1 var(--font-label); }
.need-head small { margin-left: auto; color: var(--fg-2); font-size: 13px; }
.need-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.need-grid li { display: flex; justify-content: space-between; align-items: center; gap: var(--s1); padding: 2px var(--s1); border-radius: var(--r-small); font: 600 11px/1.3 var(--font-micro); }
.need-grid .is-covered { background: #bfe3c4; color: #10381f; }
.need-grid .is-thin { background: var(--c-paper); color: var(--c-ink); }
.need-grid .is-missing { background: var(--c-red); color: var(--c-white); }
.need-line { margin-top: var(--s2); font-size: 13px; color: var(--fg-2); }

@media (max-width: 1100px) {
  .auction.is-immersive { --panel-space: 0px; }
  .is-immersive .side { z-index: 4; background: var(--c-panel); }
}
@media (max-width: 600px) {
  .topbar { gap: var(--s2); flex-wrap: wrap; padding-inline: var(--s3); }
  .topbar-mid { order: 3; width: 100%; }
}

/* A phone: the app fills the window with tabs along the bottom, whichever full screen choice was made on a computer. */
.phone-tabs, .phone-mini, .menu-btn, .menu-only { display: none; }
.auction.is-phone { --top-h: 48px; --tabs-h: calc(52px + env(safe-area-inset-bottom)); --dock-h: 108px; --panel-space: 0px; position: fixed; inset: 0; z-index: 20; min-height: 0; overflow: hidden; overscroll-behavior: none; background: var(--c-black); }

.is-phone .topbar { position: absolute; inset: 0 0 auto; z-index: 5; height: var(--top-h); flex-wrap: nowrap; gap: var(--s2); padding: 0 var(--s2); background: var(--c-black); }
.is-phone .brand, .is-phone .room-code small, .is-phone .panels-btn, .is-phone .lot-skip, .is-phone .paddle-hint { display: none; }
.is-phone .topbar-mid { order: 0; flex: 1; width: auto; white-space: nowrap; overflow: hidden; }
.is-phone .topbar-mid .muted { overflow: hidden; text-overflow: ellipsis; }
.is-phone .room-code { flex: none; min-height: 40px; align-items: center; }
.is-phone .menu-btn { display: inline-flex; flex: none; padding: 0 var(--s3); }
.is-phone .topbar-actions { display: none; position: absolute; top: 100%; right: var(--s2); width: 220px; flex-direction: column; align-items: stretch; padding: var(--s2); border: 1px solid var(--line); border-radius: var(--r); background: var(--c-black); }
.is-phone.is-menu-open .topbar-actions { display: flex; }
.is-phone .host-controls { display: grid; grid-template-columns: 1fr 1fr; }
.is-phone .topbar-actions .btn { min-height: 44px; }
.is-phone .menu-only { display: inline-flex; }

.is-phone .auction-grid, .is-phone .stage { position: absolute; inset: 0; display: block; max-width: none; padding: 0; }
.is-phone .stage .room-frame { position: absolute; inset: var(--top-h) 0 var(--tabs-h); aspect-ratio: auto; border: 0; border-radius: 0; }
.is-phone .lot { left: var(--s2); bottom: calc(var(--dock-h) + var(--s2)); width: min(70%, 300px); transform: none; padding: var(--s2); gap: var(--s1); }
.is-phone .lot-name { font-size: 22px; }
.is-phone .lot-rate strong { font-size: 20px; }
.is-phone .bid-amount { font-size: 24px; white-space: nowrap; }
.is-phone .bid-label { white-space: nowrap; }
.is-phone .bid-leader { min-height: 0; font-size: 13px; line-height: 1.15; }
.leader-code { display: none; }
.is-phone .bid-leader .crest { --size: 24px; }
.is-phone .next-strip { position: absolute; z-index: 2; top: calc(var(--top-h) + var(--s2)); left: var(--s2); right: var(--s2); max-width: none; flex-wrap: nowrap; padding: var(--s1) var(--s2); white-space: nowrap; overflow: hidden; background: rgb(17 20 15 / 0.86); }
.is-phone .next-strip span:not(.next-rating) { overflow: hidden; text-overflow: ellipsis; }

/* Always there, on every tab: what the lot is doing, and the paddle. */
.is-phone .paddle-area { position: absolute; z-index: 3; left: 0; right: 0; bottom: var(--tabs-h); height: var(--dock-h); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-rows: 30px minmax(0, 1fr); gap: var(--s1) var(--s2); align-items: stretch; padding: var(--s1) var(--s2) var(--s2); border: 0; border-top: 1px solid var(--line); border-radius: 0; background: var(--c-black); }
.is-phone .paddle-info { display: contents; }
.is-phone .wallet, .is-phone .phone-mini { grid-area: 1 / 1 / 2 / 3; min-width: 0; align-items: center; }
.is-phone .wallet { position: static; width: auto; display: flex; flex-wrap: nowrap; justify-content: space-between; gap: var(--s2); padding: 0 var(--s1); border-radius: 0; background: none; }
.is-phone .wallet .crest { display: none; }
.is-phone .wallet > div { display: flex; align-items: baseline; gap: var(--s1); }
.is-phone .wallet b { font-size: 16px; white-space: nowrap; }
.is-phone .lot-actions { grid-area: 2 / 1; position: static; display: flex; flex-wrap: nowrap; max-width: none; gap: var(--s1); }
.is-phone .lot-actions .btn { flex: 1 1 0; min-width: 0; height: 100%; min-height: 0; padding: 0 var(--s1); font-size: 13px; line-height: 1.1; }
.is-phone .paddle { grid-area: 2 / 2; position: static; width: auto; min-height: 0; touch-action: manipulation; user-select: none; }
.is-phone .paddle b { font-size: 22px; }
.is-phone .paddle.has-reason small { text-transform: none; letter-spacing: 0; font: 500 12px/1.15 var(--font-body); }
.is-phone .paddle.has-reason b { font-size: 15px; }

.auction.is-phone:not([data-phone-tab='room']) .wallet { display: none; }
.auction.is-phone:not([data-phone-tab='room']) .phone-mini { display: flex; gap: var(--s2); padding: 0 var(--s1); }
.mini-name { flex: 1; min-width: 0; font: 500 16px/1.2 var(--font-label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-bid { flex: none; font: 500 16px/1.2 var(--font-label); }
.mini-clock { flex: none; min-width: 2ch; font: 700 18px/1 var(--font-display); text-align: right; }
.mini-clock.is-low { color: var(--bad); }

.is-phone .side { display: none; }
.auction.is-phone:not([data-phone-tab='room']) .side { position: absolute; z-index: 2; inset: var(--top-h) 0 calc(var(--tabs-h) + var(--dock-h)); width: auto; display: flex; flex-direction: column; padding: var(--s2) var(--s3); border: 0; border-radius: 0; background: var(--c-panel); }
.is-phone .tabs { display: none; }
.is-phone[data-phone-tab='teams'] .tabs { display: flex; }
.is-phone .tab { display: none; }
.is-phone .tab[data-tab='teams'], .is-phone .tab[data-tab='weak'] { display: block; }
.is-phone .tab-panel { flex: 1; min-height: 0; max-height: none; margin-top: var(--s2); overscroll-behavior: contain; }
.is-phone .tab-panel .feed { height: 100%; }
.is-phone .tab-panel .feed-list { flex: 1; max-height: none; min-height: 0; }
.is-phone .team-row summary { min-height: 52px; }

.is-phone .phone-tabs { position: absolute; z-index: 3; inset: auto 0 0; height: var(--tabs-h); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); background: var(--c-black); }
.phone-tab { position: relative; min-width: 0; padding: 0 2px; border: 0; cursor: pointer; background: transparent; color: var(--muted); font: 500 14px/1.1 var(--font-label); text-transform: uppercase; letter-spacing: 0.02em; }
.phone-tab.has-new::after { content: ''; position: absolute; top: 8px; right: 12%; width: 8px; height: 8px; border-radius: 50%; background: var(--c-red); }

/* Upright phones: a compact card across the top, so the board, the tables and your paddle stay in view below it. */
@media (orientation: portrait) {
  .is-phone .lot { top: 44px; right: var(--s2); bottom: auto; width: auto; max-width: 560px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: 'meta meta' 'name name' 'rates sub' 'rates bid' 'clock clock'; gap: 3px var(--s2); }
  .is-phone .lot-meta { grid-area: meta; }
  .is-phone .lot-name { grid-area: name; font-size: 20px; }
  .is-phone .lot-rates { grid-area: rates; align-self: stretch; }
  .is-phone .lot-rate { display: grid; align-content: center; }
  .is-phone .lot-sub { grid-area: sub; flex-wrap: nowrap; font-size: 12px; white-space: nowrap; overflow: hidden; }
  .is-phone .lot-bid { grid-area: bid; align-items: center; gap: var(--s2); }
  .is-phone .bid-label { display: none; }
  .is-phone .bid-amount { font-size: 22px; }
  .is-phone .clock { grid-area: clock; }
  .is-phone .leader-full { display: none; }
  .is-phone .leader-code { display: inline; font: 500 14px/1 var(--font-label); }
}
@media (max-height: 640px) {
  .is-phone .next-strip { display: none; }
  .is-phone .lot-sub { display: none; }
}
@media (max-height: 640px) and (orientation: portrait) {
  .is-phone .lot { top: var(--s2); }
}
@media (orientation: landscape) and (max-height: 500px) {
  .auction.is-phone { --top-h: 44px; --tabs-h: calc(40px + env(safe-area-inset-bottom)); --dock-h: 60px; }
  .is-phone .next-strip { display: none; }
  .is-phone .lot { width: min(38%, 320px); }
  .is-phone .paddle-area { grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); padding: var(--s1) var(--s2); }
  .is-phone .wallet, .is-phone .phone-mini { grid-area: 1 / 1; }
  .is-phone .lot-actions { grid-area: 1 / 2; }
  .is-phone .paddle { grid-area: 1 / 3; }
  .is-phone .paddle b { font-size: 18px; }
}
@media (orientation: landscape) and (max-height: 500px) and (max-width: 700px) {
  .is-phone .paddle-area { grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.8fr) minmax(0, 0.8fr); }
}
@media (max-height: 360px) {
  .is-phone .lot-meta { display: none; }
  .is-phone .lot-rate strong { font-size: 16px; }
}
.upcoming .up-set { display: block; padding: var(--s3) 0 var(--s1); font: 700 13px/1.2 var(--font-label); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.up-count { margin-bottom: var(--s2); }
