@font-face {
  font-family: "Cinzel";
  src: url("assets/fonts/cinzel-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   DESIGN TOKENS (single source of truth)
   ========================================================================== */
@layer tokens {
  :root {
    color-scheme: dark;
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);

    /* App shell */
    --bg-app: #0b1120;
    --bg-deep: #0f172a;
    --bg-surface: #1e293b;
    --bg-card: #334155;
    --text-main: #f8fafc;
    --text-soft: #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-muted: #a8b8cc;
    --text-dim: #9aa9bc;
    --border-strong: #475569;
    --border-focus: #38bdf8;
    --white: #ffffff;

    /* Accents & diorama palette */
    --accent: #38bdf8;
    --gold-text: #fde68a;
    --gold-pale: #fef08a;
    --obsidian-surface: rgba(14, 18, 28, 0.90);
    --brass-border: #b48a3e;
    --brass-highlight: #e5c158;
    --brass-glow: rgba(229, 193, 88, 0.35);
    --sky-600: #0284c7;
    --sky-700: #0369a1;

    /* Alpha overlays */
    --black-a50: rgba(0, 0, 0, 0.5);
    --black-a60: rgba(0, 0, 0, 0.6);
    --black-a70: rgba(0, 0, 0, 0.7);
    --black-a85: rgba(0, 0, 0, 0.85);
    --white-a06: rgba(255, 255, 255, 0.06);
    --white-a12: rgba(255, 255, 255, 0.12);
    --brass-a25: rgba(180, 138, 62, 0.25);
    --brass-a35: rgba(180, 138, 62, 0.35);
    --brass-a40: rgba(180, 138, 62, 0.4);
    --brass-a45: rgba(180, 138, 62, 0.45);
    --bg-deep-a40: rgba(15, 23, 42, 0.4);
    --bg-surface-a85: rgba(30, 41, 59, 0.85);

    /* Type & layout scale */
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: "Cinzel", "Palatino Linotype", "Book Antiqua", Georgia, serif;
    --font-cinzel: var(--font-display);
    --font-body: Inter, 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-min: 0.75rem;
    --z-touch-controls: 20;
  }
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #020617;
}

body {
  display: block;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.4;
  user-select: none;
}


.btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.15s ease, transform 0.1s ease;

  @media (prefers-reduced-motion: reduce) {
    transition: none;
  }

  &:hover:not(:disabled) {
    background-color: var(--border-strong);
  }

  &:active:not(:disabled) {
    transform: scale(0.97);
  }

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  &:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
  }
}

.primary-btn {
  background-color: var(--sky-600);
  border-color: var(--accent);

  &:hover:not(:disabled) {
    background-color: var(--sky-700);
  }
}

.subtle-btn {
  background-color: transparent;
  color: var(--text-muted);
}


.surface-dialog {
  background: linear-gradient(180deg, rgba(18, 25, 40, 0.96) 0%, rgba(10, 14, 24, 0.98) 100%);
  background-color: var(--obsidian-surface);
  color: var(--text-main);
  border: 2px solid var(--brass-border);
  border-radius: 16px;
  padding: 1.25rem;
  width: min(92vw, 500px);
  max-height: min(88dvh, 800px);
  box-shadow: 0 20px 50px var(--black-a85), 0 0 24px var(--brass-glow), inset 0 1px 0 var(--white-a12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overscroll-behavior: contain;

  opacity: 0;
  transform: scale(0.95);
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.2s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;

  &::backdrop {
    background-color: rgba(4, 7, 14, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition-property: background-color, display, overlay;
    transition-duration: 0.2s;
  }

  &[open] {
    opacity: 1;
    transform: scale(1);

    @starting-style {
      opacity: 0;
      transform: scale(0.95);
    }
  }
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1.5px solid var(--brass-a40);

  & .dialog-sub {
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
  }
}

.dialog-header h2,
.dialog-header .dialog-title,
.surface-dialog h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--brass-highlight);
  text-shadow: 0 2px 4px var(--black-a85);
  letter-spacing: 0.03em;
}

.close-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: radial-gradient(circle at 35% 30%, #252f44 0%, #101625 100%);
  border: 1.5px solid var(--brass-border);
  color: var(--brass-highlight);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px var(--black-a50), inset 0 1px 0 var(--white-a12);
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
  flex-shrink: 0;

  &:hover,
  &:focus-visible {
    border-color: var(--brass-highlight);
    color: var(--white);
    box-shadow: 0 0 10px var(--brass-glow);
    transform: scale(1.06);
    background: rgba(229, 193, 88, 0.15);
  }

  &:active {
    transform: scale(0.94);
    box-shadow: inset 0 2px 4px var(--black-a70);
  }
}

dialog .primary-btn {
  background: linear-gradient(180deg, #3d301e 0%, #20170d 100%);
  border: 1.5px solid var(--brass-border);
  color: var(--brass-highlight);
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 5px var(--black-a50);

  &:hover:not(:disabled),
  &:focus-visible {
    background: linear-gradient(180deg, #4d3d27 0%, #2a1f11 100%);
    border-color: var(--brass-highlight);
    box-shadow: 0 0 10px var(--brass-glow);
    color: var(--white);
  }
}

.craft-search-box {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.craft-search-box .search-icon {
  position: absolute;
  left: 0.65rem;
  font-size: 0.82rem;
  pointer-events: none;
  opacity: 0.6;
}

.craft-search-input {
  width: 100%;
  padding: 0.4rem 2rem 0.4rem 2rem;
  font-family: inherit;
  font-size: 0.82rem;
  border-radius: 8px;
  background-color: var(--bg-app);
  border: 1.5px solid var(--border-strong);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;

  &:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 1px var(--border-focus);
  }
}

.craft-search-clear {
  position: absolute;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;

  &:hover {
    color: var(--text-main);
  }
}

/* =========================================================================
   Adventurer's Guide & Player Compendium Modal + Standalone Page Styles
   ========================================================================= */
.guide-modal-dialog {
  width: min(96vw, 1060px);
  max-width: 1060px;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.35rem;
  background: linear-gradient(180deg, #162032 0%, #0d1322 100%);
  border: 1.5px solid var(--brass-border);
  box-shadow: 0 24px 50px var(--black-a85), inset 0 1px 0 var(--white-a12);
}

.guide-modal-dialog:not([open]) {
  display: none !important;
}

.guide-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--brass-a35);
  flex-shrink: 0;
}

.guide-header-left .dialog-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-family: var(--font-display);
  color: var(--gold-text);
  font-size: 1.25rem;
}

.guide-title-icon {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
}

.guide-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.guide-external-link {
  text-decoration: none;
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(180, 138, 62, 0.5);
  color: var(--gold-text);
  background: rgba(15, 23, 42, 0.75);
}

.guide-external-link:hover {
  border-color: var(--brass-highlight);
  background: rgba(30, 41, 59, 0.9);
}

.guide-toolbar {
  padding: 0.65rem 0;
  flex-shrink: 0;
}

.guide-search-box {
  width: 100%;
}

.guide-search-status {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.guide-search-status:empty {
  display: none;
}

.guide-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
}

.guide-chapter-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
  padding-right: 0.35rem;
  border-right: 1px solid var(--brass-a25);
}

.guide-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--white-a06);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.guide-nav-btn:hover {
  background: var(--bg-surface-a85);
  color: var(--text-main);
  border-color: var(--brass-a45);
}

.guide-nav-btn.is-active {
  background: linear-gradient(135deg, rgba(180, 138, 62, 0.28) 0%, rgba(30, 41, 59, 0.95) 100%);
  color: var(--gold-pale);
  border-color: var(--brass-highlight);
  box-shadow: inset 0 0 8px rgba(245, 158, 11, 0.2);
}

.guide-content-pane {
  overflow-y: auto;
  padding-right: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 0;
  user-select: text;
}

.guide-toc a {
  color: var(--accent);
}

.guide-chapter-block {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(180, 138, 62, 0.32);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  box-shadow: inset 0 1px 0 var(--white-a06);
}

.guide-chapter-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--brass-a25);
}

.guide-chapter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: radial-gradient(circle at 30% 30%, #273754, var(--bg-deep));
  border: 1px solid rgba(229, 193, 88, 0.5);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.guide-chapter-icon svg {
  width: 24px;
  height: 24px;
}

.guide-chapter-title {
  margin: 0;
  font-size: 1.12rem;
  font-family: var(--font-display);
  color: var(--gold-text);
}

.guide-chapter-tagline {
  margin: 0.15rem 0 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.guide-screenshots-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-bottom: 0.95rem;
}

.guide-screenshots-grid.has-multiple-shots {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.guide-screenshot-card {
  margin: 0;
  background: linear-gradient(180deg, rgba(13, 19, 33, 0.92) 0%, rgba(8, 12, 21, 0.96) 100%);
  border: 1.5px solid rgba(180, 138, 62, 0.42);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.guide-screenshot-card:hover {
  border-color: rgba(245, 208, 97, 0.78);
  box-shadow: 0 10px 26px var(--black-a70), 0 0 12px rgba(229, 193, 88, 0.18);
}

.guide-screenshot-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.guide-screenshot-img-wrap {
  position: relative;
  background: radial-gradient(circle at 50% 50%, #141e33 0%, #070b14 100%);
  border-bottom: 1px solid rgba(180, 138, 62, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  overflow: hidden;
}

.guide-screenshot-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 390px;
  object-fit: contain;
  border-radius: 6px;
  transition: transform 0.2s ease;
}

.guide-screenshot-link:hover .guide-screenshot-img {
  transform: scale(1.015);
}

.guide-screenshot-zoom-badge {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  background: rgba(11, 17, 30, 0.88);
  border: 1px solid rgba(229, 193, 88, 0.55);
  color: var(--gold-text);
  font-size: var(--font-size-min);
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  pointer-events: none;
  box-shadow: 0 4px 10px var(--black-a60);
}

.guide-screenshot-caption {
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.guide-screenshot-title {
  font-size: 0.84rem;
  color: var(--gold-text);
  line-height: 1.3;
}

.guide-screenshot-desc {
  font-size: 0.79rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.guide-chapter-sections {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.guide-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(180, 138, 62, 0.28);
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.guide-table th {
  background: rgba(30, 41, 59, 0.9);
  color: var(--gold-text);
  font-weight: 700;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--brass-a35);
  white-space: nowrap;
}

.guide-table td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--white-a06);
  color: var(--text-soft);
  vertical-align: top;
  line-height: 1.4;
}

.guide-table tr:last-child td {
  border-bottom: none;
}

.guide-table tr:nth-child(even) td {
  background: var(--bg-deep-a40);
}

.guide-empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.guide-empty-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.guide-footer {
  padding-top: 0.65rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--brass-a25);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .guide-layout {
    grid-template-columns: 1fr;
  }
  .guide-chapter-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--brass-a25);
    padding-bottom: 0.4rem;
  }
  .guide-nav-btn {
    white-space: nowrap;
    width: auto;
  }
}


/* ============================================================================
 * Clean-Slate 3D Meadow Explorer: Full-Window Viewport Layout
 * ============================================================================ */

body.mode-resizable-modern {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: block;
}

.game-layout {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  gap: 0;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background-color: #020617;
}

#canvas-container,
.viewport-card {
  position: relative;
  flex: 1 1 78%;
  min-width: 0;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  background-color: #000;
}

#game-webgl-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  pointer-events: none;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
  background: transparent;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

/* ==========================================================================
   MINIMAL EXPLORATION HUD OVERLAY (3D Viewport)
   ========================================================================== */
.exploration-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--sat, 0px) + 14px) 18px calc(var(--sab, 0px) + 14px) 18px;
  user-select: none;
  font-family: var(--font-cinzel, 'Cinzel', serif);
}

