body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  color: white;
  overflow: hidden;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  background: #111619;
}

body.hv-chat-resizing {
  cursor: ns-resize;
  user-select: none;
}

:root {
  --hv-chat-opacity: 1;
  --hv-chat-side-width: 300px;
  --hv-chat-box-width: 760px;
  --hv-ping-monitor-height: 118px;
  --hv-ping-monitor-offset: 10px;
  --hv-inv-panel-gap: 14px;
  --hv-user-badge-offset-top: 12px;
  --hv-user-badge-block-height: 0px;
  --hv-inv-panel-top: 12px;
  --hv-inv-panel-bottom: calc(
    var(--hv-ping-monitor-offset) + var(--hv-ping-monitor-height) + var(--hv-inv-panel-gap)
  );
  --hv-hud-top-inset: 108px;
  --hv-hud-left-inset: 268px;
  --hv-hud-right-inset: 72px;
}

.hv-room-off-btn {
  display: none !important;
}

/* Quit confirm dialog */
.hv-quit-confirm {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hv-quit-confirm[hidden] {
  display: none !important;
}

.hv-quit-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hv-quit-confirm-panel {
  position: relative;
  z-index: 1;
  width: min(380px, 92vw);
  padding: 22px 22px 18px;
  color: #e8f4ff;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  animation: hvQuitConfirmIn 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hv-quit-confirm-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 80, 100, 0.45);
  background:
    linear-gradient(180deg, rgba(255, 60, 80, 0.08) 0%, transparent 34%),
    linear-gradient(135deg, rgba(12, 10, 22, 0.97) 0%, rgba(6, 8, 18, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(0, 255, 255, 0.08),
    0 20px 48px rgba(0, 0, 0, 0.65),
    0 0 28px rgba(255, 60, 80, 0.18);
  overflow: hidden;
}

.hv-quit-confirm-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: rgba(255, 100, 120, 0.9);
  border-style: solid;
  filter: drop-shadow(0 0 4px rgba(255, 80, 100, 0.5));
}

.hv-quit-confirm-corner-tl { top: 0; left: 0; border-width: 2px 0 0 2px; }
.hv-quit-confirm-corner-tr { top: 0; right: 0; border-width: 2px 2px 0 0; }
.hv-quit-confirm-corner-bl { bottom: 0; left: 0; border-width: 0 0 2px 2px; }
.hv-quit-confirm-corner-br { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.hv-quit-confirm-kicker {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  font-family: "Orbitron", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(255, 140, 160, 0.85);
}

.hv-quit-confirm-title {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  font-family: "Orbitron", sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 16px rgba(255, 80, 100, 0.35);
}

.hv-quit-confirm-msg {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
  font-family: "Rajdhani", sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(220, 232, 245, 0.88);
}

.hv-quit-confirm-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.hv-quit-confirm-btn {
  min-width: 88px;
  padding: 10px 16px;
  border: 1px solid transparent;
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.hv-quit-confirm-btn:hover {
  transform: translateY(-1px);
}

.hv-quit-confirm-no {
  border-color: rgba(0, 255, 255, 0.35);
  background: rgba(0, 255, 255, 0.08);
  color: #7ef9ff;
}

.hv-quit-confirm-no:hover {
  border-color: rgba(0, 255, 255, 0.65);
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.22);
}

.hv-quit-confirm-yes {
  border-color: rgba(255, 80, 100, 0.65);
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.95), rgba(127, 29, 29, 0.98));
  color: #fff5f5;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.35);
}

.hv-quit-confirm-yes:hover {
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.55);
}

@keyframes hvQuitConfirmIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.canvasContainer {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.hv-game-canvas {
  z-index: 0;
  position: absolute;
}

.hv-game-pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background:
    radial-gradient(ellipse 65% 50% at 50% 45%, rgba(255, 0, 170, 0.1) 0%, transparent 62%),
    linear-gradient(180deg, rgba(4, 10, 22, 0.2) 0%, rgba(4, 10, 22, 0.62) 100%);
  transition: opacity 0.45s ease-out;
}

