:root {
  --xh-bg: #f0f2f5;
  --xh-panel: #ffffff;
  --xh-blue: #2b4eff;
  --xh-text: #1a1a2e;
  --xh-muted: #6b7280;
  --xh-yellow: #f59e0b;
  --xh-yellow-text: #b45309;
  --xh-yellow-soft: #fef9ee;
  --xh-yellow-border: #fde68a;
  --xh-border: #e5e7eb;
  --xh-video-bg: #0a0a1a;
}

* {
  box-sizing: border-box;
  cursor: none !important;
  user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--xh-bg);
}

body {
  font-family: Bahnschrift, "Segoe UI Variable", "Trebuchet MS", sans-serif;
  touch-action: none;
}

.is-hidden {
  display: none !important;
}

.xh-display {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: 11fr 81fr 8fr;
  overflow: hidden;
  background: var(--xh-bg);
  color: var(--xh-text);
}

.xh-header,
.xh-body,
.xh-queue,
.xh-queue__section,
.xh-media,
.xh-waiting-table,
.xh-waiting-table__body,
.xh-active-grid {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.xh-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2vw;
  padding: 0 1.8%;
  background: var(--xh-panel);
  border-bottom: 1px solid var(--xh-border);
}

.xh-brand {
  display: flex;
  align-items: center;
  gap: 0.85vw;
  min-width: 0;
}

.xh-brand__logo {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.xh-brand__logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.xh-brand__copy {
  min-width: 0;
}

.xh-brand__title {
  font-size: 1.1vw;
  font-weight: 700;
  color: var(--xh-text);
  white-space: nowrap;
}

.xh-brand__subtitle {
  margin-top: 0.18vw;
  font-size: 0.75vw;
  color: var(--xh-muted);
  white-space: nowrap;
}

.xh-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.24vw;
}

.xh-clock__time {
  font-size: clamp(28px, 2.2vw, 40px);
  font-weight: 700;
  line-height: 1;
}

.xh-clock__date {
  font-size: 0.85vw;
  color: var(--xh-muted);
}

.xh-connection-badge {
  margin-top: 0.4vw;
  padding: 0.35vw 0.7vw;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: #b91c1c;
  font-size: clamp(10px, 0.7vw, 13px);
  font-weight: 700;
  white-space: nowrap;
}

.xh-body {
  display: grid;
  grid-template-columns: minmax(0, 30%) minmax(0, 70%);
}

.xh-queue {
  display: grid;
  grid-template-rows: 55fr 45fr;
  gap: 0;
  padding: 1.2%;
}

.xh-queue__section {
  display: flex;
  flex-direction: column;
  gap: 0.75vh;
  padding: 0.2vh 0;
}

.xh-section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.42vw;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: clamp(10px, 0.72vw, 13px);
  font-weight: 700;
}

.xh-section-label__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.xh-section-label--active .xh-section-label__dot {
  background: var(--xh-blue);
}

.xh-section-label--waiting {
  color: var(--xh-yellow-text);
}

.xh-section-label--waiting .xh-section-label__dot {
  background: var(--xh-yellow);
}

.xh-active-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 0.5%;
}

.xh-active-card {
  display: flex;
  align-items: center;
  gap: 5%;
  min-width: 0;
  min-height: 0;
  padding: 0 6%;
  overflow: hidden;
  background: var(--xh-panel);
  border-left: 3px solid var(--xh-blue);
  border-radius: 6px;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.05);
}

.xh-active-card.is-empty {
  background: rgba(255, 255, 255, 0.68);
  border-left-color: rgba(43, 78, 255, 0.16);
}

.xh-active-card.flash {
  background: var(--xh-blue);
}

.xh-active-card.flash .xh-active-card__ticket,
.xh-active-card.flash .xh-active-card__name {
  color: #fff !important;
}

.xh-active-card__ticket {
  flex: 0 0 auto;
  font-size: clamp(14px, 1.3vw, 22px);
  font-weight: 900;
  color: var(--xh-blue);
  line-height: 1;
}

.xh-active-card__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
  font-size: clamp(9px, 0.68vw, 12px);
  font-weight: 600;
  color: #374151;
}

.xh-waiting-table {
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--xh-panel);
  border: 1px solid var(--xh-border);
  border-radius: 6px;
}

.xh-waiting-table__head,
.xh-waiting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.xh-waiting-table__head {
  padding: 0.8vh 10px;
  background: var(--xh-yellow-soft);
  border-bottom: 1px solid var(--xh-yellow-border);
  color: var(--xh-yellow-text);
  font-size: clamp(9px, 0.7vw, 12px);
  font-weight: 700;
}

.xh-waiting-table__body {
  display: grid;
  grid-template-rows: repeat(5, minmax(0, 1fr));
}

.xh-waiting-row {
  padding: 0 10px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.7);
}

.xh-waiting-row:nth-child(odd) {
  background: #fff;
}

.xh-waiting-row:nth-child(even) {
  background: #fafafa;
}

.xh-waiting-row:last-child {
  border-bottom: none;
}

.xh-waiting-row.is-empty {
  color: rgba(107, 114, 128, 0.72);
}

.xh-waiting-row__ticket {
  font-size: clamp(12px, 1.05vw, 18px);
  font-weight: 800;
  color: var(--xh-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xh-waiting-row__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(9px, 0.68vw, 12px);
  font-weight: 500;
  color: var(--xh-muted);
}

.xh-media {
  position: relative;
  overflow: hidden;
  background: var(--xh-video-bg);
}

.xh-media__asset,
.xh-media__fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.xh-media__youtube iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.xh-media__fallback {
  display: grid;
  place-content: center;
  place-items: center;
  gap: 0.8vw;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18), transparent 18%),
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.12), transparent 22%),
    linear-gradient(135deg, #2b4eff 0%, #1935b9 100%);
  color: #fff;
}

.xh-media__fallback-logo {
  width: 7vw;
  height: 7vw;
  min-width: 74px;
  min-height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: clamp(28px, 2.2vw, 44px);
  font-weight: 900;
}

.xh-media__fallback-logo-image {
  width: 72%;
  height: 72%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.xh-media__fallback-title {
  font-size: clamp(20px, 1.8vw, 34px);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.xh-media__fallback-copy {
  font-size: clamp(12px, 0.95vw, 18px);
  color: rgba(255, 255, 255, 0.82);
}

.xh-media__overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8% 4% 3%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}

.xh-media__overlay-title {
  font-size: 1.4vw;
  font-weight: 700;
  color: #fff;
}

.xh-media__overlay-copy {
  margin-top: 0.4vw;
  font-size: 0.9vw;
  color: rgba(255, 255, 255, 0.75);
}

.xh-ticker {
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--xh-blue);
}

.xh-ticker__track {
  display: inline-flex;
  align-items: center;
  gap: 4rem;
  min-width: max-content;
  padding-left: 100%;
  white-space: nowrap;
  color: #fff;
  font-size: clamp(14px, 1.1vw, 20px);
  font-weight: 500;
  animation: xhMarquee 32s linear infinite;
  will-change: transform;
}

@keyframes xhMarquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-220%);
  }
}
