/* host-lobby: TV host screen */
/* ==========================================================================
   LOBBY — TV host screen
   Wide join plaque (code grows, QR is 180px square).
   Settings under join. Contestants are a 320px sidebar.
   ========================================================================== */
.lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.lobby-left-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
}

.lobby-host-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.lobby-host-tools .btn {
  flex: 1 1 120px;
  min-height: 46px;
  font-weight: 800;
}

.join-banner-card {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  gap: 10px;
  flex: 0 0 auto;
  background: rgba(14, 18, 36, 0.82);
  border: 1.5px solid rgba(0, 242, 254, 0.35);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.7), 0 0 35px rgba(0, 242, 254, 0.12);
  border-radius: var(--radius-lg);
}

.join-banner-header {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
  width: 100%;
}

.join-step-pill {
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--accent-cyan);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: none;
  border: none;
  padding: 0;
}

.join-url-box {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
}

.join-url-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.join-url-link {
  display: block;
  width: 100%;
  font-size: clamp(2.2rem, 4.2vw, 3.2rem);
  font-weight: 900;
  line-height: 1.2;
  color: #fff;
  background: linear-gradient(135deg, #00f2fe, #4facfe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
  word-break: break-word;
  padding-bottom: 6px;
  position: relative;
  z-index: 1;
}

.join-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  align-items: stretch;
  width: 100%;
  height: 180px;
  margin-top: 22px;
  position: relative;
  z-index: 0;
}

.room-code-display-wrap {
  display: contents;
}

.room-code-label {
  display: none;
}

.room-code-badge {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  padding: 0 12px;
  width: 100%;
  height: 180px;
  box-sizing: border-box;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 242, 254, 0.06);
  border: 2px solid var(--accent-cyan);
  border-radius: var(--radius-lg);
  color: #ffffff;
  text-shadow: 0 0 30px rgba(0, 242, 254, 0.6);
  box-shadow: inset 0 0 25px rgba(0, 242, 254, 0.15), 0 0 35px rgba(0, 242, 254, 0.25);
  line-height: 1;
}

.qr-display-wrap {
  display: contents;
}

.qr-camera-bracket {
  background: #ffffff;
  padding: 8px;
  border-radius: 12px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 180px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.qr-camera-bracket img,
#lobby-qr-code,
#lobby-qr-code img {
  display: block;
  width: 164px;
  height: 164px;
  object-fit: contain;
}

.qr-caption {
  display: none;
}

/* PLAYERS SIDEBAR */
.players-stage-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
  gap: 12px;
  width: 320px;
  max-width: 320px;
  background: rgba(14, 18, 36, 0.82);
  border: 1.5px solid rgba(255, 0, 127, 0.3);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.7), 0 0 35px rgba(255, 0, 127, 0.1);
  border-radius: var(--radius-lg);
}

.players-stage-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex-shrink: 0;
}

.players-header-title-group {
  display: flex;
  flex-direction: column;
}

.players-stage-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 900;
  color: #fff;
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
}

.player-count-num {
  font-family: var(--font-heading);
  font-variant-numeric: tabular-nums;
  color: var(--accent-cyan);
}

.players-stage-sub {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0;
}

.btn-start-stage {
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 900;
  border-radius: var(--radius-md);
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.4);
  white-space: nowrap;
  background: linear-gradient(135deg, #00f2fe, #ff007f);
  border: none;
  cursor: pointer;
  width: 100%;
  margin-top: auto;
  flex-shrink: 0;
}

.btn-start-stage:hover {
  transform: scale(1.02);
  box-shadow: 0 0 35px rgba(255, 0, 127, 0.6);
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  flex: 1;
  min-height: 0;
  align-content: start;
  overflow: auto;
}

.player-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.player-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 25px rgba(0, 242, 254, 0.35);
}

.player-avatar {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

.player-name {
  font-weight: 800;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.room-code-instruction-pill {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--accent-yellow);
  background: rgba(255, 189, 0, 0.12);
  border: 1px solid rgba(255, 189, 0, 0.4);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lobby-settings-card,
.lobby-controls-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 14px 16px 16px;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  background: rgba(14, 18, 36, 0.82);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  flex: 0 0 auto;
}

.lobby-settings-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

body.fn-beta .lobby-settings-row {
  grid-template-columns: 1fr 1fr;
}

.lobby-settings-title {
  display: none;
}

.lobby-control-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.lobby-control-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-secondary);
}

.lobby-settings-card .header-pill-select,
.lobby-controls-bar .header-pill-select {
  width: 100%;
}

.lobby-control-actions {
  margin-left: 0;
}

.lobby-tips-badge {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.host-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.host-account-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lobby-host-tools {
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.lobby-host-tools .header-chip-btn,
.lobby-host-tools .header-chip {
  flex: 1 1 auto;
}

#header-tools-slot:empty {
  display: none;
}

#header-tools-slot .host-tools {
  width: auto;
}

@media (max-width: 1100px) {
  .lobby-grid {
    grid-template-columns: 1fr;
  }
  .players-stage-card {
    width: 100%;
    max-width: none;
    min-height: 240px;
  }
}

:root {
  --ticker-h: 48px;
}

