* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #030712;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #f8fafc;
}

#webgl-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#tv-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 32px;
}

/* Top Left Brand Badge */
.hud-top-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: auto;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 10px 20px;
  border-radius: 9999px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.brand-icon {
  font-size: 26px;
  animation: pulse-glow 2.5s infinite ease-in-out;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #38bdf8, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.stats-pills {
  display: flex;
  gap: 10px;
}

.pill {
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
}

.pill-online {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.pill-room {
  background: rgba(234, 179, 8, 0.2);
  border: 1px solid rgba(234, 179, 8, 0.5);
  color: #fef08a;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.pill-room b {
  color: #ffffff;
  font-size: 13px;
  background: rgba(234, 179, 8, 0.4);
  padding: 2px 6px;
  border-radius: 6px;
}

.pill-count {
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid rgba(14, 165, 233, 0.4);
  color: #7dd3fc;
}

/* Smart TV Audio Unlock Banner */
.tv-audio-banner {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.95), rgba(15, 23, 42, 0.95));
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  border-radius: 30px;
  padding: 10px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 16px rgba(56, 189, 248, 0.3);
  z-index: 100;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.4s ease, transform 0.4s ease;
  animation: bounce-subtle 2.5s infinite ease-in-out;
}

.tv-audio-banner.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-20px);
}

.audio-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #e0f2fe;
}

.audio-banner-icon {
  font-size: 20px;
  animation: pulse-glow 1.5s infinite;
}

@keyframes bounce-subtle {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-6px); }
}

/* Top Right QR Card */
.hud-top-right {
  position: absolute;
  top: 24px;
  right: 32px;
  pointer-events: auto;
}

.qr-card {
  width: 220px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 24px rgba(56, 189, 248, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.qr-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.7), 0 0 32px rgba(56, 189, 248, 0.4);
}

.qr-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.qr-pulse-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 10px #22c55e;
  animation: pulse-dot 1.5s infinite;
}

.qr-frame {
  width: 176px;
  height: 176px;
  background: #ffffff;
  padding: 8px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.qr-frame img {
  width: 160px;
  height: 160px;
  display: block;
}

.qr-desc {
  margin-top: 10px;
  font-size: 11px;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qr-url {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  text-decoration: none;
  background: rgba(56, 189, 248, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  word-break: break-all;
}

.qr-actions {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-top: 12px;
}

.hud-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.hud-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #ffffff;
}

/* Center Spawning Alert */
.spawn-alert {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px) scale(0.9);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border: 2px solid #f59e0b;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(245, 158, 11, 0.5);
  border-radius: 24px;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: none;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 100;
}

.spawn-alert.active {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
}

.spawn-alert-icon {
  font-size: 36px;
  animation: spin-glow 3s infinite linear;
}

.spawn-alert-title {
  font-size: 16px;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.5px;
}

.spawn-alert-sub {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  margin-top: 2px;
}

/* Bottom Hint Bar */
.hud-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 10px 24px;
  border-radius: 9999px;
  align-self: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.hint-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.hint-icon {
  font-size: 16px;
}

.hint-arrow {
  color: #64748b;
  font-size: 14px;
}

/* Animations */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px #38bdf8); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 12px #818cf8); }
}

@keyframes spin-glow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* TV & Large Display Adjustments */
@media (min-width: 1920px) {
  .brand-title { font-size: 22px; }
  .qr-card { width: 260px; padding: 20px; }
  .qr-frame { width: 216px; height: 216px; }
  .qr-frame img { width: 200px; height: 200px; }
  .hint-item { font-size: 15px; }
}
