  @font-face {
    font-family: 'Inversionz';
    src: url('../Inversionz Unboxed.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
  }

  :root {
    --hpw-bg: #14100a;
    --hpw-card: #1f1810;
    --hpw-fg: #f4ead5;
    --hpw-mint: #97FCE4;
    --hypurr-paw-cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32'%3E%3Cellipse cx='16' cy='22' rx='9' ry='7' fill='%2397FCE4' stroke='%2314100A' stroke-width='2'/%3E%3Cellipse cx='6' cy='13' rx='3.2' ry='4' fill='%2397FCE4' stroke='%2314100A' stroke-width='1.8'/%3E%3Cellipse cx='12' cy='7' rx='3' ry='4' fill='%2397FCE4' stroke='%2314100A' stroke-width='1.8'/%3E%3Cellipse cx='20' cy='7' rx='3' ry='4' fill='%2397FCE4' stroke='%2314100A' stroke-width='1.8'/%3E%3Cellipse cx='26' cy='13' rx='3.2' ry='4' fill='%2397FCE4' stroke='%2314100A' stroke-width='1.8'/%3E%3C/svg%3E") 8 8, auto;
    --game-cursor: var(--hypurr-paw-cursor);
    --game-cursor-pointer: var(--hypurr-paw-cursor);
    --game-cursor-text: var(--hypurr-paw-cursor);
    --hypurr-display: 'Fredoka', system-ui, sans-serif;
    --hypurr-body: 'Nunito', system-ui, sans-serif;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body { width: 100%; height: 100%; overflow: hidden; background: #000; }
  body {
    font-family: var(--hypurr-body);
  }
  canvas {
    display: block;
    transition: opacity 0.8s ease;
  }
  body.startup-settling canvas {
    opacity: 0;
  }
  body.startup-ready canvas {
    opacity: 1;
  }

  html,
  body,
  canvas,
  #blocker,
  #menu-main,
  #multiplayer-chat {
    cursor: var(--game-cursor) !important;
  }

  a,
  button:not(:disabled),
  [role="button"],
  input[type="button"],
  input[type="submit"],
  .menu-icon-btn,
  .menu-btn,
  .option-btn {
    cursor: var(--game-cursor-pointer) !important;
  }

  input,
  textarea,
  [contenteditable="true"] {
    cursor: var(--game-cursor-text) !important;
  }

  body.gameplay-cursor,
  body.gameplay-cursor canvas,
  body.gameplay-cursor #multiplayer-chat {
    cursor: var(--game-cursor);
  }

  body.gameplay-cursor button {
    cursor: var(--game-cursor-pointer);
  }

  #pet-heart-layer {
    position: fixed;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    overflow: visible;
  }

  #emote-wheel {
    position: fixed;
    inset: 0;
    z-index: 18;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    background: radial-gradient(circle at center, rgba(20, 16, 10, 0.2), rgba(20, 16, 10, 0.46));
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    transition: opacity 0.12s ease, visibility 0.12s linear;
  }
  #emote-wheel.open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.12s ease;
  }
  #emote-wheel.open .emote-wheel-ring {
    animation: emote-wheel-pop-in 0.18s cubic-bezier(0.2, 1.4, 0.36, 1) both;
  }
  #emote-wheel:not(.open) .emote-wheel-ring {
    animation: emote-wheel-pop-out 0.12s ease-in both;
  }
  @keyframes emote-wheel-pop-in {
    0% { opacity: 0; transform: scale(0.72); }
    72% { opacity: 1; transform: scale(1.06); }
    100% { opacity: 1; transform: scale(1); }
  }
  @keyframes emote-wheel-pop-out {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.82); }
  }
  .emote-wheel-ring {
    position: relative;
    width: min(360px, calc(100vw - 42px));
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 1px solid rgba(151, 252, 228, 0.26);
    background:
      radial-gradient(circle at center, rgba(151, 252, 228, 0.18) 0 22%, rgba(20, 16, 10, 0.74) 23% 47%, rgba(255, 255, 255, 0.08) 48% 49%, rgba(20, 16, 10, 0.52) 50% 100%);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42), inset 0 0 42px rgba(151, 252, 228, 0.08);
  }
  .emote-wheel-item {
    position: absolute;
    left: 50%;
    top: 50%;
    width: clamp(62px, 18vw, 86px);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    transform: translate(-50%, -50%) translate(var(--emote-x), var(--emote-y));
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(8px) saturate(1.15);
    -webkit-backdrop-filter: blur(8px) saturate(1.15);
    transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
  }
  .emote-wheel-item:hover,
  .emote-wheel-item:focus-visible {
    border-color: rgba(151, 252, 228, 0.72);
    background: rgba(151, 252, 228, 0.18);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.34), 0 0 22px rgba(151, 252, 228, 0.24);
    transform: translate(-50%, -50%) translate(var(--emote-x), var(--emote-y)) scale(1.08);
  }
  .emote-wheel-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 4px 0 rgba(20, 16, 10, 0.22));
  }
  .emote-wheel-core {
    position: absolute;
    left: 50%;
    top: 50%;
    width: clamp(76px, 20vw, 98px);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(151, 252, 228, 0.5);
    background: rgba(20, 16, 10, 0.82);
    color: #97FCE4;
    font-family: var(--hypurr-display);
    font-size: 30px;
    font-weight: 700;
    box-shadow: inset 0 0 24px rgba(151, 252, 228, 0.14);
    pointer-events: none;
  }

  .pet-heart {
    position: absolute;
    left: 0;
    top: 0;
    width: clamp(52px, 5.4vw, 86px);
    aspect-ratio: 1 / 1;
    background: url("../assets/pet-heart.png") center / contain no-repeat;
    filter: drop-shadow(0 5px 0 rgba(20, 16, 10, 0.35)) drop-shadow(0 0 14px rgba(255, 154, 188, 0.22));
    transform: translate(-50%, -50%) scale(var(--scale, 1));
    animation: pet-heart-float 1.2s ease-out forwards;
    will-change: transform, opacity;
  }

  @keyframes pet-heart-float {
    0% { opacity: 0; transform: translate(-50%, -20%) translateX(0) scale(0.65) rotate(-8deg); }
    15% { opacity: 1; }
    100% { opacity: 0; transform: translate(calc(-50% + var(--drift, 0px)), calc(-20% - var(--rise, 78px))) scale(var(--scale, 1)) rotate(10deg); }
  }

  @media (prefers-reduced-motion: reduce) {
    .pet-heart {
      animation-duration: 0.01ms;
      opacity: 0;
    }
  }

  #blocker {
    position: fixed; inset: 0; z-index: 10;
    background: rgba(20, 16, 10, 0.88);
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; cursor: pointer;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    transition: opacity 0.8s ease;
  }
  body.startup-settling #blocker {
    opacity: 0;
    pointer-events: none;
  }
  body.startup-ready #blocker {
    opacity: 1;
    pointer-events: auto;
  }
  #blocker .menu-brand-icon {
    display: block;
    width: clamp(86px, 12vw, 132px);
    height: auto;
    margin-bottom: 18px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.35));
  }
  #blocker .menu-brand-logo {
    display: block;
    width: clamp(180px, 32vw, 320px);
    max-width: calc(100vw - 48px);
    height: auto;
    margin-bottom: 4px;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.38));
  }
  #blocker h1 {
    font-family: var(--hypurr-display); color: var(--hpw-fg);
    font-size: 72px; margin-bottom: 8px; letter-spacing: 0;
    font-weight: 700; line-height: 1.02;
  }
  #blocker .sub {
    font-family: var(--hypurr-body); color: #5CC9B5;
    font-weight: 800;
    font-size: 14px; letter-spacing: 4px; margin-bottom: 32px;
  }
  #blocker p {
    font-family: var(--hypurr-body); color: #888;
    font-size: 15px; line-height: 2; text-align: center;
  }
  #blocker .key {
    display: inline-block; background: rgba(151, 252, 228, 0.1);
    border: 1px solid rgba(151, 252, 228, 0.4); border-radius: 4px;
    padding: 2px 10px; font-family: var(--hypurr-body);
    font-weight: 800;
    color: #97FCE4; font-size: 13px;
  }
  #blocker .start-hint {
    margin-top: 28px; color: #555; font-size: 13px;
    font-family: var(--hypurr-body); animation: pulse 2s infinite;
  }
  @keyframes pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

  /* Pause menu icon buttons */
  #blocker .menu-icon-row {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 10px;
  }
  #blocker .menu-icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.84);
    font-family: var(--hypurr-body);
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(10px) saturate(1.15);
    -webkit-backdrop-filter: blur(10px) saturate(1.15);
    transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #blocker .menu-icon-btn:hover {
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), 0 0 16px rgba(255, 255, 255, 0.18);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.32);
  }

  /* Controls panel */
  #blocker .controls-panel {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    inset: 0;
    animation: fadeIn 0.3s ease;
    font-family: var(--hypurr-body);
  }
  #blocker .controls-panel.show {
    display: flex;
  }
  #blocker .controls-panel .controls-title {
    font-family: var(--hypurr-display);
    color: #97FCE4;
    font-size: 24px;
    letter-spacing: 0;
    font-weight: 700;
    margin-bottom: 20px;
  }
  #blocker .controls-panel .controls-close {
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.84);
    font-family: var(--hypurr-body);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    cursor: pointer;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(10px) saturate(1.15);
    -webkit-backdrop-filter: blur(10px) saturate(1.15);
    transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  }
  #blocker .controls-panel .controls-close:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), 0 0 16px rgba(255, 255, 255, 0.18);
  }
  #blocker .options-panel {
    max-width: min(520px, calc(100vw - 40px));
    margin: 0 auto;
  }
  #blocker .option-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(440px, calc(100vw - 56px));
  }
  #blocker .option-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.96);
    cursor: pointer;
    font-family: var(--hypurr-body);
    font-weight: 700;
    text-align: left;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px) saturate(1.1);
    -webkit-backdrop-filter: blur(8px) saturate(1.1);
    transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  }
  #blocker .option-toggle:hover {
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), 0 0 16px rgba(255, 255, 255, 0.18);
  }
  #blocker .option-label,
  #blocker .option-description,
  #blocker .option-value {
    display: block;
  }
  #blocker .option-label {
    font-size: 13px;
    letter-spacing: 2px;
  }
  #blocker .option-description {
    margin-top: 5px;
    color: #666;
    font-size: 11px;
    letter-spacing: 1px;
  }
  #blocker .option-value {
    min-width: 44px;
    padding: 4px 8px;
    border: 1px solid rgba(151, 252, 228, 0.3);
    color: #97FCE4;
    font-size: 12px;
    text-align: center;
  }
  #blocker .option-toggle.is-off .option-value {
    border-color: rgba(255,90,60,0.35);
    color: #ff5a3c;
  }
  #blocker .option-expander {
    width: 100%;
    border: 1px solid rgba(151, 252, 228, 0.16);
    background: rgba(151, 252, 228, 0.025);
  }
  #blocker .option-expander summary {
    padding: 10px 14px;
    color: #5CC9B5;
    cursor: pointer;
    font-family: var(--hypurr-body);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 2px;
    list-style-position: inside;
    transition: all 0.2s;
  }
  #blocker .option-expander summary:hover {
    color: #97FCE4;
    background: rgba(151, 252, 228, 0.05);
  }
  #blocker .option-expander .option-toggle {
    border-width: 1px 0 0;
  }
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  #loading {
    position: fixed; inset: 0; z-index: 20;
    background: var(--hpw-bg);
    display: grid; place-items: center;
    align-items: center; justify-content: center;
    flex-direction: column;
    transition: opacity 0.6s ease, visibility 0.6s ease;
  }
  #loading.site-loader--leaving {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .site-loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--hpw-fg);
    font-family: var(--hypurr-display);
    font-weight: 600;
  }
  .site-loader-inner img {
    display: block;
    width: 150px;
    max-width: 42vw;
    height: auto;
  }
  #loading h2 {
    font-family: var(--hypurr-display); color: var(--hpw-mint);
    font-size: 16px; margin-top: 2px; letter-spacing: 0;
    font-weight: 700;
  }
  #loading h2:empty { display: none; }
  .progress-bar {
    width: 132px; height: 8px;
    border: 2px solid var(--hpw-fg);
    border-radius: 999px; overflow: hidden;
    background: var(--hpw-card);
  }
  .progress-fill {
    display: block;
    width: 42% !important; height: 100%;
    background: var(--hpw-mint);
    border-radius: 999px;
    animation: loader-slide 1.05s ease-in-out infinite;
    transition: width 0.3s;
  }
  @keyframes loader-slide {
    0% { transform: translateX(-110%); }
    50% { transform: translateX(85%); }
    100% { transform: translateX(260%); }
  }
  @media (prefers-reduced-motion: reduce) {
    #loading { transition: none; }
    .progress-fill { animation: none; width: 100% !important; }
  }

  #hud-stack {
    position: fixed; top: 20px; left: 20px; z-index: 5;
    display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
  }
  #player-nametag {
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: #e8fff8;
    line-height: 1.35;
    padding: 8px 12px;
    background: rgba(28, 30, 34, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  #nametag-name {
    font-size: 14px; font-weight: 600;
    color: rgba(151, 252, 228, 0.98);
    letter-spacing: 0.02em;
  }
  #nametag-wallet {
    font-family: var(--hypurr-body);
    font-weight: 700;
    font-size: 11px;
    color: rgba(151, 252, 228, 0.62);
    margin-top: 2px;
  }
  #hud-debug {
    font-family: 'Courier New', monospace; color: #97FCE4;
    font-size: 12px;
    text-shadow: 0 0 8px rgba(151, 252, 228, 0.3);
    line-height: 1.8;
  }
  body.vision-scan #hud-debug {
    color: #ff2a1f;
    text-shadow: 0 0 10px rgba(255,42,31,0.55);
  }
  body.vision-fallback-scanlines::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    background:
      radial-gradient(circle at 50% 50%, rgba(151, 252, 228, 0.04), rgba(8, 48, 42, 0.16)),
      repeating-linear-gradient(
        to bottom,
        rgba(151, 252, 228, 0.045) 0,
        rgba(151, 252, 228, 0.045) 1px,
        transparent 1px,
        transparent 4px
      );
    mix-blend-mode: screen;
  }
  body.scan-fallback-tint::after {
    background:
      radial-gradient(circle at 50% 50%, rgba(255,35,25,0.08), rgba(90,0,0,0.22)),
      repeating-linear-gradient(
        to bottom,
        rgba(255,35,25,0.06) 0,
        rgba(255,35,25,0.06) 1px,
        transparent 1px,
        transparent 4px
      );
  }
  #energy-bar-outer {
    width: 180px; height: 6px; margin-top: 6px;
    background: rgba(151, 252, 228, 0.08);
    border: 1px solid rgba(151, 252, 228, 0.25);
    border-radius: 3px; overflow: hidden;
  }
  body.vision-scan #energy-bar-outer {
    background: rgba(255,30,20,0.08);
    border-color: rgba(255,42,31,0.28);
  }
  #energy-bar-inner {
    width: 100%; height: 100%;
    background: linear-gradient(90deg, #97FCE4, #CFFFF4);
    border-radius: 3px;
    transition: width 0.2s;
    box-shadow: 0 0 8px rgba(151, 252, 228, 0.4);
  }
  body.vision-scan #energy-bar-inner {
    background: linear-gradient(90deg, #ff2218, #ff7058);
    box-shadow: 0 0 10px rgba(255,42,31,0.5);
  }
  #energy-bar-inner.low {
    background: linear-gradient(90deg, #ff4444, #ff8800);
    box-shadow: 0 0 8px rgba(255,68,68,0.4);
  }
  #energy-label {
    display: flex; justify-content: space-between; width: 180px;
    font-size: 10px; margin-top: 2px; opacity: 0.7;
  }
  #scan-cooldown {
    position: fixed; top: 20px; right: 20px; z-index: 5;
    width: 180px; opacity: 0; pointer-events: none;
    font-family: 'Courier New', monospace; color: #ff2a1f;
    font-size: 12px; line-height: 1.8;
    text-align: left;
    text-shadow: 0 0 10px rgba(255,42,31,0.55);
    transition: opacity 0.18s;
  }
  #scan-cooldown.show { opacity: 1; }
  #scan-cooldown-bar-outer {
    width: 180px; height: 6px; margin-top: 6px;
    background: rgba(255,30,20,0.08);
    border: 1px solid rgba(255,42,31,0.28);
    border-radius: 3px; overflow: hidden;
  }
  #scan-cooldown-bar-inner {
    width: 100%; height: 100%;
    background: linear-gradient(90deg, #ff2218, #ff7058);
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(255,42,31,0.5);
  }
  #scan-cooldown-label {
    display: flex; justify-content: space-between; width: 180px;
    font-size: 10px; margin-top: 2px; opacity: 0.75;
  }
  #scan-readout {
    position: fixed; top: 72px; right: 20px; z-index: 5;
    width: 220px; opacity: 0; pointer-events: none;
    font-family: 'Courier New', monospace; color: #ff2a1f;
    font-size: 11px; line-height: 1.6;
    text-align: right;
    text-shadow: 0 0 10px rgba(255,42,31,0.55);
  }
  #scan-entity-ids {
    overflow-wrap: anywhere;
    white-space: pre-line;
  }
  #scan-entity-modal {
    position: fixed; right: 20px; bottom: 24px; z-index: 5;
    width: 280px; opacity: 0; pointer-events: none;
    padding: 12px 14px;
    border: 1px solid rgba(255,42,31,0.35);
    background: transparent;
    font-family: 'Courier New', monospace; color: #ff2a1f;
    font-size: 11px; line-height: 1.65;
    text-align: left;
    text-shadow: none;
    transition: opacity 0.5s;
  }
  #scan-entity-modal span {
    color: inherit;
  }
  #pickup-flash {
    position: fixed; top: 80px; left: 20px; z-index: 120;
    font-family: var(--hypurr-body); color: #97FCE4;
    font-weight: 800;
    font-size: 13px; opacity: 0; pointer-events: none;
    text-shadow: 0 0 12px rgba(151, 252, 228, 0.6);
    transition: opacity 0.2s;
  }
  body.vision-scan #pickup-flash {
    color: #ff2a1f;
    text-shadow: 0 0 12px rgba(255,42,31,0.7);
  }
  #pickup-flash.show { opacity: 1; }

  #interact-prompt {
    position: fixed; bottom: 30%; left: 50%; transform: translateX(-50%);
    z-index: 5; pointer-events: none;
    font-family: var(--hypurr-body); color: #fff;
    font-size: 16px; letter-spacing: .6px;
    font-weight: 800;
    text-shadow: 0 0 12px rgba(255,255,255,0.5);
    opacity: 0; transition: opacity 0.25s;
  }
  #interact-prompt.purr-bartender-message {
    width: min(86vw, 720px);
    text-align: center;
    line-height: 1.35;
    transition: opacity 0.9s ease;
  }
  #interact-prompt .purr-bartender-speaker {
    color: #97FCE4;
  }
  #interact-prompt .key-hint {
    display: inline-block; background: rgba(151, 252, 228, 0.1);
    border: 1px solid rgba(151, 252, 228, 0.5); border-radius: 4px;
    padding: 2px 10px; margin-right: 6px;
    font-size: 14px; color: #97FCE4;
  }
  #interact-prompt.show { opacity: 1; }

  #termination-screen {
    position: fixed; inset: 0; z-index: 40;
    display: none; align-items: center; justify-content: center;
    flex-direction: column;
    background: #000;
    color: #fff;
    font-family: var(--hypurr-body);
    cursor: pointer;
    text-align: center;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.9);
  }
  #termination-screen.show {
    display: flex;
  }
  #termination-screen::before {
    content: "";
    position: absolute; inset: 0;
    background: repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.05) 0,
      rgba(255, 255, 255, 0.05) 1px,
      transparent 1px,
      transparent 5px
    );
    opacity: 0.22;
    pointer-events: none;
  }
  #termination-screen .termination-title {
    font-family: var(--hypurr-display);
    font-size: clamp(48px, 11vw, 128px);
    letter-spacing: 0;
    font-weight: 700;
    color: #fff;
  }
  #termination-screen .termination-sub {
    margin-top: 18px;
    font-size: 15px;
    letter-spacing: 5px;
    color: #fff;
  }
  #termination-screen .termination-hint {
    margin-top: 42px;
    font-size: 13px;
    letter-spacing: 3px;
    color: #fff;
    animation: pulse 1.2s infinite;
  }

  /* ── Terminal GUI ── */
  #terminal-gui {
    position: fixed; inset: 0; z-index: 30;
    background: rgba(6, 28, 24, 0);
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(0px);
    cursor: var(--game-cursor);
    transition: background 0.35s ease, backdrop-filter 0.35s ease;
  }
  #terminal-gui.open {
    display: flex;
  }
  #terminal-gui.visible {
    background: rgba(6, 28, 24, 0.6);
    backdrop-filter: blur(4px);
  }

  @keyframes termOpen {
    0%   { transform: scaleX(0) scaleY(0.004); }
    40%  { transform: scaleX(1) scaleY(0.004); }
    60%  { transform: scaleX(1) scaleY(0.004); }
    100% { transform: scaleX(1) scaleY(1); }
  }
  @keyframes termClose {
    0%   { transform: scaleX(1) scaleY(1); }
    40%  { transform: scaleX(1) scaleY(0.004); }
    60%  { transform: scaleX(1) scaleY(0.004); }
    100% { transform: scaleX(0) scaleY(0.004); }
  }

  #terminal-gui .term-window {
    position: relative;
    width: 720px; max-width: 90vw; height: 520px; max-height: 85vh;
    background: #09251f;
    border: 1px solid rgba(151, 252, 228, 0.2);
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    display: flex; flex-direction: column;
    transform: scaleX(0) scaleY(0.004);
  }
  #terminal-gui.open .term-window {
    animation: termOpen 0.6s ease-out forwards;
  }
  #terminal-gui.closing .term-window {
    animation: termClose 0.45s ease-in forwards;
  }
  #terminal-gui .term-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(151, 252, 228, 0.1);
    font-family: 'Courier New', monospace;
  }
  #terminal-gui .term-ascii {
    color: #97FCE4; font-size: 5px; line-height: 1.1;
    white-space: pre; margin-bottom: 12px;
  }
  #terminal-gui .term-tabs {
    display: flex; gap: 0;
  }
  #terminal-gui .term-tab {
    padding: 8px 20px;
    font-family: 'Courier New', monospace; font-size: 12px;
    color: #5CC9B5; letter-spacing: 2px;
    background: transparent;
    border: 1px solid rgba(151, 252, 228, 0.15);
    border-bottom: none;
    cursor: var(--game-cursor-pointer);
    transition: all 0.15s;
    display: flex; align-items: center; gap: 6px;
  }
  #terminal-gui .term-tab:hover { color: #97FCE4; background: rgba(151, 252, 228, 0.05); }
  #terminal-gui .term-tab.active {
    color: #97FCE4; background: rgba(151, 252, 228, 0.1);
    border-color: rgba(151, 252, 228, 0.3);
    text-shadow: 0 0 6px rgba(151, 252, 228, 0.4);
  }
  #terminal-gui .term-tab .tab-icon { font-size: 11px; }
  #terminal-gui .term-body {
    padding: 16px 20px;
    overflow-y: auto; flex: 1;
    font-family: 'Courier New', monospace;
    scrollbar-width: thin;
    scrollbar-color: rgba(151, 252, 228, 0.2) transparent;
  }
  #terminal-gui .term-body::-webkit-scrollbar { width: 4px; }
  #terminal-gui .term-body::-webkit-scrollbar-thumb { background: rgba(151, 252, 228, 0.2); border-radius: 2px; }

  /* Projects grid */
  .term-projects { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .term-project {
    border: 1px solid rgba(151, 252, 228, 0.15);
    border-radius: 0; padding: 14px 16px;
    cursor: var(--game-cursor-pointer); transition: all 0.15s;
  }
  .term-project:hover { border-color: rgba(151, 252, 228, 0.4); background: rgba(151, 252, 228, 0.03); }
  .term-project .proj-name {
    color: #97FCE4; font-size: 13px; font-weight: bold;
    letter-spacing: 2px; margin-bottom: 4px;
    text-shadow: 0 0 6px rgba(151, 252, 228, 0.3);
  }
  .term-project .proj-desc { color: #5CC9B5; font-size: 11px; opacity: 0.7; }
  .term-project .proj-icon { color: #5CC9B5; font-size: 10px; margin-bottom: 6px; }

  /* Console */
  .term-console { color: #97FCE4; font-size: 12px; line-height: 1.8; }
  .term-console .line-boot { color: #97FCE4; }
  .term-console .line-info { color: #5CC9B5; }
  .term-console .line-dim { color: #2F8F80; }
  .term-console .console-input {
    display: flex; align-items: center; margin-top: 16px; gap: 8px;
  }
  .term-console .console-prompt { color: #97FCE4; flex-shrink: 0; }
  .term-console .console-field {
    background: transparent; border: none;
    color: #97FCE4; font-family: 'Courier New', monospace; font-size: 12px;
    outline: none; flex: 1; min-width: 0;
    cursor: var(--game-cursor-text);
  }
  .term-console .console-cursor {
    display: inline-block; width: 8px; height: 14px;
    background: #97FCE4; animation: blink 1s step-end infinite;
  }
  @keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

  /* Locations */
  .term-locations { display: flex; flex-direction: column; gap: 10px; }
  .locations-header { color: #2F8F80; font-size: 11px; margin-bottom: 8px; letter-spacing: 1px; }
  .term-location {
    border: 1px solid rgba(151, 252, 228, 0.15);
    border-radius: 0; padding: 14px 16px;
    cursor: var(--game-cursor-pointer); transition: all 0.15s;
  }
  .term-location:hover { border-color: rgba(151, 252, 228, 0.4); background: rgba(151, 252, 228, 0.03); }
  .term-location .loc-name {
    color: #97FCE4; font-size: 13px; font-weight: bold;
    letter-spacing: 2px; margin-bottom: 4px;
    text-shadow: 0 0 6px rgba(151, 252, 228, 0.3);
  }
  .term-location .loc-coords { color: #5CC9B5; font-size: 10px; margin-bottom: 6px; }
  .term-location .loc-desc { color: #2F8F80; font-size: 11px; }

  /* Links */
  .term-links { display: flex; flex-direction: column; gap: 8px; }
  .term-link {
    border: 1px solid rgba(151, 252, 228, 0.15);
    border-radius: 0; padding: 12px 16px;
    color: #97FCE4; font-size: 12px;
    cursor: var(--game-cursor-pointer); transition: all 0.15s;
    display: flex; justify-content: space-between; align-items: center;
  }
  .term-link:hover { border-color: rgba(151, 252, 228, 0.4); background: rgba(151, 252, 228, 0.03); }
  .term-link .link-label { letter-spacing: 1px; }
  .term-link .link-url { color: #2F8F80; font-size: 10px; }

  #terminal-gui .term-close {
    position: absolute; top: 12px; right: 14px;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Courier New', monospace; font-size: 16px;
    color: #5CC9B5; cursor: var(--game-cursor-pointer);
    border: 1px solid rgba(151, 252, 228, 0.15); border-radius: 0;
    background: transparent; transition: all 0.15s;
    z-index: 1;
  }
  #terminal-gui .term-close:hover {
    color: #97FCE4; border-color: rgba(151, 252, 228, 0.5);
    background: rgba(151, 252, 228, 0.1);
    text-shadow: 0 0 8px rgba(151, 252, 228, 0.5);
  }
  .term-close-hint {
    text-align: center; padding: 10px;
    color: #1D6258; font-family: 'Courier New', monospace;
    font-size: 10px; letter-spacing: 2px;
    border-top: 1px solid rgba(151, 252, 228, 0.1);
  }

  /* ── Map Transition Loading Screen ── */
  #map-transition {
    position: fixed; inset: 0; z-index: 25;
    background: #000;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
  }
  #map-transition.active {
    opacity: 1; pointer-events: auto;
  }
  #map-transition .transition-text {
    font-family: var(--hypurr-display);
    font-size: 48px; letter-spacing: 0;
    font-weight: 700;
    margin-bottom: 24px;
    text-transform: uppercase;
  }
  #map-transition .transition-sub {
    font-family: var(--hypurr-body);
    font-size: 14px; letter-spacing: .6px;
    font-weight: 800;
    opacity: 0.7;
  }
  #map-transition .transition-bar {
    width: 200px; height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 1px; overflow: hidden;
    margin-top: 32px;
  }
  #map-transition .transition-fill {
    width: 0%; height: 100%;
    border-radius: 1px;
    animation: transitionProgress 1s ease-in-out infinite;
  }
  @keyframes transitionProgress {
    0% { width: 0%; margin-left: 0%; }
    50% { width: 100%; margin-left: 0%; }
    100% { width: 0%; margin-left: 100%; }
  }
  #map-transition.cyber { background: #00110d; }
  #map-transition.cyber .transition-text { color: #97FCE4; text-shadow: 0 0 30px rgba(151, 252, 228, 0.6), 0 0 60px rgba(151, 252, 228, 0.3); }
  #map-transition.cyber .transition-sub { color: #5CC9B5; }
  #map-transition.cyber .transition-fill { background: linear-gradient(90deg, #97FCE4, #CFFFF4); }
  #map-transition.crimson { background: #100505; }
  #map-transition.crimson .transition-text { color: #ff4422; text-shadow: 0 0 30px rgba(255,68,34,0.6), 0 0 60px rgba(255,68,34,0.3); }
  #map-transition.crimson .transition-sub { color: #a44; }
  #map-transition.crimson .transition-fill { background: linear-gradient(90deg, #ff4422, #ff8800); }
  #sequence-fade-overlay {
    position: fixed;
    inset: 0;
    z-index: 85;
    pointer-events: none;
    opacity: 0;
    background: #000;
  }

  /* ── Debug Panel ── */
  #debug-panel {
    position: fixed; top: 10px; right: 10px; z-index: 100;
    width: 320px; max-height: calc(100vh - 20px);
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    padding: 16px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #cbd5e1;
    font-size: 12px;
    display: none;
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
  }
  #debug-panel.visible { display: block; }
  #debug-panel h3 {
    color: #f8fafc; font-size: 12px; margin: 14px 0 8px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    padding-bottom: 6px; letter-spacing: 1px;
    font-weight: 700;
  }
  #debug-panel h3:first-child { margin-top: 0; }
  #debug-panel .row {
    display: flex; align-items: center; justify-content: space-between;
    margin: 5px 0;
  }
  #debug-panel .row label { flex: 0 0 110px; color: #94a3b8; font-size: 11px; }
  #debug-panel .row input[type=range] {
    flex: 1; margin: 0 8px;
    accent-color: #38bdf8; height: 3px;
  }
  #debug-panel .row .val {
    flex: 0 0 42px; text-align: right; color: #e2e8f0; font-size: 11px;
  }
  #debug-panel .row input[type=color] {
    width: 28px; height: 20px; border: 1px solid rgba(148, 163, 184, 0.28);
    background: #0f172a; cursor: pointer; padding: 0;
  }
  #debug-panel .debug-select,
  #debug-panel.editor-layout .editor-view-select select {
    background: rgba(2, 6, 23, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 7px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 11px;
    outline: none;
  }
  #debug-panel .debug-select {
    flex: 1;
    margin: 0 8px;
    padding: 4px 7px;
  }
  #debug-panel .debug-text {
    flex: 1;
    min-width: 0;
    margin: 0 8px;
    padding: 4px 7px;
    background: rgba(2, 6, 23, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 7px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 11px;
    outline: none;
  }
  #debug-panel .debug-select:focus,
  #debug-panel .debug-text:focus,
  #debug-panel.editor-layout .editor-view-select select:focus {
    border-color: rgba(56, 189, 248, 0.65);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
  }
  #debug-panel .btn-row {
    display: flex; gap: 8px; margin-top: 12px;
  }
  #debug-panel button {
    flex: 1; padding: 6px 0;
    background: rgba(30, 41, 59, 0.92); border: 1px solid rgba(148, 163, 184, 0.22);
    color: #dbeafe; font-family: inherit; font-size: 11px;
    border-radius: 7px; cursor: pointer; letter-spacing: 0.4px;
    font-weight: 650;
  }
  #debug-panel button:hover { background: rgba(51, 65, 85, 0.96); border-color: rgba(56, 189, 248, 0.45); color: #f8fafc; }
  #debug-panel button:disabled {
    opacity: 0.35;
    cursor: default;
  }
  #debug-panel button:disabled:hover {
    background: rgba(30, 41, 59, 0.92);
  }
  #debug-panel .hint {
    color: #64748b; font-size: 10px; text-align: center; margin-top: 8px;
  }
  #debug-panel::-webkit-scrollbar { width: 4px; }
  #debug-panel::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.35); border-radius: 2px; }

  #debug-panel.gameplay-debug {
    width: min(420px, calc(100vw - 20px));
  }
  #debug-panel.gameplay-debug .gameplay-debug-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  }
  #debug-panel.gameplay-debug .gameplay-debug-header strong {
    color: #f8fafc;
    font-size: 12px;
    letter-spacing: 1px;
  }
  #debug-panel.gameplay-debug .gameplay-debug-header span {
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
  }
  #debug-panel.gameplay-debug .gameplay-debug-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  #debug-panel.gameplay-debug .debug-stats-export-btn,
  #debug-panel.editor-layout .debug-stats-export-btn {
    flex: 0 0 auto;
    min-width: 24px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 6px;
    background: rgba(2, 6, 23, 0.42);
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
  }
  #debug-panel.gameplay-debug .debug-stats-export-btn:hover,
  #debug-panel.editor-layout .debug-stats-export-btn:hover {
    color: #f8fafc;
    border-color: rgba(125, 211, 252, 0.5);
    background: rgba(14, 116, 144, 0.28);
  }

  #debug-panel .debug-tabs {
    display: flex; gap: 0; margin-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  }
  #debug-panel .debug-tab {
    flex: 1; padding: 8px; text-align: center;
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-bottom: none;
    color: #94a3b8; cursor: pointer;
    font-family: inherit;
    font-size: 11px; letter-spacing: 1px;
    transition: all 0.15s;
  }
  #debug-panel .debug-tab:hover { color: #e2e8f0; background: rgba(148, 163, 184, 0.08); }
  #debug-panel .debug-tab.active {
    color: #f8fafc; background: rgba(56, 189, 248, 0.16);
    border-color: rgba(56, 189, 248, 0.45);
  }
  .outliner {
    max-height: 50vh; overflow-y: auto;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px; margin-bottom: 8px;
    background: rgba(2, 6, 23, 0.24);
  }
  .outliner::-webkit-scrollbar { width: 4px; }
  .outliner::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.35); border-radius: 2px; }
  .outliner-group {
    padding: 5px 8px;
    color: #93c5fd; font-size: 10px; letter-spacing: 0.8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(30, 41, 59, 0.45);
    cursor: pointer; user-select: none;
  }
  .outliner-group:hover { background: rgba(51, 65, 85, 0.65); }
  .outliner-group.custom-group {
    color: #c4b5fd;
    background: rgba(49, 46, 129, 0.34);
  }
  .outliner-group.custom-group:hover {
    background: rgba(67, 56, 202, 0.36);
  }
  .outliner-group-name-input {
    width: 150px;
    padding: 1px 4px;
    background: rgba(2, 6, 23, 0.68);
    border: 1px solid rgba(196, 181, 253, 0.48);
    border-radius: 5px;
    color: #f8fafc;
    font: inherit;
    font-size: 10px;
    letter-spacing: 0.8px;
    outline: none;
  }
  .outliner-group-name-input:focus {
    border-color: rgba(196, 181, 253, 0.78);
    background: rgba(15, 23, 42, 0.9);
  }
  .outliner-empty {
    padding: 5px 8px 5px 22px;
    color: #64748b;
    font-size: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.07);
    font-style: italic;
  }
  .outliner-item {
    padding: 3px 8px 3px calc(12px + (var(--depth, 0) * 14px));
    cursor: pointer;
    border-bottom: 1px solid rgba(148, 163, 184, 0.07);
    font-size: 11px; color: #cbd5e1;
    display: flex; justify-content: space-between;
    gap: 8px;
    align-items: center; transition: background 0.1s;
  }
  .outliner-item:hover { background: rgba(51, 65, 85, 0.5); }
  .outliner-item.selected {
    background: rgba(56, 189, 248, 0.18); color: #f8fafc;
  }
  .outliner-item[draggable="true"] {
    cursor: grab;
  }
  .outliner-item.dragging {
    opacity: 0.45;
    cursor: grabbing;
  }
  .outliner-item.drop-inside {
    background: rgba(56, 189, 248, 0.28);
    box-shadow: inset 3px 0 0 rgba(125, 211, 252, 0.9);
  }
  .outliner-group.drop-group {
    background: rgba(124, 58, 237, 0.38);
    box-shadow: inset 3px 0 0 rgba(196, 181, 253, 0.82);
  }
  .outliner-item .obj-main {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }
  .outliner-item .object-disclosure {
    flex: 0 0 10px;
    color: #94a3b8;
    text-align: center;
  }
  .outliner-item .empty-disclosure {
    opacity: 0;
  }
  .outliner-item .obj-icon {
    flex: 0 0 14px;
    color: #7dd3fc;
    font-size: 11px;
    line-height: 1;
    text-align: center;
  }
  .outliner-item .obj-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .obj-tag {
    flex: 0 0 auto;
    padding: 1px 4px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.7);
    font-size: 8px;
    line-height: 1.2;
    letter-spacing: 0.45px;
  }
  .outliner-item[data-category="actor"] .obj-icon,
  .selected-info[data-category="actor"] .obj-tag {
    color: #c4b5fd;
    border-color: rgba(196, 181, 253, 0.28);
  }
  .outliner-item[data-category="camera"] .obj-icon,
  .selected-info[data-category="camera"] .obj-tag {
    color: #f0abfc;
    border-color: rgba(240, 171, 252, 0.3);
  }
  .outliner-item[data-category="sound"] .obj-icon,
  .selected-info[data-category="sound"] .obj-tag {
    color: #5eead4;
    border-color: rgba(94, 234, 212, 0.3);
  }
  .outliner-item[data-category="light"] .obj-icon,
  .selected-info[data-category="light"] .obj-tag {
    color: #fde68a;
    border-color: rgba(253, 230, 138, 0.28);
  }
  .outliner-item[data-category="geometry"] .obj-icon,
  .selected-info[data-category="geometry"] .obj-tag {
    color: #7dd3fc;
    border-color: rgba(125, 211, 252, 0.28);
  }
  .outliner-item[data-category="helper"] .obj-icon,
  .selected-info[data-category="helper"] .obj-tag {
    color: #86efac;
    border-color: rgba(134, 239, 172, 0.28);
  }
  .selected-info .instance-tag {
    color: #67e8f9;
    border-color: rgba(103, 232, 249, 0.36);
    background: rgba(8, 47, 73, 0.56);
  }
  .outliner-item .obj-pos {
    color: #64748b; font-size: 9px;
    font-family: "SFMono-Regular", Consolas, monospace;
    flex: 0 0 auto;
  }
  .outliner-item .obj-sequence-badge {
    flex: 0 0 auto;
    color: #86efac;
    border: 1px solid rgba(134, 239, 172, 0.28);
    background: rgba(20, 83, 45, 0.32);
    border-radius: 999px;
    padding: 1px 5px;
    font-size: 8px;
    line-height: 1.2;
    white-space: nowrap;
  }
  .selected-info {
    padding: 8px;
    background: rgba(15, 23, 42, 0.68);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px; margin-top: 8px;
    font-size: 11px;
  }
  .selected-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }
  .selected-title h3 {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .selected-info .prop-row {
    display: flex; align-items: center;
    margin: 4px 0; color: #cbd5e1;
  }
  .selected-info .prop-label { flex: 0 0 52px; font-size: 10px; color: #94a3b8; }
  .selected-info .scale-label {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  #debug-panel .selected-info .scale-lock-btn {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 5px;
    font-size: 10px;
    line-height: 1;
    color: #94a3b8;
  }
  #debug-panel .selected-info .scale-lock-btn.locked {
    color: #f8fafc;
    background: rgba(56, 189, 248, 0.22);
    border-color: rgba(56, 189, 248, 0.58);
  }
  .selected-info .prop-inputs { display: flex; gap: 3px; flex: 1; }
  .selected-info .decal-texture-drop,
  .selected-info .primitive-texture-drop,
  .selected-info .sound-file-drop {
    border: 1px dashed transparent;
    border-radius: 4px;
    padding: 2px;
  }
  .selected-info .decal-texture-drop.drag-over,
  .selected-info .primitive-texture-drop.drag-over,
  .selected-info .sound-file-drop.drag-over {
    border-color: rgba(56, 189, 248, 0.75);
    background: rgba(56, 189, 248, 0.12);
  }
  .selected-info .prop-toggle-inputs {
    align-items: center;
  }
  .selected-info .prop-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    min-height: 22px;
    color: #cbd5e1;
    font-size: 11px;
    cursor: pointer;
    user-select: none;
  }
  .selected-info .prop-toggle input {
    accent-color: #38bdf8;
    cursor: pointer;
  }
  .selected-info .material-search-row {
    margin-bottom: 6px;
  }
  .selected-info .material-search-input {
    width: 100%;
    padding: 5px 7px;
    border: 1px solid rgba(125, 211, 252, 0.22);
    border-radius: 6px;
    background: rgba(2, 6, 23, 0.52);
    color: #e2e8f0;
    font: 10px "SFMono-Regular", Consolas, monospace;
    outline: none;
  }
  .selected-info .material-search-input:focus {
    border-color: rgba(125, 211, 252, 0.52);
    background: rgba(15, 23, 42, 0.76);
  }
  .selected-info .material-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 56vh;
    overflow-y: auto;
    padding-right: 3px;
    scrollbar-width: thin;
    scrollbar-color: rgba(125, 211, 252, 0.45) rgba(15, 23, 42, 0.18);
  }
  .selected-info .material-list::-webkit-scrollbar {
    width: 6px;
  }
  .selected-info .material-list::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.18);
    border-radius: 999px;
  }
  .selected-info .material-list::-webkit-scrollbar-thumb {
    background: rgba(125, 211, 252, 0.45);
    border-radius: 999px;
  }
  .selected-info .material-card {
    padding: 7px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.54);
  }
  .selected-info .material-card-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    margin-bottom: 5px;
  }
  .selected-info .material-card-head span {
    overflow: hidden;
    color: #e2e8f0;
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .selected-info .material-card-head em {
    overflow: hidden;
    color: #64748b;
    font-size: 9px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .selected-info .material-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 5px;
  }
  .selected-info .material-chips span {
    padding: 2px 5px;
    border: 1px solid rgba(125, 211, 252, 0.18);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.42);
    color: #bae6fd;
    font-size: 9px;
    line-height: 1.2;
  }
  .selected-info .material-multipliers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 6px;
  }
  .selected-info .material-multipliers label {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    color: #c4b5fd;
    font-size: 9px;
  }
  .selected-info .material-multipliers label span {
    flex: 0 0 42px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .selected-info .material-multiplier-input {
    width: 100%;
    min-width: 0;
    padding: 2px 4px;
    background: rgba(2, 6, 23, 0.55);
    border: 1px solid rgba(196, 181, 253, 0.24);
    border-radius: 5px;
    color: #f8fafc;
    font: 10px "SFMono-Regular", Consolas, monospace;
    text-align: right;
    outline: none;
  }
  .selected-info .material-multiplier-input:focus {
    border-color: rgba(196, 181, 253, 0.65);
    background: rgba(15, 23, 42, 0.82);
  }
  .selected-info .material-textures {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  .selected-info .material-textures div {
    display: flex;
    gap: 6px;
    min-width: 0;
    color: #94a3b8;
    font-size: 9px;
  }
  .selected-info .material-textures b {
    flex: 0 0 72px;
    color: #7dd3fc;
    font-weight: 700;
  }
  .selected-info .material-textures span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .selected-info .material-empty {
    color: #64748b;
    font-size: 9px;
    font-style: italic;
  }
  .selected-info .prop-input,
  .selected-info .name-input,
  .selected-info .group-input {
    width: 100%; padding: 3px 4px;
    background: rgba(2, 6, 23, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 6px;
    color: #f8fafc; font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 11px; outline: none;
    text-align: right;
  }
  .selected-info .name-input {
    text-align: left;
  }
  .selected-info .group-input {
    padding: 3px 24px 3px 8px;
    background:
      linear-gradient(45deg, transparent 50%, #93c5fd 50%) right 12px center / 5px 5px no-repeat,
      linear-gradient(135deg, #93c5fd 50%, transparent 50%) right 7px center / 5px 5px no-repeat,
      linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(2, 6, 23, 0.72));
    color: #dbeafe;
    font-weight: 650;
    letter-spacing: 0.2px;
    text-align: left;
    appearance: none;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }
  .selected-info .group-input:hover {
    border-color: rgba(96, 165, 250, 0.42);
    background:
      linear-gradient(45deg, transparent 50%, #bfdbfe 50%) right 12px center / 5px 5px no-repeat,
      linear-gradient(135deg, #bfdbfe 50%, transparent 50%) right 7px center / 5px 5px no-repeat,
      linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.82));
  }
  .selected-info .group-input option {
    background: #0f172a;
    color: #e2e8f0;
  }
  .selected-info .prop-input[type="number"] {
    cursor: ew-resize;
    user-select: none;
  }
  .selected-info .prop-input[type="number"].value-dragging,
  body.inspector-value-dragging,
  body.inspector-value-dragging * {
    cursor: ew-resize !important;
  }
  .selected-info .prop-input:focus,
  .selected-info .name-input:focus,
  .selected-info .group-input:focus {
    border-color: rgba(56, 189, 248, 0.65);
    background: rgba(15, 23, 42, 0.82);
  }
  .selected-info .group-input:focus {
    background:
      linear-gradient(45deg, transparent 50%, #bfdbfe 50%) right 12px center / 5px 5px no-repeat,
      linear-gradient(135deg, #bfdbfe 50%, transparent 50%) right 7px center / 5px 5px no-repeat,
      rgba(15, 23, 42, 0.82);
  }
  .outliner-context-menu {
    position: fixed;
    z-index: 1000;
    min-width: 128px;
    padding: 4px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(12px);
  }
  .outliner-move-group-menu {
    min-width: 156px;
    max-width: 240px;
    max-height: min(320px, calc(100vh - 16px));
    overflow-y: auto;
  }
  .outliner-context-label {
    padding: 5px 8px 4px;
    color: #64748b;
    font: 700 9px Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.7px;
    text-transform: uppercase;
  }
  .outliner-context-menu button {
    display: block;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #cbd5e1;
    font: 650 11px Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: left;
    cursor: pointer;
  }
  .outliner-context-menu button:hover {
    background: rgba(56, 189, 248, 0.16);
    color: #f8fafc;
  }
  .outliner-context-menu button.danger {
    color: #fecaca;
  }
  .outliner-context-menu button.danger:hover {
    background: rgba(239, 68, 68, 0.18);
  }
  .outliner-context-menu button:disabled {
    color: #475569;
    cursor: default;
  }
  .outliner-context-menu button:disabled:hover {
    background: transparent;
  }
  .btn-danger {
    background: rgba(239,68,68,0.14) !important;
    border-color: rgba(248,113,113,0.38) !important;
    color: #fecaca !important;
  }
  .btn-danger:hover {
    background: rgba(239,68,68,0.24) !important;
  }

  /* ── Content Browser ── */
  .content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin-bottom: 4px;
  }
  .content-explorer {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .content-explorer-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }
  #debug-panel .content-up {
    flex: 0 0 auto;
    width: 28px;
    padding: 4px 0;
    border-radius: 2px;
    font-size: 11px;
  }
  .content-breadcrumb {
    flex: 1;
    min-width: 0;
    padding: 5px 7px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 7px;
    background: rgba(2, 6, 23, 0.32);
    color: #cbd5e1;
    font-size: 10px;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    white-space: nowrap;
  }
  #debug-panel .content-crumb {
    flex: 0 1 auto;
    min-width: 0;
    width: auto;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: #cbd5e1;
    font: inherit;
    letter-spacing: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
  }
  #debug-panel .content-crumb:hover {
    color: #f8fafc;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  #debug-panel .content-crumb.current {
    color: #94a3b8;
    cursor: default;
    pointer-events: none;
    text-decoration: none;
  }
  .content-crumb-separator {
    flex: 0 0 auto;
    color: #475569;
  }
  .content-view-toggle {
    display: flex;
    flex: 0 0 auto;
    gap: 3px;
  }
  .content-import-dropdown {
    position: relative;
    display: flex;
    margin-left: 4px;
  }
  #debug-panel .content-view-toggle button {
    flex: 0 0 auto;
    width: 28px;
    padding: 4px 0;
    border-radius: 2px;
    font-size: 11px;
  }
  #debug-panel .content-view-toggle button.active-view {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.55);
    color: #f8fafc;
  }
  #debug-panel .content-view-toggle .content-import-action {
    width: 34px;
    background: rgba(56, 189, 248, 0.16);
    border-color: rgba(56, 189, 248, 0.42);
    color: #f8fafc;
    font-size: 10px;
    line-height: 1;
  }
  #debug-panel .content-view-toggle .content-import-action:hover {
    background: rgba(56, 189, 248, 0.28);
    border-color: rgba(56, 189, 248, 0.65);
  }
  .content-import-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 20;
    min-width: 70px;
    padding: 4px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 6px;
    background: rgba(2, 6, 23, 0.96);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  }
  .content-import-dropdown.open .content-import-menu {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  #debug-panel .content-view-toggle .content-import-menu button {
    width: 100%;
    padding: 5px 8px;
    text-align: left;
    font-size: 10px;
  }
  .content-item {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 4px;
    padding: 10px 4px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 9px;
    background: rgba(15, 23, 42, 0.62);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
  }
  .content-item:hover {
    border-color: rgba(56, 189, 248, 0.48);
    background: rgba(30, 41, 59, 0.84);
  }
  .content-item:active {
    background: rgba(56, 189, 248, 0.18);
    transform: scale(0.96);
  }
  .content-icon {
    font-size: 18px; color: #7dd3fc;
    text-shadow: none;
    line-height: 1;
  }
  .content-label {
    font-size: 9px; color: #cbd5e1;
    letter-spacing: 0.5px; text-align: center;
  }
  .content-title {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
  }
  .content-explorer.grid-view .content-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .content-tag {
    flex: 0 0 auto;
    padding: 1px 4px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.7);
    font-size: 7px;
    line-height: 1.2;
    letter-spacing: 0.35px;
  }
  .content-item[data-category="actor"] .content-icon,
  .content-item[data-category="actor"] .content-tag {
    color: #c4b5fd;
    border-color: rgba(196, 181, 253, 0.28);
  }
  .content-item[data-category="camera"] .content-icon,
  .content-item[data-category="camera"] .content-tag {
    color: #f0abfc;
    border-color: rgba(240, 171, 252, 0.3);
  }
  .content-item[data-category="sound"] .content-icon,
  .content-item[data-category="sound"] .content-tag {
    color: #5eead4;
    border-color: rgba(94, 234, 212, 0.3);
  }
  .content-item[data-category="light"] .content-icon,
  .content-item[data-category="light"] .content-tag {
    color: #fde68a;
    border-color: rgba(253, 230, 138, 0.28);
  }
  .content-item[data-category="geometry"] .content-icon,
  .content-item[data-category="geometry"] .content-tag {
    color: #7dd3fc;
    border-color: rgba(125, 211, 252, 0.28);
  }
  .content-item[data-category="helper"] .content-icon,
  .content-item[data-category="helper"] .content-tag {
    color: #86efac;
    border-color: rgba(134, 239, 172, 0.28);
  }
  .content-empty {
    min-width: 140px;
    padding: 18px 10px;
    border: 1px dashed rgba(148, 163, 184, 0.22);
    border-radius: 9px;
    color: #94a3b8;
    font-size: 10px;
    letter-spacing: 0.5px;
    text-align: center;
  }
  .content-item:hover .content-label { color: #f8fafc; }
  .content-folder {
    background: rgba(30, 41, 59, 0.72);
  }
  .content-count {
    color: #94a3b8;
    font-size: 8px;
    line-height: 1;
  }
  .content-import {
    border-style: dashed;
  }
  .content-import:hover {
    border-style: solid;
  }
  .content-explorer.list-view .content-explorer-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .content-explorer.list-view .content-item {
    width: auto;
    min-height: 28px;
    flex-direction: row;
    justify-content: flex-start;
    padding: 4px 8px;
  }
  .content-explorer.list-view .content-icon {
    flex: 0 0 18px;
    font-size: 14px;
  }
  .content-explorer.list-view .content-title {
    flex: 1;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }
  .content-explorer.list-view .content-label {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .content-explorer.list-view .content-count {
    margin-left: auto;
    font-size: 9px;
  }

  /* ── Fullscreen Editor Layout ── */
  #debug-panel.editor-layout {
    --editor-left-panel-width: 270px;
    --editor-right-panel-width: 330px;
    --editor-bottom-panel-height: 220px;
    --editor-debug-panel-width: 460px;
    inset: 0;
    width: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
  }
  #debug-panel.editor-layout .editor-topbar,
  #debug-panel.editor-layout .editor-panel,
  #debug-panel.editor-layout .editor-bottom-panel,
  #debug-panel.editor-layout .editor-controls-overlay {
    pointer-events: auto;
  }
  #debug-panel.editor-layout.editor-hud-hidden > * {
    display: none !important;
  }
  #debug-panel.editor-layout .editor-topbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 10;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 12px;
    background: rgba(15, 23, 42, 0.96);
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  }
  #debug-panel.editor-layout .editor-brand {
    color: #f8fafc;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: 800;
    white-space: nowrap;
  }
  #debug-panel.editor-layout .debug-tabs {
    margin: 0;
    border: none;
    flex: 0 0 auto;
  }
  #debug-panel.editor-layout .debug-tab {
    min-width: 78px;
    padding: 7px 10px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 7px;
    margin-right: 4px;
    background: rgba(30, 41, 59, 0.72);
  }
  #debug-panel.editor-layout .debug-tab.active {
    background: rgba(56, 189, 248, 0.2);
  }
  #debug-panel.editor-layout .editor-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
  }
  #debug-panel.editor-layout .editor-actions button {
    flex: 0 0 auto;
    min-width: 58px;
    padding: 6px 9px;
    border-radius: 7px;
    font-size: 10px;
  }
  #debug-panel.editor-layout .editor-actions .editor-icon-btn,
  #debug-panel.editor-layout .editor-overflow .editor-icon-btn {
    min-width: 28px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 14px;
    line-height: 1;
  }
  #debug-panel.editor-layout .editor-actions .editor-sim-toggle {
    min-width: 28px;
    letter-spacing: 0;
  }
  #debug-panel.editor-layout .editor-actions .editor-sim-toggle.paused {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.48);
    background: rgba(127, 29, 29, 0.45);
  }
  #debug-panel.editor-layout .editor-actions .editor-sim-toggle.running {
    color: #bbf7d0;
    border-color: rgba(74, 222, 128, 0.38);
    background: rgba(20, 83, 45, 0.36);
  }
  #debug-panel.editor-layout .editor-overflow {
    position: relative;
    flex: 0 0 auto;
    margin-left: auto;
  }
  #debug-panel.editor-layout .editor-menu-trigger {
    font-size: 15px;
    position: relative;
    z-index: 12;
  }
  #debug-panel.editor-layout .editor-overflow-menu {
    position: absolute;
    top: calc(100% - 1px);
    right: 0;
    z-index: 11;
    min-width: 158px;
    padding: 4px;
    display: none;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(12, 19, 34, 0.98));
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 11px;
    box-shadow: 0 14px 30px rgba(0,0,0,0.45);
  }
  #debug-panel.editor-layout .editor-overflow.open .editor-overflow-menu,
  #debug-panel.editor-layout .editor-overflow:focus-within .editor-overflow-menu {
    display: block;
  }
  #debug-panel.editor-layout .editor-overflow.open .editor-menu-trigger {
    border-color: rgba(125, 211, 252, 0.52);
    background: rgba(30, 41, 59, 0.98);
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.28);
  }
  #debug-panel.editor-layout .editor-overflow-menu button {
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    text-align: left;
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 0;
    background: rgba(15, 23, 42, 0.78);
    box-shadow: none;
  }
  #debug-panel.editor-layout .editor-overflow-menu button:first-child {
    border-top: 0;
  }
  #debug-panel.editor-layout .editor-overflow-menu button:hover {
    background: rgba(30, 41, 59, 0.98);
  }
  #debug-panel.editor-layout .editor-overflow-menu .editor-menu-icon {
    width: 14px;
    color: #7dd3fc;
    text-align: center;
    flex: 0 0 14px;
  }
  #debug-panel.editor-layout .editor-controls-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 58px 18px 18px;
    background: rgba(2, 6, 23, 0.58);
    backdrop-filter: blur(10px);
  }
  #debug-panel.editor-layout .editor-controls-overlay.show {
    display: flex;
  }
  #debug-panel.editor-layout .editor-controls-card {
    width: min(780px, 100%);
    max-height: min(720px, calc(100vh - 76px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.52);
  }
  #debug-panel.editor-layout .editor-settings-card {
    width: min(440px, 100%);
    max-height: min(560px, calc(100vh - 76px));
  }
  #debug-panel.editor-layout .editor-controls-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  }
  #debug-panel.editor-layout .editor-controls-eyebrow {
    margin-bottom: 4px;
    color: #7dd3fc;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.2px;
  }
  #debug-panel.editor-layout .editor-controls-header h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 16px;
    letter-spacing: 0.5px;
  }
  #debug-panel.editor-layout button.editor-controls-close {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    min-width: 0;
    padding: 0;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1;
  }
  #debug-panel.editor-layout .editor-controls-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    overflow-y: auto;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(125, 211, 252, 0.42) transparent;
  }
  #debug-panel.editor-layout .editor-controls-grid::-webkit-scrollbar {
    width: 6px;
  }
  #debug-panel.editor-layout .editor-controls-grid::-webkit-scrollbar-track {
    background: transparent;
  }
  #debug-panel.editor-layout .editor-controls-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(125, 211, 252, 0.52), rgba(59, 130, 246, 0.32));
    border: 2px solid rgba(15, 23, 42, 0.98);
    border-radius: 999px;
  }
  #debug-panel.editor-layout .editor-controls-grid::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(125, 211, 252, 0.72), rgba(59, 130, 246, 0.5));
  }
  #debug-panel.editor-layout .editor-controls-grid section {
    padding: 12px;
    background: rgba(2, 6, 23, 0.38);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 10px;
  }
  #debug-panel.editor-layout .editor-controls-grid h3 {
    margin: 0 0 10px;
    padding: 0 0 7px;
    color: #f8fafc;
    font-size: 10px;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }
  #debug-panel.editor-layout .control-row {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 25px;
    color: #cbd5e1;
  }
  #debug-panel.editor-layout .control-row span {
    margin-left: auto;
    color: #94a3b8;
    font-size: 11px;
    text-align: right;
  }
  #debug-panel.editor-layout .control-row kbd {
    flex: 0 0 auto;
    min-width: 22px;
    padding: 3px 6px;
    border: 1px solid rgba(125, 211, 252, 0.28);
    border-bottom-color: rgba(125, 211, 252, 0.45);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.9);
    color: #dbeafe;
    font: 800 10px "SFMono-Regular", Consolas, monospace;
    text-align: center;
    box-shadow: inset 0 -1px 0 rgba(125, 211, 252, 0.18);
  }
  #debug-panel.editor-layout .editor-settings-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }
  #debug-panel.editor-layout .editor-settings-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: rgba(2, 6, 23, 0.38);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 10px;
  }
  #debug-panel.editor-layout .editor-settings-section-title {
    color: #f8fafc;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
  }
  #debug-panel.editor-layout .editor-settings-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #cbd5e1;
    font-size: 11px;
  }
  #debug-panel.editor-layout .editor-settings-field strong {
    color: #f8fafc;
    font-size: 11px;
    letter-spacing: 0.4px;
  }
  #debug-panel.editor-layout .editor-settings-section input[type=range] {
    width: 100%;
    margin: 0;
    accent-color: #38bdf8;
  }
  #debug-panel.editor-layout .editor-settings-select {
    width: 100%;
    margin: 0;
    padding: 7px 9px;
  }
  #debug-panel.editor-layout .editor-settings-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  #debug-panel.editor-layout .editor-settings-actions button {
    flex: 0 0 auto;
    width: 100%;
  }
  #debug-panel.editor-layout .editor-settings-actions button.is-active {
    color: #bbf7d0;
    border-color: rgba(74, 222, 128, 0.38);
    background: rgba(20, 83, 45, 0.36);
  }
  #debug-panel.editor-layout .editor-settings-actions .hint {
    margin-top: 0;
    text-align: left;
    line-height: 1.5;
  }
  @media (max-width: 720px) {
    #debug-panel.editor-layout .editor-controls-grid {
      grid-template-columns: 1fr;
    }
  }
  #debug-panel.editor-layout {
    --editor-toolbar-shift: 0px;
  }
  #debug-panel.editor-layout[data-editor-tab="vcam"] {
    --editor-toolbar-shift: 34px;
  }
  #debug-panel.editor-layout[data-editor-tab="debug"] {
    --editor-toolbar-shift: -308px;
  }
  #debug-panel.editor-layout .editor-transform-modes {
    position: fixed;
    top: 48px;
    right: calc(var(--editor-right-panel-width) + 28px + var(--editor-toolbar-shift));
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 0;
    border-left: none;
    flex: 0 0 auto;
  }
  #debug-panel.editor-layout .editor-transform-btn {
    flex: 0 0 auto;
    min-width: 30px;
    width: 30px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 7px;
    color: #94a3b8;
    font-size: 10px;
  }
  #debug-panel.editor-layout .editor-transform-btn.active-mode {
    color: #f8fafc;
    background: rgba(56, 189, 248, 0.22);
    border-color: rgba(56, 189, 248, 0.58);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.14);
  }
  #debug-panel.editor-layout .transform-icon {
    color: #7dd3fc;
    font-size: 13px;
    line-height: 1;
  }
  #debug-panel.editor-layout .editor-camera-speed {
    position: fixed;
    top: 48px;
    right: calc(var(--editor-right-panel-width) + 301px + var(--editor-toolbar-shift));
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.9);
    color: #dbeafe;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.28);
    pointer-events: auto;
    overflow: hidden;
    transition: width 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  }
  #debug-panel.editor-layout .editor-camera-icon {
    color: #7dd3fc;
    font-size: 13px;
    line-height: 1;
  }
  #debug-panel.editor-layout .editor-camera-speed input[type=range] {
    width: 0;
    margin: 0;
    opacity: 0;
    accent-color: #38bdf8;
    transition: width 0.16s ease, opacity 0.12s ease;
  }
  #debug-panel.editor-layout .editor-camera-speed:hover,
  #debug-panel.editor-layout .editor-camera-speed:focus-within {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(15, 23, 42, 0.96);
  }
  #debug-panel.editor-layout .editor-camera-speed:hover input[type=range],
  #debug-panel.editor-layout .editor-camera-speed:focus-within input[type=range] {
    width: 96px;
    opacity: 1;
  }
  #debug-panel.editor-layout .editor-view-select {
    position: fixed;
    top: 48px;
    right: calc(var(--editor-right-panel-width) + 136px + var(--editor-toolbar-shift));
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.9);
    color: #94a3b8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.7px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.28);
    pointer-events: auto;
  }
  #debug-panel.editor-layout .editor-view-select select {
    min-width: 108px;
    padding: 3px 7px;
  }
  #debug-panel.editor-layout #debug-tab-content,
  #debug-panel.editor-layout .editor-shell {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }
  #debug-panel.editor-layout .editor-panel,
  #debug-panel.editor-layout .editor-bottom-panel {
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.38);
    backdrop-filter: blur(14px);
  }
  #debug-panel.editor-layout .editor-hierarchy {
    position: absolute;
    top: 48px;
    left: 10px;
    bottom: 10px;
    width: var(--editor-left-panel-width);
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
  }
  #debug-panel.editor-layout .editor-inspector {
    position: absolute;
    top: 48px;
    right: 10px;
    bottom: calc(var(--editor-bottom-panel-height) + 18px);
    width: var(--editor-right-panel-width);
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(125, 211, 252, 0.42) transparent;
  }
  #debug-panel.editor-layout .editor-inspector::-webkit-scrollbar {
    width: 6px;
  }
  #debug-panel.editor-layout .editor-inspector::-webkit-scrollbar-track {
    background: transparent;
  }
  #debug-panel.editor-layout .editor-inspector::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(125, 211, 252, 0.58), rgba(56, 189, 248, 0.28));
    border-radius: 999px;
  }
  #debug-panel.editor-layout .editor-inspector::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(125, 211, 252, 0.82), rgba(56, 189, 248, 0.42));
  }
  #debug-panel.editor-layout .render-inspector {
    bottom: 10px;
    width: min(var(--editor-right-panel-width), calc(100vw - 20px));
  }
  #debug-panel.editor-layout .debug-inspector {
    left: 10px;
    right: auto;
    bottom: 10px;
    width: min(var(--editor-debug-panel-width), calc(100vw - 20px));
  }
  #debug-panel.editor-layout .editor-panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 7px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  }
  #debug-panel.editor-layout .editor-panel-title-row .editor-panel-title {
    flex: 1;
    min-width: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
  }
  #debug-panel.editor-layout .debug-stat-list,
  #debug-panel.gameplay-debug .debug-stat-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  #debug-panel.editor-layout .debug-stat-row,
  #debug-panel.gameplay-debug .debug-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.32);
  }
  #debug-panel.editor-layout .debug-stat-label,
  #debug-panel.gameplay-debug .debug-stat-label {
    min-width: 0;
    color: #94a3b8;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.9px;
    text-transform: uppercase;
  }
  #debug-panel.editor-layout .debug-stat-row strong,
  #debug-panel.gameplay-debug .debug-stat-row strong {
    display: block;
    color: #f8fafc;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0.2px;
    text-align: right;
  }
  #debug-panel.editor-layout .debug-breakdown,
  #debug-panel.gameplay-debug .debug-breakdown {
    margin-top: 10px;
  }
  #debug-panel.editor-layout .debug-breakdown-category,
  #debug-panel.gameplay-debug .debug-breakdown-category {
    margin-top: 6px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.24);
    overflow: hidden;
  }
  #debug-panel.editor-layout .debug-breakdown-category summary,
  #debug-panel.gameplay-debug .debug-breakdown-category summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    color: #f8fafc;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    cursor: pointer;
    list-style-position: inside;
  }
  #debug-panel.editor-layout .debug-breakdown-category summary span:last-child,
  #debug-panel.gameplay-debug .debug-breakdown-category summary span:last-child {
    color: #94a3b8;
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
  }
  #debug-panel.editor-layout .debug-breakdown-table,
  #debug-panel.gameplay-debug .debug-breakdown-table {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
  }
  #debug-panel.editor-layout .debug-breakdown-head,
  #debug-panel.editor-layout .debug-breakdown-row,
  #debug-panel.gameplay-debug .debug-breakdown-head,
  #debug-panel.gameplay-debug .debug-breakdown-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 62px 42px 42px 42px;
    gap: 6px;
    align-items: center;
    padding: 6px 10px;
  }
  #debug-panel.editor-layout .debug-breakdown-head,
  #debug-panel.gameplay-debug .debug-breakdown-head {
    color: #7dd3fc;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    background: rgba(30, 41, 59, 0.38);
  }
  #debug-panel.editor-layout .debug-breakdown-row,
  #debug-panel.gameplay-debug .debug-breakdown-row {
    color: #cbd5e1;
    font-size: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.08);
  }
  #debug-panel.editor-layout .debug-breakdown-head span:not(:first-child),
  #debug-panel.editor-layout .debug-breakdown-row span:not(:first-child),
  #debug-panel.gameplay-debug .debug-breakdown-head span:not(:first-child),
  #debug-panel.gameplay-debug .debug-breakdown-row span:not(:first-child) {
    text-align: right;
  }
  #debug-panel.editor-layout .debug-object-name,
  #debug-panel.gameplay-debug .debug-object-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #e2e8f0;
  }
  #debug-panel.editor-layout .render-inspector .row {
    width: 100%;
  }
  #debug-panel.editor-layout .render-inspector .row label {
    flex-basis: 96px;
  }
  #debug-panel.editor-layout .render-inspector .row input[type=range],
  #debug-panel.editor-layout .render-inspector .debug-select {
    min-width: 0;
  }
  #debug-panel.editor-layout .render-section {
    margin-top: 10px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 9px;
    background: rgba(2, 6, 23, 0.22);
    overflow: hidden;
  }
  #debug-panel.editor-layout .render-section:first-of-type {
    margin-top: 0;
  }
  #debug-panel.editor-layout .render-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 9px;
    border: 0;
    border-radius: 0;
    background: rgba(30, 41, 59, 0.48);
    color: #f8fafc;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-align: left;
  }
  #debug-panel.editor-layout .render-section-toggle:hover {
    background: rgba(51, 65, 85, 0.72);
  }
  #debug-panel.editor-layout .render-section-caret {
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid #7dd3fc;
    transform: rotate(90deg);
    transition: transform 0.12s ease;
  }
  #debug-panel.editor-layout .render-section.collapsed .render-section-caret {
    transform: rotate(0deg);
  }
  #debug-panel.editor-layout .render-section-body {
    padding: 6px 8px 8px;
  }
  #debug-panel.editor-layout .editor-bottom-panel {
    position: absolute;
    left: calc(var(--editor-left-panel-width) + 20px);
    right: 10px;
    bottom: 10px;
    z-index: 30;
    height: var(--editor-bottom-panel-height);
    padding: 10px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  #debug-panel.editor-layout .animate-timeline-body {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(125, 211, 252, 0.5) rgba(15, 23, 42, 0.18);
    user-select: none;
  }
  #debug-panel.editor-layout .animate-track-row,
  #debug-panel.editor-layout .animate-channel-row,
  #debug-panel.editor-layout .animate-frame-ruler {
    user-select: none;
  }
  #debug-panel.editor-layout .animate-timeline-body::-webkit-scrollbar {
    width: 7px;
  }
  #debug-panel.editor-layout .animate-timeline-body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.18);
    border-radius: 999px;
  }
  #debug-panel.editor-layout .animate-timeline-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(125, 211, 252, 0.62), rgba(56, 189, 248, 0.28));
    border: 2px solid rgba(15, 23, 42, 0.9);
    border-radius: 999px;
  }
  #debug-panel.editor-layout .animate-timeline-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(125, 211, 252, 0.84), rgba(56, 189, 248, 0.42));
  }
  #debug-panel.editor-layout .animate-timeline-body.middle-scroll-active {
    cursor: grabbing;
  }
  #debug-panel.editor-layout .animate-waveform-clip {
    position: absolute;
    top: 3px;
    bottom: 3px;
    min-width: 12px;
    display: flex;
    align-items: center;
    gap: 1px;
    padding: 0 3px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 3px;
    background: rgba(245, 158, 11, 0.1);
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
  }
  #debug-panel.editor-layout .animate-waveform-clip span:not(.animate-waveform-loading) {
    flex: 1 1 1px;
    min-width: 1px;
    border-radius: 1px;
    background: rgba(251, 191, 36, 0.72);
    box-shadow: 0 0 3px rgba(245, 158, 11, 0.25);
  }
  #debug-panel.editor-layout .animate-waveform-loading {
    width: 100%;
    color: rgba(251, 191, 36, 0.78);
    font-size: 9px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0;
  }
  #debug-panel.editor-layout .animate-header-actions {
    position: relative;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
  }
  #debug-panel.editor-layout .animate-fx-menu-wrap {
    position: relative;
    z-index: 50;
    display: flex;
  }
  #debug-panel.editor-layout .animate-fx-menu {
    position: absolute;
    right: 0;
    bottom: 28px;
    min-width: 120px;
    padding: 4px;
    border: 1px solid rgba(251, 191, 36, 0.34);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.96);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36);
    display: none;
    z-index: 200;
  }
  #debug-panel.editor-layout .animate-fx-menu.open {
    display: block;
  }
  #debug-panel.editor-layout .animate-fx-menu button {
    width: 100%;
    padding: 5px 7px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #fde68a;
    font-size: 10px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
  }
  #debug-panel.editor-layout .animate-fx-menu button:hover {
    background: rgba(251, 191, 36, 0.14);
  }
  #debug-panel.editor-layout .animate-fx-clip {
    position: absolute;
    top: 4px;
    bottom: 4px;
    min-width: 18px;
    padding: 2px 5px;
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 4px;
    background: rgba(251, 191, 36, 0.18);
    color: #fde68a;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    z-index: 2;
  }
  #debug-panel.editor-layout .animate-fx-clip.selected,
  #debug-panel.editor-layout .sequence-fx-card.selected {
    border-color: rgba(255, 255, 255, 0.78);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.36);
  }
  #debug-panel.editor-layout .sequence-fx-card {
    padding: 6px;
    margin: 0 0 6px;
    border: 1px solid rgba(251, 191, 36, 0.18);
    border-radius: 6px;
    background: rgba(251, 191, 36, 0.06);
  }
  #debug-panel.editor-layout .sequence-fx-card-head {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
  }
  #debug-panel.editor-layout .sequence-fx-select,
  #debug-panel.editor-layout .sequence-fx-delete {
    border: 0;
    background: transparent;
    color: #fde68a;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
  }
  #debug-panel.editor-layout .sequence-fx-select {
    flex: 1;
    text-align: left;
  }
  #debug-panel.editor-layout .sequence-fx-delete {
    color: #f87171;
  }
  #debug-panel.editor-layout .editor-resize-handle {
    position: absolute;
    z-index: 8;
    opacity: 0;
    transition: opacity 0.12s ease, background 0.12s ease;
    touch-action: none;
  }
  #debug-panel.editor-layout .editor-resize-handle:hover,
  #debug-panel.editor-layout .editor-resize-handle.is-resizing {
    opacity: 1;
  }
  #debug-panel.editor-layout .editor-resize-handle--right,
  #debug-panel.editor-layout .editor-resize-handle--left {
    top: 8px;
    bottom: 8px;
    width: 8px;
    cursor: ew-resize;
  }
  #debug-panel.editor-layout .editor-resize-handle--right {
    right: -4px;
    background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.34), transparent);
  }
  #debug-panel.editor-layout .editor-resize-handle--left {
    left: -4px;
    background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.34), transparent);
  }
  #debug-panel.editor-layout .editor-resize-handle--top {
    top: -4px;
    left: 8px;
    right: 8px;
    height: 8px;
    cursor: ns-resize;
    background: linear-gradient(180deg, transparent, rgba(125, 211, 252, 0.34), transparent);
  }
  body.editor-panel-resizing {
    user-select: none;
  }
  #debug-panel.editor-layout .animate-tl-scrollbar {
    width: 100%;
    height: 12px;
    margin: 2px 0 0;
    cursor: grab;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    flex: 0 0 12px;
  }
  #debug-panel.editor-layout .animate-tl-scrollbar:active {
    cursor: grabbing;
  }
  #debug-panel.editor-layout .animate-tl-scrollbar::-webkit-slider-runnable-track {
    height: 7px;
    background: rgba(15, 23, 42, 0.18);
    border-radius: 999px;
  }
  #debug-panel.editor-layout .animate-tl-scrollbar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 44px;
    height: 7px;
    border: 2px solid rgba(15, 23, 42, 0.9);
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(125, 211, 252, 0.62), rgba(56, 189, 248, 0.28));
  }
  #debug-panel.editor-layout .animate-tl-scrollbar:hover::-webkit-slider-thumb {
    background: linear-gradient(90deg, rgba(125, 211, 252, 0.84), rgba(56, 189, 248, 0.42));
  }
  #debug-panel.editor-layout .animate-tl-scrollbar::-moz-range-track {
    height: 7px;
    background: rgba(15, 23, 42, 0.18);
    border-radius: 999px;
  }
  #debug-panel.editor-layout .animate-tl-scrollbar::-moz-range-thumb {
    width: 44px;
    height: 7px;
    border: 2px solid rgba(15, 23, 42, 0.9);
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(125, 211, 252, 0.62), rgba(56, 189, 248, 0.28));
  }
  #debug-panel.editor-layout .editor-panel-title,
  #debug-panel.editor-layout .editor-section-title,
  #debug-panel.editor-layout .editor-bottom-header {
    color: #f8fafc;
    font-size: 11px;
    letter-spacing: 1px;
    padding-bottom: 7px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    font-weight: 800;
  }
  #debug-panel.editor-layout .editor-section-title {
    margin-top: 12px;
    color: #94a3b8;
    font-size: 10px;
  }
  #debug-panel.editor-layout .editor-panel-tabs {
    display: flex;
    gap: 2px;
    padding-bottom: 7px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  }
  #debug-panel.editor-layout .editor-panel-tab {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.42);
    color: #94a3b8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
    padding: 5px 4px;
    cursor: pointer;
  }
  #debug-panel.editor-layout .editor-panel-tab.active {
    background: rgba(56, 189, 248, 0.16);
    border-color: rgba(125, 211, 252, 0.42);
    color: #f8fafc;
  }
  #debug-panel.editor-layout .animate-content-browser {
    flex: 1;
    min-height: 0;
    display: flex;
    min-width: 0;
    overflow: hidden;
  }
  #debug-panel.editor-layout .editor-bottom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  #debug-panel.editor-layout .outliner {
    flex: 1;
    max-height: none;
    margin: 0;
    min-height: 0;
    background: rgba(2, 6, 23, 0.28);
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(125, 211, 252, 0.42) rgba(15, 23, 42, 0.18);
  }
  #debug-panel.editor-layout .outliner::-webkit-scrollbar {
    width: 8px;
  }
  #debug-panel.editor-layout .outliner::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.18);
    border-radius: 999px;
  }
  #debug-panel.editor-layout .outliner::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(125, 211, 252, 0.55), rgba(56, 189, 248, 0.28));
    border: 2px solid rgba(15, 23, 42, 0.85);
    border-radius: 999px;
  }
  #debug-panel.editor-layout .outliner::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(125, 211, 252, 0.8), rgba(56, 189, 248, 0.45));
  }
  #debug-panel.editor-layout .selected-info {
    margin-top: 0;
    background: rgba(2, 6, 23, 0.28);
  }
  #debug-panel.editor-layout .editor-empty-state {
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  #debug-panel.editor-layout .content-grid {
    grid-template-columns: repeat(3, 50px);
    gap: 6px;
    margin-bottom: 0;
  }
  #debug-panel.editor-layout .content-explorer {
    flex: 1;
    min-height: 0;
  }
  #debug-panel.editor-layout .content-explorer-grid {
    grid-template-columns: repeat(auto-fill, 72px);
    align-content: start;
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(125, 211, 252, 0.42) rgba(15, 23, 42, 0.18);
  }
  #debug-panel.editor-layout .content-explorer-grid::-webkit-scrollbar {
    width: 8px;
  }
  #debug-panel.editor-layout .content-explorer-grid::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.18);
    border-radius: 999px;
  }
  #debug-panel.editor-layout .content-explorer-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(125, 211, 252, 0.55), rgba(56, 189, 248, 0.28));
    border: 2px solid rgba(15, 23, 42, 0.85);
    border-radius: 999px;
  }
  #debug-panel.editor-layout .content-explorer-grid::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(125, 211, 252, 0.8), rgba(56, 189, 248, 0.45));
  }
  #debug-panel.editor-layout .content-explorer-grid.middle-scroll-active {
    cursor: grabbing;
    user-select: none;
  }
  #debug-panel.editor-layout .content-item {
    box-sizing: border-box;
    width: 50px;
    min-width: 0;
    height: 56px;
    padding: 6px 3px;
  }
  #debug-panel.editor-layout .content-explorer-grid .content-item {
    width: 72px;
  }
  #debug-panel.editor-layout .animate-content-browser .content-explorer {
    min-width: 0;
    width: 100%;
  }
  #debug-panel.editor-layout .animate-content-browser .content-explorer-bar {
    gap: 6px;
    min-width: 0;
  }
  #debug-panel.editor-layout .animate-content-browser .content-breadcrumb {
    min-width: 0;
  }
  #debug-panel.editor-layout .animate-content-browser .content-view-toggle {
    flex-shrink: 0;
  }
  #debug-panel.editor-layout .animate-content-browser .content-explorer-grid {
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    min-width: 0;
    overflow-x: hidden;
  }
  #debug-panel.editor-layout .animate-content-browser .content-item,
  #debug-panel.editor-layout .animate-content-browser .content-explorer-grid .content-item {
    width: 100%;
  }
  #debug-panel.editor-layout .content-explorer.list-view .content-explorer-grid {
    display: flex;
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding-right: 4px;
  }
  #debug-panel.editor-layout .content-explorer.list-view .content-item {
    width: auto;
    height: auto;
  }
  #debug-panel.editor-layout .content-icon {
    font-size: 16px;
  }
  #debug-panel.editor-layout .content-label {
    font-size: 8px;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  @media (max-width: 980px) {
    #debug-panel.editor-layout {
      --editor-left-panel-width: 220px;
      --editor-right-panel-width: 280px;
    }
    #debug-panel.editor-layout .editor-transform-modes {
      right: calc(var(--editor-right-panel-width) + 28px + var(--editor-toolbar-shift));
    }
    #debug-panel.editor-layout .editor-view-select {
      right: calc(var(--editor-right-panel-width) + 136px + var(--editor-toolbar-shift));
    }
  }

  /* ── Touch Controls ── */
  #touch-controls {
    position: fixed; inset: 0; z-index: 8;
    pointer-events: none;
    touch-action: none;
    -webkit-user-select: none; user-select: none;
  }
  #touch-joystick-zone {
    position: absolute;
    left: 0; bottom: 0;
    width: 45%; height: 50%;
    z-index: 1;
    pointer-events: auto;
    touch-action: none;
  }
  #touch-joystick-base {
    position: absolute;
    left: 60px; bottom: 80px;
    width: 100px; height: 100px;
    border-radius: 50%;
    border: 2px solid rgba(151, 252, 228, 0.3);
    background: rgba(151, 252, 228, 0.06);
    opacity: 0.4;
    transition: opacity 0.15s;
    pointer-events: none;
  }
  #touch-joystick-thumb {
    position: absolute;
    left: 50%; top: 50%;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(151, 252, 228, 0.35);
    border: 1px solid rgba(151, 252, 228, 0.6);
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 12px rgba(151, 252, 228, 0.2);
  }
  #touch-look-zone {
    position: absolute;
    right: 0; top: 0;
    width: 55%; height: 100%;
    z-index: 1;
    pointer-events: auto;
    touch-action: none;
  }
  .touch-btn {
    position: absolute;
    z-index: 2;
    pointer-events: auto;
    touch-action: none;
    display: flex; align-items: center; justify-content: center;
    appearance: none;
    -webkit-appearance: none;
    font-family: var(--hypurr-body);
    font-size: 11px; letter-spacing: .5px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    width: 60px; height: 60px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(10px) saturate(1.15);
    -webkit-backdrop-filter: blur(10px) saturate(1.15);
    -webkit-user-select: none; user-select: none;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
  }
  .touch-btn:active, .touch-btn.active {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3), 0 0 16px rgba(255, 255, 255, 0.18);
  }
  .touch-btn-top {
    top: calc(env(safe-area-inset-top, 0px) + 18px);
    bottom: auto;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 10px;
    letter-spacing: .3px;
  }
  #touch-btn-camera {
    right: 78px;
  }
  #touch-btn-menu {
    right: 24px;
    font-size: 12px;
  }
  #touch-btn-jump {
    right: 30px; bottom: 100px;
  }
  #touch-btn-sprint {
    right: 100px; bottom: 50px;
  }
  #touch-btn-interact {
    right: 100px; bottom: 170px;
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.16);
  }
  #touch-btn-interact:active {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
  }
  #touch-btn-scan {
    right: 30px; bottom: 180px;
    width: 50px; height: 50px;
    font-size: 9px;
  }

  /* Hide touch controls on non-touch/desktop */
  @media (hover: hover) and (pointer: fine) {
    #touch-controls { display: none !important; }
  }

  /* ── Multiplayer Chat ── */
  #multiplayer-chat {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 12;
    width: min(360px, calc(100vw - 36px));
    font-family: var(--hypurr-body);
    color: rgba(255, 255, 255, 0.96);
    pointer-events: none;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
  }
  #multiplayer-chat.hidden {
    display: none;
  }
  body.vision-scan #multiplayer-chat {
    color: rgba(255, 255, 255, 0.96);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
  }
  .multiplayer-chat-log {
    max-height: 150px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 8px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.45s ease, transform 0.45s ease, max-height 0.18s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
  }
  body.vision-scan .multiplayer-chat-log {
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
  }
  #multiplayer-chat:hover .multiplayer-chat-log,
  #multiplayer-chat:focus-within .multiplayer-chat-log {
    max-height: min(320px, 42vh);
  }
  #multiplayer-chat.inactive:not(:hover):not(:focus-within) .multiplayer-chat-log {
    opacity: 0;
    transform: translateY(6px);
  }
  .multiplayer-chat-line {
    width: fit-content;
    max-width: 100%;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px) saturate(1.1);
    -webkit-backdrop-filter: blur(8px) saturate(1.1);
  }
  body.vision-scan .multiplayer-chat-line {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.14);
  }
  .multiplayer-chat-line--system {
    color: rgba(255, 255, 255, 0.68);
    border-color: rgba(255, 255, 255, 0.12);
  }
  body.vision-scan .multiplayer-chat-line--system {
    color: rgba(255, 255, 255, 0.68);
    border-color: rgba(255, 255, 255, 0.12);
  }
  .multiplayer-chat-name {
    margin-right: 7px;
    color: #fff;
    font-weight: 800;
    text-transform: uppercase;
  }
  body.vision-scan .multiplayer-chat-name {
    color: #fff;
  }
  .multiplayer-chat-form {
    pointer-events: auto;
    touch-action: manipulation;
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .multiplayer-chat-field {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    min-width: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.82);
    cursor: var(--game-cursor-text);
    touch-action: manipulation;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(10px) saturate(1.15);
    -webkit-backdrop-filter: blur(10px) saturate(1.15);
    transition: flex-basis 0.18s ease, width 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  }
  .multiplayer-chat-field:hover,
  .multiplayer-chat-field:focus-within {
    flex-basis: min(260px, calc(100vw - 78px));
    width: min(260px, calc(100vw - 78px));
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), 0 0 16px rgba(255, 255, 255, 0.18);
  }
  .multiplayer-chat-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
  }
  body.vision-scan .multiplayer-chat-field {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.82);
  }
  body.vision-scan .multiplayer-chat-field:hover,
  body.vision-scan .multiplayer-chat-field:focus-within {
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), 0 0 16px rgba(255, 255, 255, 0.18);
  }
  .multiplayer-control-svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: currentColor;
  }
  .multiplayer-chat-icon .multiplayer-control-svg {
    width: 19px;
    height: 19px;
  }
  .multiplayer-chat-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 1px;
    height: 28px;
    box-sizing: border-box;
    padding: 6px 8px 6px 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-family: var(--hypurr-body);
    font-weight: 700;
    font-size: 12px;
    outline: none;
    opacity: 0;
    transition: opacity 0.12s ease;
  }
  .multiplayer-chat-field:hover .multiplayer-chat-input,
  .multiplayer-chat-field:focus-within .multiplayer-chat-input {
    opacity: 1;
  }
  .multiplayer-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.58);
  }
  .multiplayer-chat-input:focus {
    box-shadow: none;
  }
  body.vision-scan .multiplayer-chat-input {
    color: #fff;
  }
  body.vision-scan .multiplayer-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.58);
  }
  body.vision-scan .multiplayer-chat-input:focus {
    box-shadow: none;
  }

  /* On touch: hide keyboard-only hints, adjust HUD */
  @media (hover: none) and (pointer: coarse) {
    #blocker .start-hint { content: '[ tap to start ]'; }
    .key-hint { display: none !important; }
    #hud-stack { top: env(safe-area-inset-top, 10px); left: env(safe-area-inset-left, 10px); }
    #player-nametag { padding: 7px 10px; border-radius: 8px; }
    #nametag-name { font-size: 12px; }
    #nametag-wallet { font-size: 10px; }
    #hud-debug { font-size: 10px; }
    .term-close-hint { display: none; }
    #multiplayer-chat {
      left: 12px;
      bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
      width: min(360px, calc(100vw - 24px));
    }
    .multiplayer-chat-log {
      max-height: min(180px, 24vh);
    }
    .multiplayer-chat-field {
      border-color: rgba(255, 255, 255, 0.3);
    }
    .multiplayer-chat-field:focus-within {
      flex-basis: min(200px, calc(100vw - 110px));
      width: min(200px, calc(100vw - 110px));
    }
    #touch-look-zone {
      top: calc(env(safe-area-inset-top, 0px) + 84px);
      height: calc(100% - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 168px);
    }
    #touch-joystick-zone {
      height: calc(50% - 72px);
    }
  }

  /* ── Scene drag-and-drop ── */

  /* Full-screen drop zone — sits below editor panels (z-index 100) but above
     the WebGL canvas, so panel drag targets still work normally. */
  #scene-drop-zone {
    position: fixed;
    inset: 0;
    z-index: 99;
    pointer-events: none;
  }
  #scene-drop-zone.active {
    pointer-events: auto;
  }

  .content-item.dragging {
    opacity: 0.45;
  }

  #scene-drop-hint {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(14px, -50%);
    display: none;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(56, 189, 248, 0.55);
    border-radius: 6px;
    color: #38bdf8;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  }

  #scene-drop-hint.visible {
    display: flex;
  }

  #scene-drop-hint::before {
    content: '⊕';
    font-size: 12px;
  }
