/* Draft Room — standalone styles (no site CSS, no CDN). Dark room, one
 * amber accent, big type where the TV needs it, thumb-size targets on
 * phones. */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* the hidden attribute must beat class-level display: flex/grid */
[hidden] { display: none !important; }

:root {
  --bg: #14151a;
  --panel: #1e2027;
  --panel-2: #262933;
  --ink: #f2f3f5;
  --ink-dim: #9aa0ad;
  --accent: #ffc53d;
  --accent-ink: #1a1405;
  --good: #6fdc8c;
  --warn: #ff9f43;
  --danger: #ff6b6b;
  --radius: 12px;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }
h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-dim); margin: 1rem 0 0.5rem; }
a { color: var(--accent); }

.brand { font-size: 2rem; }
.brand.small { font-size: 1rem; color: var(--ink-dim); }
.tagline { color: var(--ink-dim); margin: 0.25rem 0 1.5rem; }
.hint { color: var(--ink-dim); font-weight: 400; font-size: 0.85em; }

/* -- shared bits -------------------------------------------------------- */

.card, .panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card.muted { background: transparent; border: 1px solid var(--panel-2); }
.card.danger-card { border: 2px solid var(--danger); background: rgba(255, 107, 107, 0.08); }
.card.danger-card p { margin-top: 0.4rem; font-size: 0.9rem; }
#server-id { margin-top: 0.75rem; opacity: 0.5; font-size: 0.75rem; }

.code-chip {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  letter-spacing: 0.15em;
  padding: 0.15em 0.5em;
  border-radius: 6px;
}

.budget-chip { margin-left: auto; font-weight: 700; color: var(--good); }

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--ink-dim);
}

