/**
 * Casual Maze Game - Game Player UI & Canvas Overlay Styles
 */

.game-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #0d1117;
  user-select: none;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Top HUD Bar — Unified Firm Command Bar & Minimal Dropdown Menus (BL-117, BL-121, ADR-0031) */
:root {
  --top-bar-height: 42px;
}

.game-hud-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top-bar-height, 42px);
  padding: 0 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
  z-index: 100;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  background: rgba(11, 19, 38, 0.94);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.game-hud-top::-webkit-scrollbar {
  display: none;
}

.game-hud-top.hud-collapsed {
  transform: translateY(-100%);
  pointer-events: none;
}

.hud-island {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  pointer-events: auto;
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.hud-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm, 6px);
  padding: 0.18rem 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hud-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.hud-stat {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.hud-stat strong {
  color: var(--accent);
  font-weight: 700;
}

/* Elevation Badge */
.elevation-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--emerald);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.elevation-badge.overhead {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--accent);
}

/* Player Inventory HUD Bar & Item Slots */
.hud-inventory-card {
  min-height: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(100, 116, 139, 0.35);
  border-radius: var(--radius-sm, 6px);
  padding: 0 0.45rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.25s ease;
}

.hud-inventory-card.has-items {
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.25);
}

.inventory-icon {
  font-size: 0.88rem;
  line-height: 1;
}

.inventory-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.inventory-count-badge {
  font-size: 0.68rem;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 0.05rem 0.35rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.hud-inventory-card.has-items .inventory-count-badge {
  background: rgba(251, 191, 36, 0.2);
  color: var(--gold);
}

.inventory-list {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: nowrap;
}

.inventory-empty-slot {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.65;
  padding: 0.05rem 0.25rem;
}

/* Single-Button Popover Dropdowns in Top Bar (BL-121, ADR-0031) */
.hud-dropdown-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.hud-dropdown-trigger {
  font-size: 0.78rem !important;
  font-weight: 700;
  padding: 0.25rem 0.55rem !important;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  white-space: nowrap;
}

.hud-dropdown-trigger[aria-expanded="true"] {
  background: rgba(56, 189, 248, 0.25) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3) !important;
}

.hud-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 150;
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 190px;
  padding: 0.5rem;
  background: rgba(13, 19, 31, 0.96);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 16px rgba(56, 189, 248, 0.15);
  animation: dropdownSlideIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.hud-dropdown-menu.active {
  display: flex !important;
}

@keyframes dropdownSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hud-dropdown-header {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent, #38bdf8);
  padding: 0.15rem 0.35rem 0.35rem 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-dropdown-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.25rem 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hud-dropdown-section:last-child {
  border-bottom: none;
}

.hud-dropdown-sublabel {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hud-dropdown-menu .hud-quick-icons {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hud-dropdown-item {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 0.45rem;
  padding: 0.32rem 0.6rem !important;
  font-size: 0.78rem !important;
  border-radius: var(--radius-sm, 6px);
  white-space: nowrap;
}

.hud-dropdown-item.active {
  background: rgba(56, 189, 248, 0.2) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
}

.key-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text);
  animation: keyAcquire 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

.key-pill .key-name {
  font-size: 0.75rem;
  font-weight: 700;
}

.key-shape-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
  text-shadow: 0 0 4px currentColor;
}

body.high-contrast-mode .key-shape-badge {
  font-weight: 900;
  transform: scale(1.15);
}

@keyframes keyAcquire {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Real-Time Action Activity Feed (BL-81) */
.game-activity-feed {
  position: absolute;
  bottom: 4.2rem;
  left: 1rem;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 380px;
  max-width: calc(100vw - 2rem);
  pointer-events: auto;
}

.activity-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.6rem;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.12));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-sm, 6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.activity-feed-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent, #38bdf8);
  cursor: pointer;
  transition: color 0.15s ease;
}

.activity-feed-title:hover {
  color: #ffffff;
}

.activity-feed-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.feed-history-btn {
  background: transparent;
  border: none;
  font-size: 0.82rem;
  padding: 0 4px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.feed-history-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

.activity-filter-pills {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.feed-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted, #94a3b8);
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.feed-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.feed-pill.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 700;
}

.feed-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 0.8rem;
  padding: 0 4px;
  cursor: pointer;
  line-height: 1;
}

.feed-toggle-btn:hover {
  color: #ffffff;
}

.activity-feed-items {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.35rem;
  pointer-events: none;
}

.game-activity-feed.minimized .activity-feed-items {
  display: none;
}

.activity-log-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm, 6px);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.1));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  font-size: 0.82rem;
  color: var(--text, #f8fafc);
  line-height: 1.35;
  animation: activitySlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.4s ease, transform 0.4s ease, background 0.15s ease, border-color 0.15s ease;
  pointer-events: auto;
  cursor: pointer;
}

.activity-log-item:hover {
  background: rgba(30, 41, 59, 0.96);
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateX(3px);
}

