:root {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #f4f3f1;
  background: radial-gradient(circle at top, #3f4c6b, #1f1c2c);
  --hud-scale: 1;
  --hud-padding: clamp(12px, 2vw, 28px);
  --hud-gap: clamp(16px, 2.5vh, 32px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.auth-background {
  background-color: #0b0c12;
  background-image: url('Content/Art/2d-art/BGs/ART_BG_01.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
}

.auth-cache-banner {
  width: min(920px, calc(100% - 24px));
  margin: 0;
  padding: 16px 18px;
  background: #ffffff;
  color: #0b1d4d;
  border: 2px solid #0f5ad1;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 10px;
  z-index: 12;
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
}

.auth-cache-banner__title {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
}

.auth-cache-banner__body {
  margin: 0;
  line-height: 1.35;
  font-size: 0.95rem;
}

.auth-cache-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-cache-banner__button {
  border: 2px solid #0f5ad1;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.auth-cache-banner__button:focus-visible {
  outline: 3px solid rgba(15, 90, 209, 0.35);
  outline-offset: 2px;
}

.auth-cache-banner__button--accept {
  background: #0f5ad1;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(15, 90, 209, 0.35);
}

.auth-cache-banner__button--accept:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 90, 209, 0.45);
}

.auth-cache-banner__button--decline {
  background: #ffffff;
  color: #0f5ad1;
}

.auth-cache-banner__button--decline:hover {
  background: #eef3ff;
  transform: translateY(-1px);
}

.auth-cache-banner__button:active {
  transform: translateY(0);
  box-shadow: none;
}

@media (max-width: 540px) {
  .auth-cache-banner {
    padding: 14px 16px;
    width: calc(100% - 16px);
    bottom: 12px;
  }

  .auth-cache-banner__title {
    font-size: 0.95rem;
  }

  .auth-cache-banner__body {
    font-size: 0.9rem;
  }
}

.auth-screen {
  /* Provide a predictable wrapper around the auth stack without disturbing non-auth screens. */
  width: 100%;
}

body.auth-background .auth-screen {
  /* Keep the logo and auth card vertically stacked without spacing the trailing scripts. */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  min-height: 100vh;
  padding: 48px 16px;
  /* Lift the stack upward by roughly half its centered offset for better composition. */
  transform: translateY(calc(-1 * clamp(0px, 25vh, 240px)));
  position: relative;
  z-index: 1;
}

body.auth-background.auth-panel-anchored .auth-screen {
  justify-content: flex-start;
  transform: none;
}

body.hero-selection-mode .auth-screen {
  min-height: 100vh;
  padding: 0;
  transform: none;
  align-items: stretch;
}

body.faction-selection-mode {
  display: block;
}

body.hero-selection-mode {
  display: block;
}

body.main-hud-mode {
  display: block;
  min-height: 100vh;
}

#app {
  width: 100%;
  max-width: 420px;
  background: rgba(15, 15, 25, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
}

.auth-server-indicator {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.auth-server-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #e9edf7;
  font-weight: 700;
}

.auth-server-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d9534f;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.auth-server-dot.is-online {
  background: #2ed573;
  box-shadow: 0 0 0 2px rgba(12, 141, 71, 0.4), 0 0 12px rgba(46, 213, 115, 0.45);
}

.auth-server-count {
  margin-left: auto;
  color: #f4f7ff;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.auth-logo-container {
  /* Keep the standalone landing logo centered above the authentication panel. */
  display: flex;
  justify-content: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

.auth-logo {
  display: block;
  width: min(426px, 80%);
  margin: 0;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.65));
}

.auth-footer {
  margin-top: 24px;
  font-size: 0.75rem;
  color: #ffffff;
  text-align: center;
  opacity: 0.8;
  letter-spacing: 0.02em;
}

.auth-leaf-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.auth-leaf {
  position: absolute;
  top: 0;
  left: 0;
  width: 64px;
  height: 64px;
  background-image: url('Content/Art/2d-art/UI/UI_elements/Leaf.png');
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0;
  animation-name: auth-leaf-fall;
  animation-duration: 12s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  transform-origin: center;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
  will-change: transform, opacity;
}

@keyframes auth-leaf-fall {
  0% {
    transform: translate3d(var(--auth-leaf-x-start, 50vw), -12vh, 0)
      scale(var(--auth-leaf-scale, 1))
      rotate(var(--auth-leaf-rotation-start, 0deg));
    opacity: 0;
  }
  10% {
    opacity: 0.75;
  }
  45% {
    transform: translate3d(var(--auth-leaf-x-mid, 52vw), 48vh, 0)
      scale(var(--auth-leaf-scale, 1))
      rotate(var(--auth-leaf-rotation-mid, 120deg));
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--auth-leaf-x-end, 55vw), 110vh, 0)
      scale(var(--auth-leaf-scale, 1))
      rotate(var(--auth-leaf-rotation-end, 240deg));
    opacity: 0;
  }
}

#app.faction-selection-mode,
#app.hero-selection-mode {
  max-width: none;
  width: 100%;
  height: 100vh;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: none;
}

#app.main-hud-mode {
  max-width: none;
  width: 100%;
  height: 100vh;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  position: relative;
  overflow: hidden;
}

.world-viewport {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #0d1216;
  /* Ensure world viewport can receive pointer events */
  pointer-events: auto;
}

.world-viewport canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.world-death-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 12, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 4;
  backdrop-filter: blur(4px);
}

.world-death-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.world-death-modal {
  min-width: 0;
  max-width: min(480px, 90vw);
  padding: 32px 36px;
  border-radius: 18px;
  background: rgba(18, 22, 30, 0.32);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.world-death-modal-title {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: #ff6b6b;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}

.world-death-modal-message {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.5;
  color: rgba(244, 243, 241, 0.92);
  max-width: 28ch;
}

.world-death-modal-revive-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  padding: 12px 28px;
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f8f9ff;
  background: linear-gradient(135deg, #36c2ff, #6c5cff);
  box-shadow: 0 10px 24px rgba(56, 160, 255, 0.35);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.world-death-modal-revive-button:hover,
.world-death-modal-revive-button:focus-visible {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 14px 28px rgba(56, 160, 255, 0.45);
  outline: none;
}

.world-death-modal-revive-button:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 8px 20px rgba(56, 160, 255, 0.35);
}

.hud-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.hud-scale-container {
  position: absolute;
  inset: 0;
  width: calc(100% / var(--hud-scale));
  height: calc(100% / var(--hud-scale));
  transform-origin: top left;
  transform: scale(var(--hud-scale));
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.server-announcement {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 72%;
  pointer-events: none;
  color: #ffe66d;
  font-weight: 700;
  font-size: 2.3rem;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: 8px 18px;
  letter-spacing: 0.5px;
  z-index: 3;
}

.server-announcement.is-visible {
  opacity: 1;
}

.server-announcement-text {
  display: inline-block;
  pointer-events: none;
  background: transparent;
  white-space: normal;
  word-break: break-word;
}

.hud-overlay-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  pointer-events: auto;
  z-index: 2;
}

.hud-toggle-ui-button {
  padding: 10px 16px;
  font-size: 0.9rem;
  backdrop-filter: blur(6px);
  background: rgba(15, 15, 25, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f4f3f1;
}

.npc-overlay-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  pointer-events: none;
  z-index: 5;
  transition: background 0.2s ease;
}

.npc-overlay-layer.is-active {
  pointer-events: auto;
  background: rgba(8, 12, 18, 0.55);
}

.npc-window {
  display: none;
  flex-direction: column;
  width: min(520px, 100%);
  max-height: calc(100% - 64px);
  border-radius: 16px;
  background: rgba(16, 20, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  color: #f4f3f1;
}

.npc-window.is-visible {
  display: flex;
}

.npc-window-header {
  padding: 18px 24px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.npc-window-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.npc-window-body {
  padding: 20px 24px;
  overflow-y: auto;
}

.npc-window-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-end;
  padding: 12px 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.npc-dialog-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 1rem;
  line-height: 1.45;
}

.npc-dialog-text p {
  margin: 0;
}

.npc-dialog-actions {
  display: none;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}

.npc-dialog-actions.has-action {
  display: flex;
}

.npc-dialog-primary-button {
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(99, 155, 255, 0.88), rgba(68, 115, 212, 0.88));
  color: #f4f3f1;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
}

.npc-dialog-primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(78, 128, 220, 0.35);
}

.npc-dialog-primary-button:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.npc-quest-section {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.npc-quest-heading {
  margin: 0 0 10px;
  font-size: 1rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: rgba(220, 232, 255, 0.82);
}

.npc-quest-list {
  margin: 0;
  padding-left: 20px;
  display: block;
  color: rgba(244, 243, 241, 0.92);
}

.npc-quest-objective {
  margin: 0;
  line-height: 1.4;
}

.npc-quest-objective.is-complete {
  color: rgba(142, 216, 143, 0.9);
  text-decoration: line-through;
}

.npc-quest-hint {
  margin: 6px 0 0;
  font-style: italic;
  color: rgba(220, 232, 255, 0.75);
}

.npc-goodbye-button {
  margin-left: auto;
  padding: 10px 24px;
}

.npc-shop-tabs {
  display: flex;
  gap: 8px;
  padding: 0 24px;
  margin: 16px 0 0;
}

.npc-shop-tab-button {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(12, 16, 24, 0.75);
  color: #f4f3f1;
  font-size: 0.95rem;
}

.npc-shop-tab-button.is-active {
  background: rgba(93, 140, 220, 0.38);
  border-color: rgba(160, 200, 255, 0.55);
}

.npc-shop-panel {
  display: none;
}

.npc-shop-panel.is-active {
  display: block;
}

.npc-shop-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.npc-shop-item {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px;
  background: rgba(10, 14, 22, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

.npc-shop-item-info {
  display: flex;
  gap: 12px;
  flex: 1 1 auto;
}

.npc-shop-item-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.npc-shop-item-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 320px;
}

.npc-shop-item-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.npc-shop-item-description {
  font-size: 0.9rem;
  color: rgba(244, 243, 241, 0.78);
}

.npc-shop-item-price,
.npc-shop-item-quantity {
  font-size: 0.9rem;
  color: rgba(215, 228, 255, 0.86);
}

.npc-shop-item-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  min-width: 120px;
}

.npc-quantity-input {
  width: 80px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(18, 22, 30, 0.9);
  color: #f4f3f1;
  font-size: 0.95rem;
}

.npc-shop-action-button {
  padding: 9px 20px;
}

.npc-refiner-summary {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
  font-size: 0.95rem;
  color: rgba(215, 228, 255, 0.86);
}

.npc-refiner-gold {
  font-weight: 600;
}

.npc-refiner-slot-section {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.npc-refiner-slot-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 16px;
  border: 2px dashed rgba(160, 200, 255, 0.45);
  background: rgba(10, 14, 22, 0.75);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.npc-refiner-slot-button:focus {
  outline: none;
  border-color: rgba(120, 190, 255, 0.9);
}

.npc-refiner-slot-button.has-item {
  border-style: solid;
  background: rgba(18, 24, 36, 0.9);
}

.npc-refiner-slot-button.is-drag-active,
.npc-refiner-slot-button.is-drag-over {
  border-color: #9dd6ff;
  background: rgba(25, 36, 54, 0.92);
}

.npc-refiner-slot-visual {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
}

.npc-refiner-slot-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.npc-refiner-slot-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.2;
  color: rgba(215, 228, 255, 0.75);
  pointer-events: none;
}

.npc-refiner-selected-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.npc-refiner-selected-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f4f3f1;
}

.npc-refiner-selected-cost {
  font-size: 0.95rem;
  color: rgba(215, 228, 255, 0.86);
}

.npc-refiner-selected-cost.is-unaffordable {
  color: #ff8585;
}

.npc-refiner-selected-cost.is-note {
  color: rgba(220, 232, 255, 0.7);
  font-style: italic;
}

.npc-refiner-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.npc-refiner-stats-column {
  background: rgba(10, 14, 22, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  min-height: 140px;
}

.npc-refiner-stats-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(215, 228, 255, 0.82);
  margin-bottom: 10px;
}

.npc-refiner-stats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.npc-refiner-stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  color: rgba(244, 243, 241, 0.85);
}

.npc-refiner-stat-label {
  font-weight: 500;
}

.npc-refiner-stat-value {
  color: rgba(215, 228, 255, 0.92);
}

.npc-refiner-stats-empty {
  font-size: 0.9rem;
  color: rgba(215, 228, 255, 0.7);
  font-style: italic;
}

