/* ============================================================
   KODA KARAOKE LIVE — shared visual system
   Wears "La Sala", the language of the private-rooms app, so the
   two karaoke products read as one family: near-black ground,
   depth carried by surface value instead of borders, one green
   for the primary action and for what is live, and nothing square.
   Structure, copy and behaviour are unchanged — only the skin.
   ============================================================ */

@import url('fonts/fonts.css?v=27');

:root {
  /* Ground and elevation. Depth is value, never a border. */
  --bg:        #121212;   /* the app's ground */
  --bg-elev:   #181818;   /* a card, a panel, at rest */
  --bg-elev-2: #242424;   /* under the finger; also a field's fill */
  --bg-elev-3: #2a2a2a;   /* pressed */
  --bg-sheet:  #282828;   /* dialogs — nearer than any card */
  --bg-tint:   rgba(255, 255, 255, .07);   /* low-commitment fills */

  --line:      rgba(255, 255, 255, .09);   /* the only hairline */
  --stroke:    rgba(255, 255, 255, .28);   /* a control's outline, never a container's */

  /* Text */
  --tx:        #ffffff;
  --tx-2:      #b3b3b3;
  --tx-3:      #949494;

  /* The one accent: the primary action, and what is live. */
  --acc:       #1ed760;
  --acc-hi:    #3be477;
  --acc-ink:   #000000;
  --acc-print: #12873b;   /* the same green, darkened to survive white paper */

  --acc-ring:  rgba(30, 215, 96, .28);   /* derived: the pulse on what is live */

  --danger:     #f15e6c;
  --danger-ink: #2a0006;
  --danger-line:rgba(241, 94, 108, .5);   /* resting outline of a destructive pill */
  --danger-tint:rgba(241, 94, 108, .12);  /* its hover wash — the danger twin of --acc-ring */

  /* Escala por rol, no por gusto. Antes había once pasos bajo 18px
     (10 · 11 · 11.5 · 12 · 12.5 · 13 · 13.5 · 14 · 15 · 16 · 17) y varios
     eran indistinguibles entre sí, así que el tamaño no comunicaba nada.
     Ahora son cuatro, cada uno con un trabajo: */
  --t-micro: 11px;   /* versales con tracking: etiquetas de panel, sellos, FICHA */
  --t-small: 13px;   /* metadatos, pistas, texto secundario de una fila */
  --t-body:  15px;   /* texto normal y etiquetas de botón */
  --t-input: 16px;   /* SOLO controles de formulario: por debajo, iOS hace zoom al enfocar */
  --t-lead:  17px;   /* el dato principal de una fila */
  /* De 19px para arriba mandan los códigos y los títulos, que ya tenían
     contraste de sobra; esos no se tocan. */

  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.3, 0, .4, 1);

  --shadow-lift:  0 8px 24px rgba(0, 0, 0, .5);
  --shadow-modal: 0 16px 48px rgba(0, 0, 0, .6);

  --r-art:  6px;
  --r-card: 8px;
  --r-lg:   12px;
  --r-full: 500px;
}

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--tx);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.003em;
}

/* Browser surfaces belong to the system too. The focus ring is white:
   the accent is reserved for the primary action and for what is live. */
::selection { background: var(--acc); color: var(--acc-ink); }
input, textarea { caret-color: var(--tx); }
:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; border-radius: var(--r-art); }
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.34); }

/* ---------- Panels ---------- */
.bezel {
  position: relative;
  background: var(--bg-elev);
  border: 0;
  border-radius: var(--r-lg);
}
.bezel--lit { background: var(--bg-elev); }

/* Empty / powered-down panel: a tint wash, not an outline */
.bezel--dark {
  background: var(--bg-tint);
  border: 0;
  color: var(--tx-2);
}

/* Region label — names a persistent area, never a decorative kicker */
.panel-tag {
  position: static;
  transform: none;
  display: block;
  background: none;
  border: 0;
  box-shadow: none;
  text-shadow: none;
  padding: 0;
  margin-bottom: 2px;
  font-family: var(--font);
  font-weight: 700;
  font-size: var(--t-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tx-2);
  white-space: nowrap;
}
.panel-tag--lit { background: none; color: var(--acc); }

/* Count tag pinned to a panel's header line */
.count-tag {
  position: absolute;
  top: 16px;
  right: 18px;
  background: var(--bg-tint);
  border: 0;
  color: var(--tx-2);
  font-family: var(--font);
  font-weight: 700;
  font-size: var(--t-micro);
  letter-spacing: 0.02em;
  padding: 3px 11px;
  border-radius: var(--r-full);
  font-variant-numeric: tabular-nums;
}

/* ---------- Location pill ---------- */
.brass-plate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-tint);
  border: 0;
  color: var(--tx-2);
  border-radius: var(--r-full);
  padding: 5px 13px;
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: var(--t-small);
  text-transform: uppercase;
}
.brass-plate::before, .brass-plate::after { content: none; }