.activity-log-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.activity-log-text {
  flex: 1;
  word-break: break-word;
}

.activity-log-item.lever-on {
  border-color: rgba(52, 211, 153, 0.6);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.25);
}

.activity-log-item.lever-off {
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.2);
}

.activity-log-item.key-event {
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.25);
}

.activity-log-item.door-event {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.activity-log-item.locked-warn {
  border-color: rgba(244, 63, 94, 0.7);
  background: rgba(45, 15, 20, 0.95);
  color: #fca5a5;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.3);
}

@keyframes activitySlideIn {
  0% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* In-Game Activity Log Modal */
.activity-modal-dialog {
  max-width: 620px;
  width: 92%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.activity-modal-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.6rem 0.85rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-modal-stats strong {
  color: var(--text);
  font-family: var(--font-mono);
}

.activity-filter-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.filter-btn.active {
  background: var(--accent);
  color: #0f172a;
  font-weight: 700;
  border-color: var(--accent);
}

.activity-modal-list {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-right: 0.25rem;
}

.log-entry-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.35;
}

.log-entry-row .log-time {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  white-space: nowrap;
  margin-top: 0.05rem;
}

.log-entry-row.key { border-left: 3px solid var(--gold); }
.log-entry-row.door { border-left: 3px solid var(--accent); }
.log-entry-row.lever { border-left: 3px solid var(--emerald); }
.log-entry-row.warning { border-left: 3px solid var(--rose); background: rgba(45, 15, 20, 0.5); }
.log-entry-row.step { border-left: 3px solid var(--text-muted); opacity: 0.8; }

.activity-empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* Minimap Container (Minimal Footprint, BL-121) */
.minimap-container {
  position: absolute;
  top: calc(var(--top-bar-height, 42px) + 8px);
  right: 0.75rem;
  background: rgba(11, 19, 38, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass-bright, rgba(56, 189, 248, 0.25));
  border-radius: var(--radius-md);
  padding: 0.35rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.minimap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0 0.15rem;
}

.minimap-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent, #38bdf8);
}

.minimap-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  width: 20px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: all 0.15s ease;
}
.minimap-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.minimap-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.minimap-container.is-minimized {
  padding: 0.25rem 0.55rem;
  cursor: pointer;
}
.minimap-container.is-minimized .minimap-body {
  display: none !important;
}

#minimap-canvas {
  display: block;
  border-radius: var(--radius-sm);
  cursor: crosshair;
  background: #05070a;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.minimap-hint {
  font-size: 0.62rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Controls Overlay / Help (Minimal & Toggleable, BL-121) */
.controls-hint-bar {
  position: absolute;
  bottom: 0.65rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 19, 38, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  z-index: 90;
  pointer-events: auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.controls-hint-bar.hidden {
  display: none !important;
}

.controls-hint-bar kbd {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 0.1rem 0.3rem;
  font-size: 0.68rem;
}

.btn-hint-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0 0.2rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.btn-hint-dismiss:hover {
  opacity: 1;
  color: #f43f5e;
}

/* Mobile Virtual D-Pad — Moveable & Top Positioned */
.virtual-controls {
  position: absolute;
  z-index: 150;
  display: none;
  touch-action: manipulation;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  user-select: none;
  transition: opacity 0.2s;
}

/* Default Docks: Top Not Bottom */
.virtual-controls[data-dock="top-left"] {
  top: 4.25rem;
  left: 1rem;
  bottom: auto;
  right: auto;
}
.virtual-controls[data-dock="top-right"] {
  top: 4.25rem;
  right: 1rem;
  bottom: auto;
  left: auto;
}
.virtual-controls[data-dock="bottom-left"] {
  bottom: 1.5rem;
  left: 1rem;
  top: auto;
  right: auto;
}
.virtual-controls[data-dock="bottom-right"] {
  bottom: 1.5rem;
  right: 1rem;
  top: auto;
  left: auto;
}

.virtual-controls.is-dragging {
  cursor: grabbing;
  opacity: 0.9;
  transition: none !important;
}

@media (max-width: 820px), (pointer: coarse) {
  .virtual-controls {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .controls-hint-bar {
    display: none;
  }
  .minimap-container {
    top: 4.25rem;
    bottom: auto;
    right: 0.75rem;
    padding: 0.35rem;
  }
  .minimap-container.is-minimized {
    padding: 0.25rem 0.5rem;
  }
  #minimap-canvas {
    width: 105px !important;
    height: 105px !important;
  }
}

.dpad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 5px 4px;
  cursor: grab;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2px;
}
.virtual-controls.is-dragging .dpad-header {
  cursor: grabbing;
}
.dpad-grip {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
  pointer-events: none;
}
.dpad-header-actions {
  display: flex;
  gap: 4px;
}
.dpad-tool-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  border-radius: 4px;
  font-size: 0.72rem;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}
.dpad-tool-btn:active {
  background: var(--accent);
  color: #04101e;
}

.dpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-rows: repeat(3, 48px);
  gap: 6px;
}

.virtual-controls.minimized .dpad-grid {
  display: none;
}

.dpad-btn {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  box-shadow: var(--shadow-md);
  transition: background 0.1s, transform 0.08s;
  touch-action: none;
}

.dpad-btn:active {
  background: var(--accent);
  color: #04101e;
  transform: scale(0.92);
}

.dpad-rot-l, .dpad-rot-r {
  font-size: 0.95rem;
  color: var(--text-muted, #94a3b8);
  background: rgba(30, 41, 59, 0.55);
}
.dpad-center {
  font-size: 0.72rem;
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--accent);
}
.dpad-more {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
}
.dpad-empty {
  pointer-events: none;
}

/* Mobile More Actions Drawer (BL-122) */
.mobile-more-drawer {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  width: 250px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  padding: 0.75rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  animation: mobileDrawerFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.virtual-controls[data-dock="bottom-left"] .mobile-more-drawer,
.virtual-controls[data-dock="bottom-right"] .mobile-more-drawer {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 6px;
}

.virtual-controls[data-dock="top-right"] .mobile-more-drawer,
.virtual-controls[data-dock="bottom-right"] .mobile-more-drawer {
  left: auto;
  right: 0;
}

.mobile-more-drawer.hidden {
  display: none !important;
}

@keyframes mobileDrawerFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.mobile-more-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.35rem;
}

.mobile-more-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.02em;
}

.btn-more-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-more-close:hover {
  color: #fff;
}

.mobile-more-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-more-section-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #94a3b8);
}

.mobile-more-row {
  display: flex;
  gap: 0.4rem;
}

.mobile-more-row .btn {
  flex: 1;
  padding: 0.35rem 0.4rem;
  font-size: 0.75rem;
  text-align: center;
  white-space: nowrap;
}

/* Pause Viewport Zoom Controls (BL-122) */
.pause-zoom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pause-zoom-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
}

.pause-zoom-btns {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Free Pan Banner */
.freepan-banner {
  position: absolute;
  top: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(56, 189, 248, 0.9);
  color: #04101e;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.4);
  z-index: 100;
  display: none;
  animation: bannerPulse 1.5s infinite;
}

.freepan-banner.active {
  display: block;
}

@keyframes bannerPulse {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.75; }
}

/* Victory Overlay Modal */
.victory-card {
  text-align: center;
}

.victory-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  display: inline-block;
  animation: bounce 1s infinite alternate ease-in-out;
}

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

.victory-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.5rem;
  margin: 0.85rem 0;
}

.stat-box {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md, 8px);
  padding: 0.5rem 0.6rem;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.stat-box:hover {
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

.stat-val {
  font-family: var(--font-mono, monospace);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent, #38bdf8);
  line-height: 1.2;
}

#vic-score {
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.25);
}

#vic-time {
  color: #38bdf8;
}

#vic-steps {
  color: #34d399;
}

#vic-secrets {
  color: #c084fc;
}

.stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-top: 0.2rem;
}

/* Tutorial Hint Card */
.tutorial-hint-card {
  position: absolute;
  top: 4.8rem;
  left: 1rem;
  max-width: 380px;
  background: rgba(22, 27, 34, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 105;
  transition: all 0.25s ease;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tutorial-hint-card.minimized {
  max-width: 200px;
  padding: 0.4rem 0.7rem;
}

.tutorial-hint-card.minimized .tutorial-hint-body {
  display: none;
}

.tutorial-hint-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}

.tutorial-hint-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent);
}

.tutorial-hint-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem;
  font-size: 0.8rem;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.tutorial-hint-toggle:hover {
  color: var(--text);
}

.tutorial-hint-body {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text);
  margin-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.45rem;
}

.tutorial-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: var(--gold);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Puzzle Minigame Modal (Rune Memory & Cipher Dials)
   ========================================================================== */
.puzzle-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 7, 10, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.2s ease-out;
}

.puzzle-modal-card {
  width: 100%;
  max-width: 440px;
  background: #0f172a;
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 24px rgba(168, 85, 247, 0.2);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.puzzle-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.puzzle-modal-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.puzzle-modal-title h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f3e8ff;
}

.puzzle-icon {
  font-size: 1.4rem;
}

.puzzle-close-btn {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: color 0.15s;
}

.puzzle-close-btn:hover {
  color: #ffffff;
}

.puzzle-modal-clue {
  background: rgba(168, 85, 247, 0.1);
  border-left: 3px solid #a855f7;
  padding: 0.65rem 0.85rem;
  border-radius: 4px;
  font-size: 0.88rem;
  color: #e9d5ff;
}

.puzzle-modal-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0;
}

/* Rune Memory Grid */
.memory-puzzle-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.rune-pips-bar {
  display: flex;
  gap: 0.6rem;
  font-size: 1.2rem;
}

.rune-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  width: 100%;
}

.rune-pad-btn {
  background: #1e293b;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  color: #ffffff;
}