.hv-game-pause-overlay[hidden] {
  display: none !important;
}

.hv-game-pause-overlay.hv-game-pause-fade-out {
  opacity: 0;
}

.hv-game-pause-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.hv-game-pause-title {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ff8ad8;
  text-shadow:
    0 0 16px rgba(255, 0, 170, 0.85),
    0 0 32px rgba(0, 240, 255, 0.35);
  animation: hvGamePauseTitleIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hv-game-pause-ring-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hv-game-pause-ring {
  --hv-pause-progress: 1;
  position: relative;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    conic-gradient(
      from -90deg,
      #ff00aa 0deg,
      #7b5cff calc(var(--hv-pause-progress) * 270deg),
      #00f0ff calc(var(--hv-pause-progress) * 360deg),
      rgba(255, 255, 255, 0.06) calc(var(--hv-pause-progress) * 360deg),
      rgba(255, 255, 255, 0.06) 360deg
    );
  box-shadow:
    0 0 24px rgba(255, 0, 170, 0.35),
    0 0 48px rgba(0, 240, 255, 0.18),
    inset 0 0 24px rgba(255, 0, 170, 0.1);
  transition: background 0.35s ease-out;
}

.hv-game-pause-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(28, 18, 48, 0.96) 0%, rgba(8, 10, 24, 0.98) 72%);
  border: 1px solid rgba(255, 120, 220, 0.24);
}

.hv-game-pause-count {
  position: relative;
  z-index: 1;
  font-family: "Orbitron", sans-serif;
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 0%, #ff8ad8 42%, #00f0ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(255, 0, 170, 0.75));
}

.hv-game-pause-count.hv-game-pause-count-pop {
  animation: hvGamePauseCountPop 0.35s ease-out;
}

.hv-game-pause-countdown-active .hv-game-pause-title {
  display: none;
}

.hv-game-pause-panel.hv-game-pause-title-only .hv-game-pause-ring-wrap {
  display: none !important;
}

@keyframes hvGamePauseTitleIn {
  from { opacity: 0; transform: scale(0.86) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes hvGamePauseCountPop {
  0% { transform: scale(0.7); opacity: 0.5; }
  60% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

.hv-room-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 25;
  border: none;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.hv-room-overlay.hv-room-overlay--visible {
  opacity: 1;
  visibility: visible;
}

.hv-room-overlay.hv-room-overlay--hidden {
  display: none !important;
}

.canvasSubContainer {
  position: absolute;
  width: 100%;
  height: 100%;
}

.hv-zoom-toast {
  position: absolute;
  left: 50%;
  top: 18%;
  z-index: 55;
  transform: translate(-50%, -8px);
  padding: 8px 14px;
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(6, 12, 22, 0.88);
  color: #dffcff;
  font-family: "Orbitron", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.18);
}

.hv-zoom-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.gameStateContainer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, calc(100vw - 24px));
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px 10px;
  z-index: 40;
  pointer-events: none;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, rgba(0, 255, 255, 0.06) 0%, transparent 32%),
    linear-gradient(135deg, rgba(8, 14, 28, 0.94) 0%, rgba(4, 8, 18, 0.97) 100%);
  border: 1px solid rgba(0, 255, 255, 0.22);
  border-top: none;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  box-shadow:
    0 0 0 1px rgba(255, 0, 128, 0.08),
    0 10px 32px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 24px rgba(0, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  font-family: "Orbitron", "Arial Black", sans-serif;
}

.hv-score-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.hv-score-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: rgba(0, 255, 255, 0.75);
  border-style: solid;
  filter: drop-shadow(0 0 5px rgba(0, 255, 255, 0.45));
}

.hv-score-corner-tl {
  top: 3px;
  left: 3px;
  border-width: 2px 0 0 2px;
}

.hv-score-corner-tr {
  top: 3px;
  right: 3px;
  border-width: 2px 2px 0 0;
}

.hv-score-corner-bl {
  bottom: 3px;
  left: 3px;
  border-width: 0 0 2px 2px;
}

