.hidden{ display:none !important; }

body{
  overflow-x:hidden;
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--ink);
  transition:padding-left .25s ease;
}
body:not(.live-mode){ padding-left:360px; }
@media (max-width:900px){
  body:not(.live-mode){ padding-left:0; }
}
/* Live mode is meant to be captured full-frame (OBS source, screen-share,
   "2ª pantalla"), so the card goes edge-to-edge instead of keeping the small
   margin/rounded corners used while editing. */
body.live-mode .stage{ margin:0; max-width:100%; width:100vw; height:100vh; height:100dvh; border-radius:0; }

/* Big by default, in *and* out of live mode — the stage used to shrink to a
   fixed 1040x420 preview any time the settings dock was open, which meant
   every icon/name on it visibly resized just from opening or closing the
   panel. Now it's always sized to the available space (dock included, via
   body's own padding-left) with a small margin — opening the dock only
   changes how much width is available, not this card's whole scale. */
.stage{
  position:relative;
  width:calc(100% - 48px);
  height:calc(100vh - 48px);
  margin:24px;
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:56px 22px 22px;
  background:
    radial-gradient(ellipse 140% 90% at 50% -10%, rgba(255,255,255,.14), transparent 60%),
    linear-gradient(180deg,var(--brand-red),var(--brand-red-dark));
  border-radius:20px;
  box-shadow:0 20px 50px rgba(0,0,0,.45);
}

.watermark{
  position:absolute; top:8px; right:22px;
  height:48px; width:auto;
  opacity:1; pointer-events:none; z-index:5;
  filter:drop-shadow(0 2px 6px rgba(0,0,0,.5));
}

.stage-top{ display:flex; gap:18px; flex:1; min-height:0; }

/* A compact grid of icon tiles instead of a tall stack of full-width name
   bars — there are always exactly 8 energies, so a fixed grid reads better
   than a scrolling list of lines, and the icon (not a name run the width of
   the stage) is the primary visual. The energy name stays on every tile
   (never replaced); once a tile is won, the winner's name is added *below*
   it instead of taking its place. */
.bars-col{
  flex:1; display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); grid-auto-rows:1fr;
  gap:12px; min-height:0; padding:2px;
}
.bar-row{
  position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:4px; min-height:0; border-radius:16px; padding:8px 6px 10px;
  background:rgba(0,0,0,.18); transition:background .15s ease;
}
.bar-row.inactive{ opacity:.35; filter:grayscale(.7); }
/* Sized in JS (syncBarIconSizing) rather than flex-grow + aspect-ratio — that
   combination doesn't reliably stay square once max-width also applies, and
   ends up an oval. The JS measures the actual tile and picks the largest
   square that still leaves room for the name (and winner-name) below it. */
/* A glowing sphere, not a flat tinted circle — closer to how the physical
   TCG energy cards present their symbol (radiant orb behind the icon)
   without tracing the cards' own artwork: the icon shapes stay ours, only
   the "glowing sphere" staging borrows the general idea. --glow (the
   entry's own lighter color, set inline in JS) drives the outer bloom so
   each energy's glow actually matches its own color instead of a fixed
   white. position:relative + overflow:hidden keeps ::before's gloss
   contained to the circle; the bloom itself is a box-shadow, which isn't
   clipped by that overflow. */