/* ---------- Request row ---------- */
.strip {
  display: flex;
  align-items: stretch;
  background: transparent;
  border: 0;
  color: var(--tx);
  border-radius: var(--r-art);
  font-family: var(--font);
  overflow: hidden;
  transition: background 160ms var(--ease);
}
.strip:hover { background: var(--bg-tint); }

/* What is live takes the tint fill permanently and turns its numerals green */
.strip--called { background: var(--bg-tint); }

.strip-code {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 10px;
  border: 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--tx-2);
  letter-spacing: -0.02em;
}
.strip--called .strip-code { color: var(--acc); }
.strip-code .code { font-size: 19px; line-height: 1.1; }
.strip-code .code-label {
  font-size: var(--t-micro);
  letter-spacing: 0.12em;
  color: var(--tx-3);
  margin-top: 3px;
  font-weight: 700;
  text-transform: uppercase;
}

.strip-body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}
.strip-song {
  font-weight: 700;
  font-size: var(--t-body);
  letter-spacing: -0.01em;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.strip--called .strip-song { color: var(--acc); }
.strip-artist {
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--tx-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.strip-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 10px;
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--tx-3);
  margin-top: 4px;
}
.strip-meta .who {
  font-weight: 700;
  color: var(--tx-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The singer's location rides with the song, like La Sala's singer pill */
.strip-meta .mesa {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-tint);
  border: 0;
  color: var(--tx-2);
  border-radius: var(--r-full);
  padding: 2px 10px;
  font-weight: 700;
  font-size: var(--t-micro);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
  text-align: left;
}
.strip--called .strip-meta .mesa { background: var(--acc); color: var(--acc-ink); }

.rack-slot { padding: 0; border-radius: var(--r-art); background: none; box-shadow: none; }

@keyframes row-in {
  0% { transform: translateY(-6px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.strip--new { animation: row-in 200ms var(--ease) both; }

/* Empty state — a tint ghost, no dashed outline */
.rack-slot--ghost {
  border: 0;
  background: var(--bg-tint);
  box-shadow: none;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tx-2);
  font-family: var(--font);
  font-size: var(--t-small);
  font-weight: 500;
  text-align: center;
  padding: 12px 16px;
  border-radius: var(--r-art);
}

.rack-more {
  text-align: center;
  color: var(--tx-3);
  font-size: var(--t-small);
  font-weight: 500;
  padding: 4px 0 2px;
}

/* ---------- Status tags ---------- */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font);
  font-weight: 700;
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  padding: 3px 11px;
  border: 0;
  border-radius: var(--r-full);
  text-transform: uppercase;
  transform: none;
  opacity: 1;
  font-variant-numeric: tabular-nums;
}
.stamp--done { color: var(--acc-ink); background: var(--acc); }
.stamp--void { color: var(--danger-ink); background: var(--danger); }

.strip--done { opacity: 0.62; }
.strip--void { opacity: 0.55; }
.strip--void .strip-song, .strip--void .strip-artist { text-decoration: line-through; text-decoration-thickness: 1px; }

/* ---------- Controls: pills and circles, nothing square ---------- */
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: var(--r-full);
  transition: background 160ms var(--ease), border-color 160ms var(--ease),
              color 160ms var(--ease), transform 100ms var(--ease), opacity 160ms var(--ease);
}
.btn:disabled { cursor: not-allowed; opacity: 0.45; }

/* Primary: accent fill, black ink, grows slightly under the finger */
.btn-push {
  background: var(--acc);
  color: var(--acc-ink);
  font-weight: 700;
  font-size: var(--t-body);
  letter-spacing: -0.01em;
  padding: 13px 30px;
  min-height: 48px;
  border: 0;
  box-shadow: none;
  text-shadow: none;
}
.btn-push:hover:not(:disabled) { background: var(--acc-hi); transform: scale(1.04); }
.btn-push:active:not(:disabled) { transform: scale(0.98); }

/* Secondary: an outline pill — visible on a dark plate without taking the accent */
.btn-key {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--tx);
  font-weight: 700;
  font-size: var(--t-small);
  padding: 10px 20px;
  min-height: 44px;
  box-shadow: none;
  text-shadow: none;
}
.btn-key:hover:not(:disabled) { border-color: #ffffff; transform: scale(1.03); }
.btn-key:active:not(:disabled) { transform: scale(0.98); }
.btn-key--danger { color: var(--danger); border-color: var(--danger-line); }
.btn-key--danger:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-tint); }
.btn-key--go { color: var(--acc); }
.btn-key--go:hover:not(:disabled) { border-color: var(--acc); }

/* Icon button: a round, borderless hit-area that fills with tint */
.btn-key--square {
  padding: 0;
  min-width: 44px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border: 0;
  color: var(--tx-2);
  flex: 0 0 auto;
}
.btn-key--square:hover:not(:disabled) { background: var(--bg-tint); color: var(--tx); border: 0; transform: none; }
.btn-key--square.btn-key--danger:hover:not(:disabled) { color: var(--danger); background: var(--danger-tint); }

/* Ghost: dismisses. The quiet half of every dialog. */
.btn-ghost {
  background: transparent;
  border: 0;
  color: var(--tx-2);
  font-weight: 700;
  font-size: var(--t-body);
  padding: 10px 18px;
  min-height: 44px;
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-tint); color: var(--tx); }