.rune-pad-btn:hover {
  transform: translateY(-2px);
  border-color: var(--rune-color, #a855f7);
  box-shadow: 0 0 12px var(--rune-color, #a855f7);
}

.rune-pad-btn.rune-active-flash,
.rune-pad-btn.rune-active-press {
  border-color: var(--rune-color, #a855f7);
  box-shadow: 0 0 20px var(--rune-color, #a855f7);
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.05);
}

.rune-btn-icon {
  font-size: 1.7rem;
}

.rune-btn-label {
  font-weight: 700;
  font-size: 0.85rem;
}

.rune-btn-key {
  font-size: 0.72rem;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
}

/* Cipher Dials Row */
.cipher-puzzle-container {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0.5rem 0;
}

.cipher-dials-row {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.cipher-dial-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.dial-display {
  width: 74px;
  height: 74px;
  background: #1e293b;
  border: 2px solid var(--dial-color, #a855f7);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  color: #f3e8ff;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 12px rgba(168, 85, 247, 0.25);
  transition: border-color 0.2s, box-shadow 0.2s;
  user-select: none;
}

.celestial-dial .dial-symbol-icon {
  font-size: 1.7rem;
  line-height: 1.1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.celestial-dial .dial-symbol-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dial-color, #cbd5e1);
  margin-top: 2px;
}

.dial-arrow-btn {
  background: #334155;
  border: none;
  color: #f3e8ff;
  width: 38px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: background 0.15s;
}

.dial-arrow-btn:hover {
  background: #a855f7;
}

.puzzle-feedback {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: #cbd5e1;
  min-height: 1.4rem;
}

.puzzle-feedback.shake {
  animation: shakeAnim 0.35s ease-in-out;
}

@keyframes shakeAnim {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.puzzle-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.85rem;
}

/* ==========================================================================
   In-Game Pause & Action Menu Drawer
   ========================================================================== */
.pause-menu-dialog {
  max-width: 540px;
  width: 92%;
  background: var(--bg-glass-elevated);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid var(--border-glass-bright);
  box-shadow: var(--inset-highlight), 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 32px rgba(56, 189, 248, 0.18);
  border-radius: var(--radius-lg);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.pause-header {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pause-stats-banner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  background: rgba(10, 15, 28, 0.75);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  margin-bottom: 1.1rem;
  text-align: center;
}

.pause-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.pause-stat-lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.pause-stat-item strong {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--accent);
}

.pause-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow-y: auto;
  max-height: calc(85vh - 170px);
  padding-right: 0.2rem;
}

.pause-section-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pause-section-header {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  padding-left: 0.2rem;
  margin-bottom: 0.1rem;
}

.pause-action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

@media (max-width: 480px) {
  .pause-action-grid {
    grid-template-columns: 1fr;
  }
}

.pause-action-btn {
  width: 100%;
  padding: 0.65rem 0.95rem;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  text-align: left;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.pause-action-prominent {
  padding: 0.85rem 1.15rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.pause-action-btn span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pause-section-danger {
  margin-top: 0.2rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pause-confirm-box {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.25rem 0;
  animation: fadeIn 0.15s ease-out;
}

.pause-confirm-box.hidden {
  display: none !important;
}

.pause-confirm-msg {
  font-size: 0.82rem;
  color: #fca5a5;
  margin: 0;
  line-height: 1.4;
  font-weight: 500;
}

.pause-confirm-btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ==========================================================================
   Compass & Rotation Dial Widget
   ========================================================================== */
.rotation-control-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(10, 15, 28, 0.75);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.compass-badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 48px;
  text-align: center;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.15);
  transition: all 0.2s ease;
}

/* ==========================================================================
   Viewport Zoom Control Widget (BL-87)
   ========================================================================== */
.zoom-control-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(10, 15, 28, 0.75);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.zoom-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 44px;
  text-align: center;
  padding: 0.15rem 0.3rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.zoom-badge:hover {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.3);
}

/* ==========================================================================
   Victory Modal Animated Medals & Score Counters
   ========================================================================== */
.victory-card {
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-glass-elevated);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid var(--border-glass-bright);
  box-shadow: var(--inset-highlight), 0 24px 64px rgba(0, 0, 0, 0.85), 0 0 40px rgba(251, 191, 36, 0.2);
  border-radius: var(--radius-lg, 12px);
}

.victory-card .modal-body {
  padding: 1.25rem 1.5rem 0.75rem;
}

.victory-icon {
  font-size: 2.6rem;
  margin-bottom: 0.35rem;
  display: inline-block;
  animation: victoryFloat 2s ease-in-out infinite alternate;
}

@keyframes victoryFloat {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-6px) scale(1.06); }
}

.victory-medal-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  animation: medalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Streamlined Victory Footer & Collapsible Drawer (BL-109, ADR-0021) */
.victory-footer-streamlined {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
}

.victory-primary-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  flex-wrap: wrap;
}