.npc-refiner-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.npc-refiner-refine-button {
  padding: 10px 24px;
}

.npc-refiner-cancel-button {
  padding: 10px 20px;
  min-width: 120px;
}

.npc-status-message {
  flex: 1 1 auto;
  font-size: 0.95rem;
  color: #9dd6ff;
  opacity: 0;
  transition: opacity 0.2s ease;
  min-height: 1.2rem;
}

.npc-status-message.is-visible {
  opacity: 1;
}

.npc-status-message.is-error {
  color: #ff8585;
}

.npc-empty-message {
  margin: 16px 0;
  text-align: center;
  color: rgba(244, 243, 241, 0.75);
}

.npc-crafting-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.npc-crafting-tab-button {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-weight: 600;
  border-radius: 4px;
  transition: background 0.2s ease, border 0.2s ease;
}

.npc-crafting-tab-button.is-active,
.npc-crafting-tab-button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}

.npc-crafting-layout {
  display: flex;
  gap: 16px;
}

.npc-crafting-recipe-list {
  flex: 0 0 200px;
  max-height: 260px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
}

.npc-crafting-recipe-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  text-align: left;
  transition: background 0.2s ease, border 0.2s ease;
}

.npc-crafting-recipe-button.is-selected,
.npc-crafting-recipe-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.npc-crafting-recipe-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.npc-crafting-recipe-name {
  flex: 1;
  font-weight: 600;
}

.npc-crafting-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.npc-crafting-output {
  display: flex;
  align-items: center;
  gap: 12px;
}

.npc-crafting-output-icon {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.npc-crafting-output-name {
  font-size: 18px;
  font-weight: 600;
}

.npc-crafting-output-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.npc-crafting-output-description.is-empty {
  display: none;
}

.npc-crafting-ingredients-title {
  font-size: 16px;
  margin: 0;
}

.npc-crafting-ingredient-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.npc-crafting-ingredient {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.npc-crafting-ingredient.is-unavailable {
  background: rgba(128, 32, 32, 0.3);
}

.npc-crafting-ingredient-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.npc-crafting-ingredient-name {
  font-weight: 600;
}

.npc-crafting-ingredient-owned {
  margin-left: auto;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.npc-crafting-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 12px;
}

.npc-crafting-craft-button {
  min-width: 120px;
}

.npc-crafting-cancel-button {
  min-width: 100px;
}

.npc-crafting-empty {
  padding: 12px;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
}

.hud-toggle-ui-button:hover {
  transform: none;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
}

h1 {
  margin: 0 0 16px;
  font-size: 1.8rem;
  text-align: center;
}

p {
  margin: 0 0 12px;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #f2994a, #f2c94c);
  color: #231f20;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

button.secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f4f3f1;
}

.faction-badge {
  margin: 8px 0 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(242, 153, 74, 0.25);
  color: #ffe3b3;
  font-weight: 600;
}

.hero-badge {
  margin: 0 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(150, 211, 255, 0.18);
  color: #d4edff;
  font-weight: 600;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
}

input {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 12px 14px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f3f1;
}

.error {
  color: #ffb4b4;
  font-size: 0.85rem;
}

.success {
  color: #a9ffb5;
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 12px;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

#ping-display {
  position: absolute;
  top: 16px;
  left: 16px;
  font-weight: 600;
  font-size: 1rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.logged-in-container {
  position: relative;
  padding-top: 40px;
}

.name-selection-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.main-hud {
  position: absolute;
  inset: 0;
  padding: var(--hud-padding);
  box-sizing: border-box;
  pointer-events: none !important;
  transition: opacity 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--hud-gap);
}

/* Ensure ALL descendants of main-hud allow pointer events through by default */
.main-hud * {
  pointer-events: none !important;
}

/* Only re-enable pointer events for elements that explicitly need it */
.main-hud [data-prevent-world-click] {
  pointer-events: auto !important;
}

[data-prevent-world-click] {
  pointer-events: auto;
}

[data-prevent-world-click][hidden],
[data-prevent-world-click][aria-hidden='true'] {
  pointer-events: none !important;
}

.hud-panel:not(.is-open) [data-prevent-world-click],
.hud-panel[hidden] [data-prevent-world-click],
.hud-panel[aria-hidden='true'] [data-prevent-world-click] {
  pointer-events: none !important;
}

.main-hud.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.main-hud-layout {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: space-between;
  gap: var(--hud-gap);
  pointer-events: none !important;
  flex: 1;
  /* Ensure grid cells don't create invisible blocking areas */
  isolation: isolate;
}

/* Explicitly ensure grid cells don't block - target all possible grid items */
.main-hud-layout > *,
.main-hud-layout > *::before,
.main-hud-layout > *::after {
  pointer-events: none !important;
}

.hud-middle-row {
  pointer-events: none !important;
  width: 100%;
  height: 100%;
}

/* Ensure all grid rows allow pointer events to pass through by default */
.main-hud-layout > * {
  pointer-events: none !important;
}

/* Only enable pointer events on children that explicitly need it */
.main-hud-layout > [data-prevent-world-click] {
  pointer-events: auto !important;
}

/* Ensure ALL descendants of middle and bottom rows allow pointer events through */
.hud-middle-row *,
.hud-bottom-row * {
  pointer-events: none !important;
}

/* Re-enable pointer events only for elements that explicitly need it */
.hud-middle-row [data-prevent-world-click],
.hud-bottom-row [data-prevent-world-click] {
  pointer-events: auto !important;
}

.hud-top-row {
  width: 100%;
  display: grid;
  grid-template-columns:
    minmax(0, clamp(320px, 34vw, 440px))
    minmax(0, 1fr)
    minmax(0, clamp(260px, 30vw, 360px));
  grid-template-areas: 'player map right';
  align-items: start;
  gap: var(--hud-gap);
  pointer-events: none;
}

.hud-top-right {
  grid-area: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
  min-width: clamp(260px, 30vw, 360px);
  max-width: clamp(300px, 32vw, 420px);
  width: 100%;
  pointer-events: none;
  justify-self: end;
}

.hud-top-right > .hud-minimap-wrapper,
.hud-top-right > .hud-quest-tracker {
  width: 100%;
  pointer-events: auto;
}

.hud-quest-tracker {
  padding: 18px 22px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(18, 24, 36, 0.88), rgba(9, 13, 21, 0.82));
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.45);
  color: #f5f7fb;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hud-quest-tracker.is-hidden {
  display: none;
}

.hud-quest-tracker-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hud-quest-tracker-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  color: #ffd56a;
}

.hud-quest-tracker-count {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

.hud-quest-tracker-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hud-quest-entry {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 12px;
  background: rgba(10, 14, 22, 0.6);
  padding: 12px 14px;
}

.hud-quest-entry.is-ready {
  box-shadow: inset 0 0 0 1px rgba(143, 255, 163, 0.35);
}

.hud-quest-entry-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.hud-quest-entry-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f7f9fe;
}

.hud-quest-entry.is-ready .hud-quest-entry-title {
  color: #8fffa3;
}

.hud-quest-entry-status {
  font-size: 0.82rem;
  font-weight: 600;
  color: #8fffa3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hud-quest-entry-tasks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hud-quest-entry-task {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-left: 16px;
  font-size: 0.88rem;
  color: rgba(245, 247, 251, 0.92);
}

.hud-quest-entry-task::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 213, 106, 0.95);
}

.hud-quest-entry-task-text {
  flex: 1;
}

.hud-quest-entry-task-progress {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.75);
}

.hud-quest-entry-task.is-complete {
  color: rgba(245, 247, 251, 0.6);
}

.hud-quest-entry-task.is-complete::before {
  background: rgba(143, 255, 163, 0.9);
}

.hud-quest-entry-task.is-complete .hud-quest-entry-task-text {
  text-decoration: line-through;
}

.hud-quest-entry-task.is-complete .hud-quest-entry-task-progress {
  color: rgba(255, 255, 255, 0.6);
}


.hud-player-panel {
  position: relative;
  grid-area: player;
  display: grid;
  grid-template-columns: minmax(130px, 151px) minmax(0, 1fr);
  align-items: center;
  column-gap: 20px;
  padding: 24px 28px 32px 24px;
  width: min(100%, 735px);
  max-width: 100%;
  min-height: 152px;
  flex-shrink: 0;
  box-sizing: border-box;
  border-radius: 20px;
  background: none;
  border: none;
  box-shadow: none;
  justify-self: start;
}

.hud-portrait-wrapper {
  position: relative;
  justify-self: center;
  width: 150px;
  height: 150px;
  border-radius: 20px;
  overflow: hidden;
  border: none;
  padding: 0;
  background: rgba(12, 16, 26, 0.72);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}

.hud-portrait-wrapper:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.44);
}

.hud-portrait-wrapper:focus-visible {
  outline: 3px solid rgba(143, 211, 255, 0.65);
  outline-offset: 3px;
}

.hud-portrait-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hud-portrait-image.is-hidden {
  display: none;
}

.hud-portrait-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.hud-player-vitals {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  width: 100%;
  max-width: clamp(220px, 30vw, 320px);
}

.hud-player-level {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffe8a3;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}
.hud-party-panel {
  position: absolute;
  top: clamp(120px, 14vh, 240px);
  left: 24px;
  width: clamp(220px, 22vw, 260px);
  display: grid;
  gap: 14px;
  padding: 16px 18px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(12, 18, 28, 0.9), rgba(6, 9, 15, 0.88));
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.45);
  color: #f5f7fb;
  pointer-events: auto;
  z-index: 4;
}
.hud-party-panel.is-hidden {
  display: none;
}
.hud-party-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.hud-party-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffe066;
}
.hud-party-count {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}
.hud-party-list {
  display: grid;
  gap: 10px;
}
.hud-party-member {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(9, 13, 21, 0.82), rgba(5, 8, 14, 0.88));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 12px 18px rgba(0, 0, 0, 0.45);
}
.hud-party-member-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.hud-party-member-name {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #f5f7fb;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.hud-party-member-name.is-leader::after {
  content: '★';
  margin-left: 6px;
  color: #ffe066;
  font-size: 0.72rem;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.hud-party-member-level {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}
.hud-party-member-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hud-party-member .hud-status-bar {
  width: 100%;
  gap: 0;
}
.hud-party-member .hud-status-bar-label {
  display: none;
}
.hud-party-member .hud-status-bar-track {
  height: 14px;
  border-radius: 8px;
}
.hud-party-member .hud-status-bar-hp .hud-status-bar-track {
  height: 16px;
}
.hud-party-member .hud-status-bar-fill {
  font-size: 0.58rem;
}
.hud-party-member .hud-status-bar-value {
  font-size: 0.58rem;
}
.hud-party-member .hud-status-bar-mana .hud-status-bar-track {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
}
.hud-party-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.hud-party-actions button {
  flex: 1 1 0;
}
.hud-party-debug-refresh-button {
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #dbeafe;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.88), rgba(30, 64, 175, 0.88));
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.hud-party-debug-refresh-button:hover:not(:disabled):not([aria-disabled='true']) {
  transform: translateY(-1px);
  box-shadow: 0 16px 26px rgba(0, 0, 0, 0.45);
  filter: brightness(1.05);
}
.hud-party-debug-refresh-button:active:not(:disabled):not([aria-disabled='true']) {
  transform: translateY(0);
}
.hud-party-debug-refresh-button:disabled,
.hud-party-debug-refresh-button[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
}
.hud-party-leave-button {
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex: 1 1 0;
  text-align: center;
  color: #ffe8e8;
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.88), rgba(185, 28, 28, 0.88));
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.hud-party-leave-button:hover:not(:disabled):not([aria-disabled='true']) {
  transform: translateY(-1px);
  box-shadow: 0 16px 26px rgba(0, 0, 0, 0.5);
  filter: brightness(1.05);
}
.hud-party-leave-button:active:not(:disabled):not([aria-disabled='true']) {
  transform: translateY(0);
}
.hud-party-leave-button:disabled,
.hud-party-leave-button[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
}
@media (max-width: 960px) {
  .hud-party-panel {
    top: clamp(90px, 12vh, 180px);
    left: 12px;
    width: clamp(200px, 60vw, 260px);
  }
}

.hud-status-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  max-width: 100%;
  --hud-mana-width-offset: 12px;
}