.hud-region-banner {
  pointer-events: auto;
  align-self: flex-start;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  padding: 6px 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.hud-region-title {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--gold-text, #fde68a);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.hud-region-subtitle {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-muted, #94a3b8);
  font-family: var(--font-body, system-ui, sans-serif);
}

/* Bottom Controls Hint */
.hud-controls-hint {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(71, 85, 105, 0.4);
  border-radius: 20px;
  padding: 5px 14px;
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 0.73rem;
  color: var(--text-soft, #e2e8f0);
  pointer-events: auto;
}

.hint-pill {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hint-kbd {
  display: inline-block;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 0.68rem;
  color: var(--gold-text, #fde68a);
}

/* ==========================================================================
   CLASSIC RIGHT MENU BAR & COMPASS DOCK
   ========================================================================== */
.right-menu-bar {
  flex: 0 0 clamp(280px, 22vw, 340px);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0f172a 0%, #090e1a 100%);
  border-left: 1px solid rgba(245, 158, 11, 0.38);
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.55);
  color: var(--text-soft, #e2e8f0);
  z-index: 20;
  overflow: hidden;
  user-select: none;
  font-family: var(--font-body, system-ui, sans-serif);
}

.right-menu-compass-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: rgba(2, 6, 23, 0.65);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  flex-shrink: 0;
}

.right-menu-compass-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.right-menu-compass-title {
  font-family: var(--font-cinzel, 'Cinzel', serif);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #94a3b8);
}

.right-menu-compass-sub {
  font-size: 0.68rem;
  color: var(--text-dim, #64748b);
}

/* Cardinal Compass Rose Widget */
.compass-rose-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  background: radial-gradient(circle at 50% 50%, rgba(30, 41, 59, 0.95), rgba(2, 6, 23, 0.95));
  border: 1px solid rgba(245, 158, 11, 0.55);
  border-radius: 50%;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.7), 0 2px 10px rgba(0, 0, 0, 0.45);
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease;
  font-family: var(--font-cinzel, 'Cinzel', serif);
}

.compass-rose-container:hover {
  transform: scale(1.04);
  border-color: rgba(245, 158, 11, 0.9);
}

.compass-rose-container:active {
  transform: scale(0.97);
}

.compass-rose-dial {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transform-origin: center center;
  transition: transform 0.05s linear;
}

.compass-point {
  position: absolute;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-dim, #9aa9bc);
}

.compass-point-n {
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  color: #ef4444;
  font-size: 0.68rem;
  font-weight: 800;
}

.compass-point-ne { top: 8px; right: 8px; font-size: 0.45rem; opacity: 0.75; }
.compass-point-e { top: 50%; right: 3px; transform: translateY(-50%); }
.compass-point-se { bottom: 8px; right: 8px; font-size: 0.45rem; opacity: 0.75; }
.compass-point-s { bottom: 2px; left: 50%; transform: translateX(-50%); }
.compass-point-sw { bottom: 8px; left: 8px; font-size: 0.45rem; opacity: 0.75; }
.compass-point-w { top: 50%; left: 3px; transform: translateY(-50%); }
.compass-point-nw { top: 8px; left: 8px; font-size: 0.45rem; opacity: 0.75; }

.compass-rose-needle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 22px;
  margin-top: -11px;
  margin-left: -1px;
  background: linear-gradient(to bottom, #ef4444 50%, #94a3b8 50%);
  border-radius: 1px;
}

.compass-heading-readout {
  font-family: var(--font-cinzel, 'Cinzel', serif);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gold-text, #fde68a);
  letter-spacing: 0.06em;
}

/* Right Menu Bar 6-Tab Strip */
.right-menu-tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 6px 8px; background: rgba(2, 6, 23, 0.8); border-bottom: 1px solid rgba(148, 163, 184, 0.2); flex-shrink: 0; }
.right-menu-tab-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 4px; background: rgba(30, 41, 59, 0.55); border: 1px solid rgba(148, 163, 184, 0.22); border-radius: 6px; color: var(--text-muted, #94a3b8); font-size: 0.7rem; font-weight: 600; cursor: pointer; transition: all 0.14s ease; }
.right-menu-tab-btn:hover { background: rgba(30, 41, 59, 0.9); border-color: rgba(245, 158, 11, 0.55); color: var(--text-soft, #f8fafc); }
.right-menu-tab-btn.is-active, .right-menu-tab-btn[aria-selected="true"] { background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.85); color: var(--gold-text, #fde68a); box-shadow: inset 0 0 8px rgba(245, 158, 11, 0.15); }

/* Right Menu Bar Panes */
.right-menu-pane { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; color: var(--text-soft, #e2e8f0); font-family: var(--font-body, system-ui, sans-serif); }
.right-menu-guide-list { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 7px; font-size: 0.75rem; line-height: 1.4; color: var(--text-soft, #cbd5e1); }
.customizer-header-actions { display: flex; align-items: center; gap: 6px; }
.btn-customizer-action { background: rgba(30, 41, 59, 0.85); border: 1px solid rgba(148, 163, 184, 0.35); color: var(--text-soft, #e2e8f0); border-radius: 6px; padding: 4px 8px; font-size: 0.72rem; cursor: pointer; transition: all 0.15s ease; }
.btn-customizer-action:hover { border-color: rgba(245, 158, 11, 0.75); color: var(--gold-text, #fde68a); }
.customizer-stage-wrap { position: relative; display: flex; flex-direction: column; align-items: center; background: radial-gradient(circle at 50% 45%, rgba(30, 41, 59, 0.9), rgba(2, 6, 23, 0.95)); border-bottom: 1px solid rgba(245, 158, 11, 0.22); padding: 6px 10px 8px; flex-shrink: 0; }
.customizer-turntable-canvas { width: 240px; height: 190px; cursor: grab; touch-action: none; display: block; }
.customizer-turntable-canvas:active { cursor: grabbing; }

.customizer-stage-controls {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.customizer-subtabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px 10px;
  background: rgba(2, 6, 23, 0.72);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  flex-shrink: 0;
}

.customizer-subtab-btn {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 6px;
  padding: 5px 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  transition: all 0.14s ease;
}

.customizer-subtab-btn:hover {
  border-color: rgba(245, 158, 11, 0.6);
  color: var(--text-soft, #f8fafc);
}

.customizer-subtab-btn.is-active,
.customizer-subtab-btn[aria-selected="true"] {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.85);
  color: var(--gold-text, #fde68a);
}

.customizer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.customizer-section {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.customizer-section-title {
  margin: 0;
  font-family: var(--font-cinzel, 'Cinzel', serif);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-text, #fde68a);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 4px;
}

.customizer-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.customizer-label {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-muted, #cbd5e1);
}

.customizer-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.btn-customizer-chip {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text-soft, #e2e8f0);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 0.73rem;
  cursor: pointer;
  transition: all 0.14s ease;
}

.btn-customizer-chip:hover {
  border-color: rgba(245, 158, 11, 0.65);
}

.btn-customizer-chip.is-active,
.btn-customizer-chip[aria-pressed="true"] {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.9);
  color: var(--gold-text, #fde68a);
  font-weight: 600;
}

.customizer-swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.customizer-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--swatch-color, #ccc);
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.customizer-swatch:hover {
  transform: scale(1.12);
}

.customizer-swatch.is-active,
.customizer-swatch[aria-pressed="true"] {
  border-color: #fde68a;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.65), 0 2px 6px rgba(0, 0, 0, 0.6);
  transform: scale(1.12);
}

.customizer-color-input {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px dashed rgba(253, 230, 138, 0.65);
  background: transparent;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}

.customizer-gear-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.customizer-select {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--text-soft, #f8fafc);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
}

.customizer-select:focus {
  border-color: rgba(245, 158, 11, 0.85);
}

.customizer-select:focus:not(:focus-visible) {
  outline: none;
}

.customizer-select:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-color: rgba(245, 158, 11, 0.85);
}

/* ==========================================================================
   SOUNDSCAPE STUDIO & MIXER PANEL
   ========================================================================== */
.audio-now-playing-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  background: radial-gradient(circle at 50% 0%, rgba(30, 41, 59, 0.92), rgba(2, 6, 23, 0.96));
  border-bottom: 1px solid rgba(245, 158, 11, 0.22);
}

.audio-now-playing-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audio-now-playing-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.audio-now-playing-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.audio-now-playing-title {
  font-family: var(--font-cinzel, 'Cinzel', serif);
  font-size: 0.86rem;
  color: var(--gold-text, #fde68a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-now-playing-sub {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-transport-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.audio-slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.audio-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.audio-slider-val {
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--gold-text, #fde68a);
}

.audio-range-slider {
  width: 100%;
  accent-color: #f59e0b;
  cursor: pointer;
}




.hint-text {
  font-size: var(--font-size-min);
  color: var(--text-muted);
}

/* Turntable Studio Bar & Extended Hero Customizer */
.turntable-studio-bar { width: 100%; max-width: 100%; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; background: rgba(15, 23, 42, 0.85); border-top: 1px solid rgba(148, 163, 184, 0.2); border-radius: 0 0 8px 8px; }
.studio-bar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; width: 100%; }
.studio-bar-label { font-size: 0.68rem; font-weight: 600; color: var(--text-muted, #94a3b8); min-width: 28px; flex-shrink: 0; }
.studio-bar-select { flex: 1 1 88px; min-width: 0; font-size: 0.70rem; padding: 3px 4px; background: rgba(30, 41, 59, 0.85); border: 1px solid rgba(148, 163, 184, 0.25); border-radius: 4px; color: #f1f5f9; }
.studio-bar-zoom-row { display: flex; align-items: center; gap: 4px; min-width: 0; width: 100%; }
.btn-studio-zoom { width: 22px; height: 22px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: rgba(30, 41, 59, 0.75); border: 1px solid rgba(148, 163, 184, 0.3); border-radius: 4px; color: #e2e8f0; cursor: pointer; font-size: 0.82rem; font-weight: 700; transition: all 0.12s ease; }
.btn-studio-zoom:hover { background: rgba(51, 65, 85, 0.95); border-color: #f59e0b; }
.studio-zoom-slider { flex: 1 1 0; min-width: 0; height: 6px; cursor: pointer; accent-color: #f59e0b; }
.customizer-slider-group { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.customizer-slider-row { display: flex; flex-direction: column; gap: 2px; }
.slider-field-label { display: flex; justify-content: space-between; font-size: 0.75rem; color: #cbd5e1; font-weight: 500; }
.customizer-slider { width: 100%; height: 6px; cursor: pointer; accent-color: #f59e0b; }
.customizer-color-row { display: flex; align-items: center; gap: 8px; }
.customizer-swatches { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.btn-color-swatch { width: 22px; height: 22px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.25); cursor: pointer; transition: transform 0.12s ease, border-color 0.12s ease; }
.btn-color-swatch:hover { transform: scale(1.15); border-color: #ffffff; }
.btn-color-swatch.is-active, .btn-color-swatch[aria-pressed="true"] { border-color: #fde68a; box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.65), 0 2px 6px rgba(0, 0, 0, 0.6); transform: scale(1.12); }

/* Settings Pane & Form Controls */
.settings-panel-header { padding: 8px 12px 10px; border-bottom: 1px solid rgba(148, 163, 184, 0.18); }
.settings-subtitle { font-size: 0.75rem; color: var(--text-muted, #94a3b8); margin: 4px 0 0; }
.settings-group-title { font-size: 0.82rem; font-weight: 700; color: var(--gold-text, #fde68a); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 8px; }
.settings-toggle-label { display: flex; align-items: center; gap: 8px; }
.settings-checkbox { width: 16px; height: 16px; accent-color: #f59e0b; cursor: pointer; }

/* HUD FPS Telemetry Badge & Accessibility Overrides */
.fps-telemetry-badge { position: absolute; top: 14px; right: 18px; display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: rgba(15, 23, 42, 0.85); border: 1px solid rgba(56, 189, 248, 0.4); border-radius: 6px; font-family: monospace; font-size: 0.74rem; font-weight: 700; color: #38bdf8; pointer-events: none; z-index: 50; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.fps-telemetry-badge .ms-val { color: #94a3b8; font-weight: 500; }
body.high-contrast-ui { --text-main: #ffffff !important; --text-soft: #ffffff !important; --text-muted: #f1f5f9 !important; border-color: #38bdf8 !important; }
body.high-contrast-ui .right-menu-bar, body.high-contrast-ui .viewport-card { border: 2px solid #38bdf8 !important; }
body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }

/* ==========================================================================
   Mobile & Tablet Responsive Architecture Defaults (< 1024px)
   ========================================================================== */

/* Default desktop state for mobile-specific elements (strictly hidden >= 1024px) */
.mobile-hud-cluster,
.mobile-drawer-scrim,
.mobile-drawer-handle,
.btn-mobile-drawer-close,
.hint-touch,
.hint-gamepad,
.hud-mobile-utility-toggle,
.hud-jump-btn,
.hud-context-action,
.bank-mobile-tabs,
.mobile-rotate-overlay {
  display: none !important;
}
.hud-primary-row,
.hud-mobile-utility-tray { display: contents; }
body[data-input-mode="gamepad"] .hud-context-action:not([hidden]) {
  display: inline-flex !important;
  position: absolute;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: 108px;
  z-index: 54;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(250, 204, 21, 0.72);
  background: rgba(15, 23, 42, 0.92);
  color: #fef3c7;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
}

body[data-input-mode="gamepad"] .hint-desktop,
body[data-input-mode="gamepad"] .hint-touch {
  display: none !important;
}

body[data-input-mode="gamepad"] .hint-gamepad {
  display: flex !important;
  align-items: center;
  gap: 5px;
}

@media (max-width: 1023px) {
  /* 1. Viewport & Canvas Container Full Immersion */
  .game-layout {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: block;
  }

  #canvas-container,
  .viewport-card {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100dvh;
    flex: none;
    z-index: 1;
  }

  .right-menu-pane {
    flex: none;
    overflow: visible;
  }

  .customizer-body {
    overflow: visible;
  }

  /* 2. Exploration HUD Safe-Area Padding */
  .exploration-hud {
    padding: max(12px, env(safe-area-inset-top, 0px))
             max(14px, env(safe-area-inset-right, 0px))
             max(12px, env(safe-area-inset-bottom, 0px))
             max(14px, env(safe-area-inset-left, 0px));
  }

  .hud-region-banner {
    max-width: calc(100vw - 180px);
  }

  .hud-region-title {
    font-size: 0.95rem;
  }

  /* Controls Hint Touch Switching */
  .hint-desktop {
    display: none !important;
  }

  .hint-touch {
    display: flex !important;
    align-items: center;
    gap: 4px;
  }

  .hud-controls-hint {
    gap: 8px;
    padding: 4px 10px;
    font-size: 0.72rem;
    max-width: 92vw;
    flex-wrap: wrap;
    justify-content: center;
  }

  /* 3. Floating HUD Action Cluster (Top-Right) */
  .fps-telemetry-badge {
    top: calc(max(12px, env(safe-area-inset-top, 0px)) + 52px);
    right: max(12px, env(safe-area-inset-right, 0px));
  }

  .mobile-hud-cluster {
    position: absolute;
    top: max(12px, env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    z-index: 50;
    display: flex !important;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
  }

  .btn-mobile-hud {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(245, 158, 11, 0.5);
    color: var(--gold-text, #fde68a);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  }

  .btn-mobile-hud:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(245, 158, 11, 0.85);
  }

  .btn-mobile-hud:active {
    transform: scale(0.92);
    background: rgba(30, 41, 59, 1);
    border-color: rgba(245, 158, 11, 1);
  }

  .mobile-compass-dial {
    display: inline-block;
    transition: transform 0.1s ease-out;
  }

  /* 4. Backdrop Scrim */
  .mobile-drawer-scrim {
    display: block !important;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 190;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .mobile-drawer-scrim.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* 5. Off-Canvas Drawer Base Styles */
  #right-menu-bar.right-menu-bar {
    position: fixed;
    z-index: 200;
    background: linear-gradient(180deg, #0f172a 0%, #090e1a 100%);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.7);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease;
    visibility: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    flex: none;
  }

  #right-menu-bar.drawer-open {
    visibility: visible;
  }

  .right-menu-compass-header {
    position: sticky;
    top: 0;
    z-index: 6;
    background: #0f172a;
  }

  .right-menu-tabs {
    position: sticky;
    top: 79px;
    z-index: 5;
    background: #0b1120;
  }

  /* Drawer Header Close Button */
  .btn-mobile-drawer-close {
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: var(--text-soft, #f8fafc);
    font-size: 1.2rem;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s ease;
    flex-shrink: 0;
  }

  .btn-mobile-drawer-close:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.6);
    color: #ef4444;
  }

  .btn-mobile-drawer-close:active {
    transform: scale(0.92);
  }
}

/* 6. Landscape Drawer (Slide from Right) */
@media (max-width: 1023px) and (orientation: landscape) {
  #right-menu-bar.right-menu-bar {
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(360px, 85vw);
    height: 100%;
    height: 100dvh;
    transform: translateX(100%);
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-left: 0;
    border-left: 1px solid rgba(245, 158, 11, 0.38);
    border-top: none;
    border-radius: 0;
  }

  #right-menu-bar.drawer-open {
    transform: translateX(0);
    visibility: visible;
  }

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

/* 7. Portrait Drawer (Bottom-Sheet Slide Up) */
@media (max-width: 1023px) and (orientation: portrait) {
  #right-menu-bar.right-menu-bar {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: min(72vh, 560px);
    max-height: min(72dvh, 560px);
    height: auto;
    transform: translateY(100%);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-top: 1px solid rgba(245, 158, 11, 0.45);
    border-left: none;
    padding-top: 6px;
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  #right-menu-bar.drawer-open {
    transform: translateY(0);
    visibility: visible;
  }

  /* Visual swipe-down drag handle */
  .mobile-drawer-handle {
    display: block !important;
    width: 44px;
    height: 4px;
    margin: 6px auto 10px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 2px;
    flex-shrink: 0;
    touch-action: none;
  }
}

/* ==========================================================================
   Virtual Joystick Overlay (Touch Locomotion)
   ========================================================================== */

#virtual-joystick-zone,
.virtual-joystick-zone {
  display: none !important;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: var(--z-touch-controls, 20);
  opacity: 0;
  visibility: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  transition: opacity 0.15s ease-out, visibility 0.15s ease-out;
}

#virtual-joystick-base,
.virtual-joystick-base {
  position: absolute;
  top: 0;
  left: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(22, 27, 34, 0.72) 0%, rgba(13, 17, 23, 0.9) 100%);
  border: 2px solid rgba(212, 175, 55, 0.6);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.3), inset 0 0 10px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
  will-change: transform;
}

#virtual-joystick-knob,
.virtual-joystick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd700 0%, #b8860b 70%, #8b6508 100%);
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.55), inset 0 1px 2px rgba(255, 255, 255, 0.5);
  pointer-events: none;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
  will-change: transform;
}

/* Gear Tab Hero Summary Card & Full-Screen Character Creation Studio */
.gear-hero-summary-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid rgba(245, 158, 11, 0.22); background: rgba(15, 23, 42, 0.72); flex-shrink: 0; }
.gear-hero-identity { display: flex; flex-direction: column; min-width: 0; }
.gear-hero-name { font-family: var(--font-cinzel, 'Cinzel', serif); font-size: 0.88rem; color: var(--gold-text, #fde68a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gear-hero-meta { font-size: 0.7rem; color: var(--text-muted, #94a3b8); text-transform: capitalize; }
.gear-hero-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.gear-new-hero-btn { flex-shrink: 0; font-weight: 700; min-height: 36px; padding: 5px 8px; }
.landing-screen-overlay { position: fixed; inset: 0; z-index: 850; background: radial-gradient(circle at 60% 35%, rgba(15, 23, 42, 0.56), rgba(2, 6, 23, 0.72)); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; padding: 16px; color: var(--text-soft, #e2e8f0); }
.landing-shell { width: 100%; max-width: 980px; max-height: 100%; display: flex; flex-direction: column; background: rgba(15, 23, 42, 0.86); border: 1px solid rgba(245, 158, 11, 0.45); border-radius: 14px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72); overflow: hidden; }
.landing-slot-pill { font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(245, 158, 11, 0.16); border: 1px solid rgba(245, 158, 11, 0.45); color: var(--gold-text, #fde68a); }
.landing-layout { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); overflow: hidden; }
.landing-roster-col { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-right: 1px solid rgba(245, 158, 11, 0.22); overflow-y: auto; }
.landing-roster-list { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-height: 120px; }
.landing-roster-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 9px; border: 1px solid rgba(148, 163, 184, 0.28); background: rgba(30, 41, 59, 0.72); color: var(--text-soft, #e2e8f0); cursor: pointer; transition: all 0.14s ease; }
.landing-roster-card:hover { border-color: rgba(245, 158, 11, 0.65); background: rgba(30, 41, 59, 0.95); }
.landing-roster-card.is-selected { border-color: #f59e0b; background: rgba(245, 158, 11, 0.16); box-shadow: inset 0 0 12px rgba(245, 158, 11, 0.14); }
.landing-roster-card-main { display: flex; flex-direction: column; min-width: 0; }
.landing-roster-card-name { font-family: var(--font-cinzel, 'Cinzel', serif); font-size: 0.92rem; color: var(--gold-text, #fde68a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.landing-roster-card-meta { font-size: 0.72rem; color: var(--text-muted, #94a3b8); text-transform: capitalize; }
.landing-roster-badge { font-size: 0.68rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(245, 158, 11, 0.22); color: #fde68a; flex-shrink: 0; }
.landing-empty-state { font-size: 0.82rem; color: var(--text-muted, #94a3b8); margin: 8px 0; }
.landing-create-btn { width: 100%; padding: 10px 12px; font-weight: 700; font-size: 0.84rem; min-height: 44px; }
.landing-stage-col { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px 16px; background: radial-gradient(circle at 50% 42%, rgba(30, 41, 59, 0.85), rgba(2, 6, 23, 0.96)); }
.landing-turntable-canvas { width: 320px; max-width: 100%; height: 340px; cursor: grab; touch-action: none; display: block; border-radius: 10px; }
.landing-turntable-canvas:active { cursor: grabbing; }
.landing-selected-summary { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.landing-selected-name { font-family: var(--font-cinzel, 'Cinzel', serif); font-size: 1.05rem; color: var(--gold-text, #fde68a); }
.landing-preview-controls { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 6px; }
.gear-style-controls { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(245, 158, 11, 0.16); display: flex; flex-direction: column; gap: 4px; }
.world-interaction-toast { position: absolute; bottom: 108px; left: 50%; transform: translateX(-50%); z-index: 60; width: min(460px, calc(100% - 24px)); display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(15, 23, 42, 0.9); border: 1px solid rgba(245, 158, 11, 0.55); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); pointer-events: auto; }
.hud-action-dock { position: absolute; bottom: 48px; left: 50%; transform: translateX(-50%); z-index: 52; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 12px; background: rgba(15, 23, 42, 0.82); border: 1px solid rgba(148, 163, 184, 0.35); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45); pointer-events: auto; width: max-content; max-width: calc(100% - 16px); }
.hud-tool-belt, .hud-combat-pad { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; pointer-events: auto; }
.hud-tool-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 8px; border: 1px solid rgba(148, 163, 184, 0.28); background: rgba(30, 41, 59, 0.78); color: #e2e8f0; font-size: 0.72rem; font-weight: 600; cursor: pointer; transition: all 0.14s ease; white-space: nowrap; }
.hud-tool-btn:hover, .hud-tool-btn.is-gathering { border-color: rgba(245, 158, 11, 0.85); color: #fde68a; background: rgba(245, 158, 11, 0.18); }
.hud-gather-progress { position: relative; min-width: 96px; height: 22px; border-radius: 8px; background: rgba(2, 6, 23, 0.85); border: 1px solid rgba(245, 158, 11, 0.5); overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 0 8px; }
.hud-gather-progress-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: linear-gradient(90deg, rgba(245, 158, 11, 0.45), rgba(250, 204, 21, 0.65)); transition: width 0.08s linear; }
.hud-gather-progress-text { position: relative; z-index: 1; font-size: 0.68rem; font-weight: 700; color: #fef08a; }
.skills-helper-copy { margin: 0 0 8px; font-size: 0.74rem; color: var(--text-muted, #94a3b8); line-height: 1.4; }
.skills-belt-grid, .skills-progress-list { display: flex; flex-direction: column; gap: 8px; }
.skill-card { padding: 8px 10px; border-radius: 8px; background: rgba(15, 23, 42, 0.72); border: 1px solid rgba(148, 163, 184, 0.25); display: flex; flex-direction: column; gap: 4px; }
.skill-card-head { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; color: #f8fafc; }
.skill-xp-bar-track { height: 6px; border-radius: 999px; background: rgba(30, 41, 59, 0.9); overflow: hidden; }
.skill-xp-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.gathering-haul-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.haul-item-pill { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; border-radius: 8px; background: rgba(15, 23, 42, 0.68); border: 1px solid rgba(148, 163, 184, 0.22); font-size: 0.74rem; }
.haul-item-pill.is-rare { border-color: rgba(250, 204, 21, 0.45); }
.world-toast-icon { font-size: 1.35rem; flex-shrink: 0; }
.world-toast-copy { flex: 1 1 auto; min-width: 0; }
.world-toast-title { display: block; font-family: var(--font-cinzel, 'Cinzel', serif); font-size: 0.86rem; color: var(--gold-text, #fde68a); }
.world-toast-body { margin: 2px 0 0; font-size: 0.76rem; color: var(--text-soft, #e2e8f0); line-height: 1.35; }
.btn-world-toast-close { min-width: 30px; min-height: 30px; border-radius: 6px; border: 1px solid rgba(148, 163, 184, 0.35); background: rgba(30, 41, 59, 0.75); color: #e2e8f0; cursor: pointer; }
.character-creation-overlay { position: fixed; inset: 0; z-index: 900; background: radial-gradient(circle at 30% 40%, rgba(15, 23, 42, 0.97), rgba(2, 6, 23, 0.99)); backdrop-filter: blur(8px); display: flex; align-items: stretch; justify-content: center; padding: 16px; color: var(--text-soft, #e2e8f0); }
.creator-shell { width: 100%; max-width: 1120px; max-height: 100%; display: flex; flex-direction: column; background: rgba(15, 23, 42, 0.92); border: 1px solid rgba(245, 158, 11, 0.35); border-radius: 14px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65); overflow: hidden; }
.creator-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid rgba(245, 158, 11, 0.25); background: rgba(2, 6, 23, 0.65); flex-shrink: 0; }
.creator-title { margin: 0; font-family: var(--font-cinzel, 'Cinzel', serif); font-size: 1.15rem; letter-spacing: 0.05em; color: var(--gold-text, #fde68a); }
.creator-subtitle { margin: 2px 0 0; font-size: 0.76rem; color: var(--text-muted, #94a3b8); }
.creator-header-actions { display: flex; align-items: center; gap: 8px; }
.creator-layout { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(280px, 420px) minmax(0, 1fr); overflow: hidden; }
.creator-stage-col { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px 16px; background: radial-gradient(circle at 50% 42%, rgba(30, 41, 59, 0.85), rgba(2, 6, 23, 0.96)); border-right: 1px solid rgba(245, 158, 11, 0.2); }
.creator-turntable-canvas { width: 340px; max-width: 100%; height: 360px; cursor: grab; touch-action: none; display: block; border-radius: 10px; }
.creator-turntable-canvas:active { cursor: grabbing; }
.creator-stage-controls { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.creator-controls-col { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.creator-controls-col .customizer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 16px; }
.creator-identity-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 10px 16px; border-bottom: 1px solid rgba(245, 158, 11, 0.18); background: rgba(2, 6, 23, 0.38); flex-shrink: 0; }
.creator-identity-field { display: flex; flex-direction: column; gap: 4px; }
.creator-name-row { display: flex; align-items: center; gap: 6px; }
.creator-text-input { flex: 1 1 auto; min-width: 0; padding: 6px 10px; border-radius: 6px; border: 1px solid rgba(148, 163, 184, 0.35); background: rgba(15, 23, 42, 0.9); color: #f8fafc; font-size: 0.84rem; }
.creator-footer { padding: 10px 18px; border-top: 1px solid rgba(245, 158, 11, 0.25); background: rgba(2, 6, 23, 0.72); flex-shrink: 0; }
.creator-actions-row, .creator-confirm-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.creator-confirm-text { font-size: 0.84rem; font-weight: 600; color: var(--gold-text, #fde68a); }
.creator-confirm-actions { display: flex; align-items: center; gap: 8px; }

/* 28-Slot Adventurer Backpack (Inventory), Shop & Paperdoll Styles */
@media (min-width: 1024px) { #bag-inventory-panel { overflow-y: auto; } }
.inv-header-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 6px; border-bottom: 1px solid rgba(245, 158, 11, 0.22); }
.inv-header-meta { display: flex; flex-direction: column; gap: 2px; }
.inv-title { margin: 0; font-size: 0.9rem; font-weight: 700; color: var(--gold-text, #fde68a); }
.inv-slot-counter { font-size: 0.72rem; color: var(--text-muted, #94a3b8); font-variant-numeric: tabular-nums; }
.inv-header-actions { display: flex; align-items: center; gap: 6px; }
.inv-filter-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 12px 4px; }
.inv-filter-bar .btn-customizer-chip { padding: 3px 8px; font-size: 0.68rem; min-height: 28px; }
.inv-status-banner { margin: 4px 12px 0; padding: 6px 9px; border-radius: 7px; background: rgba(245, 158, 11, 0.14); border: 1px solid rgba(245, 158, 11, 0.36); color: #fde68a; font-size: 0.72rem; }
.inv-status-banner.is-warn { background: rgba(127, 29, 29, 0.48); border-color: rgba(248, 113, 113, 0.45); color: #fecaca; }
.inv-grid-wrap { padding: 8px 12px; }
.inventory-slot-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.inv-slot-btn { position: relative; min-height: 48px; padding: 4px; border-radius: 8px; border: 1px solid rgba(148, 163, 184, 0.24); background: rgba(15, 23, 42, 0.72); color: #f8fafc; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease; }
.inv-slot-btn:hover { border-color: rgba(245, 158, 11, 0.65); background: rgba(30, 41, 59, 0.9); }
.inv-slot-btn.is-empty { background: rgba(15, 23, 42, 0.35); border-style: dashed; border-color: rgba(148, 163, 184, 0.16); color: rgba(148, 163, 184, 0.35); }
.inv-slot-btn.is-selected { border-color: #fbbf24; box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.28); background: rgba(30, 41, 59, 0.96); }
.inv-slot-btn.is-swap-source { border-color: #38bdf8; box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35); }
.inv-slot-btn.is-dimmed { opacity: 0.32; }
.inv-slot-icon { font-size: 1.15rem; line-height: 1.1; }
.inv-slot-name { font-size: 0.58rem; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #cbd5e1; }
.inv-slot-qty { position: absolute; top: 3px; right: 4px; font-size: 0.62rem; font-weight: 800; padding: 0 4px; border-radius: 999px; background: rgba(2, 6, 23, 0.85); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.35); font-variant-numeric: tabular-nums; }
.inv-inspector-card { margin: 4px 12px 12px; padding: 9px 10px; border-radius: 9px; border: 1px solid rgba(245, 158, 11, 0.3); background: rgba(15, 23, 42, 0.82); display: flex; flex-direction: column; gap: 6px; }
.inv-inspector-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inv-inspector-title { font-size: 0.82rem; font-weight: 700; color: #f8fafc; }
.inv-inspector-tag { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; background: rgba(245, 158, 11, 0.16); color: #fde68a; }
.inv-inspector-desc { margin: 0; font-size: 0.71rem; line-height: 1.35; color: #cbd5e1; }
.inv-inspector-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.inv-inspector-actions .btn-customizer-chip { min-height: 32px; font-size: 0.7rem; padding: 4px 9px; }
.gear-slot-store-btn { padding: 2px 7px; font-size: 0.64rem; border-radius: 5px; border: 1px solid rgba(245, 158, 11, 0.4); background: rgba(30, 41, 59, 0.8); color: #fde68a; cursor: pointer; }
.gear-slot-store-btn:hover { background: rgba(245, 158, 11, 0.2); }
.skills-haul-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gear-acquire-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.gold-pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(251, 191, 36, 0.45); background: rgba(120, 53, 15, 0.35); color: #fde68a; font-size: 0.74rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.gear-readonly-note { margin: 0 0 8px; font-size: 0.72rem; line-height: 1.38; color: #cbd5e1; }
.shop-shell { width: min(640px, 100%); max-height: min(86vh, 720px); display: flex; flex-direction: column; border-radius: 14px; border: 1px solid rgba(245, 158, 11, 0.4); background: rgba(15, 23, 42, 0.97); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7); overflow: hidden; }
.shop-tabs-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid rgba(245, 158, 11, 0.22); }
.shop-items-list { flex: 1; overflow-y: auto; padding: 10px 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.shop-item-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 9px; border: 1px solid rgba(148, 163, 184, 0.24); background: rgba(2, 6, 23, 0.56); }
.shop-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shop-item-title { font-size: 0.79rem; color: #f8fafc; }
.shop-item-desc { font-size: 0.68rem; color: #94a3b8; line-height: 1.32; }
.shop-sell-actions, .shop-tab-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.shop-action-btn { white-space: nowrap; font-weight: 700; }
.hud-ability-btn { padding: 4px 7px; border-radius: 7px; border: 1px solid rgba(148, 163, 184, 0.3); background: rgba(15, 23, 42, 0.85); color: #94a3b8; font-size: 0.68rem; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.hud-ability-btn.is-ready { border-color: rgba(251, 191, 36, 0.72); background: rgba(180, 83, 9, 0.35); color: #fde68a; }
.skill-perks-line { font-size: 0.67rem; color: #93c5fd; margin-top: 4px; font-weight: 600; }
.skill-milestone-strip { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.skill-milestone-badge { padding: 2px 6px; border-radius: 5px; border: 1px solid rgba(148, 163, 184, 0.22); background: rgba(15, 23, 42, 0.55); color: var(--text-dim); font-size: 0.62rem; }
.skill-milestone-badge.is-unlocked { border-color: rgba(52, 211, 153, 0.45); background: rgba(6, 78, 59, 0.35); color: #a7f3d0; font-weight: 700; }
.skill-ability-trigger { margin-top: 6px; width: 100%; font-size: 0.69rem; }
.hud-health-pill { display: flex; flex-direction: column; gap: 3px; padding: 6px 10px; border-radius: 10px; border: 1px solid rgba(248, 113, 113, 0.35); background: rgba(15, 23, 42, 0.84); min-width: 158px; backdrop-filter: blur(6px); }
.hud-health-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.hud-health-text { font-size: 0.72rem; font-weight: 800; color: #fecaca; font-variant-numeric: tabular-nums; }
.hud-health-bar-track { height: 6px; width: 100%; border-radius: 999px; background: rgba(2, 6, 23, 0.85); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.08); }
.hud-health-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ef4444, #22c55e); transition: width 0.18s ease; }
.hud-aegis-pill { font-size: 0.62rem; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: rgba(59, 130, 246, 0.25); border: 1px solid rgba(96, 165, 250, 0.55); color: #bfdbfe; }
.hud-combat-btn { border-color: rgba(248, 113, 113, 0.45); }
.hud-combat-btn:hover { border-color: rgba(251, 191, 36, 0.78); }
.gear-paperdoll-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 6px 0 8px; }
.paperdoll-silhouette-spacer { border-radius: 9px; border: 1px dashed rgba(148, 163, 184, 0.16); background: rgba(15, 23, 42, 0.25); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 0.62rem; color: var(--text-dim); min-height: 60px; user-select: none; }
.paperdoll-slot-card { position: relative; min-height: 60px; padding: 6px 5px 5px; border-radius: 9px; border: 1px solid rgba(148, 163, 184, 0.26); background: rgba(15, 23, 42, 0.74); color: #e2e8f0; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease; }
.paperdoll-slot-trigger { width: 100%; padding: 0; border: none; background: transparent; color: inherit; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; }
.paperdoll-slot-card:hover { border-color: rgba(251, 191, 36, 0.72); background: rgba(30, 41, 59, 0.92); }
.paperdoll-slot-card.is-worn { border-color: rgba(245, 158, 11, 0.48); background: rgba(30, 41, 59, 0.85); }
.paperdoll-slot-card.is-selected { border-color: #fbbf24; box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.3); }
.paperdoll-slot-card.is-drop-valid { border-color: #4ade80; box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.35); background: rgba(6, 78, 59, 0.35); }
.paperdoll-slot-card.is-blocked { opacity: 0.52; border-style: dashed; }
.paperdoll-slot-label { font-size: 0.56rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; color: #94a3b8; }
.paperdoll-slot-name { font-size: 0.66rem; font-weight: 700; color: #f8fafc; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paperdoll-slot-stat { font-size: 0.58rem; color: #fde68a; font-weight: 600; }
.paperdoll-slot-unequip-btn { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 1px solid rgba(248, 113, 113, 0.45); background: rgba(127, 29, 29, 0.72); color: #fecaca; font-size: 0.6rem; font-weight: 800; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.paperdoll-slot-unequip-btn:hover { background: rgba(220, 38, 38, 0.92); color: #fff; }
.gear-slot-drawer { margin: 4px 0 8px; padding: 9px 10px; border-radius: 10px; border: 1px solid rgba(251, 191, 36, 0.42); background: rgba(15, 23, 42, 0.92); display: flex; flex-direction: column; gap: 7px; }
.gear-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gear-drawer-title { font-size: 0.78rem; font-weight: 800; color: #fde68a; }
.gear-drawer-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.gear-drawer-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(148, 163, 184, 0.24); background: rgba(2, 6, 23, 0.62); }
.gear-drawer-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gear-drawer-item-name { font-size: 0.73rem; font-weight: 700; color: #f8fafc; }
.gear-drawer-item-perks { font-size: 0.64rem; color: #94a3b8; }
.gear-compare-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.gear-compare-pill { font-size: 0.6rem; font-weight: 800; padding: 1px 6px; border-radius: 999px; border: 1px solid rgba(148, 163, 184, 0.28); background: rgba(15, 23, 42, 0.85); color: #cbd5e1; font-variant-numeric: tabular-nums; }
.gear-compare-pill.is-up { border-color: rgba(74, 222, 128, 0.55); background: rgba(20, 83, 45, 0.5); color: #86efac; }
.gear-compare-pill.is-down { border-color: rgba(248, 113, 113, 0.55); background: rgba(127, 29, 29, 0.5); color: #fecaca; }
.inv-slot-tag { position: absolute; top: 3px; right: 4px; font-size: 0.5rem; font-weight: 800; text-transform: uppercase; padding: 0 3px; border-radius: 4px; background: rgba(15, 23, 42, 0.88); color: #93c5fd; border: 1px solid rgba(147, 197, 253, 0.25); }
.inv-slot-upgrade-badge { position: absolute; top: 3px; left: 4px; font-size: 0.62rem; font-weight: 900; color: #4ade80; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9); }
.inv-slot-btn.is-upgrade { border-color: rgba(74, 222, 128, 0.45); }

/* 11-Skill Gates, Locked Paperdoll/Bag Pills & Timed Elixir HUD Pill */
.hud-elixir-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; color: #a7f3d0; background: rgba(6, 78, 59, 0.72); border: 1px solid rgba(52, 211, 153, 0.55); }
.gear-req-pill { display: inline-block; margin-top: 3px; padding: 2px 7px; border-radius: 999px; font-size: 0.67rem; font-weight: 700; }
.gear-req-pill.is-met { background: rgba(20, 83, 45, 0.52); color: #bbf7d0; border: 1px solid rgba(74, 222, 128, 0.4); }
.gear-req-pill.is-unmet { background: rgba(127, 29, 29, 0.65); color: #fecaca; border: 1px solid rgba(248, 113, 113, 0.55); }
.paperdoll-slot-card.is-locked { border-color: rgba(248, 113, 113, 0.72); background: rgba(69, 10, 10, 0.65); }
.paperdoll-slot-card.is-locked .paperdoll-slot-stat { color: #fca5a5; font-weight: 700; }
.inv-slot-btn.is-locked { border-color: rgba(248, 113, 113, 0.5); opacity: 0.88; }
.inv-slot-lock-badge { position: absolute; top: 3px; left: 4px; font-size: 0.64rem; }
.skill-category-heading { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #94a3b8; margin: 8px 0 4px; }

/* Navigation row, Combat Target Cast HUD, Quick-Heal [6], Vault & Region Map */
.hud-nav-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hud-quick-heal-btn { display: inline-flex; align-items: center; gap: 5px; border-color: rgba(52, 211, 153, 0.55); background: rgba(6, 78, 59, 0.78); color: #ecfdf5; }
.hud-quick-heal-btn.is-cooldown { opacity: 0.7; border-color: rgba(251, 191, 36, 0.55); }
.hud-quick-heal-btn.is-empty { opacity: 0.52; }
.quick-heal-qty { font-size: 0.68rem; font-weight: 800; padding: 1px 5px; border-radius: 999px; background: rgba(15, 23, 42, 0.65); color: #a7f3d0; }
.hud-dodge-btn { display: inline-flex; align-items: center; gap: 4px; border-color: rgba(34, 211, 238, 0.55); background: rgba(14, 116, 144, 0.72); color: #ecfeff; }
.hud-dodge-btn.is-rolling { border-color: rgba(103, 232, 249, 0.95); background: rgba(8, 145, 178, 0.92); box-shadow: 0 0 12px rgba(34, 211, 238, 0.45); }
.hud-dodge-btn.is-cooldown { opacity: 0.68; border-color: rgba(148, 163, 184, 0.45); }
.hud-jump-btn { align-items: center; gap: 4px; border-color: rgba(129, 140, 248, 0.58); background: rgba(49, 46, 129, 0.78); color: #eef2ff; }
.hud-combat-target { position: absolute; bottom: 108px; left: 50%; transform: translateX(-50%); z-index: 54; width: min(310px, calc(100vw - 24px)); padding: 8px 12px; border-radius: 12px; background: rgba(15, 23, 42, 0.88); border: 1px solid rgba(248, 113, 113, 0.45); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.48); pointer-events: none; display: flex; flex-direction: column; gap: 5px; }
.hud-combat-target[hidden] { display: none; }
.hud-combat-target-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.76rem; font-weight: 700; color: #f8fafc; }
.hud-counter-opening-pill { font-size: 0.68rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: rgba(14, 116, 144, 0.82); border: 1px solid rgba(56, 189, 248, 0.75); color: #e0f2fe; }
.hud-target-statuses { display: flex; flex-wrap: wrap; gap: 4px; }
.hud-status-pill { display: inline-flex; align-items: center; gap: 3px; font-size: 0.64rem; font-weight: 800; padding: 1px 6px; border-radius: 999px; background: rgba(15, 23, 42, 0.88); border: 1px solid rgba(250, 204, 21, 0.55); color: #f8fafc; font-variant-numeric: tabular-nums; }
.hud-target-hp-track, .hud-target-cast-wrap { position: relative; height: 16px; border-radius: 999px; overflow: hidden; background: rgba(30, 41, 59, 0.92); border: 1px solid rgba(148, 163, 184, 0.3); }
.hud-target-hp-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #dc2626, #f87171); transition: width 120ms linear; }
.hud-target-cast-wrap { border-color: rgba(249, 115, 22, 0.75); background: rgba(69, 10, 10, 0.85); }
.hud-target-cast-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #f97316, #ef4444); }
.hud-target-hp-text, .hud-target-cast-label { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; height: 100%; font-size: 0.66rem; font-weight: 700; color: #ffffff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85); }
.inv-slot-pin, .bank-slot-pin { position: absolute; top: 2px; right: 3px; font-size: 0.64rem; }
.bank-vault-shell, .world-map-shell { width: min(920px, 96vw); max-height: 92vh; overflow-y: auto; }
.bank-vault-mode-badge.is-peek, #bank-vault-mode-badge.is-peek { background: rgba(120, 53, 15, 0.75); border-color: rgba(251, 191, 36, 0.65); color: #fef3c7; }
.bank-controls-bar, .bank-batch-bar, .world-map-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.bank-filter-group, .bank-qty-group, .world-map-tabs, .world-map-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.bank-search-input { flex: 1 1 160px; min-width: 140px; }
.bank-split-panes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bank-pane { background: rgba(15, 23, 42, 0.68); border: 1px solid rgba(148, 163, 184, 0.25); border-radius: 12px; padding: 10px; }
.bank-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; max-height: 360px; overflow-y: auto; }
.bank-slot-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 6px 4px; border-radius: 10px; border: 1px solid rgba(148, 163, 184, 0.35); background: rgba(30, 41, 59, 0.84); color: #f8fafc; cursor: pointer; }
.bank-slot-btn:hover:not(:disabled) { border-color: rgba(56, 189, 248, 0.8); background: rgba(51, 65, 85, 0.92); }
.bank-slot-btn:disabled { opacity: 0.62; cursor: not-allowed; }
.bank-slot-icon { font-size: 1.18rem; }
.bank-slot-name { font-size: 0.62rem; line-height: 1.15; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bank-slot-qty { font-size: 0.66rem; font-weight: 800; color: #bae6fd; }
.bank-empty-note { grid-column: 1 / -1; font-size: 0.82rem; color: #94a3b8; margin: 8px 4px; }
.world-map-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(220px, 0.85fr); gap: 14px; align-items: start; }
.world-map-canvas-wrap { width: 100%; background: rgba(15, 23, 42, 0.88); border-radius: 12px; border: 1px solid rgba(148, 163, 184, 0.32); overflow: hidden; }
.world-map-canvas { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; cursor: crosshair; }
.world-map-sidebar { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(15, 23, 42, 0.72); border: 1px solid rgba(148, 163, 184, 0.25); }
.world-map-poi-detail { margin: 0; font-size: 0.82rem; line-height: 1.4; color: #e2e8f0; }
.world-map-legend { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 0.76rem; color: #cbd5e1; }
.world-map-legend li { display: flex; align-items: center; gap: 8px; }
.map-dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; flex: 0 0 auto; }
.map-dot.is-hero { background: #38bdf8; }
.map-dot.is-quest { background: #facc15; }
.map-dot.is-waystone { background: #22d3ee; }
.map-dot.is-vault { background: #a855f7; }
.map-dot.is-chest { background: #f59e0b; }
.map-dot.is-resource { background: #4ade80; }
.map-dot.is-wildlife { background: #f87171; }
.hud-low-hp-vignette { position: absolute; inset: 0; pointer-events: none; z-index: 20; opacity: 0; transition: opacity 220ms ease; box-shadow: inset 0 0 84px rgba(220, 38, 38, 0.56); }
.hud-low-hp-vignette.is-active { opacity: 1; }
body.reduced-motion .hud-low-hp-vignette { opacity: 0 !important; }
.hud-top-trackers { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; pointer-events: none; }
.hud-onboarding-wrap { pointer-events: none; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: min(300px, calc(100vw - 120px)); }
.hud-onboarding-wrap[hidden] { display: none; }
.hud-onboarding-bar { display: inline-flex; align-items: stretch; gap: 4px; pointer-events: auto; }
.hud-onboarding-pill, .hud-onboarding-dismiss { pointer-events: auto; padding: 4px 9px; border-radius: 8px; border: 1px solid rgba(56, 189, 248, 0.45); background: rgba(15, 23, 42, 0.8); color: #e0f2fe; font-size: 0.7rem; font-weight: 600; cursor: pointer; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.38); }
.hud-onboarding-pill:hover, .hud-onboarding-dismiss:hover { border-color: rgba(56, 189, 248, 0.85); background: rgba(30, 41, 59, 0.94); }
.hud-onboarding-details { pointer-events: none; display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 7px 10px; border-radius: 8px; border: 1px solid rgba(56, 189, 248, 0.35); background: rgba(15, 23, 42, 0.92); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45); font-size: 0.7rem; color: #e2e8f0; }
.hud-onboarding-details[hidden] { display: none; }
.hud-onboarding-row { display: flex; align-items: center; gap: 6px; }
.hud-onboarding-row.is-done { color: #86efac; text-decoration: line-through; opacity: 0.78; }
@media (max-width: 1023px), (pointer: coarse) {
  .hud-kbd-tag { display: none; }
  .hint-desktop { display: none !important; }
  .hint-touch { display: flex !important; align-items: center; gap: 4px; }
  .hud-jump-btn { display: inline-flex !important; }
  .hud-context-action:not([hidden]) {
    display: inline-flex !important;
    position: absolute;
    right: max(8px, env(safe-area-inset-right, 0px));
    bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 152px);
    z-index: 54;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid rgba(250, 204, 21, 0.75);
    background: rgba(15, 23, 42, 0.92);
    color: #fef3c7;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #virtual-joystick-zone,
  .virtual-joystick-zone {
    display: block !important;
  }
  #virtual-joystick-zone.is-resting { opacity: 0.34; visibility: visible; }
  #virtual-joystick-zone.is-fixed { opacity: 0.72; visibility: visible; }
  #virtual-joystick-zone.is-resting:not(.active) .virtual-joystick-base,
  #virtual-joystick-zone.is-fixed .virtual-joystick-base { left: 78px; top: calc(100% - 108px); }
  #virtual-joystick-zone.active,
  .virtual-joystick-zone.active {
    opacity: 0.92;
    visibility: visible;
  }
  .virtual-joystick-base.is-sprinting { border-color: #facc15; box-shadow: 0 0 22px rgba(250, 204, 21, 0.78), inset 0 0 12px rgba(250, 204, 21, 0.3); }
  body.touch-hints-collapsed #hud-controls-hint { display: none !important; }
  body.touch-hints-collapsed .hud-tool-belt,
  body.touch-hints-collapsed .hud-combat-pad { bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
  body.touch-hints-collapsed .hud-context-action:not([hidden]) { bottom: calc(max(8px, env(safe-area-inset-bottom, 0px)) + 108px); }
  body.touch-hints-collapsed .world-interaction-toast,
  body.touch-hints-collapsed .hud-combat-target { bottom: calc(max(8px, env(safe-area-inset-bottom, 0px)) + 114px); }
  .landing-screen-overlay, .character-creation-overlay { padding: 0; }
  .landing-shell, .creator-shell { border-radius: 0; border: none; }
  .landing-layout, .creator-layout { grid-template-columns: 1fr; overflow-y: auto; }
  .landing-roster-col { border-right: none; border-bottom: 1px solid rgba(245, 158, 11, 0.22); }
  .landing-turntable-canvas, .creator-turntable-canvas { width: 240px; height: 220px; }
  .creator-stage-col { border-right: none; border-bottom: 1px solid rgba(245, 158, 11, 0.2); padding: 10px; }
  .creator-identity-bar { grid-template-columns: 1fr; }
  .hud-action-dock { display: contents; }
  .hud-tool-belt {
    position: absolute;
    left: max(8px, env(safe-area-inset-left, 0px));
    right: auto;
    transform: none;
    bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 48px);
    z-index: 52;
    max-width: calc(100% - 244px);
    padding: 5px 6px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
  }
  .hud-combat-pad {
    position: absolute;
    right: max(8px, env(safe-area-inset-right, 0px));
    bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 48px);
    z-index: 53;
    display: grid;
    grid-template-columns: repeat(3, minmax(44px, auto));
    gap: 3px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.86);
    border: 1px solid rgba(248, 113, 113, 0.42);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.48);
    max-width: 224px;
  }
  .hud-combat-pad .hud-tool-btn,
  .hud-combat-pad .hud-ability-btn {
    padding: 3px 4px;
    font-size: 0.62rem;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }
  .world-interaction-toast, .hud-combat-target {
    bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 162px);
  }
  .gear-new-hero-btn, .landing-enter-btn, .landing-delete-btn, .creator-close-btn, .creator-cancel-btn, .creator-enter-btn, .creator-stage-controls .btn-customizer-chip, .btn-world-toast-close, #gear-hide-helmet-btn, .hud-onboarding-pill, .hud-onboarding-dismiss, .hud-mobile-utility-toggle { min-width: 44px; min-height: 44px; }
  .inv-slot-btn, .inv-inspector-actions .btn-customizer-chip, .inv-filter-bar .btn-customizer-chip, .gear-slot-store-btn, .shop-action-btn, .hud-ability-btn, .hud-tool-btn, .paperdoll-slot-card, .paperdoll-slot-trigger { min-height: 44px; min-width: 44px; }
  .paperdoll-slot-unequip-btn { display: none; }
  .surface-dialog, .hud-region-banner, .hud-gear-badge, .hud-health-pill, .hud-controls-hint, .btn-mobile-hud, .mobile-drawer-scrim, .landing-screen-overlay, .auth-screen-overlay, .world-interaction-toast, .character-creation-overlay, dialog::backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (max-width: 900px) {
  .hud-tool-belt { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .hud-tool-belt {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    max-width: calc(100% - 244px);
    bottom: calc(max(12px, env(safe-area-inset-bottom, 0px)) + 64px);
  }
  .hud-combat-pad { bottom: calc(max(12px, env(safe-area-inset-bottom, 0px)) + 64px); }
  .world-interaction-toast, .hud-combat-target { bottom: calc(max(12px, env(safe-area-inset-bottom, 0px)) + 178px); }
}
@media (max-width: 1023px) and (max-height: 520px), (pointer: coarse) and (max-height: 520px) {
  .exploration-hud { padding: max(6px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
  .hud-top-left { gap: 4px; max-width: calc(100% - 250px); }
  .hud-primary-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; pointer-events: none; max-width: 100%; }
  .hud-primary-row .hud-region-banner { pointer-events: auto; padding: 4px 8px; max-width: 150px; }
  .hud-primary-row .hud-region-title { font-size: 0.78rem; }
  .hud-primary-row .hud-region-subtitle { display: none; }
  .hud-primary-row .hud-health-pill { min-width: 122px; padding: 4px 8px; font-size: 0.68rem; }
  .hud-mobile-utility-toggle { display: inline-flex !important; align-items: center; justify-content: center; pointer-events: auto; padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(56, 189, 248, 0.5); background: rgba(15, 23, 42, 0.86); color: #e0f2fe; font-size: 0.7rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
  .hud-mobile-utility-tray { display: none; flex-direction: column; align-items: flex-start; gap: 4px; pointer-events: auto; }
  .hud-mobile-utility-tray.is-expanded { display: flex; }
  .hud-controls-hint { flex-wrap: nowrap; white-space: nowrap; font-size: 0.68rem; padding: 3px 10px; gap: 8px; }
  .hud-tool-belt { bottom: calc(max(8px, env(safe-area-inset-bottom, 0px)) + 38px); max-width: calc(100% - 446px); flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; }
  .hud-combat-pad { bottom: calc(max(8px, env(safe-area-inset-bottom, 0px)) + 38px); display: flex; flex-wrap: nowrap; max-width: 424px; overflow-x: auto; }
  .hud-context-action:not([hidden]) { bottom: calc(max(8px, env(safe-area-inset-bottom, 0px)) + 98px); }
  body.touch-hints-collapsed .hud-tool-belt,
  body.touch-hints-collapsed .hud-combat-pad { bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
  body.touch-hints-collapsed .hud-context-action:not([hidden]) { bottom: calc(max(8px, env(safe-area-inset-bottom, 0px)) + 60px); }
  body.touch-hints-collapsed .world-interaction-toast,
  body.touch-hints-collapsed .hud-combat-target { bottom: calc(max(8px, env(safe-area-inset-bottom, 0px)) + 62px); }
  .world-interaction-toast, .hud-combat-target { bottom: calc(max(8px, env(safe-area-inset-bottom, 0px)) + 102px); }
  .creator-layout { grid-template-columns: 205px minmax(0, 1fr); overflow: hidden; }
  .creator-stage-col { border-right: 1px solid rgba(245, 158, 11, 0.2); border-bottom: none; padding: 6px; overflow-y: auto; }
  .landing-layout { grid-template-columns: 220px minmax(0, 1fr); overflow: hidden; }
  .landing-roster-col { border-right: 1px solid rgba(245, 158, 11, 0.22); border-bottom: none; overflow-y: auto; }
  .landing-turntable-canvas, .creator-turntable-canvas { width: 176px; height: 156px; }
  .bank-item-grid { max-height: 150px; }
  .world-map-body { grid-template-columns: 220px minmax(0, 1fr); }
  .auth-screen-overlay { align-items: flex-start; overflow-y: auto; padding: 8px 12px; }
  .auth-form { gap: 8px; padding: 10px 14px 12px; }
}
@media (pointer: coarse) and (orientation: portrait) {
  .mobile-rotate-overlay:not([hidden]) { display: flex !important; position: fixed; inset: 0; z-index: 1400; align-items: center; justify-content: center; padding: 24px; background: rgba(6, 10, 20, 0.96); color: #f8fafc; text-align: center; }
  .mobile-rotate-card { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 320px; padding: 24px 20px; border-radius: 16px; border: 1px solid rgba(245, 158, 11, 0.55); background: rgba(15, 23, 42, 0.96); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7); }
  .mobile-rotate-icon { font-size: 2.5rem; }
  .mobile-rotate-card h2 { margin: 0; font-family: var(--font-cinzel, 'Cinzel', serif); color: #fde68a; font-size: 1.25rem; }
  .mobile-rotate-card p { margin: 0; font-size: 0.84rem; line-height: 1.45; color: #cbd5e1; }
}
.hud-top-left { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; }
.hud-gear-badge { pointer-events: auto; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 5px 10px; border-radius: 8px; border: 1px solid rgba(245, 158, 11, 0.35); background: rgba(15, 23, 42, 0.78); color: var(--text-soft, #e2e8f0); cursor: pointer; text-align: left; font-family: var(--font-body, system-ui, sans-serif); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); transition: border-color 0.15s ease, background 0.15s ease; }
.hud-gear-badge:hover { border-color: rgba(245, 158, 11, 0.75); background: rgba(30, 41, 59, 0.92); }
.hud-gear-weight { font-size: 0.72rem; font-weight: 700; color: var(--gold-text, #fde68a); letter-spacing: 0.03em; }
.hud-gear-stats { font-size: 0.67rem; color: var(--text-muted, #94a3b8); }
.gear-stats-summary, .gear-set-bonuses, .gear-equipped-inspector { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.gear-archetype-banner { padding: 7px 9px; border-radius: 7px; border: 1px solid rgba(245, 158, 11, 0.25); background: rgba(15, 23, 42, 0.75); font-size: 0.72rem; line-height: 1.35; }
.gear-archetype-title { display: block; font-weight: 700; color: var(--gold-text, #fde68a); margin-bottom: 2px; }
.gear-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.gear-stat-pill { display: flex; align-items: center; justify-content: space-between; padding: 4px 7px; border-radius: 5px; background: rgba(30, 41, 59, 0.65); border: 1px solid rgba(148, 163, 184, 0.2); font-size: 0.69rem; color: #cbd5e1; }
.gear-stat-pill strong { color: #fde68a; font-variant-numeric: tabular-nums; }
.gear-set-card { padding: 6px 8px; border-radius: 6px; background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.4); font-size: 0.7rem; color: #fde68a; }
.gear-slot-card { padding: 6px 8px; border-radius: 6px; background: rgba(15, 23, 42, 0.68); border: 1px solid rgba(148, 163, 184, 0.22); display: flex; flex-direction: column; gap: 2px; font-size: 0.7rem; }
.gear-slot-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 700; color: #f8fafc; }
.gear-slot-card-tag { font-size: 0.62rem; font-weight: 600; padding: 1px 5px; border-radius: 999px; background: rgba(245, 158, 11, 0.18); color: #fde68a; text-transform: uppercase; }
.gear-slot-card-desc { color: #cbd5e1; line-height: 1.32; }
.gear-slot-card-perks { color: #93c5fd; font-weight: 600; font-size: 0.66rem; }
.creator-kit-preview { padding: 7px 14px; border-bottom: 1px solid rgba(245, 158, 11, 0.18); background: rgba(15, 23, 42, 0.72); font-size: 0.73rem; color: #cbd5e1; display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
body.quality-performance :is(.surface-dialog, .hud-region-banner, .hud-gear-badge, .hud-health-pill, .hud-controls-hint, .btn-mobile-hud, .mobile-drawer-scrim, .landing-screen-overlay, .auth-screen-overlay, .world-interaction-toast, .character-creation-overlay, .hud-waystone-btn, .scene-transition-curtain),
body.quality-performance dialog::backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
.hud-waystone-btn { pointer-events: auto; padding: 4px 10px; border-radius: 8px; border: 1px solid rgba(56, 189, 248, 0.45); background: rgba(15, 23, 42, 0.8); color: #e0f2fe; font-size: 0.7rem; font-weight: 700; cursor: pointer; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.38); }
.hud-waystone-btn:hover { border-color: rgba(56, 189, 248, 0.85); background: rgba(30, 41, 59, 0.94); }
.scene-transition-curtain { position: absolute; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; pointer-events: none; background: rgba(2, 6, 23, 0.84); opacity: 0; transition: opacity 220ms ease; }
.scene-transition-curtain.is-visible { opacity: 1; pointer-events: auto; }
.scene-transition-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 24px; border-radius: 12px; border: 1px solid rgba(250, 204, 21, 0.48); background: rgba(15, 23, 42, 0.94); box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65); color: #f8fafc; text-align: center; }
.scene-transition-card span:first-child { font-size: 1.45rem; }
.scene-transition-card strong { font-size: 1.08rem; color: #fde68a; letter-spacing: 0.03em; }
.scene-transition-card span:last-child { font-size: 0.76rem; color: #cbd5e1; }
.auth-screen-overlay { position: fixed; inset: 0; z-index: 950; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(6, 10, 20, 0.88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.auth-card { width: min(440px, 100%); border-radius: 14px; border: 1px solid rgba(245, 158, 11, 0.38); background: rgba(15, 23, 42, 0.96); box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65); overflow: hidden; }
.auth-mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 18px 0; }
.auth-form { display: flex; flex-direction: column; gap: 12px; padding: 14px 18px 18px; }
.auth-field { display: flex; flex-direction: column; gap: 5px; font-size: 0.8rem; font-weight: 600; color: #e2e8f0; }
.auth-field input { padding: 9px 11px; border-radius: 8px; border: 1px solid rgba(148, 163, 184, 0.35); background: rgba(2, 6, 23, 0.72); color: #f8fafc; font-size: 0.9rem; }
.auth-error-msg { margin: 0; padding: 8px 10px; border-radius: 8px; background: rgba(127, 29, 29, 0.5); border: 1px solid rgba(248, 113, 113, 0.45); color: #fecaca; font-size: 0.78rem; }
.auth-submit-btn { width: 100%; padding: 10px 14px; font-weight: 700; }
.landing-header-meta, .auth-settings-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
.auth-account-name { font-weight: 700; color: var(--gold-text, #fde68a); font-size: 0.85rem; }
.hud-guest-sync-btn { pointer-events: auto; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(56, 189, 248, 0.45); background: rgba(15, 23, 42, 0.82); color: #bae6fd; font-size: 0.7rem; font-weight: 700; cursor: pointer; min-height: 28px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35); }
.hud-guest-sync-btn:hover { border-color: rgba(56, 189, 248, 0.85); color: #f0f9ff; }
.auth-guest-btn { width: 100%; padding: 8px 12px; font-size: 0.82rem; }
.auth-selfservice-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.auth-inline-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding: 10px; border-radius: 8px; background: rgba(2, 6, 23, 0.55); border: 1px solid rgba(148, 163, 184, 0.25); }
.auth-danger-chip { border-color: rgba(248, 113, 113, 0.45); color: #fca5a5; }
.auth-danger-form { border-color: rgba(248, 113, 113, 0.45); }
.auth-danger-note { margin: 0; font-size: 0.72rem; line-height: 1.35; color: #fecaca; }
.auth-danger-btn { width: 100%; padding: 8px 12px; font-weight: 700; background: rgba(185, 28, 28, 0.88); color: #fff; border: 1px solid rgba(252, 165, 165, 0.5); border-radius: 8px; cursor: pointer; }
.auth-danger-btn:hover { background: rgba(220, 38, 38, 0.96); }
.landing-signin-btn { padding: 6px 12px; font-size: 0.78rem; }
.hud-quest-wrap { pointer-events: none; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: min(320px, calc(100vw - 120px)); }
.hud-quest-pill { pointer-events: auto; padding: 4px 10px; border-radius: 8px; border: 1px solid rgba(250, 204, 21, 0.36); background: rgba(15, 23, 42, 0.78); color: #fef3c7; font-size: 0.7rem; font-weight: 600; cursor: pointer; text-align: left; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.38); }
.hud-quest-pill:hover { border-color: rgba(250, 204, 21, 0.75); background: rgba(30, 41, 59, 0.92); }
.hud-quest-details { pointer-events: none; display: flex; flex-direction: column; gap: 5px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(250, 204, 21, 0.34); background: rgba(15, 23, 42, 0.92); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45); font-size: 0.7rem; color: #e2e8f0; }
.hud-quest-row { display: flex; flex-direction: column; gap: 1px; border-bottom: 1px solid rgba(148, 163, 184, 0.16); padding-bottom: 4px; }
.hud-quest-row:last-child { border-bottom: none; padding-bottom: 0; }
.hud-quest-row strong { color: #fde68a; }
.station-recipe-card { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(148, 163, 184, 0.24); background: rgba(15, 23, 42, 0.72); }
.station-recipe-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.station-recipe-name { font-size: 0.86rem; color: #f8fafc; }
.station-req-pill { font-size: 0.68rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(30, 41, 59, 0.85); color: #fde68a; }
.station-req-pill.is-met { color: #86efac; border: 1px solid rgba(74, 222, 128, 0.35); }
.station-req-pill.is-locked { color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.35); }
.station-recipe-desc { margin: 0; font-size: 0.74rem; color: #cbd5e1; line-height: 1.35; }
.station-ingredients { display: flex; flex-wrap: wrap; gap: 6px; }
.station-ing-pill { font-size: 0.7rem; padding: 2px 8px; border-radius: 6px; background: rgba(2, 6, 23, 0.65); border: 1px solid rgba(148, 163, 184, 0.25); color: #cbd5e1; }
.station-ing-pill.is-have { border-color: rgba(74, 222, 128, 0.45); color: #bbf7d0; }
.station-ing-pill.is-missing { border-color: rgba(248, 113, 113, 0.4); color: #fecaca; }
.station-recipe-footer { display: flex; justify-content: flex-end; gap: 8px; }
.npc-dialog-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 16px; overflow-y: auto; max-height: 75vh; }
.npc-dialog-body .shop-items-list { flex: none; overflow: visible; padding: 0; }
.npc-dialog-quote { margin: 0; padding: 10px 12px; border-left: 3px solid #f59e0b; border-radius: 6px; background: rgba(30, 41, 59, 0.65); color: #f1f5f9; font-size: 0.82rem; line-height: 1.45; }
.npc-quest-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.npc-contract-steps { margin: 2px 0; padding-left: 14px; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 0.74rem; color: #cbd5e1; }
.npc-contract-steps li.is-done { color: #86efac; }
.npc-contract-steps li.is-current { color: #fde68a; font-weight: 700; }
.npc-contract-reward { margin: 0; font-size: 0.73rem; font-weight: 600; color: #93c5fd; }
@media (max-width: 720px) {
  .bank-mobile-tabs { display: flex !important; gap: 6px; margin-bottom: 8px; }
  .bank-split-panes[data-mobile-pane="vault"] > .bank-pane:last-child { display: none; }
  .bank-split-panes[data-mobile-pane="bag"] > .bank-pane:first-child { display: none; }
  .bank-split-panes, .world-map-body { grid-template-columns: 1fr; }
  .hud-combat-target { bottom: 132px; }
}

/* ==========================================================================
   8. Coarse Pointer Touch Target Accessibility (Apple HIG / WCAG 2.5.5)
   Final cascade block so touch hitboxes consistently override base rules.
   ========================================================================== */
@media (pointer: coarse) {
  dialog.surface-dialog, dialog.guide-modal-dialog, .surface-dialog, .guide-modal-dialog { width: min(96vw, 1060px); max-height: min(92dvh, calc(100% - 24px)); padding: max(0.85rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) max(1.2rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px)); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  dialog::backdrop { background-color: rgba(4, 7, 14, 0.78); backdrop-filter: none; -webkit-backdrop-filter: none; touch-action: none; overscroll-behavior: contain; }
  .close-btn, #close-guide-btn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; font-size: 1.3rem; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent; flex-shrink: 0; position: relative; }
  .close-btn::after { content: ''; position: absolute; inset: -4px; }
  .guide-dialog-header { flex-wrap: wrap; gap: 0.65rem; }
  .guide-header-actions { display: flex; align-items: center; gap: 0.65rem; }
  .guide-external-link { min-height: 44px; padding: 8px 14px; font-size: 0.85rem; display: inline-flex; align-items: center; justify-content: center; touch-action: manipulation; border-radius: 8px; }
  .guide-chapter-nav { gap: 0.5rem; -webkit-overflow-scrolling: touch; scroll-padding: 8px; }
  .guide-nav-btn { min-height: 44px; padding: 10px 14px; font-size: 0.88rem; gap: 0.65rem; touch-action: manipulation; display: flex; align-items: center; flex-shrink: 0; }
  .craft-search-input, #guide-search-input { min-height: 44px; padding: 10px 48px 10px 2.1rem; font-size: 1rem; touch-action: manipulation; }
  .craft-search-clear, #guide-search-clear { width: 44px; height: 44px; min-width: 44px; min-height: 44px; right: 2px; font-size: 1.15rem; display: flex; align-items: center; justify-content: center; touch-action: manipulation; }
  .guide-screenshot-link { touch-action: manipulation; }
  #customizer-turntable-canvas, .customizer-turntable-canvas { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; max-width: 100%; }
  .customizer-stage-controls { flex-wrap: wrap; gap: 8px; margin-top: 8px; width: 100%; }
  .customizer-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  #customizer-walk-toggle-btn, #customizer-closeup-toggle-btn { min-height: 44px; min-width: 44px; padding: 8px 12px; font-size: 0.85rem; touch-action: manipulation; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }
  .customizer-swatch-row { gap: 8px; }
  .customizer-swatch { width: 36px; height: 36px; margin: 4px; position: relative; touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent; }
  .customizer-swatch::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; }
  .customizer-color-input, input[type="color"].customizer-color-input { width: 44px; height: 44px; min-width: 44px; min-height: 44px; margin: 0; padding: 2px; border-radius: 50%; touch-action: manipulation; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
  .customizer-chip-row { gap: 8px 6px; }
  .btn-customizer-chip, .btn-customizer-action { min-height: 44px; padding: 8px 14px; font-size: 0.85rem; display: inline-flex; align-items: center; justify-content: center; touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent; }
  .customizer-subtabs { gap: 6px; padding: 8px 10px; }
  .customizer-subtab-btn { min-height: 44px; min-width: 44px; padding: 8px 6px; font-size: 0.82rem; display: flex; align-items: center; justify-content: center; touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent; }
  .right-menu-tabs { grid-template-columns: repeat(6, minmax(44px, 1fr)); gap: 4px; padding: 6px; overflow-x: auto; }
  .right-menu-tab-btn { min-height: 48px; min-width: 44px; padding: 6px 2px; font-size: 0.72rem; touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent; }
  .creator-header { position: sticky; top: 0; z-index: 4; background: rgba(15, 23, 42, 0.96); }
}
@media (min-width: 1024px) and (pointer: coarse) { .right-menu-bar { flex: 0 0 clamp(316px, 24vw, 350px); width: clamp(316px, 24vw, 350px); } }
@media (pointer: coarse) {
  #right-menu-open-guide-page-link, #right-menu-open-wiki-page-link { min-height: 44px; padding: 10px 16px; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; touch-action: manipulation; }
  .audio-slider-row { gap: 6px; padding: 2px 0; }
  .audio-slider-val { font-size: 0.82rem; }
  .audio-range-slider { width: 100%; height: 44px; min-height: 44px; background: transparent; cursor: pointer; touch-action: none; margin: 4px 0; -webkit-appearance: none; appearance: none; }
  .audio-range-slider::-webkit-slider-runnable-track { width: 100%; height: 10px; background: rgba(30, 41, 59, 0.9); border: 1px solid rgba(148, 163, 184, 0.35); border-radius: 5px; }
  .audio-range-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #f59e0b; border: 2px solid #ffffff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); margin-top: -9px; cursor: pointer; touch-action: none; transition: transform 0.12s ease, background 0.12s ease; }
  .audio-range-slider::-moz-range-track { width: 100%; height: 10px; background: rgba(30, 41, 59, 0.9); border: 1px solid rgba(148, 163, 184, 0.35); border-radius: 5px; }
  .audio-range-slider::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #f59e0b; border: 2px solid #ffffff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); cursor: pointer; touch-action: none; transition: transform 0.12s ease, background 0.12s ease; }
  .audio-range-slider:active::-webkit-slider-thumb, .audio-range-slider:active::-moz-range-thumb { transform: scale(1.15); background: #fbbf24; box-shadow: 0 0 12px rgba(245, 158, 11, 0.85); }
  .audio-transport-row { gap: 10px; margin-top: 6px; }
  .audio-transport-row .btn-customizer-chip, .audio-transport-row .btn-customizer-action, #audio-prev-track-btn, #audio-next-track-btn, #audio-mute-toggle-btn { min-height: 44px; min-width: 44px; padding: 8px 14px; font-size: 0.85rem; display: inline-flex; align-items: center; justify-content: center; touch-action: manipulation; }
  .customizer-select, .studio-bar-select, #audio-track-select, #audio-ambience-select { min-width: 44px; min-height: 44px; padding: 10px 12px; font-size: 0.92rem; touch-action: manipulation; }
  .btn-studio-zoom { width: 44px; height: 44px; min-width: 44px; min-height: 44px; touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent; }
  .btn-color-swatch { width: 44px; height: 44px; min-width: 44px; min-height: 44px; touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent; }
  .studio-zoom-slider, .customizer-slider { min-width: 44px; min-height: 44px; height: 44px; touch-action: manipulation; }
  .settings-checkbox { width: 44px; height: 44px; min-width: 44px; min-height: 44px; touch-action: manipulation; }
  .hud-guest-sync-btn, .hud-quest-pill, .hud-gear-badge, .hud-waystone-btn, .hud-map-btn, .hud-quick-heal-btn, .hud-context-action, .hud-mobile-utility-toggle, .bank-mobile-tabs button, .bank-filter-group button, .bank-qty-group button, .bank-batch-bar button, .world-map-filters button, .world-map-tabs button, .creator-close-btn { min-height: 44px; min-width: 44px; padding: 8px 12px; touch-action: manipulation; }
  .auth-field input, .creator-text-input { min-height: 44px; font-size: 1rem; }
  .btn, .btn-guide-hud, .right-menu-full-guide-btn { min-height: 44px; min-width: 44px; padding: 10px 16px; touch-action: manipulation; display: inline-flex; align-items: center; justify-content: center; }
  .compass-rose-container, #compass-rose-container { min-width: 44px; min-height: 44px; touch-action: manipulation; }
}
