/* SKUNKWORKS: SURVIVAL OPS - RuneScape meets ARK */

* {
  box-sizing: border-box;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  margin: 0;
  padding: 0;
}

body {
  background: #000;
  color: #00ff41;
  cursor: crosshair;
  font-family: 'Courier New', monospace;
}

/* Map container - wraps minimap + home button */
.map-container {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: fixed;
  right: 12px;
  top: 12px;
  z-index: 10;
}

/* Home button - under minimap */
.home-btn {
  background: rgb(0 0 0 / 85%);
  border: 1px solid #00aa2b;
  color: #00aa2b;
  cursor: pointer;
  display: block;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  pointer-events: auto;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: all 0.2s;
  width: 100%;
}

.home-btn:hover {
  background: #00ff41;
  border-color: #00ff41;
  box-shadow: 0 0 10px #00ff41;
  color: #000;
}

/* stylelint-disable-next-line selector-id-pattern, selector-max-id */
#gameCanvas {
  background: #1a1a1a;
  cursor: crosshair;
  display: block;
  touch-action: none;
}

.hud {
  pointer-events: none;
  position: fixed;
  z-index: 10;
}

.stats-panel {
  background: rgb(0 0 0 / 90%);
  border: 2px solid #00ff41;
  left: 12px;
  min-width: 220px;
  padding: 10px 12px;
  position: fixed;
  top: 12px;
}

.stats-header {
  align-items: center;
  border-bottom: 1px solid #00aa2b;
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  padding-bottom: 6px;
}

.stats-title {
  color: #39ff14;
  font-size: 13px;
}

.stats-level {
  color: #00ffff;
  font-size: 10px;
  margin-bottom: 6px;
}

.stat-bar {
  margin: 5px 0;
}

.stat-label {
  color: #0ff;
  display: flex;
  font-size: 10px;
  justify-content: space-between;
  margin-bottom: 2px;
}