.victory-btn-next {
  flex: 1 1 180px;
  min-width: 150px;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

.victory-key-hint {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.8;
  letter-spacing: 0.02em;
}

.victory-quick-icons {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.victory-icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border-radius: var(--radius-md, 8px);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: all 0.15s ease;
}

.victory-icon-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.victory-btn-more {
  padding: 0.65rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
}

.victory-btn-more.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.victory-more-drawer {
  width: 100%;
  animation: drawerSlideDown 0.2s ease-out;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.55rem;
}

@keyframes drawerSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.victory-more-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  width: 100%;
}

@media (max-width: 440px) {
  .victory-more-grid {
    grid-template-columns: 1fr;
  }
}

.victory-drawer-btn {
  width: 100%;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm, 6px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  color: var(--text, #f8fafc);
  transition: all 0.15s ease;
}

.victory-drawer-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(56, 189, 248, 0.25);
  color: var(--accent, #38bdf8);
}

/* Tiered Victory Medals (BL-52) */
.victory-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  animation: medalPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.victory-tier-badge.tier-gold {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(245, 158, 11, 0.4));
  border: 2px solid #fbbf24;
  color: #fde047;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.4), inset 0 0 8px rgba(251, 191, 36, 0.2);
}

.victory-tier-badge.tier-silver {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.25), rgba(203, 213, 225, 0.4));
  border: 2px solid #cbd5e1;
  color: #f1f5f9;
  box-shadow: 0 0 20px rgba(203, 213, 225, 0.3), inset 0 0 8px rgba(203, 213, 225, 0.2);
}

.victory-tier-badge.tier-bronze {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.25), rgba(217, 119, 6, 0.4));
  border: 2px solid #f59e0b;
  color: #fed7aa;
  box-shadow: 0 0 16px rgba(217, 119, 6, 0.25), inset 0 0 8px rgba(217, 119, 6, 0.15);
}

@keyframes medalPop {
  0% { transform: scale(0.3); opacity: 0; }
  80% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* Responsive HUD Collapse (BL-92, ADR-0010) */
.hud-collapse-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.15s ease, border-color 0.15s ease;
}

.game-hud-top.hud-collapsed .hud-breadcrumbs,
.game-hud-top.hud-collapsed .rotation-control-group,
.game-hud-top.hud-collapsed .zoom-control-group,
.game-hud-top.hud-collapsed .elevation-badge,
.game-hud-top.hud-collapsed .room-badge,
.game-hud-top.hud-collapsed .hud-stat:not(:first-child) {
  display: none !important;
}

.game-hud-top.hud-collapsed {
  gap: 0.35rem;
}

.game-hud-top.hud-collapsed .hud-island {
  padding: 0.2rem 0.45rem;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.game-hud-top.hud-collapsed .hud-card {
  padding: 0.2rem 0.4rem;
  gap: 0.3rem;
}

.game-hud-top.hud-collapsed .hud-collapse-toggle {
  transform: rotate(180deg);
  border-color: #38bdf8;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.2);
}

.hud-feed-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm, 6px);
  transition: all 0.15s ease;
}

.hud-feed-pill.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.22);
  color: #38bdf8;
}

/* Touch Navigation Pill (BL-116) */
.hud-touch-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.15s ease;
}

.hud-touch-pill.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.22);
  color: #38bdf8;
}

/* Streamlined Quick Action Cluster (BL-116, BL-117) */
.hud-action-cluster {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.hud-action-cluster .btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Tactical Radar Minimap Top Bar Pill (BL-117) */
.hud-minimap-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 0.85rem;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.15s ease;
}

.hud-minimap-pill.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.22);
  color: #38bdf8;
}

/* Centralized Floating Overlay Suppression when Modals are Active (BL-117, ADR-0029) */
.overlay-suppressed {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s ease !important;
}

/* Draggable Activity Feed State (BL-116) */
.activity-feed-header {
  cursor: grab;
  touch-action: none;
}

.game-activity-feed.is-dragging {
  cursor: grabbing !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), 0 0 16px rgba(56, 189, 248, 0.25);
  user-select: none;
  transition: none !important;
}

