/* Three personal room themes. Classic retains the existing app.css palette. */
.room-head { flex-wrap: wrap; }
.room-theme-picker {
  display: flex; align-items: center; gap: .45rem; flex: 0 0 auto;
  margin: 0; color: #D6DDEF; font-size: .75rem; position: relative;
}
.room-theme-picker select {
  width: 9.5rem; min-height: 44px; margin: 0; padding: .4rem 1.75rem .4rem .65rem;
  font-size: .85rem; border-radius: 10px;
}
.theme-save-note {
  position: absolute; right: 0; top: 100%; width: min(19rem, 80vw);
  padding: .65rem; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: .8rem; z-index: 40;
}
.theme-save-note[hidden] { display: none; }
@media (max-width: 640px) {
  .room.console { grid-template-columns: minmax(0, 1fr); }
  .room.console > * { min-width: 0; }
  .room.console .btn { max-width: 100%; white-space: normal; }
  .room-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: .5rem; }
  .room-head .room-back { grid-row: 1; grid-column: 1; }
  .room-head > div:not(.room-share) { grid-row: 1; grid-column: 2; }
  .room-head .room-status { grid-row: 1; grid-column: 3; margin: 0; max-width: 7rem; }
  .room-head .room-share { grid-row: 2; grid-column: 1 / 3; margin: 0; justify-self: start; }
  .room-head .room-theme-picker { grid-row: 2; grid-column: 2 / 4; margin: 0; justify-self: end; }
  .room-head .room-theme-picker select { width: 9rem; }
}