.hud-status-bar {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-status-bar-label {
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
}

.hud-status-bar-track {
  position: relative;
  width: 100%;
  height: 20px;
  border-radius: 999px;
  background: none;
  overflow: hidden;
  border: none;
  backdrop-filter: none;
  box-shadow: none;
}

.hud-status-bar-fill {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.64rem;
  font-weight: 700;
  color: #f4f3f1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  transition: width 0.25s ease;
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 100% 100%;
  z-index: 1;
}

.hud-status-bar-hp .hud-status-bar-track {
  height: 22px;
}

.hud-status-bar-hp .hud-status-bar-fill {
  background-image: linear-gradient(rgba(220, 38, 38, 0.45), rgba(220, 38, 38, 0.45)),
    url('Content/Art/2d-art/UI/UI_elements/UnitFrame_Main_Bar_Primary_Fill.png');
}

.hud-status-bar-mana .hud-status-bar-track {
  height: 18px;
  width: calc(100% - var(--hud-mana-width-offset));
  max-width: calc(100% - var(--hud-mana-width-offset));
  margin-left: 0;
}

.hud-status-bar-mana .hud-status-bar-fill {
  background-image: linear-gradient(rgba(37, 99, 235, 0.45), rgba(37, 99, 235, 0.45)),
    url('Content/Art/2d-art/UI/UI_elements/UnitFrame_Main_Bar_Secondary_Fill.png');
}

.hud-status-bar-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.64rem;
  font-weight: 700;
  pointer-events: none;
  color: #f7f5f2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
  z-index: 2;
}

.hud-buffs {
  min-height: 52px;
  padding: 6px;
  border-radius: 12px;
  background: none;
  border: none;
  display: grid;
  grid-template-columns: repeat(5, 44px);
  grid-auto-rows: 44px;
  gap: 8px;
  align-content: flex-start;
  justify-content: flex-start;
  color: rgba(255, 255, 255, 0.7);
}

.hud-buffs.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
}

.hud-buff-icon {
  position: relative;
  width: 44px;
  height: 44px;
  border: none;
  padding: 0;
  border-radius: 10px;
  background: rgba(10, 16, 28, 0.78);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.48);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hud-buff-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.52);
}

.hud-buff-icon:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
}

.hud-buff-icon-image {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  pointer-events: none;
}

.hud-buff-icon-timer {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 2px;
  padding: 1px 2px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  font-size: 0.6rem;
  font-weight: 600;
  color: #e8f3ff;
  text-align: center;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.hud-map-indicator-wrapper {
  grid-area: map;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: clamp(240px, 30vw, 340px);
  justify-self: center;
  order: 0;
  margin-top: 4px;
}

.hud-map-indicator {
  padding: 12px 20px;
  border-radius: 16px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.24), rgba(18, 22, 34, 0.86)),
    url('Content/Art/2d-art/UI/UI_elements/Art_2d_UIelement_Panel_1.png') center/cover no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42);
  font-size: 1.05rem;
  font-weight: 600;
}

.hud-target-frame {
  --hud-mana-width-offset: 0px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(32, 42, 68, 0.86), rgba(18, 24, 38, 0.92)),
    url('Content/Art/2d-art/UI/UI_elements/Art_2d_UIelement_Panel_1.png') center/cover no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
  min-width: 280px;
}

.hud-target-actions {
  position: absolute;
  top: 8px;
  right: 12px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.hud-target-action-button {
  width: 34px;
  height: 34px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(12, 18, 32, 0.68);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.hud-target-action-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.hud-target-action-button:not(:disabled):hover,
.hud-target-action-button:not(:disabled):focus-visible {
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.45);
  transform: translateY(-1px);
}

.hud-target-loot-button.is-active {
  border-color: rgba(255, 230, 109, 0.75);
  background: rgba(255, 230, 109, 0.22);
  box-shadow: 0 0 0 2px rgba(255, 230, 109, 0.18), 0 6px 14px rgba(0, 0, 0, 0.45);
}

.hud-target-loot-button.is-active .hud-target-action-icon {
  filter: drop-shadow(0 0 6px rgba(255, 230, 109, 0.45));
}

.hud-target-action-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.hud-target-overlay {
  position: absolute;
  top: clamp(92px, 12vh, 160px);
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 48px));
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 15;
}

.hud-target-overlay > .hud-target-frame {
  pointer-events: auto;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.hud-target-overlay > .hud-target-frame.is-target-dragging,
.hud-target-overlay.is-target-moving > .hud-target-frame {
  cursor: grabbing;
}

.hud-target-overlay > .hud-target-frame button {
  touch-action: manipulation;
}

@media (max-width: 768px) {
  .hud-target-overlay {
    top: clamp(80px, 18vw, 148px);
    width: min(100%, calc(100% - 24px));
  }
}

.hud-target-frame.is-hidden {
  display: none;
}

.hud-target-portrait {
  position: relative;
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
}

.hud-target-portrait-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

.hud-target-portrait-frame {
  position: absolute;
  inset: -11px;
  width: calc(100% + 22px);
  height: calc(100% + 22px);
  object-fit: contain;
  pointer-events: none;
}

.hud-target-portrait-frame--enemy {
  transform: none;
}

.hud-target-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
}

.hud-target-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.hud-target-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f4f3f1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

.hud-target-name.is-friendly {
  color: #8fd3ff;
}

.hud-target-name.is-hostile {
  color: #ff8080;
}

.hud-enemy-frame .hud-target-name,
.hud-target-name.is-enemy {
  color: #ff5a5a;
}

.hud-target-level {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.75);
}

.hud-target-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud-target-frame .hud-status-bar-label {
  font-size: 0.58rem;
  letter-spacing: 0.07em;
}

.hud-target-frame .hud-status-bar-track {
  height: 16px;
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hud-target-frame .hud-status-bar-fill {
  font-size: 0.58rem;
}

.hud-target-frame .hud-status-bar-mana .hud-status-bar-track {
  width: 100%;
  max-width: 100%;
}

.hud-target-buffs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 38px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.74rem;
}

.hud-target-buffs.is-empty {
  font-style: italic;
}

.hud-target-buff-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 18, 32, 0.6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.35);
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  line-height: 1;
  appearance: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.hud-target-buff-icon:hover,
.hud-target-buff-icon:focus-visible {
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.45), 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.hud-target-buff-icon:focus-visible {
  outline: none;
  transform: translateY(-1px);
}

.hud-target-buff-icon-image {
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
}

.hud-minimap {
  width: clamp(200px, 22vw, 260px);
  max-width: 100%;
  aspect-ratio: 1;
  height: auto;
  border-radius: 16px;
  background:
    radial-gradient(circle at top, rgba(120, 170, 230, 0.3), rgba(20, 28, 48, 0.92)),
    url('Content/Art/2d-art/UI/UI_elements/Art_2d_UIelement_Panel_2.png') center/cover no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

.hud-minimap.has-map {
  display: flex;
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

/* Provide a dedicated staging element so the minimap canvases can stack. */
.hud-minimap-stage {
  position: relative;
  width: 100%;
  height: 100%;
}

.hud-minimap-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  image-rendering: optimizeQuality;
}

.hud-minimap-canvas.is-overlay {
  pointer-events: none;
}

.hud-minimap-status {
  padding: 8px 12px;
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.hud-minimap-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: clamp(220px, 26vw, 280px);
}

.hud-gm-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.18), rgba(20, 26, 42, 0.88)),
    url('Content/Art/2d-art/UI/UI_elements/Art_2d_UIelement_Panel_1.png') center/cover no-repeat;
  color: #ffe66d;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}

.hud-gm-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.48);
}

.hud-gm-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 3px;
}

.hud-leaderboard-button {
  position: absolute;
  top: clamp(8px, 1.6vw, 14px);
  right: clamp(8px, 1.6vw, 14px);
  left: auto;
  transform: none;
  width: clamp(48px, 6vw, 56px);
  height: clamp(48px, 6vw, 56px);
  border: none;
  padding: 6px;
  border-radius: 14px;
  background: rgba(9, 14, 24, 0.85);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.48);
  cursor: pointer;
  transition: box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.hud-leaderboard-button:hover {
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.55);
}

.hud-leaderboard-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
}

.hud-leaderboard-button-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
  pointer-events: none;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.hud-leaderboard-button:hover .hud-leaderboard-button-image {
  transform: scale(1.04);
  filter: brightness(1.08) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55));
}

.hud-bottom-row {
  width: 100%;
  display: grid;
  grid-template-columns:
    minmax(clamp(280px, 32vw, 420px), auto)
    minmax(0, 1fr)
    minmax(0, clamp(280px, 32vw, 420px));
  align-items: end;
  gap: var(--hud-gap);
  pointer-events: none !important;
  /* Ensure grid cells don't create invisible blocking areas */
  isolation: isolate;
}

/* Only enable pointer events on children that explicitly need it via data attribute */
.hud-bottom-row > * {
  pointer-events: none !important;
}

.hud-bottom-row > [data-prevent-world-click] {
  pointer-events: auto !important;
}

.hud-skill-bar-wrapper {
  grid-column: 2;
  justify-self: center;
  align-self: end;
  display: flex;
  justify-content: center;
  width: min(100%, clamp(520px, 48vw, 760px));
  pointer-events: none;
}

.hud-skill-bar-wrapper[data-prevent-world-click] {
  pointer-events: auto;
}

.hud-skill-bar-wrapper .hud-skill-bar {
  width: 100%;
}

.hud-cast-bar {
  position: absolute;
  left: 50%;
  bottom: clamp(140px, 18vh, 240px);
  transform: translateX(-50%);
  width: min(520px, 46vw);
  max-width: clamp(320px, 44vw, 560px);
  background: rgba(12, 18, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.15s ease, transform 0.18s ease;
  z-index: 4;
}

.hud-cast-bar.is-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
  visibility: hidden;
}

.hud-cast-bar-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(255, 231, 122, 0.85), rgba(255, 187, 0, 0.95));
  opacity: 0.95;
  transition: width 0.05s linear;
}

.hud-cast-bar-contents {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 22px;
  z-index: 1;
}

.hud-cast-bar-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 128px;
}

.hud-cast-bar-icon-wrapper {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.4);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.45);
}

.hud-cast-bar-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Keep the cast bar text highly readable with bright lettering and a dark outline. */
.hud-cast-bar-name {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #ffffff;
  text-shadow: -1px -1px 0 #000000, 1px -1px 0 #000000, -1px 1px 0 #000000,
    1px 1px 0 #000000;
  max-width: clamp(160px, 32vw, 260px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-cast-bar-time {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
  text-shadow: -1px -1px 0 #000000, 1px -1px 0 #000000, -1px 1px 0 #000000,
    1px 1px 0 #000000;
  min-width: 96px;
  text-align: center;
}

.hud-bottom-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(12px, 1.6vw, 20px);
  padding: 0;
  border-radius: 20px;
  background: none;
  border: none;
  box-shadow: none;
  flex: 0 1 auto;
  width: auto;
  max-width: clamp(420px, 56vw, 760px);
  min-width: 0;
  margin: 0;
  justify-self: end;
  align-self: end;
  grid-column: 3;
  flex-wrap: wrap;
}

@media (max-width: 1280px) {
  .hud-top-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, clamp(280px, 44vw, 360px));
    grid-template-areas:
      'player right'
      'map right';
  }

  .hud-map-indicator-wrapper {
    justify-self: flex-start;
  }
}

@media (max-width: 960px) {
  .hud-bottom-row {
    grid-template-columns: 1fr;
  }

  .hud-bottom-bar {
    grid-column: 1;
    justify-self: stretch;
    max-width: none;
    width: 100%;
    justify-content: flex-end;
  }

  .hud-skill-bar-wrapper {
    grid-column: 1;
    justify-self: stretch;
    width: 100%;
  }

  .hud-chat {
    justify-self: stretch;
  }

}

@media (max-width: 900px) {
  .hud-top-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      'player'
      'map'
      'right';
  }

  .hud-top-right {
    justify-self: stretch;
    align-items: center;
  }

  .hud-minimap-wrapper {
    max-width: clamp(220px, 60vw, 280px);
  }

  .hud-map-indicator-wrapper {
    justify-self: center;
  }

  .hud-player-panel {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 16px;
    text-align: center;
  }

  .hud-player-vitals {
    max-width: none;
    align-items: center;
  }

  .hud-status-bars {
    max-width: 360px;
  }
}

.hud-skillbook-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 16px;
  background:
    linear-gradient(140deg, rgba(94, 156, 255, 0.3), rgba(21, 34, 66, 0.92)),
    url('Content/Art/2d-art/UI/UI_elements/Art_2d_UIelement_Panel_2.png') center/cover no-repeat;
  border: 1px solid rgba(153, 201, 255, 0.4);
  color: #f4f3f1;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.hud-skillbook-button:hover {
  transform: translateY(-2px);
  border-color: rgba(179, 225, 255, 0.85);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.55);
}