/* Danger: the filled destructive commit — same object as primary, other temperature */
.btn-danger {
  background: var(--danger);
  color: var(--danger-ink);
  font-weight: 700;
  font-size: var(--t-body);
  padding: 13px 30px;
  min-height: 48px;
  border: 0;
}
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 82%, #fff); transform: scale(1.04); }
.btn-danger:active:not(:disabled) { transform: scale(0.98); }

/* ---------- Status dot ---------- */
.lamp {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  background: var(--tx-3);
  box-shadow: none;
  flex: 0 0 auto;
}
@keyframes dot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.lamp--on, .lamp--green { background: var(--acc); animation: dot-pulse 1.6s ease-in-out infinite; }
.lamp--red { background: var(--danger); }

/* Retired device from an earlier world — kept as a no-op hook */
.marquee-bulbs { display: none; }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label {
  font-family: var(--font);
  font-weight: 600;
  font-size: var(--t-small);
  letter-spacing: 0;
  color: var(--tx-2);
}
.field input, .field select {
  width: 100%;
  font-family: var(--font);
  font-size: var(--t-input);   /* por debajo de 16px iOS hace zoom al enfocar y no vuelve */
  font-weight: 500;
  color: var(--tx);
  background: var(--bg-elev-2);
  border: 1px solid transparent;
  border-radius: var(--r-art);
  padding: 13px 14px;
  box-shadow: none;
  min-height: 48px;
  transition: background 160ms var(--ease), border-color 160ms var(--ease);
}
.field input::placeholder { color: var(--tx-3); font-style: normal; }
/* Focus is white. The accent never marks a field. */
.field input:focus, .field select:focus {
  outline: none;
  background: var(--bg-elev-3);
  border-color: #ffffff;
}
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3b3b3' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 17px;
  padding-right: 40px;
}

.hint { font-size: var(--t-small); color: var(--tx-3); }

.field-error {
  color: var(--danger);
  font-size: var(--t-small);
  font-weight: 600;
  display: none;
}
.field.is-bad .field-error { display: block; }
.field.is-bad input { border-color: var(--danger); }

/* ---------- Icons ---------- */
.ric { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.ric--solid { fill: currentColor; stroke: none; }
.ric--sm { width: 16px; height: 16px; }
.ric--lg { width: 26px; height: 26px; }

/* ---------- Brand ---------- */
.venue-sub {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: var(--t-micro);
  color: var(--tx-2);
  text-transform: uppercase;
}

.wordmark {
  font-family: var(--font);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--tx);
  text-shadow: none;
}
.wordmark .dot { color: var(--acc); }
.wordmark--off { color: var(--tx-3); text-shadow: none; }

/* The equaliser is the brand mark and the shorthand for "playing" */
.eq-mark { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 15px; }
.eq-mark i {
  display: block; width: 3px; border-radius: var(--r-full); background: var(--acc);
  height: 100%; transform-origin: bottom;
  animation: eq 0.9s ease-in-out infinite;
}
.eq-mark i:nth-child(1) { animation-delay: 0s; }
.eq-mark i:nth-child(2) { animation-delay: 0.25s; }
.eq-mark i:nth-child(3) { animation-delay: 0.5s; }
@keyframes eq {
  0%, 100% { transform: scaleY(0.3); }
  50%      { transform: scaleY(1); }
}

.chip-demo {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 60;
  background: var(--bg-sheet);
  border: 0;
  color: var(--tx-2);
  font-weight: 700;
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 13px;
  border-radius: var(--r-full);
  box-shadow: var(--shadow-lift);
}

.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  background: var(--danger);
  border: 0;
  color: var(--danger-ink);
  font-weight: 700;
  font-size: var(--t-small);
  text-align: center;
  padding: 10px 16px;
  display: none;
}
body.is-offline .offline-banner { display: block; }

/* ---------- Dialogs: ghost dismisses, primary commits ---------- */
.rk-dialog {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .72);
  animation: scrim-in 200ms var(--ease) both;
}
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
.rk-dialog-card {
  width: min(520px, 100%);
  background: var(--bg-sheet);
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-modal);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: sheet-in 200ms var(--ease) both;
}
@keyframes sheet-in { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.rk-dialog-card h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.025em; color: var(--tx); }
.rk-dialog-card p { font-size: var(--t-body); color: var(--tx-2); }
.rk-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}

/* ---------- KODA brand mark (assets copied unchanged from koda-final) ---------- */
.logo { display: block; height: 30px; width: auto; }
.logo--login { height: 40px; }
.logo--print { height: 22px; }
.wordmark > .logo { height: clamp(30px, 8vw, 36px); }
.topbar .logo { height: 26px; }
.board-head .logo { height: clamp(28px, 4.2vh, 56px); }

/* ---------- Fila de lista: QUIEN | QUE, en versales ---------- */
.row-title {
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--tx);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-title .sep { color: var(--tx-3); margin: 0 .4em; font-weight: 500; }
