﻿.hv-match-quests-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 50;
  width: max-content;
  max-width: min(440px, calc(100vw - 24px));
  pointer-events: auto;
}

.hv-mq-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, max-content);
  width: max-content;
  max-width: 100%;
}

.hv-match-quests-panel[hidden] {
  display: none !important;
}

.hv-match-quests-panel:not(.is-open) .hv-match-quests-toggle {
  border-radius: 12px;
}

.hv-match-quests-panel.is-open .hv-mq-frame {
  border-radius: 12px;
}

.hv-mq-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(0, 255, 255, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(0, 255, 255, 0.04) 0%, transparent 28%),
    linear-gradient(135deg, rgba(8, 14, 28, 0.96) 0%, rgba(4, 8, 18, 0.98) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 0, 128, 0.08),
    0 12px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

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

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

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

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

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

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

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

.hv-match-quests-toggle {
  position: relative;
  z-index: 2;
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  width: auto;
  min-width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 12px 12px 0 0;
  background: transparent;
  color: #e8f8ff;
  cursor: pointer;
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  white-space: nowrap;
}

.hv-match-quests-toggle:hover {
  background: rgba(0, 255, 255, 0.04);
}

.hv-match-quests-toggle:focus-visible {
  outline: 1px solid rgba(0, 255, 255, 0.55);
  outline-offset: 2px;
}

.hv-mq-tag {
  flex-shrink: 0;
  padding: 2px 7px;
  border: 1px solid rgba(255, 0, 128, 0.45);
  border-radius: 3px;
  background: rgba(255, 0, 128, 0.1);
  color: #ff6eb4;
  font-family: "Orbitron", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-shadow: 0 0 10px rgba(255, 0, 128, 0.35);
}

.hv-match-quests-toggle-label {
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #dffcff;
  text-shadow: 0 0 14px rgba(0, 255, 255, 0.25);
}

.hv-match-quests-toggle-meta {
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid rgba(0, 255, 255, 0.28);
  border-radius: 999px;
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #67e8f9;
  background: rgba(0, 255, 255, 0.06);
}

.hv-match-quests-chevron {
  width: 12px;
  height: 12px;
  color: #67e8f9;
  transition: transform 0.22s ease;
}

.hv-match-quests-panel.is-open .hv-match-quests-chevron {
  transform: rotate(180deg);
}

.hv-match-quests-dropdown {
  position: relative;
  z-index: 2;
  grid-column: 1;
  width: 0;
  min-width: 100%;
  box-sizing: border-box;
  max-height: min(52vh, 380px);
  overflow-x: hidden;
  overflow-y: auto;
  border-top: 1px solid rgba(0, 255, 255, 0.14);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 255, 255, 0.6) rgba(0, 255, 255, 0.08);
}

.hv-match-quests-dropdown::-webkit-scrollbar {
  width: 9px;
}

.hv-match-quests-dropdown::-webkit-scrollbar-track {
  background: linear-gradient(180deg, rgba(0, 14, 24, 0.95), rgba(4, 8, 18, 0.98));
  border-left: 1px solid rgba(0, 255, 255, 0.14);
  box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.06);
}

.hv-match-quests-dropdown::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.95), rgba(255, 0, 128, 0.7));
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 255, 0.35);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.35);
}

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

.hv-match-quests-dropdown::-webkit-scrollbar-corner {
  background: transparent;
}

.hv-match-quests-dropdown[hidden] {
  display: none !important;
}

.hv-mq-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.12);
  background: rgba(0, 255, 255, 0.04);
  position: sticky;
  top: 0;
  z-index: 1;
}

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

.hv-mq-head span:nth-child(2),
.hv-mq-head span:nth-child(3) {
  text-align: right;
  min-width: 72px;
}

.hv-match-quests-list {
  display: flex;
  flex-direction: column;
}

.hv-mq-row {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
}

.hv-mq-row:hover {
  background: rgba(0, 255, 255, 0.04);
}

.hv-mq-row.is-done {
  opacity: 0.5;
}

.hv-mq-row.is-done .hv-mq-bar-fill {
  background: linear-gradient(90deg, rgba(74, 222, 128, 0.5), rgba(34, 197, 94, 0.85));
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.35);
}

.hv-mq-row-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
  margin-bottom: 7px;
}

.hv-mq-desc {
  margin: 0;
  font-family: "Rajdhani", sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: #eef6ff;
  overflow-wrap: anywhere;
}

.hv-mq-type {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(165, 180, 252, 0.35);
  background: rgba(99, 102, 241, 0.12);
  font-family: "Orbitron", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c4b5fd;
  white-space: nowrap;
}