/* Responsive Island Collapse for Smaller Viewports */
@media (max-width: 900px) {
  .game-hud-top {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .hud-island {
    padding: 0.3rem 0.5rem;
  }
  .hide-mobile {
    display: none !important;
  }
}

/* Firm Top Bar and Mobile Overlay Collision Elimination (BL-117, BL-121, ADR-0031) */
:root {
  --top-bar-height: 42px;
}

@media (max-width: 768px) {
  .controls-hint-bar {
    display: none !important;
  }

  .game-hud-top.firm-top-bar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: var(--top-bar-height, 42px) !important;
    padding: 0 0.5rem !important;
    background: rgba(11, 19, 38, 0.96) !important;
    backdrop-filter: blur(14px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 0.35rem !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x !important;
    pointer-events: auto !important;
    z-index: 100 !important;
  }

  .game-hud-top.firm-top-bar::-webkit-scrollbar {
    display: none !important;
  }

  .game-hud-top.firm-top-bar .hud-island {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    gap: 0.25rem !important;
    flex-shrink: 0 !important;
  }

  .game-hud-top.firm-top-bar .hud-island-right {
    margin-left: auto;
  }

  .game-hud-top.firm-top-bar .hud-card {
    padding: 0.15rem 0.35rem !important;
    gap: 0.25rem !important;
  }

  .game-hud-top.firm-top-bar #hud-level-title {
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.78rem !important;
  }

  .game-hud-top.firm-top-bar .elevation-badge {
    font-size: 0.62rem !important;
    padding: 0.1rem 0.35rem !important;
  }

  .hud-breadcrumbs {
    display: none !important;
  }

  .game-hud-top > .hud-island > .rotation-control-group {
    display: none !important;
  }

  .game-hud-top > .hud-island > .zoom-control-group {
    display: none !important;
  }

  .hud-dropdown-menu .rotation-control-group,
  .hud-dropdown-menu .zoom-control-group {
    display: flex !important;
  }

  .hud-action-cluster {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.2rem !important;
  }

  .hud-action-cluster .btn-icon,
  .hud-action-cluster .hud-minimap-pill,
  .hud-action-cluster .hud-feed-pill {
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    font-size: 0.78rem !important;
  }

  .hud-stat:not(:first-child) {
    display: none !important;
  }

  /* Anchored below Firm Top Bar (BL-117, BL-121) */
  .minimap-container {
    top: calc(var(--top-bar-height, 42px) + 8px) !important;
    right: 0.5rem !important;
    max-width: 140px !important;
    z-index: 90 !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
  }

  .minimap-container.is-minimized {
    max-width: 80px !important;
  }

  /* Activity Feed comes from the top below firm bar, collapsible and movable (BL-116, BL-117) */
  .game-activity-feed {
    top: calc(var(--top-bar-height, 42px) + 8px) !important;
    bottom: auto !important;
    left: 0.5rem !important;
    width: min(290px, calc(100vw - 1rem)) !important;
    max-height: 180px !important;
    z-index: 95 !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease !important;
  }

  .contextual-interact-btn {
    right: 0.75rem !important;
    bottom: 4.5rem !important;
    z-index: 110 !important;
  }

  .hud-disambig-drawer {
    right: 0.75rem !important;
    bottom: 4.5rem !important;
    max-width: calc(100vw - 1.5rem) !important;
    z-index: 120 !important;
  }

  .virtual-controls[data-dock="top-left"] {
    top: calc(var(--top-bar-height, 42px) + 8px) !important;
    left: 0.5rem !important;
  }

  .virtual-controls[data-dock="top-right"] {
    top: calc(var(--top-bar-height, 42px) + 8px) !important;
    right: 0.5rem !important;
  }
}

/* Subtle In-World Tile [E] Overlay Indicator (BL-42, BL-93) */
.hud-tile-indicator {
  position: absolute;
  transform: translate(-50%, -50%) scale(clamp(0.75, var(--camera-zoom, 1), 1.35));
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(56, 189, 248, 0.9);
  border-radius: 50%;
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4), inset 0 0 6px rgba(56, 189, 248, 0.2);
  cursor: pointer;
  z-index: 125;
  pointer-events: auto;
  user-select: none;
  animation: pulseTileIndicator 1.8s ease-in-out infinite;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.hud-tile-count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 9999px;
  background: #38bdf8;
  color: #0f172a;
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
  border: 1px solid rgba(15, 23, 42, 0.8);
  pointer-events: none;
}

.hud-tile-count-badge.hidden {
  display: none !important;
}

.hud-tile-indicator:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translate(-50%, -50%) scale(calc(clamp(0.75, var(--camera-zoom, 1), 1.35) * 1.18));
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.8);
}

.hud-tile-indicator.hidden {
  display: none !important;
}

@keyframes pulseTileIndicator {
  0%, 100% {
    transform: translate(-50%, -50%) scale(clamp(0.75, var(--camera-zoom, 1), 1.35));
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
  }
  50% {
    transform: translate(-50%, -50%) scale(calc(clamp(0.75, var(--camera-zoom, 1), 1.35) * 1.12));
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.75);
  }
}

/* Discreet Side HUD Action Drawer (BL-42) */
.contextual-interact-btn {
  position: fixed;
  right: 1.5rem;
  bottom: 4.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.95rem;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1.5px solid rgba(56, 189, 248, 0.7);
  border-radius: var(--radius-full, 9999px);
  color: #f8fafc;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 14px rgba(56, 189, 248, 0.35);
  cursor: pointer;
  z-index: 120;
  white-space: nowrap;
  pointer-events: auto;
  user-select: none;
  animation: slideInSideAction 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.contextual-interact-btn.hidden {
  display: none !important;
}

.contextual-interact-btn:hover {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(56, 189, 248, 1);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7), 0 0 22px rgba(56, 189, 248, 0.6);
  transform: translateY(-2px) scale(1.03);
}