.hud-skillbook-button:focus-visible {
  outline: 2px solid rgba(140, 197, 255, 0.9);
  outline-offset: 4px;
}

.hud-skill-bar {
  display: grid;
  grid-template-columns: repeat(10, minmax(58px, 1fr));
  gap: 8px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(12, 18, 32, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  flex: 1 1 100%;
  min-width: 0;
}

.hud-skill-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 12px;
  background: rgba(18, 24, 38, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f4f3f1;
  cursor: pointer;
  min-width: 62px;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}

.hud-skill-slot.is-empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.26);
  color: rgba(255, 255, 255, 0.55);
  background: rgba(18, 24, 38, 0.55);
  box-shadow: none;
}

.hud-skill-slot:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.48);
}

.hud-skill-slot:focus-visible {
  outline: 2px solid rgba(143, 211, 255, 0.85);
  outline-offset: 2px;
}

.hud-skill-slot.is-drag-over {
  border-color: rgba(103, 255, 144, 0.8);
  box-shadow: 0 0 18px rgba(103, 255, 144, 0.45);
}

.hud-skill-slot-hotkey {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  z-index: 2;
}

.hud-skill-slot-icon-wrapper {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(9, 14, 24, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.hud-skill-slot-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hud-skill-slot-cooldown-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: linear-gradient(180deg, rgba(12, 18, 30, 0.85), rgba(12, 18, 30, 0));
  opacity: 0;
  transition: height 0.12s ease, opacity 0.12s ease;
}

.hud-skill-slot.is-on-cooldown .hud-skill-slot-cooldown-overlay {
  opacity: 0.9;
}

.hud-skill-slot-cooldown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fefefe;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.hud-skill-slot-name,
.hud-skill-slot-cost {
  display: none;
}

.skillbook-panel {
  bottom: 120px;
  width: 420px;
  max-width: min(96vw, 460px);
}


.skillbook-tab {
  border: none;
  border-radius: 12px 12px 0 0;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(244, 243, 241, 0.72);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(12, 14, 22, 0.82));
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.skillbook-tab:hover {
  color: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}

.skillbook-tab.is-active {
  color: #ffffff;
  background:
    linear-gradient(165deg, rgba(120, 196, 255, 0.35), rgba(20, 32, 54, 0.92));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.skillbook-tab:focus-visible {
  outline: 2px solid rgba(143, 211, 255, 0.7);
  outline-offset: 2px;
}

.skillbook-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 360px;
  padding-right: 4px;
}

.skillbook-entry {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.1), rgba(12, 16, 26, 0.82));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  color: #f4f3f1;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.12s ease;
}

.skillbook-entry:not(.skillbook-entry--passive) {
  cursor: grab;
}

.skillbook-entry:not(.skillbook-entry--passive):active {
  cursor: grabbing;
}

.skillbook-entry:hover,
.skillbook-entry:focus-visible {
  border-color: rgba(143, 211, 255, 0.6);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
  transform: translateY(-1px);
}

.skillbook-entry:focus-visible {
  outline: none;
}

.skillbook-entry.is-equipped {
  border-color: rgba(103, 255, 144, 0.75);
  box-shadow: 0 0 18px rgba(103, 255, 144, 0.35);
}

.skillbook-entry--passive {
  cursor: default;
  opacity: 0.78;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

.skillbook-entry-icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.skillbook-entry-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skillbook-entry-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.skillbook-entry-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.skillbook-entry-cost {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.68);
  white-space: nowrap;
}

.skillbook-entry-target {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(179, 226, 255, 0.78);
}

.skillbook-entry-range {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(244, 243, 241, 0.75);
}

.skillbook-entry-description {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(244, 243, 241, 0.82);
}

.skillbook-empty {
  padding: 24px 18px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  text-align: center;
  color: rgba(244, 243, 241, 0.7);
  background: rgba(0, 0, 0, 0.2);
}

.hud-bag-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  border-radius: 18px;
  background: url('Content/Art/2d-art/UI/UI_elements/Accept_Button_Normal.png') center/contain no-repeat;
  border: none;
  color: #2a1d12;
  min-width: 140px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.38);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, color 0.2s ease,
    background-image 0.2s ease;
}

.hud-bag-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  pointer-events: none;
}

.hud-bag-button:hover {
  background-image: url('Content/Art/2d-art/UI/UI_elements/Accept_Button_Light.png');
  color: #1d1209;
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.42);
}

.hud-bag-button:focus-visible {
  outline: 2px solid rgba(253, 217, 141, 0.85);
  outline-offset: 3px;
}

.hud-options-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.28), rgba(15, 18, 28, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}

.hud-options-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.45);
}

.hud-options-icon {
  font-size: 30px;
  color: #f4f3f1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.hud-character-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border-radius: 18px;
  background: url('Content/Art/2d-art/UI/UI_elements/Accept_Button_Normal.png') center/contain no-repeat;
  border: none;
  color: #2a1d12;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 140px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.38);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, color 0.2s ease,
    background-image 0.2s ease;
}

.hud-character-button:hover {
  background-image: url('Content/Art/2d-art/UI/UI_elements/Accept_Button_Light.png');
  color: #1d1209;
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.42);
}

.hud-character-icon,
.hud-menu-icon {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  pointer-events: none;
}

.hud-menu-icon {
  width: 32px;
  height: 32px;
}

.hud-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  border-radius: 18px;
  background: url('Content/Art/2d-art/UI/UI_elements/Accept_Button_Normal.png') center/contain no-repeat;
  border: none;
  color: #2a1d12;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 140px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.38);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, color 0.2s ease,
    background-image 0.2s ease;
}

.hud-menu-button:hover {
  background-image: url('Content/Art/2d-art/UI/UI_elements/Accept_Button_Light.png');
  color: #1d1209;
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.42);
}

.hud-menu-button:focus-visible {
  outline: 2px solid rgba(253, 217, 141, 0.85);
  outline-offset: 3px;
}

.menu-panel-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}

.menu-panel-button-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-button-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.menu-panel-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 18px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(149, 203, 255, 0.32), rgba(20, 28, 48, 0.94));
  border: 1px solid rgba(153, 201, 255, 0.42);
  color: #f4f3f1;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease,
    background 0.2s ease;
}

.menu-panel-button.menu-panel-button--danger {
  background:
    linear-gradient(145deg, rgba(255, 164, 164, 0.36), rgba(52, 16, 16, 0.92));
  border-color: rgba(255, 190, 190, 0.55);
  box-shadow: 0 16px 32px rgba(77, 11, 11, 0.6);
}

.menu-panel-button.menu-panel-button--danger:hover {
  border-color: rgba(255, 214, 214, 0.85);
  box-shadow: 0 22px 36px rgba(77, 11, 11, 0.68);
}

.menu-panel-button:hover {
  transform: translateY(-1px);
  border-color: rgba(186, 229, 255, 0.85);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.55);
}

.menu-panel-button:focus-visible {
  outline: 2px solid rgba(140, 197, 255, 0.9);
  outline-offset: 4px;
}

.life-skills-panel {
  width: 420px;
  max-width: 100%;
}

.life-skills-panel-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
}

.life-skills-tablist {
  display: flex;
  gap: 12px;
}

.life-skills-tab {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(137, 180, 250, 0.25), rgba(24, 32, 58, 0.9));
  border: 1px solid rgba(153, 201, 255, 0.35);
  color: #f4f3f1;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.life-skills-tab:hover,
.life-skills-tab:focus-visible {
  border-color: rgba(186, 229, 255, 0.85);
  transform: translateY(-1px);
  outline: none;
}

.life-skills-tab.is-active {
  border-color: rgba(253, 217, 141, 0.9);
  background: linear-gradient(135deg, rgba(253, 217, 141, 0.38), rgba(57, 43, 12, 0.92));
}

.life-skills-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.life-skills-panel-section {
  display: none;
  flex-direction: column;
  gap: 14px;
  background: rgba(12, 18, 34, 0.72);
  border: 1px solid rgba(153, 201, 255, 0.28);
  border-radius: 16px;
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.life-skills-panel-section.is-active {
  display: flex;
}

.life-skills-panel-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #f8f5ee;
}

.life-skills-level {
  font-size: 1rem;
  font-weight: 600;
  color: #fdd98d;
}

.life-skills-experience {
  font-size: 0.95rem;
  color: #d8e8ff;
}

.life-skills-progress-track {
  position: relative;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(27, 39, 66, 0.85);
  overflow: hidden;
  border: 1px solid rgba(153, 201, 255, 0.35);
}

.life-skills-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, rgba(117, 203, 255, 0.75), rgba(44, 116, 255, 0.9));
  transition: width 0.25s ease;
}

.hud-panel {
  position: absolute;
  bottom: 120px;
  right: 24px;
  width: 340px;
  max-width: 92vw;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(155deg, rgba(42, 36, 58, 0.9), rgba(14, 18, 30, 0.92)),
    url('Content/Art/2d-art/UI/UI_elements/Art_2d_UIelement_Panel_2.png') center/cover no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 30;
  overflow: hidden;
}

.hud-panel.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.hud-panel.is-dragging {
  transition: none !important;
  cursor: grabbing;
}

.hud-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)),
    url('Content/Art/2d-art/UI/UI_elements/UI_LOGIN_REGISTER.png') center/120% auto no-repeat;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  cursor: move;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.hud-panel.is-dragging .hud-panel-header {
  cursor: grabbing;
}

.inventory-panel {
  bottom: 120px;
  right: 24px;
}

.character-panel {
  bottom: 120px;
  right: 388px;
  width: 480px;
  max-width: min(96vw, 540px);
}

.character-panel .hud-panel-content {
  overflow-y: visible;
}

.character-stats-panel {
  bottom: 120px;
  right: 24px;
  width: 360px;
  max-width: min(92vw, 380px);
}

.player-equipment-panel {
  bottom: 120px;
  right: 24px;
  width: 656px;
  max-width: min(94vw, 750px);
  max-height: 75vh;
}

.player-invite-panel {
  bottom: 120px;
  right: 24px;
  width: 320px;
  max-width: min(92vw, 360px);
}

.friends-panel {
  bottom: 120px;
  right: 24px;
  width: 360px;
  max-width: min(94vw, 420px);
  max-height: min(62vh, 520px);
}

.friends-panel-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px 24px;
}

.friends-list-header {
  display: grid;
  grid-template-columns: 32px 1fr 80px;
  align-items: center;
  padding: 0 8px 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(244, 243, 241, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.friends-list-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px 2px 4px 0;
}

.friends-list-row {
  display: grid;
  grid-template-columns: 32px 1fr 80px;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(32, 44, 68, 0.72), rgba(18, 22, 34, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.friends-list-row:hover {
  border-color: rgba(153, 201, 255, 0.35);
  box-shadow: inset 0 1px 0 rgba(153, 201, 255, 0.35);
}

.friends-list-col {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.friends-list-col-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #f4f3f1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friends-list-col-level {
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  color: rgba(244, 243, 241, 0.8);
}

.friends-status-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(15, 18, 28, 0.75);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.05));
}

.friends-status-indicator.is-online {
  background: radial-gradient(circle at 30% 30%, #8effa3, #1f9d55);
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.65);
}

.friends-status-indicator.is-offline {
  background: radial-gradient(circle at 30% 30%, #ffb3b3, #d64545);
  box-shadow: 0 0 8px rgba(214, 69, 69, 0.45);
  opacity: 0.8;
}

.friends-panel-empty {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(24, 30, 44, 0.85);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: rgba(244, 243, 241, 0.72);
  text-align: center;
  font-size: 0.92rem;
}

.friends-list-body::-webkit-scrollbar {
  width: 8px;
}

.friends-list-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(110, 132, 197, 0.8), rgba(64, 92, 168, 0.8));
  border-radius: 999px;
}

.friends-list-body::-webkit-scrollbar-track {
  background: rgba(12, 16, 24, 0.45);
  border-radius: 999px;
}

.monster-loot-panel {
  bottom: 120px;
  right: 24px;
  width: 380px;
  max-width: min(94vw, 420px);
}

.monster-loot-panel-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 22px 24px;
}

.monster-loot-message {
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: rgba(244, 243, 241, 0.85);
  min-height: 1.4em;
}