.bar-icon{
  position:relative; overflow:hidden;
  flex:0 0 auto; width:var(--icon-size, 100px); height:var(--icon-size, 100px); border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  border:3px solid rgba(255,255,255,.4);
  box-shadow:0 0 22px 2px color-mix(in srgb, var(--glow, #fff) 55%, transparent), 0 3px 8px rgba(0,0,0,.5);
}
.bar-icon::before{
  content:""; position:absolute; inset:0; border-radius:50%; pointer-events:none;
  background:radial-gradient(ellipse 46% 30% at 34% 24%, rgba(255,255,255,.65), rgba(255,255,255,0) 72%);
}
.bar-icon svg{ width:56%; height:56%; position:relative; filter:drop-shadow(0 1px 3px rgba(0,0,0,.35)); }
.bar-row.won .bar-icon{
  box-shadow:0 0 0 3px #f4c430, 0 0 22px 2px color-mix(in srgb, var(--glow, #fff) 55%, transparent), 0 3px 8px rgba(0,0,0,.5);
}
.bar-name{
  flex:0 0 auto; color:#fff; font-family:var(--font); font-weight:900;
  font-size:clamp(14px,1.9vw,22px); letter-spacing:.6px;
  text-shadow:0 2px 5px rgba(0,0,0,.7);
  background:rgba(0,0,0,.28); padding:2px 12px; border-radius:999px;
  text-transform:uppercase; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%;
}
/* The winner is the whole point of a tile that's already been won, so its
   name reads bigger and bolder than the energy-name label above it — the
   opposite emphasis from an unwon tile, where the energy name is all there is. */
.winner-name-input{
  flex:0 0 auto; width:100%; max-width:100%; min-width:0; text-align:center; box-sizing:border-box;
  background:rgba(0,0,0,.38); border:2px solid rgba(244,196,48,.5); outline:none; border-radius:999px; padding:5px 12px;
  color:#fff; font-family:var(--font); font-weight:900;
  font-size:clamp(17px,2.4vw,28px);
  text-shadow:0 2px 5px rgba(0,0,0,.7);
}
.winner-name-input::placeholder{ color:rgba(255,255,255,.55); font-weight:900; }
.confirm-check{
  position:absolute; top:4px; right:4px; width:26px; height:26px; border-radius:50%;
  border:2px solid rgba(255,255,255,.5); background:rgba(0,0,0,.35); color:rgba(255,255,255,.6);
  font-weight:900; font-size:13px; line-height:1; display:flex; align-items:center; justify-content:center;
  animation:confirmPulse 1.4s ease infinite;
}
.confirm-check:hover{ border-color:#fff; color:#fff; }
.confirm-check.is-confirmed{
  border-color:#38b44a; background:#38b44a; color:#fff; animation:none;
}
@keyframes confirmPulse{
  0%,100%{ box-shadow:0 0 0 0 rgba(244,196,48,.5); }
  50%{ box-shadow:0 0 0 6px rgba(244,196,48,0); }
}
.bar-row.winner-step .bar-icon{ animation:winnerPulse 1.6s ease; }
@keyframes winnerPulse{
  0%{ transform:scale(1); }
  18%{ transform:scale(1.14); box-shadow:0 0 0 4px #f4c430, 0 0 34px #f4c430; }
  100%{ transform:scale(1); box-shadow:inset 0 0 0 3px rgba(255,255,255,.06); }
}

.stage-bottom{ display:flex; gap:14px; align-items:stretch; height:88px; }
.banner-pill{
  flex:1; min-width:0; background:#000; border-radius:999px;
  position:relative; overflow:hidden;
  transition:transform .15s ease, box-shadow .15s ease, background .05s linear;
  box-shadow:0 8px 22px rgba(0,0,0,.35), inset 0 0 0 2px rgba(255,255,255,.08);
}
.banner-pill.winner-step{ animation:winnerPulse 1.6s ease; }
.banner-reel{
  --slide-ms:160ms;
  position:absolute; inset:0; padding:12px 26px;
  display:flex; align-items:center; justify-content:center; gap:16px;
  transform:translateY(0); opacity:1;
  transition:transform var(--slide-ms) cubic-bezier(.45,0,.8,.35), opacity var(--slide-ms) linear;
}
.banner-reel.banner-reel-incoming{ transform:translateY(105%); opacity:0; transition:none; }
.banner-reel.banner-reel-outgoing{ transform:translateY(-105%); opacity:0; }
.banner-icon{ font-size:clamp(26px,3.8vw,44px); flex:0 0 auto; display:flex; }
.banner-text{
  min-width:0; max-width:100%;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  color:#fff; font-family:var(--font); font-weight:900;
  font-size:clamp(18px,2.9vw,36px); letter-spacing:1px; text-align:center;
  text-transform:uppercase; text-shadow:0 2px 4px rgba(0,0,0,.5);
}
.banner-placeholder{ color:rgba(255,255,255,.5); letter-spacing:2px; }
.spins-pill{
  background:linear-gradient(180deg,var(--green),var(--green-dark));
  border-radius:999px; padding:8px 24px; min-width:150px;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  box-shadow:var(--shadow-soft);
}
.spins-pill span{ font-family:var(--font); font-weight:900; font-size:clamp(18px,2.8vw,30px); color:#0c2a10; line-height:1; }
.spins-pill small{ font-weight:800; color:#0c2a10; letter-spacing:1px; font-size:10px; margin-top:2px; }

.corner-hover{ position:fixed; top:0; right:0; width:76px; height:76px; display:flex; align-items:flex-start; justify-content:flex-end; padding:12px; opacity:0; transition:opacity .2s ease; z-index:100; }
.corner-hover:hover{ opacity:1; }
.dock-toggle{ width:38px; height:38px; border-radius:50%; border:none; background:rgba(0,0,0,.65); color:#fff; font-size:18px; }

.dock{
  position:fixed; top:0; left:0; width:360px; height:100vh; overflow-y:auto;
  background:#141417; border-right:1px solid rgba(255,255,255,.08);
  padding:20px; display:flex; flex-direction:column; gap:16px; z-index:80;
}
body.live-mode .dock{ display:none; }
.dock .back-link{ font-size:12px; color:#888; text-decoration:none; }
.dock .back-link:hover{ color:#fff; }
.dock h2{ margin:0; font-size:16px; }
.dock .hint{ margin:0; font-size:11px; color:#777; }
.live-toggle, .spin-btn, .reset-btn, .round-reset-btn{ border:none; border-radius:12px; padding:12px; font-weight:800; font-size:13px; }
.live-toggle{ background:#232327; color:#fff; }
.spin-btn{ width:100%; background:var(--brand-red); color:#fff; font-size:16px; }
.spin-btn:hover{ background:var(--brand-red-dark); }
.spin-btn:disabled{ opacity:.5; cursor:not-allowed; }
.round-reset-btn{ background:#232327; color:#e0b84c; border:1px solid #3a331a; margin-top:4px; }
.reset-btn{ background:transparent; color:#c94444; border:1px solid #4a2222; }

.field{ display:flex; flex-direction:column; gap:4px; font-size:12px; color:#999; margin-bottom:10px; }
.field input[type=text]{ background:#0c0c0e; border:1px solid #2a2a2e; color:#fff; border-radius:8px; padding:8px 10px; font-size:13px; }
.field input[type=color]{ width:100%; height:34px; border:1px solid #2a2a2e; border-radius:8px; background:#0c0c0e; padding:2px; }

.seg-details{ border-top:1px solid rgba(255,255,255,.08); padding-top:12px; }
.seg-details summary{ cursor:pointer; font-size:13px; font-weight:700; color:#ddd; list-style:none; display:flex; align-items:center; gap:6px; }
.seg-details summary::-webkit-details-marker{ display:none; }
.seg-details summary::before{ content:'▸'; color:#777; transition:transform .15s ease; }
.seg-details[open] summary::before{ transform:rotate(90deg); }
.seg-details summary .muted{ font-size:10px; font-weight:500; color:#777; text-transform:none; letter-spacing:0; }
.seg-details .entries-list{ margin-top:10px; }
.seg-details .add-form{ margin-top:10px; }
.count-badge{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:18px; padding:0 5px; height:18px; border-radius:999px;
  background:var(--brand-red); color:#fff; font-size:10px; font-weight:800;
}
.prize-tools{ display:flex; flex-direction:column; gap:6px; margin-top:10px; }
.shuffle-btn{
  width:100%; background:#2a2a30; color:#fff;
  border:1px solid #3a3a42; border-radius:8px; padding:8px; font-size:12px; font-weight:700;
}
.shuffle-btn:hover{ background:#3a3a42; }
.tier-hint{ margin:6px 0 0; font-size:10px; color:#777; text-align:center; }

.entries-list{ display:flex; flex-direction:column; gap:10px; max-height:320px; overflow-y:auto; padding-right:4px; }
.entry-row{ background:#1c1c21; border-radius:10px; padding:8px; display:flex; flex-direction:column; gap:6px; }
.entry-row.is-won{ background:#241f14; }
.entry-line1{ display:flex; align-items:center; gap:6px; }
.entry-line1 .ent-emoji{ width:64px; background:#0c0c0e; border:1px solid #2a2a2e; color:#fff; border-radius:6px; padding:5px 2px; font-size:11px; }
.ent-icon-preview{
  flex:0 0 auto; width:26px; height:26px; border-radius:50%;
  background:#0c0c0e; border:1px solid #2a2a2e; color:#fff; font-size:15px;
  display:flex; align-items:center; justify-content:center;
}
.entry-line1 .ent-name{ flex:1; min-width:0; background:#0c0c0e; border:1px solid #2a2a2e; color:#fff; border-radius:6px; padding:6px 8px; font-size:12px; }
.entry-line1 button{ width:24px; height:24px; border-radius:6px; border:1px solid #2a2a2e; background:#0c0c0e; color:#ccc; font-size:11px; padding:0; flex:0 0 auto; }
.entry-line1 .ent-remove{ color:#e05555; }
.entry-line1 .ent-undo{ width:auto; padding:0 8px; color:#e0b84c; }
.entry-line2{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:10px; color:#888; }
.entry-line2 label{ display:flex; align-items:center; gap:4px; }
.entry-line2 input[type=color]{ width:28px; height:22px; border:none; background:none; padding:0; }
.entry-line2 input[type=number]{ width:52px; background:#0c0c0e; border:1px solid #2a2a2e; color:#fff; border-radius:6px; padding:3px 5px; }
.entry-line2 .ent-pct-suffix{ margin-left:-4px; }
.won-badge{ color:#e0b84c; font-weight:700; font-size:11px; }

.add-form{ display:flex; flex-direction:column; gap:8px; }
.add-form select, .add-form input{ background:#0c0c0e; border:1px solid #2a2a2e; color:#fff; border-radius:8px; padding:8px; font-size:12px; }
.add-form select{
  appearance:none; -webkit-appearance:none; cursor:pointer; padding-right:30px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%239a9aa2' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center;
}
.add-form select option{ color:#fff; background:#0c0c0e; }
.add-form button{ background:var(--green); color:#0c2a10; font-weight:800; border:none; border-radius:8px; padding:10px; }

.preset-row{ display:flex; gap:6px; margin-bottom:8px; }
.preset-row input[type=text]{ flex:1; background:#0c0c0e; border:1px solid #2a2a2e; color:#fff; border-radius:8px; padding:8px; font-size:12px; }
.preset-row select{
  flex:1; min-width:0; appearance:none; -webkit-appearance:none;
  background:#0c0c0e; border:1px solid #2a2a2e; color:#fff; border-radius:8px;
  padding:8px 30px 8px 10px; font-size:13px; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%239a9aa2' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center;
}
.preset-row select option{ color:#fff; background:#0c0c0e; }
.preset-row button{ background:#2a2a30; color:#fff; border:1px solid #3a3a42; border-radius:8px; padding:8px 10px; font-size:12px; font-weight:700; }
.preset-row button:hover{ background:#3a3a42; }

.modal-overlay{
  position:fixed; inset:0; z-index:200;
  background:rgba(0,0,0,.65);
  display:flex; align-items:center; justify-content:center;
  padding:20px;
}
.modal-box{
  background:#18181c; border:1px solid #2e2e34; border-radius:16px;
  padding:22px; max-width:360px; width:100%;
  box-shadow:0 20px 50px rgba(0,0,0,.5);
}
.modal-box p{ margin:0 0 18px; color:#fff; font-size:14px; line-height:1.4; }
.modal-actions{ display:flex; gap:10px; justify-content:flex-end; }
.modal-btn{ border:none; border-radius:10px; padding:10px 16px; font-weight:700; font-size:13px; }
.modal-btn-ghost{ background:#232327; color:#ccc; }
.modal-btn-ghost:hover{ background:#2e2e34; }
.modal-btn-primary{ background:var(--brand-red); color:#fff; }
.modal-btn-primary:hover{ background:var(--brand-red-dark); }

/* Phones: eight tiles in four narrow columns — let the names wrap instead of cutting them to "P…". */
@media (max-width: 600px){
  .bar-row{ padding:6px 3px 8px; }
  .bar-name{
    font-size:clamp(8.5px, 2.4vw, 10.5px); letter-spacing:-.2px; padding:3px 3px; border-radius:12px; line-height:1.15;
    white-space:normal; overflow-wrap:break-word; text-overflow:clip;
  }
  .winner-name-input{ font-size:13px; padding:4px 6px; border-width:1.5px; }
}

/* Phones: the winner's name needs the full width — stack the "premios restantes" pill under the banner instead of beside it. */
@media (max-width: 600px){
  .stage-bottom{ flex-direction:column; height:auto; gap:8px; }
  .banner-pill{ flex:0 0 auto; min-height:64px; }
  .banner-reel{ padding:8px 14px; gap:8px; }
  .banner-text{ font-size:clamp(15px, 5vw, 22px); letter-spacing:.3px; }
  .spins-pill{ min-width:0; padding:6px 16px; flex-direction:row; gap:8px; justify-content:center; }
  .spins-pill small{ margin-top:0; }
}

/* --- Espejo dentro del live de Chasers (shared/espejo.js): va encima del video, así que el
   escenario no lleva fondo; las fichas, el banner y el contador tienen el suyo y se leen. La
   palomita de confirmar es cosa del vendedor. --- */
html.modo-espejo, html.modo-espejo body{ background: transparent !important; }
html.modo-espejo .stage{ background: none !important; box-shadow: none !important; }
html.modo-espejo .confirm-check{ display: none !important; }

/* --- El nombre del ganador ocupa el lugar del nombre de la energía (el icono ya dice cuál es):
   así la ficha no crece ni empuja a las de al lado cuando alguien la gana. --- */
.bar-name.con-ganador{ color:#f4c430; text-transform:none; letter-spacing:.2px; background:rgba(0,0,0,.45); border:1.5px solid rgba(244,196,48,.55); }
html.modo-espejo .winner-name-input{ display:none !important; }
/* El letrero «listo para girar» es del vendedor; la sala ve el banner hasta que haya un premio. */
html.modo-espejo .banner-pill:has(.banner-placeholder){ visibility:hidden; }

/* --- Pujas del break (sólo en el control, dentro del live) --- */
.pujas{ display:flex; flex-direction:column; gap:8px; padding:10px; border-radius:12px; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.08); }
.pujas h3{ margin:0; font-size:13px; }
.pujas-campos{ display:flex; gap:10px; }
.pujas-campos label{ flex:1; display:flex; align-items:center; gap:6px; font-size:12px; color:#bbb; }
.pujas-campos input, .pujas-campos select{ flex:1; min-width:0; background:#1d1d22; color:#fff; border:1px solid rgba(255,255,255,.15); border-radius:8px; padding:6px 8px; font-size:14px; }
.pujas-btn{ border:none; border-radius:10px; padding:9px 12px; font-weight:900; font-size:13px; background:var(--brand-red); color:#fff; cursor:pointer; }
.pujas-btn.activa{ background:#444; }
.pujas-estado{ margin:0; font-size:12px; color:#9ad99a; min-height:16px; }
.pujas-estado.mal{ color:#ff8686; }