.contextual-interact-btn:active {
  transform: translateY(1px) scale(0.97);
}

.contextual-interact-btn .interact-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.contextual-interact-btn .interact-text-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.contextual-interact-btn .interact-label {
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
  color: #ffffff;
}

.contextual-interact-btn .interact-subtext {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 500;
}

.contextual-interact-btn .interact-badge {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 0.72rem;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: #38bdf8;
  line-height: 1.2;
}

/* Multi-Target Interaction Disambiguation (BL-85) */
.hud-tile-indicators-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 125;
}

.hud-tile-indicators-container.hidden {
  display: none !important;
}

.hud-disambig-pill {
  position: absolute;
  transform: translate(-50%, -50%) scale(clamp(0.75, var(--camera-zoom, 1), 1.35));
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(56, 189, 248, 0.75);
  border-radius: var(--radius-full, 9999px);
  color: #f8fafc;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: 0.72rem;
  font-weight: 600;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  white-space: nowrap;
  animation: pulseTileIndicator 1.8s ease-in-out infinite;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.hud-disambig-pill:hover {
  background: rgba(56, 189, 248, 0.3);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translate(-50%, -50%) scale(calc(clamp(0.75, var(--camera-zoom, 1), 1.35) * 1.1));
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.75);
}

.hud-disambig-pill-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #38bdf8;
  color: #0f172a;
  border-radius: 50%;
  font-family: var(--font-mono, monospace);
  font-weight: 800;
  font-size: 0.68rem;
}

.hud-disambig-pill-icon {
  font-size: 0.8rem;
  line-height: 1;
}

.hud-disambig-pill-label {
  color: #f1f5f9;
  font-weight: 600;
}

.hud-disambig-drawer {
  position: fixed;
  right: 1.5rem;
  bottom: 8.25rem;
  width: 260px;
  max-width: calc(100vw - 3rem);
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  border-radius: var(--radius-lg, 12px);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  z-index: 120;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 16px rgba(56, 189, 248, 0.2);
  animation: slideInSideAction 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-disambig-drawer.hidden {
  display: none !important;
}

.hud-disambig-header {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 0.25rem 0.25rem 0.25rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.hud-disambig-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.hud-disambig-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  color: #f1f5f9;
  font-size: 0.78rem;
  font-family: var(--font-sans, sans-serif);
  cursor: pointer;
  pointer-events: auto;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.hud-disambig-row:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  transform: translateX(-2px);
}

.hud-disambig-row:active {
  transform: scale(0.98);
}

.hud-disambig-row-num {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: #38bdf8;
  font-size: 0.8rem;
}

.hud-disambig-row-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.hud-disambig-row-text {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Lore / Note Inspection Side Card (BL-42) */
.hud-lore-card {
  position: fixed;
  right: 1.5rem;
  top: 5.5rem;
  width: 320px;
  max-width: calc(100vw - 3rem);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1.5px solid rgba(251, 191, 36, 0.5);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  color: #f8fafc;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(251, 191, 36, 0.2);
  z-index: 150;
  pointer-events: auto;
  user-select: text;
  animation: slideInLoreCard 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hud-lore-card.hidden {
  display: none !important;
}

.hud-lore-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-lore-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.hud-lore-title-group {
  flex: 1;
  min-width: 0;
}

.hud-lore-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fbbf24;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-lore-author {
  display: block;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.1rem;
}

.hud-lore-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease;
}

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

.hud-lore-body {
  font-size: 0.86rem;
  line-height: 1.55;
  color: #e2e8f0;
  margin: 0 0 0.6rem 0;
  white-space: pre-line;
}

.hud-lore-response {
  font-size: 0.8rem;
  font-style: italic;
  color: #38bdf8;
  margin: 0;
  padding-top: 0.4rem;
  border-top: 1px dashed rgba(56, 189, 248, 0.25);
}

.hud-lore-response:empty {
  display: none;
}

@keyframes slideInSideAction {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLoreCard {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 640px) {
  .hud-lore-card {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    top: auto;
    bottom: 5.2rem;
  }
  .contextual-interact-btn {
    right: 1rem;
    bottom: 4rem;
  }
}

/* HUD Lore Journal Button & Badge (BL-81) */
.hud-journal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
}

.hud-journal-badge {
  background: rgba(56, 189, 248, 0.22);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0 6px;
  border-radius: 9999px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono, monospace);
  line-height: 1;
}

/* Level Lore Journal Modal (BL-81) */
.journal-modal-backdrop {
  z-index: 1000;
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.journal-card {
  max-width: 780px;
  width: 95%;
  height: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--card-bg, #0f172a);
  border: 1px solid var(--border-glass, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
  padding: 1.2rem;
  box-sizing: border-box;
}

.journal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  flex: 1;
  min-height: 0;
  margin-top: 0.8rem;
}

.journal-entries-pane {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-right: 1px solid var(--border-glass, rgba(255, 255, 255, 0.1));
  padding-right: 0.8rem;
  min-height: 0;
}

.journal-entries-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #94a3b8);
}

.journal-entries-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
  flex: 1;
  padding-right: 0.2rem;
}