html[data-auction-theme="vibrant"] :is(body.room, body.projector) {
  --theme-bg: linear-gradient(135deg, #FFF0A6, #FFD8E9 52%, #B9F4DE);
  --theme-header: linear-gradient(105deg, #7824B8, #B91866 65%, #BC421B);
  --theme-head-text: #FFFFFF;
  --theme-panel: #FFF0CD; --theme-tile: #FFF8E8;
  --theme-lot: linear-gradient(125deg, #FFE28A, #FFC4D8 70%);
  --theme-big: #50E2C3; --theme-big-ink: #073D34;
  --theme-border: #C186AD; --theme-text: #35213F; --theme-muted: #674D6D;
  --theme-primary: linear-gradient(115deg, #AD155B, #7824B8);
  --theme-primary-ink: #FFFFFF; --theme-button: #FFE1EF;
  --theme-active: #075B3D; --theme-success: #C6F5D9;
  --theme-gold: #744000; --theme-sold: #FFD170; --theme-danger: #9E1938;
  --theme-purse: #CAF5DB; --theme-squad: #F9D8F0;
  --theme-teams: #BFEFDF; --theme-chat: #FFDBE9; --theme-sales: #FFEAA6;
  --theme-bar: #FFE9F2; --theme-focus: #7824B8;
  color-scheme: light;
}
html[data-auction-theme="black-gold"] :is(body.room, body.projector) {
  --theme-bg: radial-gradient(ellipse at top right, #2C2413, #080808 70%);
  --theme-header: #0B0A08; --theme-head-text: #FFF4D8;
  --theme-panel: #181612; --theme-tile: #252017;
  --theme-lot: linear-gradient(125deg, #292214, #11100D 75%);
  --theme-big: #352B16; --theme-big-ink: #FFD269;
  --theme-border: #786039; --theme-text: #FFF4D8; --theme-muted: #D9C8A3;
  --theme-primary: linear-gradient(115deg, #FFE6A1, #E4B34A);
  --theme-primary-ink: #241905; --theme-button: #2E2617;
  --theme-active: #BFE6C6; --theme-success: #1D3424;
  --theme-gold: #FFD269; --theme-sold: #352B16; --theme-danger: #FFACAF;
  --theme-purse: #1B1811; --theme-squad: #1B1811;
  --theme-teams: #1B1811; --theme-chat: #1B1811; --theme-sales: #1B1811;
  --theme-bar: #14110B; --theme-focus: #FFD269;
  color-scheme: dark;
}

/* The root attribute outranks the existing hard-coded live-room colours. */
html[data-auction-theme]:not([data-auction-theme="classic"]) :is(body.room, body.projector) {
  background: var(--theme-bg); background-attachment: fixed;
}
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room,
html[data-auction-theme]:not([data-auction-theme="classic"]) body.projector,
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .room,
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .room-head {
  --bg: transparent; --surface: var(--theme-panel); --surface-2: var(--theme-tile);
  --surface-3: var(--theme-button); --border: var(--theme-border);
  --border-strong: var(--theme-border); --text: var(--theme-text);
  --text-muted: var(--theme-muted); --text-faint: var(--theme-muted);
  --accent: var(--theme-focus); --accent-strong: var(--theme-focus);
  --accent-soft: var(--theme-button); --accent-text: var(--theme-primary-ink);
  --focus: var(--theme-focus); --live: var(--theme-active); --live-soft: var(--theme-success);
  --cyan-400: var(--theme-big-ink); --gold-400: var(--theme-gold);
  --violet-500: var(--theme-focus); --red-600: var(--theme-danger);
  --navy-700: var(--theme-tile); --navy-800: var(--theme-panel);
  color: var(--theme-text);
}
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .room-head {
  background: var(--theme-header); color: var(--theme-head-text);
  border-bottom-color: var(--theme-border);
}
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .room-head :is(.room-team,.room-theme-picker) {
  color: var(--theme-head-text);
}
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .room-status {
  color: var(--theme-muted); background: var(--theme-tile); padding: .35rem .6rem;
  border: 1px solid var(--theme-border); border-radius: 8px;
}
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .room-status[data-kind="ok"] { color: var(--theme-active); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .room-status[data-kind="warn"] { color: var(--theme-gold); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .room-status[data-kind="error"] { color: var(--theme-danger); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room :where(.lot-card,.purse-card,.squad-card,.teams-panel,.sales-panel,.pool,.console-actions,.control-lease,.seat-claim,.readiness,.auction-timing,.chat-panel,.chat-sheet > summary) {
  background: var(--theme-panel); border-color: var(--theme-border);
  box-shadow: 0 5px 18px rgb(0 0 0 / 8%);
}
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .lot-card { background: var(--theme-lot); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .purse-card { background: var(--theme-purse); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .squad-card { background: var(--theme-squad); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .teams-panel { background: var(--theme-teams); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room :is(.chat-panel,.chat) { background: var(--theme-chat); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .sales-panel { background: var(--theme-sales); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room :is(.lot-label,.lot-category,.lot-figures dt,.budget-help,.squad-list-labels,.squad-empty,.bid-step,.seat-row span,.team-row .muted,.sale-row .muted,.sale-team,.lot-card.is-unsold .lot-label,.lot-card.is-unsold .lot-result) { color: var(--theme-muted); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room :where(.lot-figures > div,.team-row,.sale-row,.squad-list li,.chat-msg,.seat-row,.bid-state,.lot-photo) {
  background: var(--theme-tile); border-color: var(--theme-border); color: var(--theme-text);
}
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .lot-figures > div.is-big { background: var(--theme-big); border-color: var(--theme-big-ink); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room :is(.team-row,.sale-row) { border-left-color: var(--team, var(--theme-border)); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room :is(.lot-figures .big,.team-row .amount,[data-my-purse],.pool-list .btn .amount) { color: var(--theme-big-ink); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room :is([data-my-safe-maximum],.squad-list .amount,.bid-state[data-kind="leading"],.bid-reason,.control-lease .ok) { color: var(--theme-active); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room :is([data-my-reserve],.sale-row .amount,.countdown[data-urgent]) { color: var(--theme-gold); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room :is(.squad-count,.bid-state[data-kind="leading"],[data-bidding-state="leading"] .lot-figures > .is-leader) { background: var(--theme-success); color: var(--theme-active); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room :is(.lot-result,.lot-card.is-sold,.lot-figures > div:has(.countdown[data-urgent])) { background: var(--theme-sold); border-color: var(--theme-gold); color: var(--theme-gold); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .lot-card.is-sold .big { color: var(--theme-gold); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room :is(.btn,.step-btn,.room-share .btn,select,input,textarea) {
  background: var(--theme-button); color: var(--theme-text); border-color: var(--theme-border);
  box-shadow: none;
}
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room :is(input,textarea)::placeholder { color: var(--theme-muted); opacity: 1; }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room select { appearance: auto; background-image: none; }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room :is(.btn-primary,.bid-button):not(:disabled) {
  background: var(--theme-primary); color: var(--theme-primary-ink);
  border-color: var(--theme-focus); font-weight: 800;
}
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room :is(.btn-primary:disabled,.bid-button:disabled,.step-btn:disabled) {
  background: var(--theme-tile); color: var(--theme-muted); border-color: var(--theme-border); opacity: 1;
}
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .bid-bar { background: var(--theme-bar); border-color: var(--theme-border); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .console .bid-bar { background: transparent; }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .chat-role { background: var(--theme-button); color: var(--theme-focus); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .chat-official { border-left-color: var(--theme-focus); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .room-back .icon { color: var(--theme-head-text); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .team-squad { color: var(--theme-muted); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .presence-list li { background: var(--theme-tile); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .presence-list li[data-here="true"] span { color: var(--theme-active); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.room .presence-list li[data-here="false"] span { color: var(--theme-gold); }

/* The standalone projector uses the same palette as the interactive rooms. */
html[data-auction-theme]:not([data-auction-theme="classic"]) body.projector .proj {
  color: var(--theme-text); row-gap: 1.5vh;
}
html[data-auction-theme]:not([data-auction-theme="classic"]) body.projector .proj-head {
  background: var(--theme-header); color: var(--theme-head-text);
  border: 1px solid var(--theme-border); border-radius: 14px; padding: 1vh 1vw;
}
html[data-auction-theme]:not([data-auction-theme="classic"]) body.projector :is(.room-theme-picker,.proj-status) {
  color: var(--theme-head-text);
}
html[data-auction-theme]:not([data-auction-theme="classic"]) body.projector .room-theme-picker select {
  background: var(--theme-button); color: var(--theme-text); border-color: var(--theme-border);
  appearance: auto; background-image: none;
}
html[data-auction-theme]:not([data-auction-theme="classic"]) body.projector :is(.proj-main,.proj-teams,.proj-chat) {
  border: 1px solid var(--theme-border); border-radius: 18px; padding: 1.5vh 1.2vw;
  box-shadow: 0 5px 18px rgb(0 0 0 / 8%);
}
html[data-auction-theme]:not([data-auction-theme="classic"]) body.projector .proj-main { background: var(--theme-lot); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.projector .proj-teams { background: var(--theme-teams); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.projector .proj-chat { background: var(--theme-chat); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.projector :is(.proj-label,.proj-category,.proj-sales-head,.team-squad,.sale-team,.sale-empty) { color: var(--theme-muted); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.projector :is(.lot-photo,.team-row,.sale-row) {
  background: var(--theme-tile); color: var(--theme-text); border-color: var(--theme-border);
}
html[data-auction-theme]:not([data-auction-theme="classic"]) body.projector :is(.team-row,.sale-row) { border-left-color: var(--team, var(--theme-border)); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.projector :is(.proj-bid,.team-purse) { color: var(--theme-big-ink); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.projector .team-row.is-leader {
  background: var(--theme-success); border-top-color: var(--theme-active);
  border-right-color: var(--theme-active); border-bottom-color: var(--theme-active);
}
html[data-auction-theme]:not([data-auction-theme="classic"]) body.projector :is(.proj-rehearsal,.proj-clock[data-urgent],.proj-result,.sale-amount,.proj-main.is-sold .proj-bid) { color: var(--theme-gold); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.projector .proj-main.is-sold { background: var(--theme-sold); border-color: var(--theme-gold); }
html[data-auction-theme]:not([data-auction-theme="classic"]) body.projector .proj-main.is-unsold :is(.proj-bid,.proj-result) { color: var(--theme-muted); }