.hv-score-corner-br {
  bottom: 3px;
  right: 3px;
  border-width: 0 2px 2px 0;
}

.hv-score-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 255, 0.022) 2px,
    rgba(0, 255, 255, 0.022) 4px
  );
  opacity: 0.5;
  animation: hvScoreScan 6s linear infinite;
}

@keyframes hvScoreScan {
  from { transform: translateY(0); }
  to { transform: translateY(8px); }
}

.hv-score-tag {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  padding: 2px 7px;
  border: 1px solid rgba(255, 0, 128, 0.45);
  background: rgba(255, 0, 128, 0.1);
  color: #ff6eb4;
  font-family: "Orbitron", sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-shadow: 0 0 8px rgba(255, 0, 128, 0.35);
}

.teamIcon,
.teamicon {
  position: relative;
  z-index: 1;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 2px;
  box-shadow: 0 0 10px currentColor;
}

.teamIcon.red,
.teamicon.red {
  background-color: #ef4444;
  border: 1px solid rgba(252, 165, 165, 0.65);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.55);
}

.teamIcon.blue,
.teamicon.blue {
  background-color: #3b82f6;
  border: 1px solid rgba(147, 197, 253, 0.65);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.55);
}

.score {
  position: relative;
  z-index: 1;
  min-width: 28px;
  overflow: hidden;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
}

.score--red {
  color: #fca5a5;
  text-shadow: 0 0 14px rgba(248, 113, 113, 0.65);
}

.score--blue {
  color: #93c5fd;
  text-shadow: 0 0 14px rgba(96, 165, 250, 0.65);
}

.score-sep {
  position: relative;
  z-index: 1;
  padding: 0 2px;
  font-size: 18px;
  font-weight: 700;
  color: rgba(0, 255, 255, 0.55);
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.35);
  line-height: 1;
}

.scoreBoard {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.gameTime {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #dffcff;
  text-shadow: 0 0 12px rgba(0, 255, 255, 0.25);
}

.gameTime > .overtime {
  margin-right: 10px;
  visibility: hidden;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #ff6eb4;
  text-shadow: 0 0 12px rgba(255, 0, 128, 0.65);
}

.gameTime > .overtime.on {
  visibility: visible;
  animation: hvOvertimeAppear 0.4s linear, hvOvertimePulse 1.2s ease-in-out 0.4s infinite alternate;
}

@keyframes hvOvertimeAppear {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
}

@keyframes hvOvertimePulse {
  from {
    opacity: 0.75;
    text-shadow: 0 0 8px rgba(255, 0, 128, 0.45);
  }
  to {
    opacity: 1;
    text-shadow: 0 0 16px rgba(255, 0, 128, 0.85);
  }
}

.gameTime.time-warn {
  animation: hvTimeWarn 0.3s infinite alternate linear;
}

@keyframes hvTimeWarn {
  from {
    color: #fde047;
    text-shadow: 0 0 12px rgba(253, 224, 71, 0.55);
  }
  to {
    color: #f87171;
    text-shadow: 0 0 16px rgba(248, 113, 113, 0.65);
  }
}

.gameTime > .digit {
  width: 14px;
  text-align: center;
}

.hv-duty-time-cap {
  margin-left: 7px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(223, 252, 255, 0.5);
  font-variant-numeric: tabular-nums;
}

.hv-duty-time-cap[hidden] {
  display: none !important;
}

.gameTime > .time-colon {
  padding: 0 1px;
  color: rgba(0, 255, 255, 0.6);
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.35);
}

.chatContainer {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-width: 0;
  height: 100%;
  padding: 0 12px;
  pointer-events: auto;
  transform: translateY(0);
  opacity: 1;
  will-change: transform, opacity;
}

body.hv-chat-anim-ready .chatContainer {
  transition:
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease;
}

body.hv-chat-slide-out.hv-chat-pos-bottom .chatContainer,
body.hv-chat-pos-bottom.hv-chat-slide-out .chatContainer {
  transform: translateY(calc(100% + 20px));
  opacity: 0;
  pointer-events: none;
}