.journal-entry-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm, 6px);
  color: var(--text, #f8fafc);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.journal-entry-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}

.journal-entry-item.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.journal-entry-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.journal-entry-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.journal-entry-title {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text, #f8fafc);
}

.journal-entry-sub {
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.journal-empty-state {
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
  font-style: italic;
  padding: 1rem 0.5rem;
  text-align: center;
}

.journal-reader-pane {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md, 8px);
  padding: 1.2rem;
  overflow-y: auto;
  min-height: 0;
}

.journal-reader-empty {
  margin: auto;
  text-align: center;
  color: var(--text-muted, #94a3b8);
  font-size: 0.88rem;
  max-width: 280px;
}

.journal-reader-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 0.8rem;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.journal-reader-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.journal-reader-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold, #fbbf24);
}

.journal-reader-author {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  font-style: italic;
}

.journal-reader-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #e2e8f0;
  margin: 0 0 1rem 0;
  white-space: pre-wrap;
  font-family: Georgia, 'Times New Roman', serif;
}

.journal-reader-response {
  font-size: 0.88rem;
  color: #38bdf8;
  font-style: italic;
  padding: 0.6rem 0.8rem;
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid #38bdf8;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1rem;
}

.journal-reader-footer {
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
  font-family: var(--font-mono, monospace);
}

@media (max-width: 640px) {
  .journal-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 150px 1fr;
  }
  .journal-entries-pane {
    border-right: none;
    border-bottom: 1px solid var(--border-glass, rgba(255, 255, 255, 0.1));
    padding-right: 0;
    padding-bottom: 0.5rem;
  }
}

/* -------------------------------------------------------------
 * BL-119 / BL-120: Universal Top Bar, Canvas Border, Safe Buffer & Minimal Mode Exit
 * ------------------------------------------------------------- */
:root {
  --bottom-safe-buffer: max(16px, env(safe-area-inset-bottom, 16px));
}

/* Visual Border Around Render Area (BL-119, Issue #83) */
.canvas-render-border {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 2px solid rgba(56, 189, 248, 0.28);
  box-shadow: inset 0 0 16px rgba(56, 189, 248, 0.08), 0 0 10px rgba(56, 189, 248, 0.12);
  border-radius: 4px;
  z-index: 50;
}

/* Floating Exit Minimal View Button (BL-120, Issue #82) */
.btn-exit-minimal-mode {
  position: fixed;
  top: calc(var(--top-bar-height, 42px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border: 2px solid #38bdf8;
  border-radius: 9999px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 14px rgba(56, 189, 248, 0.4);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.15s ease, box-shadow 0.2s ease;
  pointer-events: auto;
}

.btn-exit-minimal-mode:hover,
.btn-exit-minimal-mode:active {
  background: rgba(56, 189, 248, 0.25);
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7), 0 0 20px rgba(56, 189, 248, 0.6);
}

.btn-exit-minimal-mode.hidden {
  display: none !important;
}

/* Quick Access Icons Island Styling */
.hud-quick-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.hud-menu-btn {
  font-weight: 700;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Streamlined Pause Dialog & Modal Size Reductions (BL-121) */
.pause-menu-dialog {
  max-width: 480px;
}

.pause-menu-dialog .modal-body {
  padding: 0.85rem 1.1rem !important;
}

.pause-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pause-section-group {
  margin-bottom: 0.2rem;
}

.pause-section-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent, #38bdf8);
  margin-bottom: 0.3rem;
}

.pause-action-btn {
  padding: 0.42rem 0.75rem !important;
  font-size: 0.8rem !important;
}

/* Responsive Fit & Safe Buffer on Mobile Screens (BL-119, BL-121, Issue #83) */
@media (max-width: 768px) {
  .game-hud-top.firm-top-bar .hud-breadcrumbs {
    display: inline-flex !important;
    font-size: 0.72rem !important;
    max-width: 95px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .game-hud-top.firm-top-bar .hud-breadcrumbs #hud-crumb-chapter {
    display: none !important;
  }

  .modal-dialog,
  .modal-card,
  .pause-menu-dialog {
    max-height: calc(100vh - var(--top-bar-height, 42px) - var(--bottom-safe-buffer) - 20px) !important;
    max-width: min(520px, calc(100vw - 1rem)) !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    margin-bottom: var(--bottom-safe-buffer) !important;
  }

  .controls-hint-bar {
    bottom: var(--bottom-safe-buffer) !important;
  }

  .virtual-controls[data-dock="bottom-left"] {
    bottom: calc(var(--bottom-safe-buffer) + 8px) !important;
  }

  .virtual-controls[data-dock="bottom-right"] {
    bottom: calc(var(--bottom-safe-buffer) + 8px) !important;
  }
}