label { display: block; font-size: 0.8rem; color: var(--ink-dim); margin: 0.75rem 0 0.25rem; }
input, select, textarea {
  width: 100%;
  font-size: 1.1rem;
  padding: 0.6em 0.7em;
  border-radius: 8px;
  border: 1px solid var(--panel-2);
  background: var(--bg);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
textarea { font-size: 0.8rem; font-family: monospace; resize: vertical; }
#join-code { text-transform: uppercase; letter-spacing: 0.3em; font-weight: 700; }

.btn {
  font-size: 1rem;
  font-weight: 600;
  padding: 0.6em 1em;
  margin-top: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--panel-2);
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.warn { color: var(--warn); }
.btn.danger { color: var(--danger); }
.btn.big { width: 100%; padding: 0.8em; font-size: 1.15rem; }
a.btn { display: inline-block; text-decoration: none; }
.btn.armed { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn-row { display: flex; gap: 0.5rem; align-items: end; }
.btn-row .btn { flex-shrink: 0; }
.btn-row select { flex: 1; min-width: 0; }
.btn-row input { width: 6.5rem; }

/* -- history page ------------------------------------------------------- */

.history-wrap { max-width: 36rem; margin: 0 auto; padding: 0 1rem 2rem; }
.history-table { width: 100%; border-collapse: collapse; }
.history-table th {
  text-align: left;
  color: var(--ink-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.4em 0.5em;
}
.history-table td { padding: 0.45em 0.5em; border-top: 1px solid var(--panel-2); }
.history-table tr.undone td { text-decoration: line-through; color: var(--ink-dim); }

.field-error { color: var(--danger); font-size: 0.9rem; margin-top: 0.5rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  padding: 0.6em 1em;
  border-radius: 999px;
  max-width: 90vw;
  text-align: center;
  z-index: 50;
}

.banner {
  text-align: center;
  font-weight: 800;
  border-radius: var(--radius);
  padding: 0.6em;
  margin-bottom: 0.75rem;
}
.paused-banner { background: var(--warn); color: var(--accent-ink); letter-spacing: 0.2em; }
.sold-banner { background: var(--good); color: #05240e; }

.roster li, .results li, .my-team li { list-style: none; padding: 0.4em 0; border-bottom: 1px solid var(--panel-2); }

/* -- join page ---------------------------------------------------------- */

.join-wrap { max-width: 26rem; margin: 0 auto; padding: 2.5rem 1.25rem; }

/* -- bidder page -------------------------------------------------------- */

.bidder-wrap { max-width: 28rem; margin: 0 auto; padding: 0 1rem 2rem; }

.countdown {
  font-size: 5rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.player-name { font-size: 1.8rem; font-weight: 700; text-align: center; margin: 0.25rem 0; }
.high-bid { font-size: 1.25rem; color: var(--accent); text-align: center; margin-bottom: 1rem; }

.quick-bids { display: flex; gap: 0.5rem; }
.quick-bids .bid-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  line-height: 1.1;
  padding: 0.55em 0;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.quick-bids .step { font-size: 1.35rem; font-weight: 800; }
.quick-bids .total { font-size: 0.85rem; font-weight: 600; opacity: 0.7; }
.custom-bid { display: flex; gap: 0.5rem; align-items: end; margin-top: 0.25rem; }
.you-are-high { text-align: center; color: var(--good); font-weight: 700; margin-top: 0.75rem; }

.my-team { margin-top: 1.5rem; color: var(--ink-dim); }
.my-team summary { cursor: pointer; }

.dropped-note { text-align: center; color: var(--warn); font-weight: 600; margin-top: 0.75rem; }
#btn-drop { margin-top: 1rem; }

.player-card { display: flex; align-items: center; justify-content: center; gap: 0.9rem; margin: 0.6rem 0; }
.player-card img { width: 64px; height: 64px; object-fit: cover; border-radius: 50%; background: var(--panel-2); }
.player-card .card-line1 { font-weight: 700; }
.player-card .card-line2 { color: var(--ink-dim); font-size: 0.9rem; }
.player-card.big img { width: 110px; height: 110px; }
.player-card.big .card-line1 { font-size: 1.5rem; }
.player-card.big .card-line2 { font-size: 1.1rem; }

.bid-ladder.small { margin-top: 0.75rem; gap: 0.2rem; margin-bottom: 0.75rem; }
.bid-ladder.small li { font-size: 1rem; }

.wheel { list-style: none; margin-top: 0.25rem; border: 1px solid var(--panel-2); border-radius: 8px; overflow: hidden; }
.wheel:empty { display: none; }
.wheel li { display: flex; align-items: center; gap: 0.6rem; padding: 0.5em 0.7em; cursor: pointer; border-bottom: 1px solid var(--panel-2); }
.wheel li:last-child { border-bottom: none; }
.wheel li:active { background: var(--panel-2); }
.wheel img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--panel-2); }
.wheel .amt { margin-left: auto; color: var(--ink-dim); font-size: 0.85rem; }

#league-rosters details { padding: 0.35em 0; border-bottom: 1px solid var(--panel-2); }
#league-rosters summary { cursor: pointer; }
#league-rosters ul { margin: 0.35em 0 0.35em 1em; }
#league-rosters li { list-style: none; color: var(--ink-dim); padding: 0.15em 0; border-bottom: none; }

.budget-list li.out .who, .budget-list li.out .amt { text-decoration: line-through; opacity: 0.45; }

/* -- screen (TV) page --------------------------------------------------- */

.page-screen { overflow: hidden; }
.screen-wrap { height: 100vh; display: flex; flex-direction: column; padding: 1.25rem 1.5rem; }
.screen-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.screen-join-hint { font-size: 1.1rem; color: var(--ink-dim); }

.screen-main { display: flex; flex: 1; gap: 1.5rem; min-height: 0; }
.screen-stage {
  flex: 3;
  position: relative;
  background: var(--panel);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}
.stage-block h1 { font-size: 3rem; }
.stage-sub { font-size: 1.4rem; color: var(--ink-dim); margin-top: 1rem; }

.screen-countdown {
  font-size: clamp(6rem, 18vh, 11rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.screen-player { font-size: clamp(2.5rem, 7vh, 4.5rem); font-weight: 700; margin-top: 1rem; }
.screen-bid { font-size: clamp(1.8rem, 5vh, 3rem); color: var(--accent); margin-top: 0.5rem; }

.screen-bid { animation: pop-in 0.25s ease; }

/* -- the auctioneer ------------------------------------------------------ */

.auctioneer {
  margin-top: 1.25rem;
  font-size: clamp(1.6rem, 4.5vh, 3rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--accent);
  animation: call-beat 0.9s ease-in-out infinite;
}
.auctioneer[data-stage="twice"] { color: var(--warn); animation-duration: 0.65s; }
.auctioneer[data-stage="final"] { color: var(--danger); animation-duration: 0.4s; }
.auctioneer.small { margin: 0.5rem 0 0; font-size: 1.05rem; font-weight: 700; }

.sold-shout {
  font-size: clamp(2.5rem, 8vh, 5rem);
  font-weight: 800;
  color: var(--good);
  margin-bottom: 1rem;
  animation: slam 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
}

.screen-countdown.urgent, .countdown.urgent { color: var(--danger); }

.announcer-toggle { margin-top: 0; font-size: 0.9rem; padding: 0.35em 0.8em; }
.announcer-toggle.on { border-color: var(--accent); color: var(--accent); }

@keyframes call-beat {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.72; transform: scale(0.985); }
}
@keyframes slam {
  0% { transform: scale(2.2) rotate(-4deg); opacity: 0; }
  60% { transform: scale(0.94) rotate(1deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .auctioneer, .sold-shout, .screen-bid { animation: none; }
}

.bid-ladder {
  list-style: none;
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}
.bid-ladder li {
  display: flex;
  gap: 1rem;
  font-size: 1.5rem;
  color: var(--ink-dim);
}
.bid-ladder li .amt { font-variant-numeric: tabular-nums; }
.bid-ladder li:nth-child(2) { opacity: 0.75; }
.bid-ladder li:nth-child(3) { opacity: 0.55; }
.bid-ladder li:nth-child(4) { opacity: 0.4; }
.bid-ladder li:nth-child(5) { opacity: 0.3; }

@keyframes pop-in {
  from { transform: scale(0.9); opacity: 0.3; }
  to { transform: scale(1); opacity: 1; }
}

.paused-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 21, 26, 0.85);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}
.paused-overlay { flex-direction: column; gap: 0.75rem; }
.paused-overlay span {
  font-size: clamp(2rem, 5vh, 4rem);
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--warn);
  text-align: center;
}
.paused-overlay .paused-clock {
  font-size: 2rem;
  letter-spacing: normal;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

.paused-banner { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.paused-banner .btn { margin-top: 0; padding: 0.3em 0.9em; }
#btn-pause { width: 100%; margin-bottom: 0.75rem; }

.screen-rail { flex: 1; min-width: 16rem; overflow-y: auto; }
.budget-list li, .sale-list li {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35em 0.5em;
  border-radius: 6px;
  font-size: 1.05rem;
}
.budget-list li.nominating { background: var(--panel-2); outline: 1px solid var(--accent); }
.budget-list .amt { color: var(--good); font-weight: 700; }
.sale-list .amt { color: var(--ink-dim); }
.sale-list .who, .budget-list .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.final-board { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: center; margin-top: 1.5rem; text-align: left; }
.final-column h4 { margin-bottom: 0.5rem; }
.final-column li { list-style: none; color: var(--ink-dim); }

/* -- host page ---------------------------------------------------------- */

.host-wrap { max-width: 30rem; margin: 0 auto; padding: 0 1rem 2rem; }
.live-summary .summary-line { padding: 0.2em 0; }
.live-summary .big { font-size: 1.3rem; font-weight: 700; display: flex; gap: 0.6em; flex-wrap: wrap; }
.live-summary .alert { color: var(--warn); font-weight: 700; }
.countdown-inline { color: var(--accent); font-variant-numeric: tabular-nums; }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1rem; }
.controls .btn { margin-top: 0; }

@media (max-width: 900px) {
  .screen-main { flex-direction: column; }
  .stage-block h1 { font-size: 2rem; }
}