.monster-loot-message.is-error {
  color: #ff9898;
}

.monster-loot-gold {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffd966;
  letter-spacing: 0.03em;
}

.monster-loot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 14px;
}

.monster-loot-entry {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(circle at top, rgba(64, 78, 118, 0.35), rgba(22, 26, 40, 0.92));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  min-height: 96px;
  overflow: hidden;
}

.monster-loot-entry-image {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.monster-loot-entry-chance {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(12, 18, 32, 0.78);
  color: #f4f3f1;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.monster-loot-entry.is-rarity-uncommon {
  border-color: rgba(102, 255, 145, 0.55);
  box-shadow: 0 14px 32px rgba(60, 120, 80, 0.45);
}

.monster-loot-entry.is-rarity-rare {
  border-color: rgba(74, 168, 255, 0.55);
  box-shadow: 0 14px 32px rgba(40, 80, 140, 0.45);
}

.monster-loot-entry.is-rarity-epic {
  border-color: rgba(195, 136, 255, 0.65);
  box-shadow: 0 16px 34px rgba(120, 60, 160, 0.5);
}

.monster-loot-entry.is-rarity-legendary {
  border-color: rgba(255, 179, 71, 0.7);
  box-shadow: 0 18px 36px rgba(180, 110, 40, 0.55);
}

.monster-loot-entry.is-rarity-common {
  border-color: rgba(244, 243, 241, 0.22);
}

.player-invite-panel-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px 24px;
}

.player-invite-message {
  margin: 0;
  font-size: 0.95rem;
  color: #f4f3f1;
  letter-spacing: 0.01em;
}

.player-invite-message.is-disabled {
  color: rgba(244, 243, 241, 0.65);
}

.player-invite-target {
  color: #ffe66d;
  font-weight: 700;
}

.player-invite-hint {
  margin: -4px 0 0;
  font-size: 0.84rem;
  color: rgba(244, 243, 241, 0.7);
  font-style: italic;
}

.player-invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.player-invite-button {
  flex: 1 1 140px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(44, 48, 62, 0.9);
  color: #f4f3f1;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease;
}

.player-invite-button:disabled,
.player-invite-button[aria-disabled='true'] {
  cursor: not-allowed;
  color: rgba(244, 243, 241, 0.6);
  background: rgba(26, 28, 38, 0.72);
  border-color: rgba(255, 255, 255, 0.1);
  transform: none;
}

.player-invite-button:not(:disabled):not([aria-disabled='true']):hover {
  background: rgba(66, 70, 86, 0.95);
  border-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-1px);
}

.player-invite-button:focus-visible {
  outline: 2px solid rgba(255, 230, 109, 0.75);
  outline-offset: 2px;
}

.player-invite-guild-button {
  background: rgba(30, 32, 44, 0.88);
}

.player-invite-party-button {
  background: linear-gradient(135deg, rgba(255, 230, 109, 0.9), rgba(255, 172, 64, 0.88));
  color: #2b1f10;
  border-color: rgba(255, 193, 94, 0.65);
}

.player-invite-party-button:not(:disabled):not([aria-disabled='true']):hover {
  background: linear-gradient(135deg, rgba(255, 236, 140, 0.95), rgba(255, 184, 92, 0.92));
  border-color: rgba(255, 204, 120, 0.8);
}

.options-panel {
  top: 120px;
  right: 24px;
  bottom: auto;
}

.guild-panel {
  top: 120px;
  right: 120px;
  bottom: auto;
  width: 720px;
  max-width: min(96vw, 780px);
  min-height: 540px;
}

.guild-panel-content {
  min-height: 440px;
  gap: 24px;
}

.guild-panel-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
}

.guild-empty-state {
  font-size: 1.05rem;
  text-align: center;
  padding: 32px 16px;
  color: rgba(244, 243, 241, 0.8);
  background: rgba(26, 28, 38, 0.6);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.guild-tablist {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

.guild-tab-button {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(42, 44, 58, 0.72);
  color: #f4f3f1;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease, transform 0.2s ease;
}

.guild-tab-button:hover,
.guild-tab-button:focus-visible {
  border-color: rgba(255, 230, 109, 0.45);
  color: #ffe66d;
  outline: none;
}

.guild-tab-button.is-active {
  background: rgba(255, 230, 109, 0.18);
  border-color: rgba(255, 230, 109, 0.45);
  color: #ffe66d;
  transform: translateY(-1px);
}

.guild-tabpanels {
  flex: 1 1 auto;
  display: flex;
}

.guild-tab-panel {
  flex: 1 1 auto;
  display: none;
  flex-direction: column;
  gap: 18px;
}

.guild-tab-panel.is-active {
  display: flex;
}

.guild-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 24px;
}

.guild-info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(26, 28, 38, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.guild-info-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(244, 243, 241, 0.62);
}

.guild-info-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f4f3f1;
}

.guild-info-value--emblem {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.guild-emblem-preview {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.guild-emblem-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.35);
}

.guild-emblem-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.guild-emblem-placeholder {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(244, 243, 241, 0.6);
  text-transform: uppercase;
  text-align: center;
  padding: 0 6px;
}

.guild-info-value--emblem .guild-emblem-button {
  margin-left: auto;
}

.guild-info-value--emblem.has-emblem .guild-emblem-preview {
  border-color: rgba(255, 230, 109, 0.55);
  background: rgba(255, 230, 109, 0.1);
}

.guild-info-value--emblem.has-emblem .guild-emblem-placeholder {
  display: none;
}

.guild-emblem-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 18, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  z-index: 1200;
}

.guild-emblem-overlay[hidden] {
  display: none !important;
}

.guild-emblem-dialog {
  width: min(720px, 92vw);
  max-height: 90vh;
  background: rgba(22, 24, 32, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: #f4f3f1;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.guild-emblem-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.guild-emblem-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.guild-emblem-close {
  background: transparent;
  border: none;
  color: rgba(244, 243, 241, 0.7);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.guild-emblem-close:hover,
.guild-emblem-close:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #f4f3f1;
  outline: none;
}

.guild-emblem-description {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(244, 243, 241, 0.72);
}

.guild-emblem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  overflow-y: auto;
  padding: 4px;
  max-height: 320px;
}

.guild-emblem-option {
  display: block;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px 10px;
  color: #f4f3f1;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.guild-emblem-option:focus-visible,
.guild-emblem-option:hover {
  outline: none;
  border-color: rgba(255, 230, 109, 0.55);
  box-shadow: 0 0 0 2px rgba(255, 230, 109, 0.25);
  background: rgba(255, 230, 109, 0.12);
}

.guild-emblem-option.is-selected {
  border-color: rgba(255, 230, 109, 0.85);
  box-shadow: 0 0 0 2px rgba(255, 230, 109, 0.32);
  background: rgba(255, 230, 109, 0.16);
}

.guild-emblem-option[aria-disabled='true'] {
  opacity: 0.6;
  cursor: default;
}

.guild-emblem-option-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.guild-emblem-option-image {
  width: 64px;
  height: 64px;
  object-fit: contain;
  image-rendering: auto;
}

.guild-emblem-option-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.guild-emblem-option--clear {
  background: rgba(255, 255, 255, 0.02);
}

.guild-emblem-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.guild-emblem-status {
  margin: 0;
}

.guild-subheading {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(244, 243, 241, 0.85);
}

.guild-motd-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guild-motd-input {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(26, 28, 38, 0.6);
  color: #f4f3f1;
  font-family: inherit;
}

.guild-motd-input:focus-visible {
  outline: 2px solid rgba(255, 230, 109, 0.55);
  outline-offset: 2px;
}

.guild-motd-display {
  min-height: 110px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(26, 28, 38, 0.4);
  color: rgba(244, 243, 241, 0.86);
  white-space: pre-wrap;
}

.guild-motd-actions {
  display: flex;
  gap: 10px;
}

.guild-status-message {
  font-size: 0.85rem;
  color: rgba(244, 243, 241, 0.72);
}

.guild-status-message.is-error {
  color: #ff7777;
}

.guild-status-message.is-success {
  color: #6df2a7;
}

.guild-status-message.is-pending {
  color: #ffe66d;
}

.guild-actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.guild-primary-button,
.guild-secondary-button,
.guild-danger-button {
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border 0.18s ease, transform 0.18s ease;
}

.guild-primary-button {
  background: linear-gradient(135deg, rgba(255, 230, 109, 0.8), rgba(255, 184, 92, 0.78));
  color: #2b1f10;
  border-color: rgba(255, 193, 94, 0.55);
}

.guild-primary-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 205, 120, 0.85);
}

.guild-secondary-button {
  background: rgba(42, 44, 58, 0.72);
  color: #f4f3f1;
  border-color: rgba(255, 255, 255, 0.08);
}

.guild-secondary-button:hover {
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffe66d;
}

.guild-danger-button {
  background: rgba(120, 32, 32, 0.82);
  color: #ffe6e6;
  border-color: rgba(255, 120, 120, 0.38);
}

.guild-danger-button:hover {
  border-color: rgba(255, 120, 120, 0.65);
  color: #ffffff;
}

.guild-members-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guild-member-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(26, 28, 38, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
}

.guild-member-table th,
.guild-member-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.guild-member-table thead {
  background: rgba(26, 28, 38, 0.6);
  color: rgba(244, 243, 241, 0.85);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.guild-member-name-button {
  background: none;
  border: none;
  color: #ffe66d;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.guild-member-name-button:hover,
.guild-member-name-button:focus-visible {
  text-decoration: underline;
  outline: none;
}

.guild-members-empty {
  text-align: center;
  color: rgba(244, 243, 241, 0.72);
}

.guild-nickname-editor {
  display: flex;
  gap: 8px;
  align-items: center;
}

.guild-nickname-input {
  flex: 1 1 auto;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(26, 28, 38, 0.6);
  color: #f4f3f1;
}

.guild-nickname-input:focus-visible {
  outline: 2px solid rgba(255, 230, 109, 0.55);
  outline-offset: 1px;
}

.guild-benefits-panel {
  flex: 1 1 auto;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  background: rgba(26, 28, 38, 0.32);
}

.guild-invite-overlay,
.guild-create-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  z-index: 20;
  background: rgba(12, 14, 22, 0.35);
  backdrop-filter: blur(2px);
  transition: background 0.18s ease;
}

.guild-invite-overlay.is-open,
.guild-create-overlay.is-open {
  pointer-events: auto;
  background: rgba(12, 14, 22, 0.6);
}

.guild-invite-overlay[hidden],
.guild-create-overlay[hidden] {
  display: none !important;
}

.skill-book-dialog-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  z-index: 22;
  background: rgba(12, 14, 22, 0.35);
  backdrop-filter: blur(2px);
  transition: background 0.2s ease;
}

.skill-book-dialog-overlay.is-open {
  pointer-events: auto;
  background: rgba(12, 14, 22, 0.58);
}

.skill-book-dialog-overlay[hidden] {
  display: none !important;
}

.skill-book-dialog {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 18px;
  background: rgba(20, 22, 32, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: #f4f3f1;
}

.skill-book-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.skill-book-dialog-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(244, 243, 241, 0.85);
}

.skill-book-dialog-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f3f1;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.skill-book-dialog-close:hover,
.skill-book-dialog-close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.05);
  outline: none;
}

.skill-book-dialog-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skill-book-dialog-item {
  display: flex;
  gap: 16px;
  align-items: center;
}

.skill-book-dialog-item-icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 14, 22, 0.45);
  object-fit: contain;
}

.skill-book-dialog-item-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.skill-book-dialog-item-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffe66d;
  text-shadow: 0 0 12px rgba(255, 230, 109, 0.35);
}

.skill-book-dialog-item-difficulty,
.skill-book-dialog-item-chance {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(244, 243, 241, 0.78);
}

.skill-book-dialog-skill-preview {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 18, 26, 0.7);
  padding: 16px;
}

