:root {
  --bg: #0f1114;
  --surface: #171a1f;
  --text: #f2f4f7;
  --muted: #8b93a1;
  --line: #2a2f38;
  --accent: #5eead4;
  --accent-ink: #042f2e;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --font: "Sora", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
}

.hidden { display: none !important; }

.screen {
  width: 100%;
  height: 100%;
  padding: 4vh 4vw;
}

.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.eyebrow {
  font-size: 1vw;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.2vh;
  font-weight: 600;
}

.brand {
  font-size: 4.2vw;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 1vh;
}

.brand.small { font-size: 1.8vw; color: var(--muted); font-weight: 600; }

.brand-inline {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.4vw;
}

.lead {
  color: var(--muted);
  font-size: 1.4vw;
  margin-bottom: 3.5vh;
  max-width: 40vw;
  line-height: 1.5;
  font-weight: 400;
}

.hint {
  color: var(--muted);
  font-size: 1.05vw;
  margin-top: 2vh;
}

h1 {
  font-size: 2.4vw;
  margin: 0.5vh 0 1.5vh;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.btn-xl {
  appearance: none;
  border: 0;
  background: var(--text);
  color: var(--bg);
  font-family: inherit;
  font-size: 1.5vw;
  font-weight: 700;
  padding: 1.8vh 3vw;
  min-width: 24vw;
  cursor: pointer;
  border-radius: 4px;
}

.btn-xl:focus {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.code-box {
  font-size: 5vw;
  font-weight: 700;
  letter-spacing: 0.2em;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 2.5vh 3vw;
  margin: 1.5vh 0 2.5vh;
  min-width: 34vw;
  border-radius: 4px;
}

.qr {
  background: #fff;
  padding: 12px;
  width: 180px;
  height: 180px;
  border-radius: 4px;
}

.panel {
  display: flex;
  flex-direction: column;
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5vw;
  padding-bottom: 2vh;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.top-left, .top-right, .top-center {
  display: flex;
  align-items: center;
  gap: 0.8vw;
  min-width: 0;
}

.top-center { flex: 1; justify-content: center; }

.dot-sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line);
}

.title {
  font-size: 1.15vw;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.count {
  font-size: 1.15vw;
  font-weight: 700;
  background: var(--text);
  color: var(--bg);
  min-width: 2.2vw;
  text-align: center;
  padding: 0.2vh 0.6vw;
  border-radius: 3px;
}

.estab { color: var(--muted); font-size: 1.1vw; }

.clock {
  font-size: 1.3vw;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.conn {
  font-size: 1vw;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4vw;
}

.conn i {
  width: 0.5vw;
  height: 0.5vw;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
}

.conn.online { color: var(--ok); }
.conn.online i { background: var(--ok); }
.conn.offline { color: var(--warn); }
.conn.offline i { background: var(--warn); }

.reconnect {
  position: absolute;
  top: 9vh;
  right: 4vw;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--warn);
  padding: 0.6vh 1vw;
  font-size: 1vw;
  z-index: 5;
  border-radius: 4px;
}

.cards {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 1.5vh 1.2vw;
  padding-top: 2.5vh;
  overflow: hidden;
}

.card {
  width: calc(33.333% - 0.85vw);
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 2.5vh 1.8vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 32vh;
  border-radius: 6px;
}

.card.urgente {
  border-color: var(--danger);
}

.card.novo {
  animation: card-in 0.6s ease-out 1;
}

@keyframes card-in {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1vw;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5vh;
}

.card-mesa {
  font-size: 5.5vw;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.05em;
  margin-bottom: 1.5vh;
}

.card-timer {
  font-size: 2.6vw;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.card-status {
  margin-top: 2vh;
  font-size: 1.05vw;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.card.urgente .card-status { color: var(--danger); }

/* Idle / propaganda — clean split */
.idle {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 2.5vh;
  gap: 2vh;
}

.promo {
  flex: 1;
  display: flex;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.promo-media {
  flex: 1.2;
  position: relative;
  min-width: 0;
  background: #12151a;
}

.promo-fallback {
  width: 100%;
  height: 100%;
  background: #12151a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.promo-fallback::after {
  content: "ChamaSenha";
  font-size: 2.2vw;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--line);
}

.promo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.promo-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5vh 4vw;
  min-width: 30vw;
}

.promo-label {
  font-size: 0.95vw;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 2vh;
}

.promo-copy h2 {
  font-size: 3.2vw;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 2vh;
}

.promo-copy p#promo-text {
  color: var(--muted);
  font-size: 1.4vw;
  line-height: 1.5;
  max-width: 26vw;
  font-weight: 400;
}

.idle-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5vw;
  color: var(--muted);
  padding: 0 0.2vw;
}

.idle-ok {
  font-size: 1.05vw;
  font-weight: 600;
  color: var(--ok);
}

@media (max-width: 1100px) {
  .card { width: calc(50% - 0.7vw); }
  .promo { flex-direction: column; }
  .promo-media { min-height: 36vh; }
  .promo-copy { min-width: 0; }
  .promo-copy p#promo-text { max-width: none; }
}

@media (max-width: 700px) {
  .card { width: 100%; min-height: 22vh; }
  .card-mesa { font-size: 14vw; }
  .code-box { font-size: 11vw; }
  .brand { font-size: 11vw; }
}