body.hv-chat-slide-out.hv-chat-pos-left .chatContainer,
body.hv-chat-pos-left.hv-chat-slide-out .chatContainer {
  transform: translateX(calc(-100% - 24px));
  opacity: 0;
  pointer-events: none;
}

body.hv-chat-slide-out.hv-chat-pos-right .chatContainer,
body.hv-chat-pos-right.hv-chat-slide-out .chatContainer {
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
}

body.hv-chat-hidden .chatContainer {
  display: none;
}

/* Side chat: bottom-anchored column; height is resizable upward */
body.hv-chat-pos-left .chatContainer,
body.hv-chat-pos-right .chatContainer {
  position: fixed;
  top: auto;
  bottom: var(--hv-chat-side-bottom, calc(var(--hv-chat-height, 96px) + 12px));
  height: var(--hv-chat-side-height, 50vh);
  max-height: calc(
    100vh - var(--hv-hud-top-inset, 108px) - 10px - var(--hv-chat-side-bottom, 108px)
  );
  width: var(--hv-chat-side-width, 300px);
  flex: 0 0 0;
  max-width: none;
  min-width: 0;
  padding: 0;
  z-index: 90;
  justify-content: stretch;
}

body.hv-chat-pos-left .chatContainer {
  left: 10px;
  right: auto;
}

body.hv-chat-pos-right .chatContainer {
  right: 10px;
  left: auto;
}

body.hv-chat-pos-left .chatBox,
body.hv-chat-pos-right .chatBox {
  width: 100%;
  height: 100%;
  border-radius: 14px;
}

body.hv-chat-pos-left .chatWidthHandle {
  left: auto;
  right: 0;
  top: 22px;
  bottom: 0;
  width: 6px;
  height: auto;
  transform: none;
  cursor: ew-resize;
  border-radius: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 255, 255, 0.55), transparent);
}

body.hv-chat-pos-right .chatWidthHandle {
  left: 0;
  right: auto;
  top: 22px;
  bottom: 0;
  width: 6px;
  height: auto;
  transform: none;
  cursor: ew-resize;
  border-radius: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 255, 255, 0.55), transparent);
}

@media (prefers-reduced-motion: reduce) {
  body.hv-chat-anim-ready .chatContainer,
  body.hv-chat-anim-ready .bottomSection {
    transition: none !important;
  }
}

body.hv-tools-hud-hidden #hvHudDock {
  display: none !important;
}

body.hv-ping-hidden #hvPingGraph {
  display: none !important;
}

body.hv-quests-hidden #hvMatchQuestsPanel {
  display: none !important;
}

