/* ══════════════════════════════════════════════
   CricBid  ·  Stylesheet
   Dark broadcast cricket — turf green, gold,
   Bebas Neue for drama, DM Sans for clarity
══════════════════════════════════════════════ */

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

:root {
  /* Greens */
  --g0: #040e08;
  --g1: #081810;
  --g2: #0d2b18;
  --g3: #145830;
  --g4: #1e8046;
  --g5: #27a85c;
  /* Gold */
  --gold:       #d4a21a;
  --gold-lt:    #f0c842;
  --gold-dim:   rgba(212,162,26,.14);
  --gold-bdr:   rgba(212,162,26,.28);
  /* Neutrals */
  --white:      #ffffff;
  --muted:      rgba(255,255,255,.42);
  --border:     rgba(255,255,255,.07);
  --card:       rgba(255,255,255,.04);
  --card-hov:   rgba(255,255,255,.08);
  /* Semantic */
  --red:        #c0392b;
  --red-dim:    rgba(192,57,43,.18);
  --green-ok:   #27ae60;
  /* Light surface (setup screens) */
  --lbg:  #f0ede6;
  --lcard: #ffffff;
  --lbdr: #d9d5cc;
  --ltxt: #18180f;
  --lmut: #6b6860;
}

html {
  /* NO smooth scroll — causes auto-jump-to-top glitch when
     scrollIntoView fires during Firebase re-renders */
  scroll-behavior: auto;
  /* Prevent the whole page from scrolling; each panel scrolls internally */
  overflow: hidden;
  height: 100%;
}
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--g0);
  color: var(--white);
  height: 100%;
  overflow: hidden;   /* page-level scroll disabled; panels own their scroll */
}

/* ── SCREENS ────────────────────────────── */
.screen { display: none; height: 100vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.screen.active { display: block; }

/* ══════════════════════════════════════════
   LANDING
══════════════════════════════════════════ */
#s-landing.active {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 2rem;
  background:
    radial-gradient(ellipse 90% 55% at 50% 0%, rgba(30,128,70,.38) 0%, transparent 70%),
    var(--g0);
  position: relative; overflow-y: auto; overflow-x: hidden;
}
.land-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 72px 72px;
}
.land-center { text-align: center; position: relative; max-width: 640px; width: 100%; }
.land-eye {
  font-size: .68rem; letter-spacing: .38em; text-transform: uppercase;
  color: var(--gold); margin-bottom: .5rem;
}
.land-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(5.5rem, 18vw, 11rem);
  line-height: .88; letter-spacing: 6px;
}
.land-logo em { color: var(--gold); font-style: normal; }
.land-tagline { color: var(--muted); font-size: .9rem; margin-top: .8rem; letter-spacing: .04em; }
.land-btns {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  margin-top: 3rem;
}
.land-btn {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 2rem; border-radius: 12px; border: none;
  font-family: 'DM Sans', sans-serif; cursor: pointer;
  transition: box-shadow .18s, background .18s;
  text-align: left; min-width: 230px;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.land-btn:active { transform: scale(0.97); }
.land-btn strong { display: block; font-size: 1.05rem; font-weight: 600; }
.land-btn small { font-size: .78rem; opacity: .72; }
.land-btn-icon { font-size: 1.9rem; }
.lb-host { background: var(--gold); color: #18120a; box-shadow: 0 8px 32px rgba(212,162,26,.32); }
.lb-host:hover { box-shadow: 0 14px 44px rgba(212,162,26,.48); }
.lb-join { background: var(--card-hov); color: var(--white); border: 1px solid rgba(255,255,255,.14); }
.lb-join:hover { background: rgba(255,255,255,.13); }
.land-pills {
  display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap;
  margin-top: 2.5rem; font-size: .8rem; color: var(--muted);
}

/* ══════════════════════════════════════════
   SETUP (Host)
══════════════════════════════════════════ */
#s-setup.active { display: flex; min-height: 100vh; }
.setup-shell { display: flex; width: 100%; }

/* Sidebar */
.setup-side {
  width: 230px; flex-shrink: 0;
  background: var(--g1); border-right: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  display: flex; flex-direction: column; gap: 2.5rem;
}
.ss-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.9rem; letter-spacing: 3px;
}
.ss-brand em { color: var(--gold); font-style: normal; }
.ss-nav { display: flex; flex-direction: column; gap: .35rem; }
.ss-nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem .75rem; border-radius: 8px;
  opacity: .38; transition: opacity .2s, background .2s;
}
.ss-nav-item.active { opacity: 1; background: var(--gold-dim); }
.ss-nav-item.done  { opacity: .65; }
.ss-nav-num {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
}
.ss-nav-item.active .ss-nav-num { background: var(--gold); color: #18120a; }
.ss-nav-item.done  .ss-nav-num  { background: var(--g4); color: #fff; }
.ss-nav-label { font-size: .88rem; font-weight: 500; }
.ss-back {
  background: none; border: none; color: var(--muted);
  font-family: 'DM Sans', sans-serif; font-size: .82rem;
  cursor: pointer; text-align: left; padding: 0; margin-top: auto;
}
.ss-back:hover { color: var(--white); }

/* Content pane */
.setup-main {
  flex: 1; overflow-y: auto;
  background: var(--lbg); color: var(--ltxt);
  padding: 3rem 4rem;
}
.setup-step { display: none; }
.setup-step.visible { display: block; }
.stp-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.4rem; letter-spacing: 2px; color: var(--ltxt);
  margin-bottom: .4rem;
}
.stp-desc { color: var(--lmut); font-size: .9rem; margin-bottom: 2rem; }

/* Form elements */
.fg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 2rem; }
.fg1 { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.field { display: flex; flex-direction: column; gap: .38rem; }
.field label {
  font-size: .75rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--lmut);
}
.field input, .field select, .field textarea {
  padding: .65rem .9rem; border: 1.5px solid var(--lbdr);
  border-radius: 8px; background: var(--lcard); color: var(--ltxt);
  font-family: 'DM Sans', sans-serif; font-size: .95rem;
  transition: border-color .18s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--g3); }