.hv-mq-row[data-source="event-pass"] .hv-mq-type {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}

.hv-mq-row[data-source="daily"] .hv-mq-type,
.hv-mq-row[data-source="pack"] .hv-mq-type {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(245, 158, 11, 0.1);
  color: #fcd34d;
}

.hv-mq-row[data-source="battlepass"] .hv-mq-type {
  border-color: rgba(244, 114, 182, 0.35);
  background: rgba(236, 72, 153, 0.1);
  color: #f9a8d4;
}

.hv-mq-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hv-mq-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.35);
}

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

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

.hv-match-quests-empty {
  margin: 0;
  padding: 18px 14px;
  font-family: "Rajdhani", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  text-align: center;
}

.hv-quest-toast-stack {
  position: absolute;
  top: 68px;
  right: 12px;
  z-index: 56;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}

.hv-level-toast-stack {
  /* Slightly below quest toasts to avoid overlap. */
  top: 118px;
}

.hv-quest-toast {
  position: relative;
  width: 100%;
  opacity: 0;
  transform: translateX(calc(100% + 24px)) scale(0.96);
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease;
  filter: drop-shadow(0 0 18px rgba(0, 255, 255, 0.18));
}

.hv-quest-toast.is-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.hv-quest-toast.is-leaving {
  opacity: 0;
  transform: translateX(36px) scale(0.98);
  transition:
    transform 0.35s ease-in,
    opacity 0.3s ease-in;
}

.hv-quest-toast.hv-quest-toast-bump .hv-quest-toast-inner {
  animation: hvQuestToastBump 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.hv-quest-toast.hv-quest-toast-bump .hv-quest-toast-delta {
  animation: hvQuestToastDeltaPop 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes hvQuestToastBump {
  0% { transform: scale(1); }
  35% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes hvQuestToastDeltaPop {
  0% { transform: scale(1); color: #7efcff; }
  40% { transform: scale(1.18); color: #ffffff; }
  100% { transform: scale(1); color: #7efcff; }
}

.hv-quest-toast-inner {
  position: relative;
  overflow: hidden;
  padding: 12px 14px 12px 16px;
  border: 1px solid rgba(0, 255, 255, 0.45);
  background:
    linear-gradient(135deg, rgba(0, 255, 255, 0.07) 0%, transparent 42%),
    linear-gradient(225deg, rgba(255, 0, 170, 0.08) 0%, transparent 48%),
    rgba(6, 10, 22, 0.94);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 10px 28px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(0, 255, 255, 0.12);
}

.hv-quest-toast-inner::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #00ffff 0%, #ff00aa 100%);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.65);
}

.hv-quest-toast-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 255, 255, 0.03) 0px,
    rgba(0, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.35;
  animation: hvQuestToastScan 3s linear infinite;
}

@keyframes hvQuestToastScan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

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

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

.hv-quest-toast-delta {
  font-family: "Orbitron", sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #00ffff;
  text-shadow: 0 0 12px rgba(0, 255, 255, 0.75);
}

.hv-quest-toast-title {
  margin: 0 0 10px;
  font-family: "Rajdhani", sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  color: #e8f4ff;
}

.hv-quest-toast-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hv-quest-toast-bar {
  flex: 1;
  height: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(0, 255, 255, 0.2);
}

.hv-quest-toast-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #00ffff 0%, #ff00aa 100%);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.55);
  transition: width 0.35s ease;
}

.hv-quest-toast-numbers {
  font-family: "Orbitron", sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #fcd34d;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hv-quest-toast-complete {
  margin: 8px 0 0;
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fde047;
  text-shadow: 0 0 10px rgba(253, 224, 71, 0.5);
}

.hv-quest-toast.is-complete .hv-quest-toast-inner {
  border-color: rgba(253, 224, 71, 0.55);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 10px 28px rgba(0, 0, 0, 0.45),
    0 0 28px rgba(253, 224, 71, 0.18);
}

.hv-quest-toast.is-complete .hv-quest-toast-inner::before {
  background: linear-gradient(180deg, #fde047 0%, #ff00aa 100%);
}

.hv-quest-toast.is-complete .hv-quest-toast-delta {
  color: #fde047;
  text-shadow: 0 0 14px rgba(253, 224, 71, 0.75);
}


/* Top-level game.html (public rooms): fixed overlay */
.hv-match-quests-panel.is-game-shell {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 120;
}

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

.hv-quest-toast-stack.is-game-shell {
  position: fixed;
  top: 68px;
  right: 12px;
  z-index: 121;
}

.hv-level-toast-stack.is-game-shell {
  top: 118px;
}