.bar-container {
  background: #1a1a1a;
  border: 1px solid #00aa2b;
  height: 14px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.bar-fill {
  height: 100%;
  transition: width 0.3s;
}

.bar-fill.health {
  background: linear-gradient(to right, #dc2626, #ef4444);
}

.bar-fill.stamina {
  background: linear-gradient(to right, #eab308, #fbbf24);
}

.bar-fill.hunger {
  background: linear-gradient(to right, #f97316, #fb923c);
}

.bar-fill.thirst {
  background: linear-gradient(to right, #0284c7, #38bdf8);
}

.bar-fill.xp {
  background: linear-gradient(to right, #7c3aed, #a855f7);
}

.hotbar {
  background: rgb(0 0 0 / 90%);
  border: 3px solid #00ff41;
  bottom: 20px;
  display: flex;
  gap: 5px;
  left: 50%;
  padding: 10px;
  position: fixed;
  transform: translateX(-50%);
}

.hotbar-slot {
  align-items: center;
  background: #0a0a0a;
  border: 2px solid #00aa2b;
  color: #0ff;
  cursor: pointer;
  display: flex;
  font-size: 10px;
  height: 60px;
  justify-content: center;
  pointer-events: auto;
  position: relative;
  width: 60px;
}

.hotbar-slot.active {
  border-color: #39ff14;
  box-shadow: 0 0 10px #00ff41;
}

.hotbar-slot--drag-over {
  border-color: #ffd700 !important;
  box-shadow: 0 0 15px #ffd700 !important;
  background: rgba(255, 215, 0, 0.1) !important;
}

.hotbar-slot .key {
  color: #666;
  font-size: 10px;
  left: 4px;
  position: absolute;
  top: 2px;
}

.hotbar-slot .count {
  bottom: 2px;
  color: #39ff14;
  font-size: 10px;
  position: absolute;
  right: 4px;
}

.inventory-panel {
  background: rgb(0 0 0 / 95%);
  border: 3px solid #00ff41;
  display: none;
  left: 50%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
  pointer-events: auto;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
}

.inventory-panel.visible {
  display: block;
}

.inventory-title {
  border-bottom: 2px solid #00ff41;
  color: #39ff14;
  font-size: 18px;
  margin-bottom: 15px;
  padding-bottom: 10px;
}

.inventory-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(8, 70px);
  margin-bottom: 20px;
}

.inventory-slot {
  align-items: center;
  background: #0a0a0a;
  border: 2px solid #00aa2b;
  color: #0ff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font-size: 9px;
  height: 70px;
  justify-content: center;
  padding: 4px;
  position: relative;
  text-align: center;
  width: 70px;
}

.inventory-slot:hover {
  border-color: #39ff14;
}

.inventory-slot .item-count {
  bottom: 4px;
  color: #39ff14;
  font-size: 11px;
  font-weight: bold;
  position: absolute;
  right: 4px;
}

/* Sprite icon styling */
.item-icon {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  margin-bottom: 2px;
}

/* Consumable indicator */
.inventory-slot--consumable {
  border-color: #ffd700;
}

.inventory-slot--consumable:hover {
  box-shadow: 0 0 8px #ffd700;
}

.consumable-hint {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 6px;
  color: #ffd700;
  background: rgba(0, 0, 0, 0.7);
  padding: 1px 3px;
  border-radius: 2px;
  pointer-events: none;
}

/* Hotbar icon styling */
.hotbar-icon {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  margin-bottom: 2px;
}

.hotbar-label {
  font-size: 8px;
  color: #0ff;
  text-align: center;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* God mode indicator (HUD) */
.god-mode-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100px);
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #ffd700;
  color: #ffd700;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  pointer-events: none;
  z-index: 1000;
}

/* ===== CRAFTING PANEL ===== */
.crafting-panel {
  background: rgb(0 0 0 / 95%);
  border: 3px solid #00ff41;
  display: none;
  max-height: 85vh;
  overflow-y: auto;
  padding: 12px;
  pointer-events: auto;
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 380px;
}

.crafting-panel.visible {
  display: flex;
  flex-direction: column;
}

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

.crafting-close {
  background: transparent;
  border: 1px solid #dc2626;
  color: #dc2626;
  cursor: pointer;
  font-size: 11px;
  margin: 0;
  padding: 4px 8px;
}

.crafting-close:hover {
  background: #dc2626;
  color: #000;
}

/* Station Tabs */
.station-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.station-tab {
  background: #0a0a0a;
  border: 1px solid #00aa2b;
  color: #00aa2b;
  cursor: pointer;
  font-size: 10px;
  padding: 4px 8px;
  transition: all 0.2s;
}

.station-tab:hover {
  border-color: #39ff14;
  color: #39ff14;
}

.station-tab.active {
  background: #00aa2b;
  border-color: #00ff41;
  color: #000;
}

.station-icon {
  font-size: 12px;
}

/* Recipe Search */
.recipe-search {
  background: #0a0a0a;
  border: 1px solid #00aa2b;
  color: #00ff41;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  outline: none;
  padding: 6px 8px;
  text-transform: uppercase;
  width: 100%;
}

.recipe-search:focus {
  border-color: #39ff14;
  box-shadow: 0 0 6px rgb(0 255 65 / 30%);
}

.recipe-search::placeholder {
  color: #00aa2b;
  opacity: 60%;
}

/* Category Filter */
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.category-btn {
  background: transparent;
  border: 1px solid #333;
  color: #666;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 9px;
  letter-spacing: 0.05em;
  padding: 2px 6px;
}

.category-btn:hover {
  border-color: #00aa2b;
  color: #00aa2b;
}

.category-btn.active {
  background: #00aa2b;
  border-color: #00ff41;
  color: #000;
}

/* Crafting Queue */
.crafting-queue {
  border-bottom: 1px solid #333;
  margin-bottom: 8px;
  padding-bottom: 8px;
}

.queue-empty {
  color: #333;
  font-size: 10px;
  text-align: center;
}

.queue-item {
  margin-bottom: 6px;
}

.queue-item-info {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}

.queue-item-name {
  color: #0ff;
  font-size: 10px;
}

.queue-item-pct {
  color: #39ff14;
  font-size: 10px;
}

.queue-cancel {
  color: #dc2626;
  cursor: pointer;
  font-size: 12px;
  margin-left: 8px;
}

.queue-cancel:hover {
  color: #f87171;
  text-shadow: 0 0 6px #dc2626;
}

.queue-bar-container {
  background: #1a1a1a;
  border: 1px solid #333;
  height: 8px;
  overflow: hidden;
  width: 100%;
}

.queue-bar-fill {
  background: linear-gradient(to right, #00aa2b, #39ff14);
  height: 100%;
  transition: width 0.3s;
}

/* Recipe List */
.recipe-list {
  flex: 1;
  overflow-y: auto;
}

.recipe {
  background: #0a0a0a;
  border: 2px solid #00aa2b;
  cursor: pointer;
  margin-bottom: 6px;
  padding: 8px;
  transition: border-color 0.2s;
}

.recipe:hover {
  border-color: #39ff14;
}

.recipe.locked {
  cursor: not-allowed;
  opacity: 60%;
}

.recipe.hidden-recipe {
  border-color: #333;
  opacity: 40%;
}

.recipe-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.recipe-name {
  color: #39ff14;
  font-size: 12px;
}

.recipe-time {
  color: #666;
  font-size: 10px;
}

.recipe-cost {
  color: #0ff;
  display: flex;
  flex-wrap: wrap;
  font-size: 10px;
  gap: 4px 10px;
}

.recipe-cost .insufficient {
  color: #dc2626;
}

.recipe-stats {
  color: #ffd700;
  font-size: 10px;
  margin-top: 3px;
}

.recipe-lock {
  color: #dc2626;
  font-size: 9px;
  margin-top: 3px;
}

.message {
  background: rgb(0 0 0 / 95%);
  border: 3px solid #00ff41;
  color: #39ff14;
  display: none;
  font-size: 16px;
  left: 50%;
  padding: 20px 40px;
  position: fixed;
  text-align: center;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
}

.message.visible {
  animation: fadeOut 2s forwards;
  display: block;
}

/* stylelint-disable-next-line keyframes-name-pattern */
@keyframes fadeOut {
  0%,
  70% {
    opacity: 100%;
  }

  100% {
    display: none;
    opacity: 0%;
  }
}

.controls-hint {
  background: rgb(0 0 0 / 85%);
  border: 2px solid #00aa2b;
  bottom: 90px;
  color: #00aa2b;
  font-size: 10px;
  left: 12px;
  padding: 0;
  pointer-events: auto;
  position: fixed;
}

.controls-toggle {
  color: #00ffff;
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 6px 10px;
  user-select: none;
}

.controls-toggle:hover {
  color: #39ff14;
}

.controls-list {
  display: none;
  padding: 0 10px 8px;
}

.controls-list div {
  margin-bottom: 3px;
}

.controls-hint.expanded .controls-list {
  display: block;
}

.controls-hint.expanded .controls-toggle::after {
  content: ' ▼';
}

.map-indicator {
  background: rgb(0 0 0 / 90%);
  border: 2px solid #00ff41;
  height: 220px;
  overflow: hidden;
  padding: 6px;
  position: static;
  width: 220px;
}

.minimap {
  background: #0a0a0a;
  border: 1px solid #00aa2b;
  overflow: hidden;
  cursor: pointer;
  height: 100%;
  pointer-events: auto;
  position: relative;
  transition: box-shadow 0.2s;
  width: 100%;
}

.minimap:hover {
  box-shadow: 0 0 12px rgb(0 255 65 / 50%);
}
.minimap-info {
  color: #00ff41;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
  margin-top: 4px;
  text-align: center;
  text-shadow: 0 0 4px rgb(0 255 65 / 50%);
  text-transform: uppercase;
}

.player-dot {
  background: #39ff14;
  border-radius: 50%;
  box-shadow: 0 0 5px #00ff41;
  height: 6px;
  position: absolute;
  width: 6px;
}

button {
  background: #00aa2b;
  border: 2px solid #00ff41;
  color: #000;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  margin: 5px;
  padding: 8px 16px;
  pointer-events: auto;
}

button:hover {
  background: #39ff14;
  box-shadow: 0 0 10px #00ff41;
}

button:disabled {
  cursor: not-allowed;
  opacity: 50%;
}

/* Mobile Controls */
.mobile-controls {
  bottom: 0;
  display: none;
  height: 250px;
  left: 0;
  pointer-events: none;
  position: fixed;
  width: 100%;
  z-index: 1000;
}

.mobile-controls.visible {
  display: block;
}

.joystick-container {
  bottom: 40px;
  height: 100px;
  left: 40px;
  pointer-events: auto;
  position: absolute;
  width: 100px;
}

.joystick-base {
  background: rgb(0 255 65 / 30%);
  border: 3px solid rgb(0 255 65 / 50%);
  border-radius: 50%;
  box-shadow: 0 0 10px rgb(0 255 65 / 30%);
  height: 100px;
  position: absolute;
  width: 100px;
}

.joystick-knob {
  background: rgb(0 255 65 / 60%);
  border: 3px solid #00ff41;
  border-radius: 50%;
  box-shadow: 0 0 15px #00ff41;
  height: 40px;
  left: 50%;
  position: absolute;
  top: 50%;
  touch-action: none;
  transform: translate(-50%, -50%);
  transition: all 0.1s ease-out;
  width: 40px;
}

.action-buttons {
  bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  pointer-events: auto;
  position: absolute;
  right: 40px;
}

.action-button {
  align-items: center;
  background: rgb(0 255 65 / 30%);
  border: 3px solid rgb(0 255 65 / 50%);
  border-radius: 50%;
  box-shadow: 0 0 10px rgb(0 255 65 / 30%);
  color: #00ff41;
  cursor: pointer;
  display: flex;
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: bold;
  height: 60px;
  justify-content: center;
  touch-action: none;
  user-select: none;
  width: 60px;
}

.action-button:active,
.action-button.active {
  background: rgb(0 255 65 / 50%);
  box-shadow: 0 0 20px #00ff41;
}

/* Analytics Dashboard */
.analytics-dashboard {
  background: rgb(0 0 0 / 95%);
  border: 3px solid #00ff41;
  box-shadow: 0 0 20px rgb(0 255 65 / 30%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 15px;
  pointer-events: auto;
  position: fixed;
  right: 20px;
  top: 240px;
  width: 280px;
  z-index: 1001;
}

.analytics-header {
  align-items: center;
  border-bottom: 2px solid #00ff41;
  color: #39ff14;
  display: flex;
  font-size: 16px;
  font-weight: bold;
  justify-content: space-between;
  letter-spacing: 2px;
  margin-bottom: 12px;
  padding-bottom: 8px;
}

.analytics-title {
  color: #39ff14;
  text-shadow: 0 0 10px #00ff41;
}

.analytics-close {
  color: #dc2626;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.2s;
}

.analytics-close:hover {
  color: #f87171;
  text-shadow: 0 0 10px #dc2626;
}

.analytics-content {
  color: #0ff;
  font-size: 11px;
}

.analytics-section {
  margin-bottom: 15px;
}

.section-title {
  border-bottom: 1px solid #00aa2b;
  color: #39ff14;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 6px;
  padding-bottom: 4px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  padding: 2px 0;
}

.stat-row span:first-child {
  color: #00aa2b;
}

.stat-row span:last-child {
  color: #39ff14;
  font-weight: bold;
}

/* stylelint-disable-next-line selector-id-pattern, selector-max-id */
#heatmapCanvas {
  background: #0a0a0a;
  border: 2px solid #00aa2b;
  cursor: crosshair;
  display: block;
  height: 200px;
  margin-top: 8px;
  width: 200px;
}

.analytics-actions {
  border-top: 2px solid #00aa2b;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
}

.analytics-button {
  background: #00aa2b;
  border: 2px solid #00ff41;
  color: #000;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: bold;
  margin: 0;
  padding: 8px 12px;
  pointer-events: auto;
  text-transform: uppercase;
  transition: all 0.2s;
  width: 100%;
}

.analytics-button:hover {
  background: #39ff14;
  box-shadow: 0 0 15px rgb(0 255 65 / 50%);
  transform: translateY(-2px);
}

.analytics-button.clear {
  background: #7f1d1d;
  border-color: #dc2626;
  color: #fef2f2;
}

.analytics-button.clear:hover {
  background: #dc2626;
  box-shadow: 0 0 15px rgb(220 38 38 / 50%);
}

/* ===== FULLSCREEN MAP MODAL ===== */
.map-modal {
  align-items: center;
  background: rgb(0 0 0 / 85%);
  display: none;
  inset: 0;
  justify-content: center;
  position: fixed;
  z-index: 9999;
}

.map-modal.visible {
  display: flex;
}

.map-modal-content {
  background: #000;
  border: 3px solid #00ff41;
  box-shadow: 0 0 30px rgb(0 255 65 / 30%);
  display: flex;
  flex-direction: column;
  max-height: 95vh;
  max-width: 95vw;
  padding: 16px;
}

.map-modal-header {
  align-items: center;
  border-bottom: 2px solid #00ff41;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
}

.map-modal-title {
  color: #39ff14;
  font-family: 'Courier New', monospace;
  font-size: 18px;
  letter-spacing: 0.15em;
  text-shadow: 0 0 10px #00ff41;
  text-transform: uppercase;
}

.map-modal-close {
  border: 2px solid #dc2626;
  color: #dc2626;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 2px 8px;
  transition: all 0.2s;
}

.map-modal-close:hover {
  background: #dc2626;
  box-shadow: 0 0 10px #dc2626;
  color: #000;
}

/* stylelint-disable-next-line selector-id-pattern, selector-max-id */
#mapCanvas {
  border: 2px solid #00ff41;
  cursor: crosshair;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  max-height: 70vh;
  max-width: 70vw;
}

.map-modal-legend {
  color: #00ff41;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  margin-top: 10px;
  text-transform: uppercase;
}

/* ===== CHARACTER SHEET / PAPER DOLL ===== */
.character-panel {
  background: rgb(0 0 0 / 95%);
  border: 3px solid #00ff41;
  box-shadow: 0 0 20px rgb(0 255 65 / 20%);
  display: none;
  left: 50%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 16px;
  pointer-events: auto;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 520px;
  z-index: 1001;
}

.character-panel.visible {
  display: block;
}

.character-panel__header {
  align-items: center;
  border-bottom: 2px solid #00ff41;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
}

.character-panel__title {
  color: #39ff14;
  font-size: 16px;
  letter-spacing: 0.15em;
  text-shadow: 0 0 10px #00ff41;
}

.character-panel__close {
  color: #dc2626;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 2px 6px;
  transition: all 0.2s;
}

.character-panel__close:hover {
  color: #f87171;
  text-shadow: 0 0 10px #dc2626;
}

/* Paper Doll Body */
.character-panel__body {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

/* Paper Doll Grid */
.paper-doll {
  flex: 1;
  min-width: 0;
}

.paper-doll__grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.paper-doll__row {
  align-items: center;
  display: flex;
  gap: 6px;
}

.paper-doll__row--center {
  justify-content: center;
}

.paper-doll__row--spread {
  justify-content: space-between;
}

.paper-doll__spacer {
  width: 60px;
}

.paper-doll__silhouette {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0.3;
}

.paper-doll__silhouette-head {
  background: #00ff41;
  border-radius: 50%;
  height: 16px;
  width: 16px;
}

.paper-doll__silhouette-body {
  background: #00ff41;
  border-radius: 2px;
  height: 24px;
  width: 12px;
}

/* Equipment Slots */
.eq-slot {
  align-items: center;
  background: #0a0a0a;
  border: 2px dashed #333;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 52px;
  justify-content: center;
  min-width: 60px;
  padding: 4px;
  position: relative;
  transition: all 0.2s;
  width: 60px;
}

.eq-slot:hover {
  border-color: #00ff41;
}

.eq-slot--small {
  height: 40px;
  min-width: 50px;
  width: 50px;
}

.eq-slot--placeholder {
  border-color: transparent;
  cursor: default;
  opacity: 0;
}

.eq-slot--filled {
  border-style: solid;
}

.eq-slot--valid-target {
  animation: pulse-glow 1s infinite;
  border-color: #00ffff !important;
  box-shadow: 0 0 8px rgb(0 255 255 / 50%) !important;
}

.eq-slot--drag-over {
  background: rgb(0 255 65 / 15%);
  border-color: #39ff14 !important;
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 4px rgb(0 255 255 / 30%);
  }

  50% {
    box-shadow: 0 0 12px rgb(0 255 255 / 60%);
  }
}

.eq-slot__label {
  color: #555;
  font-size: 8px;
  letter-spacing: 0.1em;
}

.eq-slot__name {
  font-size: 8px;
  font-weight: bold;
  letter-spacing: 0.05em;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.eq-slot__durability {
  background: #1a1a1a;
  border: 1px solid #333;
  bottom: 2px;
  height: 3px;
  left: 4px;
  overflow: hidden;
  position: absolute;
  right: 4px;
}

.eq-slot__durability-fill {
  background: #22c55e;
  height: 100%;
  transition: width 0.3s;
}

/* Attributes Panel */
.attributes-panel {
  border-left: 1px solid #333;
  flex-shrink: 0;
  padding-left: 12px;
  width: 140px;
}

.attributes-panel__title {
  border-bottom: 1px solid #00aa2b;
  color: #00ffff;
  font-size: 10px;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
  padding-bottom: 4px;
}

.attr-row {
  align-items: center;
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
  padding: 2px 0;
}

.attr-label {
  color: #00aa2b;
  font-size: 10px;
  width: 28px;
}

.attr-total {
  color: #39ff14;
  font-size: 12px;
  font-weight: bold;
  width: 24px;
}

.attr-base {
  color: #666;
  font-size: 9px;
  width: 20px;
}

.attr-bonus {
  font-size: 9px;
  font-weight: bold;
}

/* Derived Stats */
.derived-stats {
  border-top: 1px solid #333;
  margin-bottom: 12px;
  padding-top: 8px;
}

.derived-stats__title {
  border-bottom: 1px solid #00aa2b;
  color: #00ffff;
  font-size: 10px;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
  padding-bottom: 4px;
}

.derived-stats__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.derived-stat {
  align-items: center;
  background: #0a0a0a;
  border: 1px solid #333;
  display: flex;
  flex: 1 1 calc(33% - 8px);
  gap: 6px;
  min-width: 80px;
  padding: 4px 8px;
}

.derived-stat__label {
  color: #00aa2b;
  font-size: 9px;
}

.derived-stat__value {
  color: #39ff14;
  font-size: 11px;
  font-weight: bold;
}

/* Equipment Inventory (Backpack) */
.equipment-inventory {
  border-top: 1px solid #333;
  margin-bottom: 12px;
  padding-top: 8px;
}

.equipment-inventory__title {
  border-bottom: 1px solid #00aa2b;
  color: #00ffff;
  font-size: 10px;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
  padding-bottom: 4px;
}

.equipment-inventory__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.eq-inv-empty {
  color: #555;
  font-size: 10px;
  padding: 12px;
  text-align: center;
  width: 100%;
}

.eq-inv-item {
  background: #0a0a0a;
  border: 2px solid #333;
  cursor: grab;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 90px;
  padding: 6px;
  position: relative;
  transition: all 0.2s;
}

.eq-inv-item:hover {
  border-color: #00ff41;
}

.eq-inv-item--selected {
  background: rgb(0 255 255 / 10%);
  border-color: #00ffff !important;
  box-shadow: 0 0 8px rgb(0 255 255 / 40%);
}

.eq-inv-item__name {
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 0.05em;
}

.eq-inv-item__slot {
  color: #666;
  font-size: 8px;
}

/* Equipment Tooltip */
.eq-tooltip {
  background: rgb(0 0 0 / 95%);
  border: 2px solid #00ff41;
  box-shadow: 0 0 10px rgb(0 255 65 / 30%);
  font-size: 10px;
  left: 50%;
  max-width: 200px;
  padding: 10px;
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  z-index: 1002;
}

/* ===== DEBUG OVERLAY ===== */
.debug-overlay {
  background: rgb(0 0 0 / 90%);
  border: 2px solid #00ff41;
  box-shadow: 0 0 15px rgb(0 255 65 / 20%);
  color: #00ff41;
  display: none;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  left: 12px;
  padding: 8px 10px;
  pointer-events: auto;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 220px;
  z-index: 1002;
}

.debug-overlay.visible {
  display: block;
}

.debug-header {
  align-items: center;
  border-bottom: 1px solid #00aa2b;
  color: #39ff14;
  display: flex;
  font-size: 11px;
  font-weight: bold;
  justify-content: space-between;
  letter-spacing: 1px;
  margin-bottom: 6px;
  padding-bottom: 4px;
}

.debug-close {
  color: #dc2626;
  cursor: pointer;
  font-size: 10px;
}

.debug-close:hover {
  color: #f87171;
}

.debug-section {
  border-bottom: 1px solid rgb(0 170 43 / 30%);
  margin-bottom: 6px;
  padding-bottom: 6px;
}

.debug-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.debug-label {
  color: #00ffff;
  font-size: 9px;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.debug-graph {
  align-items: flex-end;
  background: #0a0a0a;
  border: 1px solid rgb(0 170 43 / 40%);
  display: flex;
  gap: 1px;
  height: 24px;
  margin-top: 4px;
  overflow: hidden;
  padding: 2px;
}

.debug-budget-bar {
  background: #1a1a1a;
  border: 1px solid rgb(0 170 43 / 40%);
  height: 6px;
  margin-top: 3px;
  overflow: hidden;
}

.debug-budget-fill {
  height: 100%;
  transition: width 0.3s;
}

/* ===== MOBILE LAYOUT ===== */
@media (max-width: 768px) {
  /* HUD becomes a top-anchored flex column */
  .hud {
    align-items: flex-start;
    display: flex;
    flex-direction: row;
    gap: 4px;
    left: 0;
    padding: 0;
    right: 0;
    top: 0;
    width: 100%;
  }

  /* Compact stats panel - horizontal strip at top */
  .stats-panel {
    bottom: auto;
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: 4px 12px;
    left: auto;
    min-width: 0;
    padding: 6px 10px;
    position: static;
    right: auto;
    top: auto;
    width: auto;
  }

  .stats-header {
    display: none; /* hide "SURVIVAL OPS" header on mobile */
  }

  .stats-level {
    font-size: 9px !important;
    margin-bottom: 0 !important;
    width: 100%;
  }

  .stat-bar {
    flex: 1 1 calc(50% - 8px);
    margin: 0;
    min-width: 0;
  }

  .stat-label {
    font-size: 9px;
    margin-bottom: 2px;
  }

  .bar-container {
    height: 10px;
    border-width: 1px;
  }

  /* Temperature line at bottom of stats */
  .stats-panel > div:last-child {
    font-size: 9px !important;
    margin-top: 0 !important;
    width: 100%;
  }

  /* Map container - sits beside stats in the HUD row */
  .map-container {
    flex-shrink: 0;
    gap: 2px;
    position: static;
    right: auto;
    top: auto;
  }

  .map-indicator {
    border-width: 2px;
    height: 60px;
    padding: 3px;
    width: 60px;
  }

  /* Home button - compact under mini minimap */
  .home-btn {
    font-size: 8px;
    padding: 2px 6px;
  }

  /* Hide keyboard controls hint on mobile */
  .controls-hint {
    display: none;
  }

  /* Compact hotbar at bottom */
  .hotbar {
    border-width: 2px;
    bottom: 8px;
    gap: 2px;
    padding: 4px;
  }

  .hotbar-slot {
    font-size: 8px;
    height: 44px;
    width: 44px;
  }

  .hotbar-slot .key {
    font-size: 8px;
  }

  /* Mobile controls positioned above hotbar */
  .mobile-controls {
    bottom: 72px; /* above hotbar */
    height: 160px;
  }

  .joystick-container {
    bottom: 10px;
    height: 90px;
    left: 20px;
    width: 90px;
  }

  .joystick-base {
    height: 90px;
    width: 90px;
  }

  .joystick-knob {
    height: 36px;
    width: 36px;
  }

  .action-buttons {
    bottom: 10px;
    gap: 10px;
    right: 20px;
  }

  .action-button {
    font-size: 14px;
    height: 50px;
    width: 50px;
  }

  /* Compact panels on mobile */
  .inventory-panel {
    left: 5%;
    max-height: 70vh;
    padding: 12px;
    right: 5%;
    transform: translateY(-50%);
    width: 90%;
  }

  .inventory-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .inventory-slot {
    height: 56px;
    width: auto;
  }

  .crafting-panel {
    left: 3%;
    max-height: 75vh;
    right: 3%;
    width: 94%;
  }

  .station-tabs {
    gap: 3px;
  }

  .station-tab {
    font-size: 9px;
    padding: 3px 6px;
  }

  /* Analytics dashboard - hidden or minimal on mobile */
  .analytics-dashboard {
    display: none;
  }

  /* Debug overlay repositioned on mobile */
  .debug-overlay {
    left: 5%;
    right: 5%;
    top: auto;
    bottom: 100px;
    transform: none;
    width: auto;
  }

  /* Map modal - smaller on mobile */
  .map-modal-content {
    padding: 10px;
  }

  .map-modal-title {
    font-size: 14px;
  }

  /* stylelint-disable-next-line selector-id-pattern, selector-max-id */
  #mapCanvas {
    max-height: 60vh;
    max-width: 85vw;
  }

  .map-modal-legend {
    font-size: 10px;
  }

  /* Message popup - under status bar instead of center screen */
  .message {
    font-size: 12px;
    left: 50%;
    padding: 8px 16px;
    top: 90px;
    transform: translateX(-50%);
    width: 90%;
  }

  /* Character panel - full width on mobile */
  .character-panel {
    left: 2%;
    max-height: 85vh;
    padding: 10px;
    right: 2%;
    transform: translateY(-50%);
    width: 96%;
  }

  .character-panel__body {
    flex-direction: column;
    gap: 10px;
  }

  .attributes-panel {
    border-left: none;
    border-top: 1px solid #333;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding-left: 0;
    padding-top: 8px;
    width: 100%;
  }

  .attr-row {
    flex: 1 1 calc(50% - 12px);
    min-width: 0;
  }

  .eq-slot {
    height: 44px;
    min-width: 50px;
    width: 50px;
  }

  .eq-slot--small {
    height: 36px;
    min-width: 42px;
    width: 42px;
  }

  .paper-doll__spacer {
    width: 44px;
  }

  .derived-stat {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }

  .eq-inv-item {
    min-width: 80px;
  }
}

/* ===== QUEST DIALOG PANEL ===== */
.quest-dialog-panel {
  background: rgba(10, 5, 30, 0.98);
  border: 3px solid #7b68ee;
  box-shadow: 0 0 20px rgba(123, 104, 238, 0.3);
  display: none;
  left: 50%;
  max-width: 600px;
  min-width: 400px;
  padding: 0;
  pointer-events: auto;
  position: fixed;
  bottom: 80px;
  transform: translateX(-50%);
  width: min(600px, 90vw);
  z-index: 1002;
}

.quest-dialog-panel.visible {
  display: block;
}

.quest-dialog-panel.dragging {
  cursor: grabbing;
  user-select: none;
}

.quest-dialog-header {
  align-items: center;
  background: rgba(123, 104, 238, 0.1);
  border-bottom: 2px solid #7b68ee;
  cursor: grab;
  display: flex;
  justify-content: space-between;
  padding: 12px 15px;
}

.quest-dialog-header:active {
  cursor: grabbing;
}

.quest-dialog-npc {
  color: #c0b0ff;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 0.1em;
  text-shadow: 0 0 8px #7b68ee;
}

.quest-dialog-close {
  color: #dc2626;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 2px 6px;
  transition: all 0.2s;
}

.quest-dialog-close:hover {
  color: #f87171;
  text-shadow: 0 0 10px #dc2626;
}

.quest-dialog-body {
  max-height: 200px;
  overflow-y: auto;
  padding: 15px;
}

.quest-dialog-text {
  color: #e0d8ff;
  font-size: 12px;
  line-height: 1.6;
}

.quest-dialog-options {
  border-top: 1px solid rgba(123, 104, 238, 0.3);
  display: flex;
  gap: 10px;
  padding: 12px 15px;
}

.quest-option-btn {
  background: rgba(123, 104, 238, 0.2);
  border: 1px solid #7b68ee;
  color: #c0b0ff;
  cursor: pointer;
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 8px 12px;
  text-transform: uppercase;
  transition: all 0.2s;
}

.quest-option-btn:hover {
  background: rgba(123, 104, 238, 0.4);
  box-shadow: 0 0 8px rgba(123, 104, 238, 0.5);
}

.quest-option-btn:active {
  background: rgba(123, 104, 238, 0.6);
}

/* ===== QUEST LOG PANEL ===== */
.quest-log-panel {
  background: rgba(10, 5, 30, 0.98);
  border: 3px solid #7b68ee;
  box-shadow: 0 0 20px rgba(123, 104, 238, 0.3);
  display: none;
  left: 50%;
  max-height: 80vh;
  max-width: 700px;
  min-width: 500px;
  overflow-y: auto;
  padding: 0;
  pointer-events: auto;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(700px, 95vw);
  z-index: 1002;
}

.quest-log-panel.visible {
  display: block;
}

.quest-log-panel.dragging {
  cursor: grabbing;
  user-select: none;
}

.quest-log-header {
  align-items: center;
  background: rgba(123, 104, 238, 0.1);
  border-bottom: 2px solid #7b68ee;
  cursor: grab;
  display: flex;
  justify-content: space-between;
  padding: 12px 15px;
}

.quest-log-header:active {
  cursor: grabbing;
}

.quest-log-title {
  color: #c0b0ff;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 0.15em;
  text-shadow: 0 0 10px #7b68ee;
}

.quest-log-close {
  color: #dc2626;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 2px 6px;
  transition: all 0.2s;
}

.quest-log-close:hover {
  color: #f87171;
  text-shadow: 0 0 10px #dc2626;
}

.quest-log-body {
  padding: 15px 20px;
}

.quest-log-reputation {
  border-bottom: 1px solid rgba(123, 104, 238, 0.3);
  color: #9b88ff;
  font-size: 12px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  text-align: center;
}

.quest-log-reputation div {
  margin: 4px 0;
}

.quest-log-list {
  font-size: 13px;
}

.quest-log-item {
  margin-bottom: 20px;
}

.quest-log-item-header {
  font-weight: bold;
  margin-bottom: 8px;
}

.quest-log-item-objective {
  color: #ccc;
  font-size: 11px;
  margin-left: 20px;
  margin-top: 6px;
}

.quest-log-footer {
  border-top: 1px solid rgba(123, 104, 238, 0.3);
  color: #666;
  font-size: 10px;
  padding: 8px;
  text-align: center;
}

/* ===== TRANSLATION PUZZLE PANEL ===== */
.translation-panel {
  background: rgba(10, 5, 30, 0.98);
  border: 3px solid #c0b0ff;
  box-shadow: 0 0 20px rgba(192, 176, 255, 0.3);
  display: none;
  left: 50%;
  max-width: 500px;
  min-width: 400px;
  padding: 0;
  pointer-events: auto;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(500px, 90vw);
  z-index: 1003;
}

.translation-panel.visible {
  display: block;
}

.translation-header {
  align-items: center;
  background: rgba(192, 176, 255, 0.1);
  border-bottom: 2px solid #c0b0ff;
  display: flex;
  justify-content: space-between;
  padding: 12px 15px;
}

.translation-title {
  color: #c0b0ff;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 0.1em;
  text-shadow: 0 0 8px #c0b0ff;
}

.translation-close {
  color: #dc2626;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 2px 6px;
  transition: all 0.2s;
}

.translation-close:hover {
  color: #f87171;
  text-shadow: 0 0 10px #dc2626;
}

.translation-body {
  padding: 20px;
  text-align: center;
}

.translation-glyph {
  color: #ffd700;
  font-size: 48px;
  font-weight: bold;
  margin: 20px 0;
  text-shadow: 0 0 15px #ffd700;
}

.translation-hint {
  color: #9b88ff;
  font-size: 11px;
  margin-bottom: 20px;
}

.translation-input {
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #7b68ee;
  color: #e0d8ff;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  margin: 20px 0;
  padding: 10px;
  text-align: center;
  width: 100%;
}

.translation-input:focus {
  border-color: #c0b0ff;
  box-shadow: 0 0 10px rgba(192, 176, 255, 0.5);
  outline: none;
}

.translation-instructions {
  color: #888;
  font-size: 10px;
  line-height: 1.6;
  margin-top: 15px;
}

/* Mobile adjustments for quest panels */
@media (max-width: 768px) {
  .quest-dialog-panel {
    bottom: 100px;
    min-width: 90vw;
    width: 90vw;
  }

  .quest-log-panel {
    max-height: 70vh;
    min-width: 95vw;
    width: 95vw;
  }

  .translation-panel {
    min-width: 90vw;
    width: 90vw;
  }
}