.bottomSection {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  height: var(--hv-chat-height, 200px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  box-sizing: border-box;
  pointer-events: auto;
  background: transparent;
  overflow: visible;
  isolation: isolate;
}

body.hv-chat-anim-ready .bottomSection {
  transition: height 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

body.hv-chat-resizing .bottomSection {
  transition: none;
}

.chatBox {
  position: relative;
  width: min(var(--hv-chat-box-width, 760px), 100%);
  height: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: transparent;
  border: none;
  border-radius: 14px 14px 0 0;
  box-shadow: none;
  overflow: hidden;
  pointer-events: auto;
}

/* Opacity applies to chrome only — text/input stay fully readable */
.chatBox::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: var(--hv-chat-opacity, 1);
  background: linear-gradient(180deg, rgba(8, 14, 22, 0.92) 0%, rgba(17, 22, 25, 0.88) 100%);
  border: 1px solid rgba(0, 255, 255, 0.14);
  border-bottom: none;
  box-shadow:
    0 -8px 28px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(0, 255, 255, 0.1);
}

body.hv-chat-pos-left .chatBox::before,
body.hv-chat-pos-right .chatBox::before {
  border-bottom: 1px solid rgba(0, 255, 255, 0.14);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(0, 255, 255, 0.1);
}

.chatBox > *:not(.chatResizeHandle):not(.chatWidthHandle):not(.chatPosBar) {
  position: relative;
  z-index: 1;
}

.chatPosBar {
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto;
  z-index: 85;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: rgba(0, 10, 18, 0.55);
  border: 1px solid rgba(0, 255, 255, 0.18);
  pointer-events: auto;
}

.chatPosBtn {
  width: 26px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(103, 232, 249, 0.85);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

.chatPosBtn:hover {
  background: rgba(0, 255, 255, 0.12);
  color: #67e8f9;
}

.chatPosBtn.is-active {
  background: rgba(0, 255, 255, 0.22);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 255, 255, 0.35);
}

.chatCloseBtn {
  margin-left: 2px;
  color: rgba(248, 113, 113, 0.9);
  border-left: 1px solid rgba(0, 255, 255, 0.14);
  border-radius: 0 6px 6px 0;
}

.chatCloseBtn:hover {
  background: rgba(248, 113, 113, 0.18);
  color: #fca5a5;
}

body.hv-chat-pos-left .chatPosBar,
body.hv-chat-pos-right .chatPosBar {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.hv-chat-reopen {
  display: none;
  position: fixed;
  z-index: 120;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px 10px 0 0;
  border: 1px solid rgba(0, 255, 255, 0.28);
  border-bottom: none;
  background: linear-gradient(180deg, rgba(8, 18, 28, 0.92), rgba(12, 22, 32, 0.88));
  color: #67e8f9;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  pointer-events: auto;
  box-shadow:
    0 -6px 18px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(0, 255, 255, 0.12);
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

body.hv-chat-hidden .hv-chat-reopen {
  display: inline-flex;
}

body.hv-chat-pos-left.hv-chat-hidden .hv-chat-reopen {
  left: 14px;
  transform: none;
}

body.hv-chat-pos-right.hv-chat-hidden .hv-chat-reopen {
  left: auto;
  right: 14px;
  transform: none;
}

.hv-chat-reopen:hover {
  border-color: rgba(103, 232, 249, 0.55);
  color: #fff;
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.5),
    0 0 16px rgba(0, 255, 255, 0.2);
}

.hv-chat-reopen-icon {
  font-size: 13px;
  line-height: 1;
}

.hv-chat-reopen-label {
  line-height: 1;
}

.chatResizeHandle {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.55), transparent);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.35);
  cursor: ns-resize;
  z-index: 80;
  pointer-events: auto;
  touch-action: none;
}

.chatResizeHandle:hover,
body.hv-chat-resizing .chatResizeHandle {
  background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.85), transparent);
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.55);
  height: 5px;
}

.chatWidthHandle {
  position: absolute;
  top: 18px;
  right: 0;
  width: 6px;
  height: calc(100% - 28px);
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, rgba(0, 255, 255, 0.45), transparent);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.25);
  cursor: ew-resize;
  z-index: 80;
  pointer-events: auto;
  touch-action: none;
}

.chatWidthHandle:hover,
body.hv-chat-resizing .chatWidthHandle {
  background: linear-gradient(180deg, transparent, rgba(103, 232, 249, 0.85), transparent);
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.55);
}

.chatBox > .chatLog,
.chatBox > .chatInput {
  margin-top: 5px;
}

.chatLog {
  position: relative;
  flex-grow: 1;
  overflow-x: hidden;
  overflow-y: auto;
  line-height: 1.35;
  padding: 36px 4px 6px 14px;
  background: transparent;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 255, 255, 0.65) rgba(0, 255, 255, 0.06);
}

.chatLog::-webkit-scrollbar {
  width: 7px;
}

.chatLog::-webkit-scrollbar-track {
  margin: 14px 3px;
  background: linear-gradient(180deg, rgba(0, 10, 18, 0.4), rgba(0, 18, 28, 0.55));
  border-radius: 999px;
  border-left: 1px solid rgba(0, 255, 255, 0.1);
  box-shadow: inset 0 0 8px rgba(0, 255, 255, 0.05);
}

.chatLog::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.92), rgba(255, 0, 128, 0.65));
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 255, 0.32);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.35);
}

.chatLog::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #67e8f9, #f472b6);
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.55);
}