.field-hint { font-size: .75rem; color: var(--lmut); margin-top: .15rem; }
.field-err  { font-size: .75rem; color: var(--red); margin-top: .15rem; display: none; }

/* Timer mode picker */
.timer-mode-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: .5rem;
}
.tmc {
  border: 2px solid var(--lbdr); border-radius: 10px;
  padding: 1.1rem 1.25rem; cursor: pointer; transition: border-color .18s, background .18s;
  background: var(--lcard);
}
.tmc:hover { border-color: var(--g3); }
.tmc.selected { border-color: var(--g3); background: #e8f5ee; }
.tmc input[type=radio] { display: none; }
.tmc-icon { font-size: 1.6rem; margin-bottom: .5rem; }
.tmc-title { font-weight: 700; font-size: .95rem; color: var(--ltxt); margin-bottom: .25rem; }
.tmc-desc { font-size: .78rem; color: var(--lmut); line-height: 1.4; }

/* Step footer */
.stp-foot {
  display: flex; gap: 1rem; margin-top: 2rem; align-items: center;
}
.btn-next {
  background: var(--g2); color: #fff; border: none; border-radius: 8px;
  padding: .75rem 2rem; font-family: 'DM Sans', sans-serif;
  font-size: .95rem; font-weight: 600; cursor: pointer; transition: background .18s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn-next:hover { background: var(--g3); }
.btn-next:active { background: var(--g4); transform: scale(0.98); }
.btn-next:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-back-s {
  background: none; border: 1.5px solid var(--lbdr); color: var(--lmut);
  border-radius: 8px; padding: .75rem 1.5rem;
  font-family: 'DM Sans', sans-serif; font-size: .95rem; cursor: pointer;
}
.btn-back-s:hover { border-color: var(--ltxt); color: var(--ltxt); }

.err-block {
  display: none; background: #fff0f0; border: 1px solid #f5c6c2;
  border-radius: 8px; padding: .65rem 1rem;
  color: var(--red); font-size: .85rem; margin-top: 1rem;
}

/* Teams grid (step 2) */
.teams-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 2rem; }
.team-row { display: flex; flex-direction: column; gap: .38rem; }

/* Upload (step 3) */
.format-hint {
  background: #e8f5ee; border: 1px solid #b3d9c2;
  border-radius: 10px; padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}
.fh-title { font-size: .78rem; font-weight: 700; color: var(--g2); margin-bottom: .5rem; }
.fh-cols  { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .4rem; }
.col-req  { display: inline-block; padding: .18rem .6rem; border-radius: 99px; font-size: .72rem; font-weight: 700; background: var(--g2); color: #fff; }
.col-opt  { display: inline-block; padding: .18rem .6rem; border-radius: 99px; font-size: .72rem; font-weight: 700; background: #b3d9c2; color: var(--g2); }
.fh-note  { font-size: .76rem; color: var(--lmut); }
.fh-note code { background: rgba(0,0,0,.07); padding: .1rem .35rem; border-radius: 4px; }
.dropzone {
  border: 2px dashed var(--lbdr); border-radius: 12px;
  padding: 3rem 2rem; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.over { border-color: var(--g3); background: #eef6f2; }
.dz-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.dz-primary { font-weight: 600; }
.dz-secondary { font-size: .8rem; color: var(--lmut); margin-top: .3rem; }
.upload-ok {
  background: #e8f5ee; border: 1px solid #b3d9c2; border-radius: 8px;
  padding: .65rem 1rem; color: var(--g2); font-size: .88rem; font-weight: 500;
  margin-top: 1rem;
}
.preview-table { overflow-x: auto; margin-top: 1.25rem; }
.preview-table table { width: 100%; border-collapse: collapse; font-size: .83rem; }
.preview-table th {
  background: var(--lbg); padding: .45rem .7rem; text-align: left;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--lmut); border-bottom: 1px solid var(--lbdr);
}
.preview-table td { padding: .48rem .7rem; border-bottom: 1px solid var(--lbdr); }
.preview-table tr:last-child td { border-bottom: none; }

/* Launching */
.launching {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; gap: 1rem;
}
.spin {
  width: 44px; height: 44px; border: 3px solid var(--lbdr);
  border-top-color: var(--g3); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.launching-label { font-family: 'Bebas Neue', sans-serif; font-size: 2rem; letter-spacing: 2px; }
.launching-sub { color: var(--lmut); font-size: .88rem; }

/* Role pills */
.rp { display: inline-block; padding: .14rem .5rem; border-radius: 99px; font-size: .68rem; font-weight: 700; }
.rp-BAT  { background: #fff3cd; color: #7a5700; }
.rp-BOWL { background: #d1e7dd; color: #0a4520; }
.rp-ALL  { background: #cfe2ff; color: #08377a; }
.rp-WK   { background: #f0d8ff; color: #5a1278; }

/* ══════════════════════════════════════════
   JOIN
══════════════════════════════════════════ */
#s-join.active {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 2rem;
  background:
    radial-gradient(ellipse 80% 55% at 50% 20%, rgba(30,128,70,.3) 0%, transparent 70%),
    var(--g0);
}
.join-card {
  background: var(--lcard); color: var(--ltxt);
  border-radius: 16px; padding: 2.5rem;
  width: 100%; max-width: 430px;
}
.join-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem; letter-spacing: 3px; color: var(--g2); margin-bottom: 1.5rem;
}
.join-logo em { color: var(--gold); font-style: normal; }
.join-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.8rem; letter-spacing: 1px; margin-bottom: 1.5rem; }
.join-card .field { margin-bottom: 1.25rem; }
.join-card .field label { font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--lmut); display: block; margin-bottom: .38rem; }
.join-card .field input, .join-card .field select {
  width: 100%; padding: .65rem .9rem; border: 1.5px solid var(--lbdr);
  border-radius: 8px; background: var(--lcard); color: var(--ltxt);
  font-family: 'DM Sans', sans-serif; font-size: .95rem;
}
.join-card .field input:focus, .join-card .field select:focus { outline: none; border-color: var(--g3); }
.join-back { display: block; text-align: center; margin-top: 1rem; background: none; border: none; color: var(--lmut); font-family: 'DM Sans', sans-serif; font-size: .85rem; cursor: pointer; }
.join-back:hover { color: var(--ltxt); }

/* ══════════════════════════════════════════
   WAITING ROOM
══════════════════════════════════════════ */
#s-waiting.active {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 2rem;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(30,128,70,.28) 0%, transparent 70%),
    var(--g0);
}
.waiting-wrap { width: 100%; max-width: 580px; }
.wr-brand {
  font-family: 'Bebas Neue', sans-serif; font-size: 1.4rem;
  letter-spacing: 3px; color: var(--muted); text-align: center; margin-bottom: 1.5rem;
}
.wr-brand em { color: var(--gold); font-style: normal; }
.wr-code-label { font-size: .65rem; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); text-align: center; }
.wr-code {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(4rem, 14vw, 7rem);
  letter-spacing: 14px; color: var(--gold); line-height: 1;
  text-align: center; margin: .25rem 0 .5rem;
}
.wr-tname { text-align: center; font-size: 1.1rem; font-weight: 600; }
.wr-tinfo { text-align: center; font-size: .85rem; color: var(--muted); margin: .2rem 0 2rem; }
.wr-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.75rem;
}
.wr-section { margin-bottom: 1.5rem; }
.wr-section:last-child { margin-bottom: 0; }
.wr-sec-title { font-size: .65rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); margin-bottom: .7rem; }
.wr-team-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .5rem .7rem; border-radius: 8px; background: var(--card);
  margin-bottom: .35rem; font-size: .88rem; font-weight: 500;
}
.wr-status { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.btn-start {
  width: 100%; padding: 1rem; background: var(--gold); color: #18120a;
  border: none; border-radius: 10px; font-family: 'DM Sans', sans-serif;
  font-size: 1.05rem; font-weight: 700; cursor: pointer; transition: background .18s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn-start:hover:not(:disabled)  { background: var(--gold-lt); }
.btn-start:active:not(:disabled) { transform: scale(0.98); }
.btn-start:disabled { opacity: .38; cursor: not-allowed; }

/* ══════════════════════════════════════════
   AUCTION ROOM
══════════════════════════════════════════ */
#s-auction {
  background: var(--g0);
  /* Override .screen's overflow-y:auto — auction manages its own internal scroll */
  overflow: hidden;
}
#s-auction.active { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* Topbar */
.auc-top {
  background: rgba(0,0,0,.45); border-bottom: 1px solid var(--border);
  padding: .6rem 1.5rem; display: flex; align-items: center;
  justify-content: space-between; flex-shrink: 0; gap: 1rem;
}
.auc-top-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.55rem; letter-spacing: 3px; white-space: nowrap;
}
.auc-top-brand em { color: var(--gold); font-style: normal; }
.auc-top-tname { font-size: .82rem; color: var(--muted); margin-left: .4rem; font-family: 'DM Sans', sans-serif; font-weight: 400; letter-spacing: 0; }
.auc-counters { display: flex; gap: 1.5rem; }
.auc-counter { text-align: center; }
.auc-counter-val { font-family: 'Bebas Neue', sans-serif; font-size: 1.5rem; line-height: 1; }
.auc-counter-val.gold  { color: var(--gold); }
.auc-counter-val.muted { color: var(--muted); }
.auc-counter-lbl { font-size: .6rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.auc-role-badge {
  font-size: .72rem; padding: .25rem .75rem; border-radius: 99px;
  background: var(--gold-dim); border: 1px solid var(--gold-bdr); color: var(--gold);
  white-space: nowrap;
}

/* Body */
.auc-body { display: grid; grid-template-columns: 1fr 310px; flex: 1; overflow: hidden; min-height: 0; }
.auc-main { overflow-y: auto; padding: 1rem 1.5rem 2rem; display: flex; flex-direction: column; gap: 1rem; }
.auc-sidebar { background: rgba(0,0,0,.28); border-left: 1px solid var(--border); overflow-y: auto; }

/* Queue */
.queue-wrap { overflow-x: auto; padding-bottom: 2px; }
.queue-row  { display: flex; gap: .35rem; padding: .2rem 0; min-width: max-content; }
.qchip {
  padding: .28rem .7rem; border-radius: 6px; font-size: .72rem; font-weight: 600;
  border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}
.qchip.cur    { background: var(--gold-dim); border-color: var(--gold-bdr); color: var(--gold); }
.qchip.sold   { color: rgba(255,255,255,.18); text-decoration: line-through; }
.qchip.unsold { color: rgba(255,255,255,.12); text-decoration: line-through; }

/* Spotlight */
.spotlight-idle {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 280px; gap: 1rem; color: var(--muted);
}
.si-ico { font-size: 3rem; }

.spotlight {
  background: linear-gradient(135deg, rgba(20,88,48,.55), rgba(4,14,8,.85));
  border: 1px solid rgba(255,255,255,.07); border-radius: 16px;
  padding: 2rem; position: relative; overflow: hidden;
}
.sp-bg-num {
  position: absolute; top: -1rem; right: 1rem;
  font-family: 'Bebas Neue', sans-serif; font-size: 9rem;
  color: rgba(255,255,255,.035); pointer-events: none; line-height: 1;
}
.sp-role  { font-size: .67rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-bottom: .35rem; }
.sp-name  { font-family: 'Bebas Neue', sans-serif; font-size: clamp(2.5rem, 5vw, 4.5rem); letter-spacing: 3px; line-height: .92; margin-bottom: .4rem; }
.sp-meta  { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-bottom: 1.25rem; }
.sp-stats { font-size: .78rem; color: rgba(255,255,255,.32); margin-top: .75rem; line-height: 1.5; }
.sp-base  { font-size: .82rem; color: var(--muted); margin-bottom: .75rem; }

.sp-bid-lbl { font-size: .67rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
.sp-bid-amt { font-family: 'Bebas Neue', sans-serif; font-size: clamp(3rem, 7vw, 5.5rem); color: var(--gold); letter-spacing: 3px; line-height: 1; }
.sp-bid-team { font-size: .9rem; color: #62e89a; margin-top: .2rem; min-height: 1.3rem; }

/* Timer */
.sp-timer { display: flex; align-items: center; gap: 1rem; margin-top: 1.25rem; }
.sp-timer-ring {
  width: 70px; height: 70px; border-radius: 50%; flex-shrink: 0;
  border: 3px solid rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .3s, background .3s;
}
.sp-timer-ring.urgent { border-color: rgba(192,57,43,.6); background: rgba(192,57,43,.1); }
.sp-timer-ring.manual-mode { border-color: rgba(212,162,26,.4); background: var(--gold-dim); }
.sp-timer-num { font-family: 'Bebas Neue', sans-serif; font-size: 2.1rem; }
.sp-timer-num.urgent { color: #ff6b5b; }
.sp-timer-bar-wrap { flex: 1; height: 4px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; }
.sp-timer-bar { height: 100%; background: var(--gold); border-radius: 99px; transition: width 1s linear, background .3s; }
.sp-timer-bar.urgent { background: var(--red); }
.sp-manual-tag { font-size: .72rem; color: var(--gold); letter-spacing: .1em; text-transform: uppercase; }

/* Team bids (team owner bid buttons in spotlight) */
.sp-bid-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.25rem; }
.sp-bid-btn {
  padding: .55rem 1.1rem; border-radius: 8px; border: 1px solid var(--gold-bdr);
  background: var(--gold-dim); color: var(--gold);
  font-family: 'DM Sans', sans-serif; font-size: .85rem; font-weight: 700;
  cursor: pointer; transition: background .15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.sp-bid-btn:hover  { background: rgba(212,162,26,.25); }
.sp-bid-btn:active { transform: scale(0.96); opacity: .8; }

/* Host panel */
.host-panel {
  background: rgba(0,0,0,.3); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem 1.25rem;
}
.hp-label { font-size: .62rem; text-transform: uppercase; letter-spacing: .18em; color: var(--muted); margin-bottom: .7rem; }
.hp-row { display: flex; gap: .45rem; flex-wrap: wrap; }
.hp-btn {
  padding: .48rem 1rem; border-radius: 7px; border: 1px solid var(--border);
  background: var(--card); color: var(--white);
  font-family: 'DM Sans', sans-serif; font-size: .8rem; font-weight: 600;
  cursor: pointer; transition: background .15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.hp-btn:hover  { background: var(--card-hov); }
.hp-btn:active { transform: scale(0.96); opacity: .85; }
.hp-btn:disabled { opacity: .3; cursor: not-allowed; transform: none; }
.hp-sold { background: rgba(39,168,92,.28); border-color: rgba(39,168,92,.45); color: #62e89a; }
.hp-sold:hover:not(:disabled) { background: rgba(39,168,92,.45); }
.hp-unsold { color: var(--muted); }
.hp-next { background: rgba(20,88,48,.45); border-color: rgba(20,88,48,.6); }
.hp-next:hover { background: rgba(20,88,48,.65); }
.hp-timer-pause { background: var(--gold-dim); border-color: var(--gold-bdr); color: var(--gold); }
.hp-danger { color: #ff7b6b; }

/* Sidebar */
.sb-sec { padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); }
.sb-sec:last-child { border-bottom: none; }
.sb-title { font-size: .62rem; text-transform: uppercase; letter-spacing: .18em; color: var(--muted); margin-bottom: .65rem; }

.sb-team-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem .6rem; border-radius: 8px; margin-bottom: .32rem;
  background: var(--card); border: 1px solid transparent; transition: border-color .15s;
}
.sb-team-row.winning { background: rgba(39,168,92,.1); border-color: rgba(39,168,92,.3); }
.sb-team-name { font-weight: 600; font-size: .85rem; }
.sb-team-meta { font-size: .7rem; color: var(--muted); }
.sb-team-bid  { font-family: 'Bebas Neue', sans-serif; font-size: 1.15rem; color: var(--gold); }

/* Custom bid input (team role) */
.custom-bid-wrap { display: flex; gap: .4rem; margin-top: .6rem; }
.custom-bid-inp {
  flex: 1; min-width: 0; padding: .48rem .7rem;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--card); color: var(--white);
  font-family: 'DM Sans', sans-serif; font-size: .85rem;
}
.custom-bid-inp:focus { outline: none; border-color: var(--gold); }
.custom-bid-inp::placeholder { color: var(--muted); }
.custom-bid-go {
  padding: .48rem .9rem; background: var(--gold); color: #18120a;
  border: none; border-radius: 7px; font-family: 'DM Sans', sans-serif;
  font-size: .82rem; font-weight: 700; cursor: pointer;
}

/* My squad */
.my-squad-player {
  display: flex; justify-content: space-between; align-items: center;
  padding: .3rem 0; border-bottom: 1px solid var(--border);
  font-size: .78rem;
}
.my-squad-player:last-child { border-bottom: none; }
.my-squad-price { color: var(--gold); font-weight: 600; }
.my-remaining { font-size: .75rem; color: var(--muted); margin-top: .55rem; }
.my-remaining strong { color: var(--gold-lt); }

/* Bid log */
.log-entry { font-size: .76rem; padding: .28rem 0; border-bottom: 1px solid rgba(255,255,255,.04); color: var(--muted); }
.log-sold   { color: #62e89a; }
.log-unsold { color: rgba(255,255,255,.18); }
.log-bid strong { color: var(--gold); }

/* Identity badge in sidebar */
.sb-identity { background: var(--gold-dim); border-bottom-color: var(--gold-bdr); }
.sb-id-name { font-weight: 600; font-size: .9rem; }
.sb-id-sub  { font-size: .75rem; color: var(--muted); margin-top: .18rem; }

/* ══════════════════════════════════════════
   SOLD OVERLAY
══════════════════════════════════════════ */
.overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.9);
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(5px);
}
.overlay.show { display: flex; }
.overlay-inner { text-align: center; padding: 2rem; }
.overlay-word {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(5rem, 16vw, 11rem);
  letter-spacing: 6px; line-height: 1; color: var(--g5);
  animation: pop .45s cubic-bezier(.36,.07,.19,.97);
}
.overlay-word.unsold { color: var(--muted); font-size: clamp(3.5rem, 10vw, 7rem); }
@keyframes pop { 0%{transform:scale(.15);opacity:0} 70%{transform:scale(1.07)} 100%{transform:scale(1);opacity:1} }
.overlay-player { font-size: 2rem; font-weight: 700; margin-top: .5rem; }
.overlay-team   { font-size: 1.15rem; color: var(--gold); margin-top: .3rem; }
.overlay-price  { font-family: 'Bebas Neue', sans-serif; font-size: 3.2rem; color: var(--gold); letter-spacing: 2px; }
.overlay-btn {
  margin-top: 2rem; padding: .72rem 2.5rem;
  background: rgba(255,255,255,.1); color: var(--white);
  border: 1px solid rgba(255,255,255,.2); border-radius: 8px;
  font-family: 'DM Sans', sans-serif; font-size: .95rem; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.overlay-btn:hover { background: rgba(255,255,255,.18); }

/* ══════════════════════════════════════════
   RESULTS
══════════════════════════════════════════ */
#s-results.active { display: block; background: var(--g0); }
.results-wrap { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 5rem; }
.res-header { text-align: center; padding: 2.5rem 0 3rem; }
.res-top-brand { font-family: 'Bebas Neue', sans-serif; font-size: 1.4rem; letter-spacing: 3px; color: var(--muted); }
.res-top-brand em { color: var(--gold); font-style: normal; }
.res-title { font-family: 'Bebas Neue', sans-serif; font-size: clamp(3rem, 8vw, 6rem); letter-spacing: 4px; color: var(--gold); }
.res-summary { color: var(--muted); font-size: .9rem; margin-top: .4rem; }
.res-new-btn {
  display: inline-block; margin-top: 1.5rem; padding: .55rem 1.5rem;
  background: var(--card); color: var(--muted); border: 1px solid var(--border);
  border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: .85rem;
  cursor: pointer;
}
.res-new-btn:hover { color: var(--white); }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.res-team-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; }
.res-team-name { font-family: 'Bebas Neue', sans-serif; font-size: 2rem; letter-spacing: 2px; color: var(--gold); }
.res-team-stats { display: flex; gap: 1.5rem; font-size: .78rem; color: var(--muted); margin: .4rem 0 .9rem; }
.res-bar-wrap { height: 4px; background: rgba(255,255,255,.07); border-radius: 99px; overflow: hidden; margin-bottom: 1rem; }
.res-bar-fill { height: 100%; background: var(--gold); border-radius: 99px; }
.res-squad { display: grid; grid-template-columns: 1fr 1fr; gap: .38rem; }
.res-sq-chip { background: var(--card); border: 1px solid var(--border); border-radius: 7px; padding: .42rem .6rem; }
.res-sq-name  { font-weight: 600; font-size: .76rem; }
.res-sq-price { font-size: .7rem; color: var(--gold); }

/* ══════════════════════════════════════════
   TOAST
══════════════════════════════════════════ */
.toast-host {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 1100; display: flex; flex-direction: column; gap: .45rem;
}
.toast {
  padding: .65rem 1.1rem; border-radius: 8px; font-size: .85rem; font-weight: 500;
  background: rgba(20,50,30,.95); border: 1px solid var(--border); color: var(--white);
  animation: toastIn .22s ease; max-width: 310px;
}
.toast.terr { background: rgba(70,15,15,.95); border-color: rgba(192,57,43,.4); color: #ff9d9d; }
.toast.tok  { border-color: rgba(39,168,92,.4); color: #62e89a; }
@keyframes toastIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 860px) {
  .auc-body  { grid-template-columns: 1fr; }
  .auc-sidebar { border-left: none; border-top: 1px solid var(--border); }
  .setup-side { display: none; }
  .setup-main { padding: 2rem 1.25rem; }
  .fg2, .teams-wrap { grid-template-columns: 1fr; }
  .timer-mode-cards { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════
   AUTH SCREEN
══════════════════════════════════════════ */
#s-auth.active {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 2rem;
  background:
    radial-gradient(ellipse 80% 55% at 50% 20%, rgba(30,128,70,.3) 0%, transparent 70%),
    var(--g0);
}
.auth-bg { width: 100%; display: flex; align-items: center; justify-content: center; }
.auth-card {
  background: var(--lcard); color: var(--ltxt);
  border-radius: 16px; padding: 2.5rem;
  width: 100%; max-width: 440px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.auth-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem; letter-spacing: 3px; color: var(--g2); margin-bottom: 1.75rem;
}
.auth-logo em { color: var(--gold); font-style: normal; }
.auth-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.7rem; letter-spacing: 1px; margin-bottom: .35rem; }
.auth-desc  { font-size: .88rem; color: var(--lmut); margin-bottom: 1.5rem; }

.auth-step.hidden { display: none; }

.auth-method-btns { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.25rem; }
.auth-method-btn {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; border-radius: 10px;
  border: 1.5px solid var(--lbdr); background: var(--lbg);
  font-family: 'DM Sans', sans-serif; cursor: pointer;
  transition: border-color .18s, background .18s;
  text-align: left;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.auth-method-btn:hover  { border-color: var(--g3); background: #eef6f2; }
.auth-method-btn:active { transform: scale(0.98); }
.auth-method-btn strong { display: block; font-size: .95rem; font-weight: 600; color: var(--ltxt); }
.auth-method-btn small  { font-size: .76rem; color: var(--lmut); }
.auth-method-icon { font-size: 1.6rem; flex-shrink: 0; }

.phone-inp-wrap { display: flex; gap: .5rem; }
.country-code-sel {
  width: 110px; flex-shrink: 0;
  padding: .65rem .5rem; border: 1.5px solid var(--lbdr);
  border-radius: 8px; background: var(--lcard); color: var(--ltxt);
  font-family: 'DM Sans', sans-serif; font-size: .88rem;
}
.phone-inp-wrap input { flex: 1; }

.auth-resend {
  font-size: .82rem; color: var(--lmut); margin: .75rem 0;
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
}
.auth-resend-btn {
  background: none; border: none; color: var(--g3);
  font-family: 'DM Sans', sans-serif; font-size: .82rem;
  font-weight: 600; cursor: pointer; padding: 0;
}
.auth-resend-btn:disabled { color: var(--lmut); cursor: not-allowed; }
.auth-back-btn {
  display: block; background: none; border: none;
  color: var(--lmut); font-family: 'DM Sans', sans-serif;
  font-size: .82rem; cursor: pointer; margin-top: 1rem; padding: 0;
}
.auth-back-btn:hover { color: var(--ltxt); }

/* User badge in setup sidebar */
.ss-user-badge {
  background: var(--gold-dim); border: 1px solid var(--gold-bdr);
  border-radius: 8px; padding: .5rem .75rem;
  font-size: .78rem; color: var(--muted); word-break: break-all;
}

/* Watch Live button on landing */
.lb-watch {
  background: rgba(255,255,255,.06); color: var(--white);
  border: 1px solid rgba(255,255,255,.12);
}
.lb-watch:hover { background: rgba(255,255,255,.11); }

/* Spectator join screen */
#s-spectate-join.active {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 55% at 50% 20%, rgba(30,128,70,.3) 0%, transparent 70%),
    var(--g0);
}
.join-bg { width: 100%; display: flex; align-items: center; justify-content: center; padding: 2rem; }

/* Spectator sidebar notice */
.spectator-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .85rem; border-radius: 99px;
  background: var(--gold-dim); border: 1px solid var(--gold-bdr);
  color: var(--gold); font-size: .78rem; font-weight: 600;
}

/* recaptcha container sizing */
#recaptcha-container { margin: .75rem 0; }
#recaptcha-container iframe { border-radius: 8px; }
/* ══════════════════════════════════════════
   BROADCAST OVERLAY
══════════════════════════════════════════ */
#s-broadcast.active {
  display: flex; flex-direction: column;
  background: transparent; /* For OBS browser source transparency */
  height: 100vh; width: 100vw; overflow: hidden;
  padding: 2rem;
}
.bc-container {
  display: grid; grid-template-rows: auto 1fr auto;
  height: 100%; gap: 1rem;
}
.bc-top { display: flex; justify-content: space-between; align-items: flex-end; }
.bc-brand { font-family: 'Bebas Neue', sans-serif; font-size: 2.5rem; color: var(--gold); letter-spacing: 4px; line-height: 1; }
.bc-tname { font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

#bc-spotlight {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; background: rgba(0,0,0,0.4); border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(10px);
  padding: 3rem; margin: 2rem 0; box-shadow: 0 40px 100px rgba(0,0,0,0.5);
  animation: bcPop .5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes bcPop { from{opacity:0;transform:scale(0.9)} to{opacity:1;transform:scale(1)} }

.bc-p-info { margin-bottom: 2rem; }
.bc-p-role { font-size: 1rem; letter-spacing: 0.3em; color: var(--gold); margin-bottom: 0.5rem; }
.bc-p-name { font-family: 'Bebas Neue', sans-serif; font-size: 7rem; line-height: 0.85; letter-spacing: 4px; }
.bc-p-stats { font-size: 1.2rem; color: var(--muted); margin-top: 1rem; }

.bc-bid-box { background: var(--gold); color: #000; padding: 1.5rem 4rem; border-radius: 12px; display: inline-block; }
.bc-bid-label { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.2em; opacity: 0.7; }
.bc-bid-amt { font-family: 'Bebas Neue', sans-serif; font-size: 5rem; line-height: 1; }
.bc-bidder { font-size: 1.5rem; font-weight: 700; text-transform: uppercase; margin-top: 0.25rem; }

.bc-timer-wrap { width: 100%; max-width: 600px; margin-top: 2rem; position: relative; height: 10px; background: rgba(0,0,0,0.3); border-radius: 99px; overflow: hidden; }
.bc-timer-bar { height: 100%; background: var(--gold); transition: width 1s linear; }
.bc-timer-num { position: absolute; top: -3rem; left: 50%; transform: translateX(-50%); font-family: 'Bebas Neue', sans-serif; font-size: 2.5rem; color: var(--gold); }

.bc-bottom { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: flex-end; }
.bc-log { display: flex; flex-direction: column; gap: 0.5rem; }
.bc-log-e { background: rgba(0,0,0,0.5); padding: 0.5rem 1rem; border-radius: 8px; font-size: 0.9rem; border-left: 4px solid var(--gold); animation: slideIn .3s ease; }
@keyframes slideIn { from{opacity:0;transform:translateX(-20px)} to{opacity:1;transform:none} }
.bc-log-e.sold { border-left-color: var(--g5); color: var(--g5); }

.bc-teams { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; max-width: 600px; }
.bc-team-chip { background: rgba(255,255,255,0.05); padding: 0.5rem 1rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); white-space: nowrap; }
.bc-team-chip.winning { border-color: var(--gold); background: var(--gold-dim); }
.bc-t-name { font-size: 0.75rem; font-weight: 700; color: var(--gold); }
.bc-t-stats { font-size: 0.7rem; color: var(--muted); }

.bc-idle { font-family: 'Bebas Neue', sans-serif; font-size: 4rem; letter-spacing: 5px; color: var(--muted); }

/* ══════════════════════════════════════════
   NEW: PAYMENTS & LIMITS
   ══════════════════════════════════════════ */
.pay-notice {
  background: #fdf6e7; border: 1.5px solid #f3e5c9;
  border-radius: 10px; padding: 1.25rem; margin-top: 1.25rem;
  text-align: center; animation: slideDown 0.3s ease;
}
@keyframes slideDown { from{opacity:0;transform:translateY(-10px)} to{opacity:1;transform:none} }
.pn-msg { font-weight: 600; font-size: 0.9rem; color: #7a5700; margin-bottom: 0.75rem; }
.btn-pay {
  background: #27ae60; color: #fff; border: none; border-radius: 6px;
  padding: 0.6rem 1.5rem; font-weight: 700; cursor: pointer; transition: background 0.2s;
}
.btn-pay:hover { background: #2ecc71; }

/* ══════════════════════════════════════════
   NEW: CHAT (Feature 6)
   ══════════════════════════════════════════ */
.chat-sec { height: 260px; display: flex; flex-direction: column; }
.chat-box { flex: 1; overflow-y: auto; background: rgba(0,0,0,0.2); border-radius: 8px; padding: 0.5rem; margin-bottom: 0.5rem; }
.chat-msg { font-size: 0.78rem; margin-bottom: 0.35rem; line-height: 1.3; }
.chat-name { font-weight: 700; color: var(--gold); margin-right: 0.35rem; }
.chat-text { color: var(--white); }
.chat-input-wrap { display: flex; gap: 0.35rem; }
.chat-input-wrap input {
  flex: 1; background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.4rem 0.6rem; color: var(--white); font-size: 0.8rem;
}
.chat-input-wrap button {
  background: var(--g3); border: none; color: #fff; border-radius: 6px;
  padding: 0 0.75rem; font-size: 0.75rem; cursor: pointer;
}

/* ══════════════════════════════════════════
   NEW: ADMIN DASHBOARD
   ══════════════════════════════════════════ */
.admin-shell { padding: 3rem; max-width: 1200px; margin: 0 auto; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.ah-brand { font-family: 'Bebas Neue', sans-serif; font-size: 2.5rem; letter-spacing: 4px; color: var(--gold); }
.ah-close { background: var(--card); color: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 1rem; cursor: pointer; }

.admin-grid { display: grid; grid-template-columns: 1fr 400px; gap: 2rem; }
.admin-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem; }
.ac-title { font-size: 1.1rem; font-weight: 700; color: var(--white); margin-bottom: 1.25rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }

.admin-t-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem; border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.atr-name { font-weight: 600; }
.atr-meta { font-size: 0.75rem; color: var(--muted); }
.atr-actions { display: flex; gap: 0.5rem; }
.btn-adm { font-size: 0.75rem; padding: 0.3rem 0.6rem; border-radius: 4px; border: 1px solid var(--border); background: var(--card); cursor: pointer; }
.btn-adm.ok { border-color: var(--g5); color: var(--g5); }
.btn-adm.err { border-color: var(--red); color: var(--red); }