.skill-book-dialog-preview {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.skill-book-dialog-preview-icon-wrapper {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 14, 22, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-book-dialog-preview-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.skill-book-dialog-preview-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-book-dialog-preview-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(244, 243, 241, 0.92);
}

.skill-book-dialog-preview-cost,
.skill-book-dialog-preview-cooldown,
.skill-book-dialog-preview-cast-time,
.skill-book-dialog-preview-range {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(244, 243, 241, 0.75);
}

.skill-book-dialog-preview-description {
  margin: 4px 0 0;
  font-size: 0.95rem;
  color: rgba(244, 243, 241, 0.78);
}

.skill-book-dialog-preview-empty {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(244, 243, 241, 0.7);
}

.skill-book-dialog-status {
  min-height: 20px;
  font-size: 0.95rem;
  color: rgba(244, 243, 241, 0.8);
}

.skill-book-dialog-status.is-error {
  color: #ff6b6b;
}

.skill-book-dialog-status.is-success {
  color: #6df2a7;
}

.skill-book-dialog-status.is-pending {
  color: #ffe66d;
}

.skill-book-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.skill-book-dialog-cancel,
.skill-book-dialog-confirm {
  min-width: 120px;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.skill-book-dialog-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: #f4f3f1;
}

.skill-book-dialog-cancel:hover,
.skill-book-dialog-cancel:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
  outline: none;
}

.skill-book-dialog-confirm {
  background: linear-gradient(135deg, #36c2ff, #6c5cff);
  color: #f8f9ff;
  box-shadow: 0 12px 32px rgba(56, 160, 255, 0.32);
}

.skill-book-dialog-confirm:hover,
.skill-book-dialog-confirm:focus-visible {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 16px 36px rgba(56, 160, 255, 0.4);
  outline: none;
}

.skill-book-dialog-confirm:disabled,
.skill-book-dialog-cancel:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.guild-invite-dialog {
  width: min(420px, 100%);
  padding: 26px;
  border-radius: 18px;
  background: rgba(20, 22, 32, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: #f4f3f1;
}

.guild-create-dialog {
  width: min(420px, 100%);
  padding: 26px;
  border-radius: 18px;
  background: rgba(20, 22, 32, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: #f4f3f1;
}

.guild-invite-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(244, 243, 241, 0.72);
}

.guild-create-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(244, 243, 241, 0.72);
}

.guild-invite-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffe66d;
  text-shadow: 0 0 8px rgba(255, 230, 109, 0.45);
}

.guild-create-description {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(244, 243, 241, 0.75);
}

.guild-create-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.guild-create-label {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(244, 243, 241, 0.65);
}

.guild-create-input {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(14, 16, 24, 0.85);
  color: #f4f3f1;
  font-size: 1rem;
}

.guild-create-input:focus-visible {
  outline: 2px solid rgba(255, 230, 109, 0.55);
  outline-offset: 2px;
}

.guild-invite-details {
  font-size: 0.95rem;
  color: rgba(244, 243, 241, 0.75);
}

.guild-invite-details[hidden] {
  display: none !important;
}

.guild-invite-meta {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(244, 243, 241, 0.82);
}

.guild-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.guild-create-status {
  min-height: 20px;
}

.guild-invite-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 6px;
}

.guild-invite-actions .guild-primary-button,
.guild-invite-actions .guild-secondary-button {
  flex: 0 0 auto;
  min-width: 140px;
}

.guild-invite-status {
  min-height: 20px;
}

.guild-remove-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  z-index: 20;
  background: rgba(12, 14, 22, 0.35);
  backdrop-filter: blur(2px);
  transition: background 0.18s ease;
}

.guild-remove-overlay.is-open {
  pointer-events: auto;
  background: rgba(12, 14, 22, 0.62);
}

.guild-remove-overlay[hidden] {
  display: none !important;
}

.guild-remove-dialog {
  width: min(420px, 100%);
  padding: 24px;
  border-radius: 18px;
  background: rgba(20, 22, 32, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: #f4f3f1;
}

.guild-remove-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(244, 243, 241, 0.72);
}

.guild-remove-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffe66d;
}

.guild-remove-details {
  font-size: 0.9rem;
  color: rgba(244, 243, 241, 0.7);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guild-remove-details[hidden] {
  display: none;
}

.guild-remove-message {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(244, 243, 241, 0.82);
}

.guild-remove-status {
  min-height: 1.2em;
}

.guild-remove-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.hud-panel-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hud-panel-close {
  background: transparent;
  border: none;
  color: rgba(244, 243, 241, 0.75);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.18s ease, color 0.18s ease;
}

.hud-panel-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.gm-panel {
  top: 120px;
  right: 224px;
  bottom: auto;
  width: 420px;
  max-width: min(96vw, 440px);
}

.gm-panel .gm-panel-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gm-control-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gm-control-row select {
  flex: 1 1 auto;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(12, 16, 26, 0.86);
  color: #f4f3f1;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.gm-control-row select:focus-visible {
  outline: 2px solid rgba(143, 211, 255, 0.65);
  outline-offset: 2px;
}

.gm-control-row button {
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
}

.gm-panel .hud-panel-message {
  min-height: 1.4em;
}

.hud-panel-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px 20px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.options-panel-content {
  gap: 20px;
}

.options-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.options-section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(244, 243, 241, 0.92);
}

.options-slider-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.options-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.options-checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: rgba(244, 243, 241, 0.82);
  cursor: pointer;
  user-select: none;
}

.options-checkbox-row input[type='checkbox'] {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(12, 16, 26, 0.7);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.options-checkbox-row input[type='checkbox']:checked {
  background: linear-gradient(135deg, #f2994a, #f2c94c);
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 10px rgba(242, 153, 74, 0.45);
}

.options-checkbox-row input[type='checkbox']:focus-visible {
  outline: 2px solid rgba(242, 153, 74, 0.65);
  outline-offset: 2px;
}

.options-slider-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.options-slider-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  color: rgba(244, 243, 241, 0.82);
}

.options-slider-name {
  font-weight: 500;
}

.options-slider-value {
  font-variant-numeric: tabular-nums;
  color: rgba(244, 243, 241, 0.68);
}

.options-slider-input {
  width: 100%;
  accent-color: #f2b705;
  cursor: pointer;
}

.options-slider-input:focus-visible {
  outline: 2px solid rgba(242, 183, 5, 0.65);
  outline-offset: 2px;
}

.options-panel .hud-toggle-ui-button {
  width: 100%;
  justify-content: center;
}

.hud-panel-message {
  font-size: 0.9rem;
  color: rgba(244, 243, 241, 0.78);
  min-height: 1.2em;
}

.hud-panel-message.is-error {
  color: #ff8f8f;
}

.inventory-gold-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 209, 102, 0.12);
  color: #ffd166;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.25);
}

.inventory-gold-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: rgba(255, 243, 220, 0.78);
}

.inventory-gold-value {
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  color: #ffe8a3;
}

.inventory-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.leaderboard-panel {
  width: 360px;
}

.leaderboard-panel-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leaderboard-description {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
}

.leaderboard-updated {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leaderboard-entry {
  display: grid;
  grid-template-columns: minmax(48px, auto) 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.12), rgba(18, 22, 36, 0.7)),
    rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.leaderboard-entry-rank {
  font-weight: 700;
  color: #ffd966;
}

.leaderboard-entry-name {
  font-weight: 600;
  color: #f4f3f1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-entry-level {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.82);
}


.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 10px;
}

.inventory-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 6px;
  box-sizing: border-box;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.18);
}

.inventory-slot-visual {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inventory-slot.has-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.inventory-slot.is-empty {
  background: rgba(255, 255, 255, 0.02);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.08);
  cursor: default;
}

.inventory-slot:disabled {
  opacity: 0.65;
  cursor: default;
}

.inventory-slot-icon {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.45));
}

.inventory-slot-visual .inventory-slot-icon {
  position: relative;
  z-index: 1;
}

.item-rarity-frame {
  pointer-events: none;
  user-select: none;
}

.inventory-slot-visual .item-rarity-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
}

.inventory-slot-quantity {
  position: absolute;
  bottom: 4px;
  right: 6px;
  padding: 1px 5px;
  border-radius: 10px;
  background: rgba(10, 14, 22, 0.75);
  color: #f4f3f1;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  z-index: 3;
}

.inventory-empty-notice {
  text-align: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(244, 243, 241, 0.7);
  font-size: 0.85rem;
}


.inventory-tooltip {
  position: fixed;
  z-index: 220;
  display: inline-flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  min-width: 0;
  max-width: none;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 12px;
  color: #f4f3f1;
  box-shadow: none;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.inventory-tooltip.has-comparison {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: start;
  gap: 16px;
}

.inventory-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.inventory-tooltip-card {
  position: relative;
  min-width: 180px;
  max-width: 260px;
  padding: 18px 16px 14px;
  background: rgba(16, 18, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
  color: inherit;
  flex: 0 0 auto;
}

.inventory-tooltip.has-comparison .inventory-tooltip-card.is-equipped {
  order: 0;
}

.inventory-tooltip.has-comparison .inventory-tooltip-card.is-hovered {
  order: 1;
}

.inventory-tooltip-card.has-badge {
  padding-top: 36px;
}

.inventory-tooltip-badge {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: linear-gradient(90deg, #ffd166, #f6c343);
  color: #1f1400;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.inventory-tooltip-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}

.inventory-tooltip-type {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(244, 243, 241, 0.6);
  margin-bottom: 8px;
}

.inventory-tooltip-quantity {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(244, 243, 241, 0.88);
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.inventory-tooltip-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.inventory-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inventory-tooltip-row-label {
  font-weight: 600;
  color: rgba(244, 243, 241, 0.78);
}

.inventory-tooltip-row-value {
  font-weight: 700;
  color: #ffd166;
}

.inventory-tooltip-description {
  margin-top: 10px;
  color: rgba(244, 243, 241, 0.75);
  font-size: 0.82rem;
  line-height: 1.3;
}

.skill-tooltip {
  position: fixed;
  z-index: 215;
  min-width: 200px;
  max-width: 280px;
  padding: 14px 16px;
  background: rgba(16, 18, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  color: #f4f3f1;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.skill-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.skill-tooltip-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}

.skill-tooltip-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(244, 243, 241, 0.6);
  margin-bottom: 8px;
}

.skill-tooltip-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.skill-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.skill-tooltip-row-label {
  font-weight: 600;
  color: rgba(244, 243, 241, 0.78);
}

.skill-tooltip-row-value {
  font-weight: 700;
  color: #ffd166;
}

.skill-tooltip-description {
  margin-top: 10px;
  color: rgba(244, 243, 241, 0.75);
  font-size: 0.82rem;
  line-height: 1.3;
}

.stat-tooltip {
  position: fixed;
  z-index: 240;
  max-width: 220px;
  padding: 10px 12px;
  background: rgba(12, 15, 22, 0.95);
  border: 1px solid rgba(143, 211, 255, 0.35);
  border-radius: 10px;
  color: #f4f3f1;
  font-size: 0.78rem;
  line-height: 1.35;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.42);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.stat-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.character-panel-heading {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(244, 243, 241, 0.75);
}

.character-panel-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.player-equipment-panel-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.player-equipment-message {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 18, 32, 0.45);
  color: rgba(244, 243, 241, 0.78);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-align: center;
}

.player-equipment-layout[hidden] {
  display: none !important;
}

.player-equipment-preview {
  justify-content: center;
  align-items: center;
}

@media (min-width: 821px) {
  .player-equipment-layout .character-gear-column.is-center {
    grid-column: 2;
  }

  .player-equipment-layout .player-equipment-preview {
    grid-column: 3;
    justify-self: center;
  }
}

.character-gear-section,
.character-stats-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.character-gear-layout {
  display: grid;
  grid-template-columns:
    minmax(140px, 1fr)
    minmax(0, 200px)
    minmax(140px, 1fr)
    minmax(140px, 1fr);
  column-gap: 6px;
  row-gap: 16px;
  align-items: start;
}

@media (max-width: 640px) {
  .character-panel {
    width: min(92vw, 420px);
  }
  .character-stats-panel {
    width: min(92vw, 360px);
  }
  .player-equipment-panel {
    width: min(92vw, 562px);
  }
  .character-gear-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 820px) and (min-width: 641px) {
  .character-gear-layout {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.character-gear-preview {
  grid-row: 1;
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 6px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  min-height: 0;
  box-shadow: inset 0 0 0 1px rgba(12, 18, 32, 0.22);
}

.character-gear-preview-slots {
  width: 100%;
}

.character-gear-preview-slots .character-gear-slot {
  width: 100%;
}

@media (max-width: 820px) and (min-width: 641px) {
  .character-gear-preview {
    grid-column: 1 / -1;
    justify-self: center;
  }
}

@media (max-width: 640px) {
  .character-gear-preview {
    grid-column: auto;
  }
}

.character-gear-hero {
  width: auto;
  max-width: 160px;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.48));
}

.character-gear-column {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.character-gear-column .character-gear-slot-grid {
  width: 100%;
}

.character-gear-slot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  align-content: start;
}

/* Ensure the weapon and off-hand slots render side-by-side beneath the portrait. */
.character-gear-slot-grid.character-gear-preview-slots {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

@media (max-width: 820px) and (min-width: 641px) {
  .character-gear-slot-grid {
    grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  }
}

.character-gear-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
}

.character-gear-slot-button {
  width: 50%;
  min-width: 48px;
  max-width: 96px;
  margin: 0 auto;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  cursor: pointer;
  position: relative;
  padding: 0;
}

.character-gear-slot-button.has-item {
  background: rgba(255, 255, 255, 0.08);
}

.character-gear-slot-button.has-item:hover {
  transform: translateY(-2px);
  border-color: rgba(143, 211, 255, 0.5);
  background: rgba(143, 211, 255, 0.16);
}

.character-gear-slot-button:focus-visible {
  outline: 3px solid rgba(143, 211, 255, 0.65);
  outline-offset: 3px;
}

.character-gear-slot-button.is-empty {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.02);
  cursor: default;
}

.character-gear-slot-button:disabled {
  cursor: default;
  opacity: 0.65;
}

@media (min-width: 821px) {
  .character-gear-layout {
    grid-template-columns:
      max-content
      minmax(0, 200px)
      max-content
      max-content;
    justify-content: center;
  }

  .character-gear-column .character-gear-slot-grid {
    width: max-content;
  }

  .character-gear-slot {
    width: max-content;
  }

  .character-gear-slot-button {
    width: 70px;
    margin: 0;
  }
}

.character-gear-icon-wrapper {
  width: 70%;
  height: 70%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.character-gear-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.55));
}

.character-gear-icon-wrapper .character-gear-icon {
  position: relative;
  z-index: 1;
}

.character-gear-icon-wrapper .item-rarity-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
}

.character-gear-placeholder {
  font-size: 1.35rem;
  color: rgba(244, 243, 241, 0.45);
}

.character-gear-slot-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(244, 243, 241, 0.65);
  text-align: center;
}