.chatLog::-webkit-scrollbar-corner {
  background: transparent;
}

.chatLog p {
  vertical-align: baseline;
  min-height: 12px;
  overflow: hidden;
  margin: 0;
  word-break: break-word;
}

.chatLog > p:not(:last-child),
.chatLog > .chat-event-block:not(:last-child) {
  margin-bottom: 4px;
}

.chatLog p.notice {
  color: #8ed2ab;
  font-size: 13px;
}

.chatLog p.highlight {
  font-weight: bold;
}

.chatLog p.announcement {
  border-left: 3px solid #c13535;
  padding-left: 8px;
  white-space: pre-wrap;
  font-size: 13px;
}

.chat-timer {
  text-align: center;
  color: #00ddff !important;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  margin: 2px 0 6px !important;
}

.chat-separator {
  height: 10px;
  margin: 4px 0 8px;
  position: relative;
}

.chat-separator::before {
  content: "╭──────────────────────────────────────────────╮";
  display: block;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  line-height: 1;
  letter-spacing: -0.5px;
  overflow: hidden;
  white-space: nowrap;
}

.chat-separator.chat-separator-bottom::before {
  content: "╰──────────────────────────────────────────────╯";
}

.chat-event-block {
  border-left: 3px solid #c13535;
  padding: 2px 0 2px 10px;
  margin: 4px 0 8px;
}

.chat-event-block p {
  margin: 0;
  padding: 0;
  border: none;
}

.chat-event-header {
  color: #00ffcc !important;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px !important;
}

.chat-event-item {
  color: #f0f4f7 !important;
  font-size: 13px;
  padding-left: 2px;
  margin-bottom: 2px !important;
}

.chat-event-footer {
  color: #aaaaaa !important;
  font-style: italic;
  font-size: 12px;
  margin-top: 4px !important;
}

.chat-menu-row {
  font-size: 12px;
  line-height: 1.45;
  color: #e8eef2;
}

.chat-welcome {
  color: #8ed2ab !important;
  font-weight: 700;
  text-align: center;
  font-size: 13px;
}

.chatInput {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 10px 10px;
  background: transparent;
  border-top: 1px solid rgba(0, 255, 255, 0.16);
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.chatInput::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.45), transparent);
  pointer-events: none;
}

