/* TV no estilo VSCO (recriado sem DESIGN.md de referência): galeria em preto,
   tipografia fina e enorme, rótulos pequenos espaçados, nenhuma cor de destaque. */
:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --text: #f5f5f5;
  --muted: #8a8a8a;
  --line: #2a2a2a;
  font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: transparent; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
/* Logo da barbearia em tela cheia, levemente inclinada, atrás do conteúdo da TV. */
body::before {
  content: ""; position: fixed; inset: -4vh 0; z-index: -1; pointer-events: none;
  background: url("/logo.svg") center / contain no-repeat;
  transform: rotate(-8deg);
  opacity: .14;
}
h1, h2, p { margin: 0; }
button, input { font: inherit; }
button {
  cursor: pointer; min-height: 44px; padding: 8px 22px; border: 1px solid var(--text); border-radius: 0;
  background: transparent; color: var(--text); font-size: .7rem; font-weight: 600; letter-spacing: .24em;
  text-transform: uppercase; transition: background-color .2s, color .2s;
}
button:hover { background: var(--text); color: var(--bg); }
button:disabled { cursor: default; }
:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; }

.tv-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 4vw; padding: 3vh 0 2.4vh; border-bottom: 1px solid var(--line); }
.tv-header h1 { font-size: clamp(.8rem, 1.2vw, 1.3rem); font-weight: 600; letter-spacing: .4em; }
main { padding: 0 4vw 4vh; }

.tv-access { max-width: 420px; margin: min(9vh, 80px) auto; padding: 36px; border: 1px solid var(--line); }
.tv-access h2 { font-size: 1.6rem; font-weight: 200; }
.tv-access form { display: grid; gap: 8px; margin-block: 24px; }
.tv-access label { font-size: .64rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.tv-access input {
  width: 100%; min-height: 46px; padding: 8px 0; margin-bottom: 12px; border: 0; border-bottom: 1px solid #444;
  border-radius: 0; color: var(--text); background: transparent; font-size: 1.05rem; font-weight: 300;
}
.tv-access input:focus { outline: none; border-bottom-color: var(--text); }
.tv-access form button { background: var(--text); color: var(--bg); }
.tv-access p, #tv-status { color: var(--muted); font-size: .95rem; }
#tv-switch { margin-top: 14px; }

#tv-board { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 0; min-height: calc(100dvh - 12vh); }

/* Destaque de quem é chamado */
.tv-call { display: grid; align-content: center; gap: 3vh; padding: 6vh 4vw 6vh 0; border-right: 1px solid var(--line); }
.tv-call h2 { display: flex; align-items: center; gap: 1.2em; color: var(--muted); font-size: clamp(.75rem, 1.1vw, 1.2rem); font-weight: 500; letter-spacing: .4em; text-transform: uppercase; }
.tv-call h2::before { content: ""; width: .6em; height: .6em; border-radius: 50%; background: var(--text); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
#tv-client { font-size: clamp(3rem, min(10vw, 20vh), 13rem); font-weight: 200; line-height: .92; letter-spacing: -.05em; overflow-wrap: anywhere; }
#tv-barber { display: flex; align-items: center; gap: 1em; color: var(--text); font-size: clamp(.9rem, 1.6vw, 1.8rem); font-weight: 500; letter-spacing: .3em; text-transform: uppercase; overflow-wrap: anywhere; }
#tv-barber::before { content: "com"; color: var(--muted); font-weight: 400; letter-spacing: .3em; }

/* Fila */
.tv-queue { padding: 6vh 0 6vh 3vw; }
.tv-queue h2 { color: var(--muted); font-size: clamp(.75rem, 1.1vw, 1.2rem); font-weight: 500; letter-spacing: .4em; text-transform: uppercase; }
.tv-queue ol { counter-reset: fila; list-style: none; margin: 3vh 0 0; padding: 0; display: grid; gap: 0; }
.tv-queue li {
  counter-increment: fila; display: flex; align-items: baseline; gap: 1.4em; padding: 1.8vh 0; border-bottom: 1px solid var(--line);
  font-size: clamp(1.1rem, 2.4vw, 2.8rem); font-weight: 300; letter-spacing: -.01em; overflow-wrap: anywhere;
}
.tv-queue li::before { content: counter(fila, decimal-leading-zero); color: var(--muted); font-size: .5em; letter-spacing: .15em; font-variant-numeric: tabular-nums; }
.tv-queue li:first-child { font-weight: 400; }
.tv-queue li:first-child::before { color: var(--text); }
#tv-status { grid-column: 1 / -1; padding-top: 2vh; }
#tv-empty { color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.8rem); font-weight: 300; margin-top: 3vh; }
@media (prefers-reduced-motion: reduce) { .tv-call h2::before { animation: none; } button { transition: none; } }
@media (max-width: 820px) {
  #tv-board { grid-template-columns: minmax(0, 1fr); }
  .tv-call { padding: 5vh 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .tv-queue { padding: 4vh 0; }
}

/* Vitrine de produtos: ocupa o mesmo espaço da chamada e alterna com ela. */
.tv-call, .tv-products { grid-column: 1; grid-row: 1; }
.tv-queue { grid-column: 2; grid-row: 1; }
.tv-products { display: grid; align-content: center; gap: 4vh; padding: 6vh 4vw 6vh 0; border-right: 1px solid var(--line); min-width: 0; }
.tv-product { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 4vw; align-items: center; min-width: 0; }
.tv-product-media { aspect-ratio: 1; max-width: 100%; max-height: 62vh; background: #151515; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.tv-product-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tv-product figcaption { display: grid; gap: 2.2vh; min-width: 0; }
.tv-product-tag { color: var(--muted); font-size: clamp(.75rem, 1.1vw, 1.2rem); font-weight: 500; letter-spacing: .4em; text-transform: uppercase; }
#tv-product-name { font-size: clamp(2rem, min(5vw, 9vh), 6.5rem); font-weight: 200; line-height: 1; letter-spacing: -.035em; overflow-wrap: anywhere; }
#tv-product-description { color: var(--muted); font-size: clamp(1rem, 1.7vw, 1.9rem); font-weight: 300; line-height: 1.35; max-width: 30ch; }
#tv-product-price { font-size: clamp(1.6rem, 3.4vw, 4rem); font-weight: 300; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tv-product-progress { height: 1px; background: var(--line); overflow: hidden; }
#tv-product-bar { display: block; height: 100%; width: 100%; background: var(--text); transform-origin: left; transform: scaleX(0); }
#tv-product-bar.is-playing { animation: tv-progress linear forwards; }
.tv-product.is-playing { animation: tv-enter .7s ease-out both; }
.tv-call:not([hidden]) { animation: tv-enter .35s ease-out both; }
@keyframes tv-progress { to { transform: scaleX(1); } }
@keyframes tv-enter { from { opacity: 0; transform: translateY(1.5vh); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .tv-product.is-playing, .tv-call:not([hidden]) { animation: none; }
}
@media (max-width: 820px) {
  .tv-call, .tv-products, .tv-queue { grid-column: 1; grid-row: auto; }
  .tv-products { padding: 5vh 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .tv-product { grid-template-columns: minmax(0, 1fr); }
  .tv-product-media { max-height: 40vh; justify-self: start; width: min(100%, 40vh); }
}