.character-gear-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-style: italic;
  color: rgba(244, 243, 241, 0.7);
}

.character-stats-subheading {
  margin: 4px 0 2px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(244, 243, 241, 0.58);
}

.character-stats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.character-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.character-stat-row.is-empty {
  justify-content: center;
  color: rgba(244, 243, 241, 0.7);
  font-style: italic;
}

.character-stat-label {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.character-stat-label.has-tooltip {
  cursor: help;
}

.character-stat-label.has-tooltip:focus-visible {
  outline: 2px solid rgba(143, 211, 255, 0.6);
  outline-offset: 2px;
}

.character-stat-value {
  color: rgba(244, 243, 241, 0.8);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.character-stat-value-text {
  display: inline-block;
  min-width: 28px;
}

.character-unused-points {
  margin: 6px 0 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(143, 211, 255, 0.35);
  background: rgba(143, 211, 255, 0.12);
  color: rgba(185, 228, 255, 0.82);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.character-unused-points:not(.has-points) {
  border-color: rgba(244, 243, 241, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(244, 243, 241, 0.7);
}

.portrait-selection-wrapper {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.portrait-selection-wrapper.is-open {
  pointer-events: auto;
  opacity: 1;
}

.portrait-selection-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 14, 0.65);
  backdrop-filter: blur(4px);
}

.portrait-selection-dialog {
  position: relative;
  width: min(520px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 20px;
  background: rgba(18, 22, 34, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.65);
  padding: 24px;
  transform: translateY(20px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.portrait-selection-wrapper.is-open .portrait-selection-dialog {
  transform: translateY(0);
  opacity: 1;
}

.portrait-selection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.portrait-selection-header h3 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.portrait-selection-close {
  border: none;
  background: transparent;
  color: rgba(244, 243, 241, 0.75);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 10px;
  padding: 4px 8px;
  transition: background 0.18s ease, color 0.18s ease;
}

.portrait-selection-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.portrait-selection-description {
  margin: 0 0 16px;
  color: rgba(244, 243, 241, 0.7);
  font-size: 0.9rem;
  line-height: 1.4;
}

.portrait-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.portrait-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  padding: 14px 12px 16px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: center;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.portrait-option:hover {
  transform: translateY(-2px);
  border-color: rgba(143, 211, 255, 0.4);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.35);
}

.portrait-option.is-selected,
.portrait-option[aria-pressed='true'] {
  border-color: rgba(143, 211, 255, 0.7);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.35);
}

.portrait-option:focus-visible {
  outline: 3px solid rgba(143, 211, 255, 0.65);
  outline-offset: 3px;
}

.portrait-option-image {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
}

.portrait-option-placeholder {
  width: 100%;
  min-height: 120px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(244, 243, 241, 0.7);
  background: rgba(12, 16, 26, 0.65);
  box-shadow: inset 0 8px 16px rgba(0, 0, 0, 0.35);
  text-transform: uppercase;
}

.portrait-option-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.03em;
}

.stat-increase-button {
  padding: 2px 10px;
  border-radius: 8px;
  border: 1px solid rgba(143, 211, 255, 0.6);
  background: linear-gradient(135deg, rgba(111, 185, 255, 0.85), rgba(86, 154, 235, 0.85));
  color: #f4f3f1;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
  min-width: 32px;
}

.stat-increase-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(78, 135, 211, 0.45);
}

.stat-increase-button:active {
  transform: translateY(0);
  box-shadow: none;
}

.stat-increase-button:disabled,
.stat-increase-button.is-loading {
  cursor: not-allowed;
  opacity: 0.65;
  box-shadow: none;
}

.hero-selection {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 48px 6vw 64px;
  box-sizing: border-box;
  background: linear-gradient(135deg, rgba(18, 21, 35, 0.95), rgba(12, 16, 24, 0.9));
}

.hero-selection--race {
  --race-screen-safe-margin: 24px;
  position: relative;
  padding: 0;
  gap: 0;
  background: #050608;
}

.hero-selection--race .hero-selection-heading {
  position: absolute;
  top: var(--race-screen-safe-margin);
  left: var(--race-screen-safe-margin);
  margin: 0;
  max-width: 420px;
  z-index: 2;
  text-align: left;
}

.hero-selection--race .hero-selection-heading h1 {
  font-size: 1.9rem;
  margin-bottom: 6px;
}

.hero-selection--race .hero-selection-heading p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
}

.race-selection-error {
  position: absolute;
  top: var(--race-screen-safe-margin);
  right: var(--race-screen-safe-margin);
  margin: 0;
  max-width: 320px;
  text-align: right;
  z-index: 2;
}

.hero-selection--race[data-faction='infernal'] {
  --race-screen-safe-margin: clamp(28px, 5vw, 64px);
  padding: var(--race-screen-safe-margin);
  /* Allow the Infernal selection screen to use the scene artwork instead of a flat black backdrop. */
  background: transparent;
}

.race-gallery {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  min-height: 100%;
}

.race-card {
  position: relative;
  flex: 1 1 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: none;
  background: #050608;
  /* Square off the race cards so the information plate is not clipped by rounded corners. */
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  color: #ffffff;
  text-align: left;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.race-card:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: -4px;
}

.race-card:hover,
.race-card:focus-visible {
  transform: scale(1.01);
}

.race-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85);
  transition: transform 0.3s ease;
  position: relative;
  z-index: 0;
}

.race-card:hover .race-card-image,
.race-card:focus-visible .race-card-image {
  transform: scale(1.04);
}

.race-card-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2;
  overflow: hidden;
}

.race-card-overlay::before {
  /* Provide a tight, high-contrast backing plate for the overlay text. */
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  /* Match the squared race card corners to eliminate the curved clipping at the bottom. */
  border-radius: 0;
  z-index: -1;
}

.race-card-name,
.race-card-info {
  position: relative;
  z-index: 1;
}

.race-card-name {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.85);
}

.race-card-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 18px;
  width: 100%;
}

.race-card-info-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.race-card-info-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.68);
}

.race-card-info-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
}

@media (max-width: 1024px) {
  .race-card-name {
    font-size: 1.6rem;
  }

  .race-card-info {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 900px) {
  .hero-selection--race .hero-selection-heading {
    position: static;
    padding: 28px var(--race-screen-safe-margin) 12px;
  }

  .race-selection-error {
    position: static;
    padding: 0 var(--race-screen-safe-margin) 16px;
    text-align: left;
  }

  .race-gallery {
    flex-direction: column;
  }

  .race-card {
    min-height: 360px;
  }

  body.hero-selection-floating-controls-active .hero-selection-floating-controls {
    position: static;
    padding: 24px clamp(20px, 6vw, 32px) 0;
  }
}

.hero-selection-heading {
  max-width: 840px;
  margin: 0 auto;
  text-align: left;
}

.hero-selection-floating-controls {
  position: fixed;
  top: clamp(24px, 5vw, 72px);
  left: clamp(24px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  z-index: 30;
}

.hero-selection-floating-controls p {
  margin: 0;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.82);
}

body.hero-selection-floating-controls-active .hero-selection--race .hero-selection-heading {
  top: calc(var(--race-screen-safe-margin) + 112px);
}

body.hero-selection-floating-controls-active .race-selection-error {
  top: calc(var(--race-screen-safe-margin) + 112px);
}

.hero-selection-back-button {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  align-self: flex-start;
}

.hero-selection-heading h1 {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.hero-selection-heading p {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.82);
  margin: 0;
}

.hero-selection-error {
  max-width: 840px;
  margin: 0 auto;
  color: #ffb4b4;
  font-weight: 600;
}

.hero-grid {
  display: grid;
  /* Expand the minimum card width so each hero panel grows by roughly one-third for breathing room. */
  grid-template-columns: repeat(auto-fit, minmax(346px, 1fr));
  gap: 28px;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

.hero-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 32px 24px 28px;
  border-radius: 24px;
  background: radial-gradient(circle at top, rgba(22, 28, 44, 0.92), rgba(9, 13, 24, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  color: #f4f3f1;
  cursor: pointer;
  text-align: center;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.hero-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.45);
}

.hero-card.pending {
  filter: saturate(0.6);
}

.hero-card-art {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.hero-card-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-card-name {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.2;
}

.hero-card-race {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.74);
}

.hero-card-art-image {
  width: 100%;
  max-width: 320px;
  max-height: 420px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.65));
}

.hero-card-lock {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(242, 201, 76, 0.25);
  color: #ffe9a3;
  font-weight: 600;
  font-size: 0.85rem;
}

.hero-card-locked {
  filter: grayscale(0.5) brightness(0.8);
}

.hero-card-locked .hero-card-lock {
  background: rgba(200, 80, 80, 0.4);
  color: #ffd6d6;
}

@media (max-width: 900px) {
  .hero-card {
    padding: 28px 20px 24px;
  }
}


.hero-selection--detail-open .hero-grid {
  display: none;
}

.hero-detail-panel {
  display: none;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 1240px;
  margin: 24px auto 0;
  padding: 32px 36px;
  background: linear-gradient(135deg, rgba(8, 12, 24, 0.92), rgba(4, 6, 14, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.45);
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.hero-selection--detail-open .hero-detail-panel {
  display: flex;
}

.hero-detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.hero-detail-back {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(20, 26, 46, 0.85);
  color: #f4f3f1;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.hero-detail-back:hover {
  background: rgba(30, 38, 64, 0.85);
  transform: translateY(-1px);
}

.hero-detail-title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-detail-title h2 {
  margin: 0;
  font-size: 1.9rem;
}

.hero-detail-title p {
  margin: 0;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.74);
}

.hero-detail-lock-note {
  color: #ffe9a3;
  font-weight: 600;
}

.hero-detail-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-detail-art {
  display: flex;
  justify-content: center;
}

.hero-detail-art-image {
  width: 100%;
  max-width: 420px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 22px 32px rgba(0, 0, 0, 0.6));
}

