/* ==================================================================== */
/* ASTREA MULTIPLAYER HALLOWEEN GAMESPACE STYLES                        */
/* ==================================================================== */

:root {
  --hg-orange: #ff9e00;
  --hg-pumpkin: #ff6200;
  --hg-purple: #9d4edd;
  --hg-cyan: #06b6d4;
  --hg-dark: #0c0812;
  --hg-panel: rgba(18, 12, 26, 0.88);
  --hg-border: rgba(255, 158, 0, 0.28);
}

.hg-game-container {
  position: relative;
  background: var(--hg-panel);
  border: 1px solid var(--hg-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 50px rgba(255, 120, 0, 0.2);
  backdrop-filter: blur(16px);
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
}

/* Header & Lobby Bar */
.hg-lobby-bar {
  background: rgba(10, 6, 16, 0.95);
  border-bottom: 1px solid var(--hg-border);
  padding: 16px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.hg-room-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 158, 0, 0.12);
  border: 1px solid rgba(255, 158, 0, 0.35);
  color: var(--hg-orange);
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.hg-pulse-dot {
  width: 9px;
  height: 9px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: hgPulse 1.5s infinite;
}

@keyframes hgPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hg-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 4px 10px;
}

.hg-input-group input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.88rem;
  width: 120px;
}

.hg-input-group input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.hg-avatar-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 158, 0, 0.2);
}

.hg-avatar-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.hg-avatar-btn:hover {
  background: rgba(255, 158, 0, 0.2);
  transform: scale(1.15);
}

.hg-avatar-btn.active {
  background: rgba(255, 158, 0, 0.3);
  border-color: var(--hg-orange);
  box-shadow: 0 0 10px rgba(255, 158, 0, 0.4);
  transform: scale(1.15);
}

.hg-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
  text-decoration: none;
}

.hg-btn-primary {
  background: linear-gradient(135deg, #ff9e00 0%, #ff5500 100%);
  color: #120902;
  box-shadow: 0 4px 15px rgba(255, 110, 0, 0.35);
}

.hg-btn-primary:hover {
  background: linear-gradient(135deg, #ffab20 0%, #ff6a18 100%);
  box-shadow: 0 6px 20px rgba(255, 110, 0, 0.55);
  transform: translateY(-2px);
  color: #000;
}

.hg-btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 158, 0, 0.35);
  color: #f1dfca;
}

.hg-btn-outline:hover {
  background: rgba(255, 158, 0, 0.15);
  border-color: var(--hg-orange);
  color: #fff;
  transform: translateY(-2px);
}

/* Canvas Area */
.hg-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 680px;
  background: #08050e;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}

@media (min-width: 1400px) {
  .hg-canvas-wrapper {
    height: 720px;
  }
}

@media (max-width: 991px) {
  .hg-canvas-wrapper {
    height: 520px;
  }
}

@media (max-width: 576px) {
  .hg-canvas-wrapper {
    height: 420px;
  }
}

#hgCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* In-Game HUD Overlays */
.hg-hud-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 20;
}

.hg-hud-card {
  pointer-events: auto;
  background: rgba(14, 9, 22, 0.85);
  border: 1px solid rgba(255, 158, 0, 0.25);
  border-radius: 12px;
  padding: 8px 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 0.85rem;
}

.hg-hud-card h6 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--hg-orange);
  margin-bottom: 5px;
  font-weight: 700;
}

.hg-leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
  min-width: 160px;
  max-height: 110px;
  overflow-y: auto;
}

.hg-leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hg-leaderboard-item:last-child {
  border-bottom: none;
}

.hg-leaderboard-item.is-me {
  color: #ffb703;
  font-weight: 700;
}

.hg-my-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hg-stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 158, 0, 0.15);
  border: 1px solid rgba(255, 158, 0, 0.35);
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffbe0b;
}

/* Bottom Controls & Emote Bar */
.hg-hud-bottom {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 20;
}

.hg-emote-bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 9, 22, 0.88);
  border: 1px solid rgba(255, 158, 0, 0.28);
  border-radius: 30px;
  padding: 5px 10px;
  backdrop-filter: blur(10px);
}

.hg-emote-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: transform 0.15s ease, background 0.15s;
}

.hg-emote-btn:hover {
  transform: scale(1.3) translateY(-3px);
  background: rgba(255, 158, 0, 0.2);
}

.hg-controls-hint {
  pointer-events: auto;
  background: rgba(14, 9, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 5px 14px;
  color: #c4b19c;
  font-size: 0.78rem;
  backdrop-filter: blur(8px);
}

.hg-dash-btn {
  pointer-events: auto;
  display: none;
  background: linear-gradient(135deg, #9d4edd 0%, #7b2cbf 100%);
  border: 1px solid #c77dff;
  color: #fff;
  border-radius: 50%;
  width: 54px;
  height: 54px;
  font-size: 1.3rem;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(157, 78, 221, 0.5);
  cursor: pointer;
  touch-action: manipulation;
}

/* Virtual Joystick for Touch Devices */
.hg-joystick-base {
  position: absolute;
  bottom: 20px;
  left: 20px;
  width: 90px;
  height: 90px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 158, 0, 0.35);
  border-radius: 50%;
  pointer-events: auto;
  display: none;
  z-index: 25;
  touch-action: none;
}

.hg-joystick-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  margin-top: -20px;
  background: radial-gradient(circle, #ff9e00 0%, #ff5400 100%);
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(255, 158, 0, 0.6);
  pointer-events: none;
}

@media (pointer: coarse) or (max-width: 768px) {
  .hg-joystick-base {
    display: block;
  }
  .hg-dash-btn {
    display: flex;
    position: absolute;
    right: 18px;
    bottom: 18px;
  }
  .hg-emote-bar {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 14px;
  }
  .hg-controls-hint {
    display: none;
  }
}

/* Footer Control & Instructions Bar */
.hg-info-bar {
  background: rgba(8, 5, 12, 0.95);
  border-top: 1px solid var(--hg-border);
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: #a89476;
}

.hg-info-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hg-key-badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 1px 7px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.78rem;
  font-weight: 700;
}

/* Toast Notification for Link Copy */
.hg-toast {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(16, 185, 129, 0.95);
  color: #fff;
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 99;
}

.hg-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