.customInput {
  color: #e8f4ff;
  background: rgba(4, 10, 18, 0.96);
  border: 1px solid rgba(0, 255, 255, 0.22);
  border-radius: 2px;
  padding: 0 12px;
  margin-right: 0;
  flex-grow: 1;
  align-self: stretch;
  box-sizing: border-box;
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.customInput::placeholder {
  color: rgba(140, 180, 200, 0.45);
}

.customInput:focus {
  outline: none;
  border: 1px solid rgba(0, 255, 255, 0.62);
  padding: 0 12px;
  box-shadow:
    0 0 14px rgba(0, 255, 255, 0.22),
    inset 0 0 10px rgba(0, 255, 255, 0.06);
}

.chatInput button {
  flex-shrink: 0;
  margin: 0;
  padding: 8px 18px;
  min-width: 76px;
  border: 1px solid rgba(0, 255, 255, 0.42);
  border-radius: 0;
  color: #e0ffff;
  background: linear-gradient(135deg, rgba(0, 36, 52, 0.96), rgba(28, 0, 44, 0.96));
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  box-shadow:
    0 0 12px rgba(0, 255, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.chatInput button:hover {
  background: linear-gradient(135deg, rgba(0, 56, 72, 0.98), rgba(56, 0, 72, 0.98));
  border-color: rgba(255, 0, 180, 0.55);
  box-shadow:
    0 0 18px rgba(0, 255, 255, 0.38),
    0 0 10px rgba(255, 0, 128, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.chatInput button:active {
  background: linear-gradient(135deg, rgba(0, 24, 36, 0.98), rgba(16, 0, 28, 0.98));
  border-color: rgba(0, 255, 255, 0.75);
  box-shadow:
    0 0 8px rgba(0, 255, 255, 0.25),
    inset 0 0 12px rgba(0, 0, 0, 0.35);
}

.chatInput button:disabled {
  background: rgba(30, 30, 36, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.35);
  box-shadow: none;
}

.chat-interaction-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 4px 0 6px;
  pointer-events: auto;
}

.chat-interaction-label {
  color: rgba(200, 230, 240, 0.85);
  font-size: 12px;
  margin-right: 4px;
}

.hv-chat-btn {
  pointer-events: auto;
  cursor: pointer;
  border: 1px solid rgba(0, 255, 255, 0.45);
  border-radius: 4px;
  padding: 6px 12px;
  color: #e8ffff;
  background: linear-gradient(135deg, rgba(0, 40, 58, 0.96), rgba(24, 0, 42, 0.96));
  font-family: "Rajdhani", "Orbitron", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.12);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.hv-chat-btn:hover {
  border-color: rgba(0, 255, 255, 0.75);
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.24);
  transform: translateY(-1px);
}

.hv-chat-btn:active {
  transform: translateY(0);
}

.hv-chat-btn[data-button-id="cmd_daily"],
.hv-chat-btn[data-button-id="cmd_weekly"] {
  border-color: rgba(0, 255, 136, 0.65);
  color: #d6ffe8;
  background: linear-gradient(135deg, rgba(0, 52, 36, 0.96), rgba(0, 28, 44, 0.96));
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.18);
}

.hv-chat-btn[data-button-id="cmd_mails"] {
  border-color: rgba(240, 157, 0, 0.65);
  color: #ffe8b0;
}

.hv-chat-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.chatLog {
  pointer-events: auto;
}

.chatLog .announcement,
.chatLog p,
.chatLog .chat-menu-row,
.chatLog .chat-interaction-row {
  pointer-events: auto;
}

.hv-user-badge {
  position: relative;
  top: auto;
  left: auto;
  z-index: 1;
  width: 100%;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  flex-shrink: 0;
}

.hv-user-badge.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.hv-user-badge[hidden] {
  display: none !important;
}

.hv-ub-frame {
  display: none;
}

.hv-ub-corner,
.hv-ub-scan {
  display: none;
}

.hv-ub-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 6px;
}

.hv-ub-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0, 255, 255, 0.35);
  box-shadow:
    0 0 10px rgba(0, 255, 255, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
}

.hv-ub-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hv-ub-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 18px;
  line-height: 1;
}

.hv-ub-body {
  min-width: 0;
  flex: 1;
}

.hv-ub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 1px;
}

.hv-ub-tag {
  font-family: "Orbitron", sans-serif;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7dd3fc;
}

.hv-ub-mode {
  font-family: "Orbitron", sans-serif;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(253, 224, 71, 0.85);
}

.hv-ub-name {
  margin: 0;
  font-family: "Rajdhani", sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  color: #eef6ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.15);
}

.hv-ub-level {
  margin: 1px 0 4px;
  font-family: "Rajdhani", sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: #fde047;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hv-ub-xp {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hv-ub-bar {
  flex: 1;
  height: 4px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.35);
  clip-path: polygon(0 0, calc(100% - 3px) 0, 100% 100%, 0 100%);
}

.hv-ub-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #06b6d4, #22d3ee 45%, #fde047);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.45);
  transition: width 0.45s ease;
}

.hv-ub-xp-nums {
  flex-shrink: 0;
  min-width: 48px;
  text-align: right;
  font-family: "Orbitron", sans-serif;
  font-size: 8px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #fde047;
  text-shadow: 0 0 8px rgba(253, 224, 71, 0.25);
}

.hv-ub-next {
  margin: 3px 0 0;
  font-family: "Rajdhani", sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: #94a3b8;
}

@media (max-width: 640px) {
  .hv-user-badge {
    width: 100%;
  }

  .hv-ub-inner {
    padding: 7px 8px 5px;
    gap: 7px;
  }

  .hv-ub-avatar-wrap {
    width: 34px;
    height: 34px;
  }

  .hv-ub-name {
    font-size: 12px;
  }
}