.hero-detail-section {
  background: rgba(9, 14, 26, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-detail-section h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.hero-detail-section-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-detail-stat-list,
.hero-detail-growth-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px 18px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  font-size: 0.95rem;
}

.hero-detail-ability {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(12, 18, 30, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-detail-ability-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
}

.hero-detail-ability-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-detail-ability-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.hero-detail-ability-description {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
}

.hero-detail-empty {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

.hero-detail-actions {
  display: flex;
  justify-content: flex-end;
}

.hero-detail-select {
  padding: 14px 28px;
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #0d1324;
  background: linear-gradient(135deg, #ffd36b, #f9b34d);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hero-detail-select:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.hero-detail-select:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.hero-detail-select-locked {
  background: linear-gradient(135deg, rgba(200, 80, 80, 0.6), rgba(160, 40, 40, 0.6));
  color: #ffe9e9;
}

@media (max-width: 900px) {
  .hero-detail-panel {
    padding: 24px;
    max-height: none;
  }
}

.main-hud-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-radius: 16px;
  background: rgba(15, 15, 25, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.main-hud-top-bar h2 {
  margin: 0;
  font-size: 1.35rem;
}

.main-hud-player-info {
  font-weight: 600;
  font-size: 1rem;
}

.hud-chat {
  position: relative;
  width: min(100%, clamp(280px, 32vw, 420px));
  max-width: 100%;
  min-width: 240px;
  min-height: 260px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(12, 12, 18, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  overflow: hidden;
  flex: 0 1 auto;
  justify-self: start;
}

.hud-chat.is-chat-moving,
.hud-chat.is-chat-resizing {
  user-select: none;
}

.hud-chat-handle {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  line-height: 1;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  z-index: 5;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.hud-chat-handle:hover,
.hud-chat-handle:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  outline: none;
}

.hud-chat-handle--resize {
  top: 10px;
  right: 10px;
  cursor: nwse-resize;
}

.hud-chat-handle--resize::after {
  content: '\2197';
}

.hud-chat-handle--move {
  bottom: 10px;
  right: 10px;
  cursor: grab;
}

.hud-chat.is-chat-moving .hud-chat-handle--move {
  cursor: grabbing;
}

.hud-chat-handle--move::after {
  content: '\2630';
}

.hud-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.hud-chat-title {
  font-size: 1rem;
}

.hud-chat-status {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin-right: 36px;
}

.hud-chat-tabs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.hud-chat-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.hud-chat-tab.is-active {
  background: linear-gradient(135deg, rgba(242, 153, 74, 0.35), rgba(242, 201, 76, 0.35));
  border-color: rgba(242, 201, 76, 0.6);
  color: #ffe9c0;
}

.hud-chat-tab:hover {
  transform: none;
  box-shadow: none;
}

.hud-chat-tab:not(.is-active):hover {
  background: rgba(255, 255, 255, 0.12);
}

.hud-chat-tab[hidden] {
  display: none;
}

.hud-chat-panels {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.hud-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.hud-chat-messages.is-hidden {
  display: none;
}

.hud-chat-messages--logs {
  gap: 4px;
}

.hud-chat-message {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
  line-height: 1.3;
}

.hud-log-message {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  border-left: 3px solid rgba(242, 201, 76, 0.6);
}

.hud-chat-message-human {
  color: #89c2ff;
}

.hud-chat-message-infernal {
  color: #ff8787;
}

.hud-chat-message-neutral {
  color: #f4f3f1;
}

.hud-chat-message-name {
  font-weight: 600;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-size: 0.95rem;
}

.hud-chat-message-name:hover,
.hud-chat-message-name:focus {
  text-decoration: underline;
}

.hud-chat-message-separator {
  color: inherit;
  margin: 0 4px 0 2px;
}

.hud-chat-message-text {
  color: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

.hud-chat-item-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  color: #f4f3f1;
}

.hud-chat-item-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 2px;
}

.hud-chat-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #ffe66d;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease;
  appearance: none;
}

.hud-chat-action:hover,
.hud-chat-action:focus-visible {
  background: rgba(255, 230, 109, 0.22);
  color: #fff8d2;
  border-color: rgba(255, 230, 109, 0.8);
  transform: translateY(-1px);
}

.hud-chat-action:focus-visible {
  outline: 2px solid rgba(255, 230, 109, 0.65);
  outline-offset: 2px;
}

.hud-chat-action.is-disabled,
.hud-chat-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(244, 243, 241, 0.75);
  transform: none;
}

.hud-chat-profile-popup {
  position: absolute;
  background: rgba(18, 22, 33, 0.95);
  color: #f4f3f1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  min-width: 160px;
  z-index: 3000;
  pointer-events: auto;
}

.hud-chat-profile-popup-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.hud-chat-profile-popup-row {
  font-size: 0.85rem;
  margin-top: 2px;
  color: rgba(244, 243, 241, 0.85);
}

.hud-chat-profile-popup-actions {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

.hud-chat-profile-popup-button {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.8rem;
  color: #f4f3f1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.hud-chat-profile-popup-button:hover,
.hud-chat-profile-popup-button:focus-visible {
  background: rgba(255, 230, 109, 0.28);
  border-color: rgba(255, 230, 109, 0.45);
  transform: translateY(-1px);
  outline: none;
}

.hud-chat-profile-popup-button:disabled,
.hud-chat-profile-popup-button[aria-disabled='true'] {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  transform: none;
}

.hud-chat-message.hud-chat-rank-1,
.hud-chat-message.hud-chat-rank-1 .hud-chat-message-name,
.hud-chat-message.hud-chat-rank-1 .hud-chat-message-text {
  color: #ffd700;
}

.hud-chat-message.hud-chat-rank-2,
.hud-chat-message.hud-chat-rank-2 .hud-chat-message-name,
.hud-chat-message.hud-chat-rank-2 .hud-chat-message-text {
  color: #c0c0c0;
}

.hud-chat-message.hud-chat-rank-3,
.hud-chat-message.hud-chat-rank-3 .hud-chat-message-name,
.hud-chat-message.hud-chat-rank-3 .hud-chat-message-text {
  color: #cd7f32;
}

.hud-chat-message.hud-chat-affinity-party,
.hud-chat-message.hud-chat-affinity-party .hud-chat-message-name,
.hud-chat-message.hud-chat-affinity-party .hud-chat-message-text {
  color: #4ade80;
}

.hud-chat-message.hud-chat-affinity-guild,
.hud-chat-message.hud-chat-affinity-guild .hud-chat-message-name,
.hud-chat-message.hud-chat-affinity-guild .hud-chat-message-text {
  color: #c084fc;
}

.hud-chat-message.hud-chat-message-guild-level-up,
.hud-chat-message.hud-chat-message-guild-level-up .hud-chat-message-name,
.hud-chat-message.hud-chat-message-guild-level-up .hud-chat-message-text {
  color: #60a5fa;
  font-weight: 700;
}

.hud-chat-message.hud-chat-message-guild-welcome,
.hud-chat-message.hud-chat-message-guild-welcome .hud-chat-message-name,
.hud-chat-message.hud-chat-message-guild-welcome .hud-chat-message-text {
  color: #6df2a7;
  font-weight: 700;
}

.hud-chat-composer {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-right: 40px;
}

.hud-chat-composer.is-hidden {
  display: none;
}

.hud-chat-composer input {
  flex: 1;
}

.hud-chat-composer button {
  min-width: 80px;
}

.hud-chat-composer .hud-chat-send-button {
  min-width: 80px;
}

.hud-chat-composer .hud-chat-emote-button {
  min-width: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, rgba(58, 62, 78, 0.9), rgba(32, 36, 48, 0.9));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.hud-chat-composer .hud-chat-emote-button:hover,
.hud-chat-composer .hud-chat-emote-button:focus-visible,
.hud-chat-composer .hud-chat-emote-button.is-active {
  background: linear-gradient(180deg, rgba(84, 136, 255, 0.95), rgba(38, 74, 158, 0.95));
  border-color: rgba(143, 187, 255, 0.9);
  outline: none;
}

.hud-chat-composer .hud-chat-emote-button:focus-visible {
  box-shadow: 0 0 0 2px rgba(143, 187, 255, 0.65);
}

.hud-chat-composer .hud-chat-emote-button img {
  max-width: 24px;
  max-height: 24px;
}

.hud-chat-emote-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hud-chat-emote-window {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(15, 17, 27, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
  min-width: 200px;
  max-width: 420px;
  pointer-events: auto;
  z-index: 12;
}

.hud-chat-emote-window.is-hidden {
  display: none;
}

.hud-chat-emote-header {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.hud-chat-emote-status {
  font-size: 0.85rem;
  color: rgba(214, 226, 255, 0.9);
}

.hud-chat-emote-status.is-hidden {
  display: none;
}

.hud-chat-emote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}

.hud-chat-emote-grid::-webkit-scrollbar {
  width: 8px;
}

.hud-chat-emote-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

.hud-chat-emote-option {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background-color: rgba(30, 32, 46, 0.85);
  background-repeat: no-repeat;
  background-position: 0% 0%;
  background-size: 300% 100%;
  /* Background animation frames are advanced via HUD JavaScript to match in-world timing. */
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.hud-chat-emote-option:hover,
.hud-chat-emote-option:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(143, 187, 255, 0.75);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45);
  outline: none;
}

.hud-chat-emote-option:focus-visible {
  box-shadow: 0 0 0 2px rgba(143, 187, 255, 0.65), 0 12px 24px rgba(0, 0, 0, 0.5);
}

.logged-in-container h2 {
  text-align: center;
  margin-bottom: 12px;
}

.faction-selection {
  position: relative;
  display: flex;
  height: 100%;
}

.faction-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  background: #0b0c12;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, filter 0.25s ease;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fdfdfd;
}

.faction-button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 12, 18, 0.35), rgba(12, 12, 18, 0.65));
  transition: opacity 0.25s ease;
}

.faction-button:hover::after,
.faction-button:focus-visible::after {
  opacity: 0.2;
}

.faction-button.pending {
  filter: grayscale(0.4);
}

.faction-button-label {
  position: relative;
  z-index: 1;
  font-size: clamp(1.5rem, 2.5vw, 3rem);
  font-weight: 700;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.8);
}

.faction-selection-heading {
  position: absolute;
  top: 5vh;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
}

.faction-selection-heading h1 {
  margin-bottom: 8px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  text-shadow: -1px 0 0 #000, 1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000;
}

.faction-selection-heading p {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.4rem);
  text-shadow: -1px 0 0 #000, 1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000;
}

.hud-dps-meter {
  position: absolute;
  top: clamp(120px, 18vh, 260px);
  right: 24px;
  width: clamp(240px, 26vw, 320px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px 20px;
  border-radius: 18px;
  background: linear-gradient(185deg, rgba(12, 18, 28, 0.92), rgba(6, 9, 15, 0.9));
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.48);
  color: #f5f7fb;
  pointer-events: auto;
  z-index: 6;
}

.hud-dps-meter.is-hidden {
  display: none;
}

.hud-dps-meter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: move;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.hud-dps-meter-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8fd3ff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.hud-dps-meter-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hud-dps-meter-entry {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(9, 13, 21, 0.82), rgba(5, 8, 14, 0.9));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 12px 18px rgba(0, 0, 0, 0.45);
}

.hud-dps-meter-entry-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.hud-dps-meter-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #f5f7fb;
}

.hud-dps-meter-value {
  font-size: 0.74rem;
  font-weight: 600;
  color: #8fd3ff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.hud-dps-meter-bar {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.hud-dps-meter-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(143, 211, 255, 0.92), rgba(103, 255, 144, 0.92));
  box-shadow: 0 10px 18px rgba(143, 211, 255, 0.24);
  transition: width 0.2s ease;
}

.hud-dps-meter-empty {
  padding: 12px 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(245, 247, 251, 0.65);
}

@media (max-width: 960px) {
  .hud-dps-meter {
    top: clamp(90px, 14vh, 220px);
    right: 12px;
    width: clamp(220px, 60vw, 320px);
  }
}

.faction-selection-error {
  position: absolute;
  bottom: 4vh;
  left: 0;
  right: 0;
  text-align: center;
  color: #ffb4b4;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

@media (max-width: 768px) {
  .faction-selection {
    flex-direction: column;
  }

  .faction-button {
    height: 50%;
  }

  .faction-selection-heading {
    top: 3vh;
  }
}

/*
 * Styling for the floating preview panel that showcases the new eight
 * direction sprite sheet animations. The panel intentionally mirrors the
 * existing HUD aesthetic so it feels like a native diagnostic tool.
 */
.new-sprite-preview-window {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 5000;
  width: min(700px, 90vw);
  max-height: 90vh;
  overflow: auto;
  background: rgba(14, 21, 35, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
  padding: 16px;
  backdrop-filter: blur(12px);
}

.new-sprite-preview-header {
  margin-bottom: 12px;
}

.new-sprite-preview-header h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.new-sprite-preview-header p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.new-sprite-preview-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.new-sprite-preview-section h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: #f1c27d;
}

.new-sprite-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.new-sprite-preview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 12px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.new-sprite-preview-canvas {
  image-rendering: pixelated;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.85);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.new-sprite-preview-label {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
}
