      :root {
        --ios-glass: rgba(12, 12, 15, 0.85);
        --ios-border: rgba(255, 255, 255, 0.08);
        --caine-red: #ff0033;
      }
      body {
        margin: 0;
        overflow: hidden;
        background-color: #030305;
        font-family:
          -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
        color: #f0f0f0;
        position: fixed;
        inset: 0;
      }
      #start-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0);
        z-index: 9999;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        cursor: pointer;
      }
      #canvas-container {
        position: fixed;
        inset: 0;
        z-index: 1;
      }
      #ui-layer {
        position: fixed;
        inset: 0;
        z-index: 10;
        pointer-events: none;
        transition: opacity 0.4s ease;
        box-sizing: border-box;
      }
      .interactive-panel {
        pointer-events: auto;
      }
      .glass-panel {
        background: var(--ios-glass);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        border: 1px solid var(--ios-border);
        border-radius: 18px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
      }
      .scrollbar-thin::-webkit-scrollbar {
        width: 5px;
        height: 5px;
      }
      .scrollbar-thin::-webkit-scrollbar-track {
        background: transparent;
      }
      .scrollbar-thin::-webkit-scrollbar-thumb {
        background: rgba(255, 0, 0, 0.5);
        border-radius: 10px;
      }
      .scrollbar-thin::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 0, 0, 0.8);
      }
      button,
      .btn {
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        cursor: pointer;
      }
      button:active,
      .btn:active {
        transform: scale(0.95);
      }
      .ui-hidden {
        opacity: 0 !important;
        pointer-events: none !important;
      }
      #btn-toggle-ui {
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        z-index: 50;
        pointer-events: auto;
      }
      .vfs-item {
        padding: 8px 12px;
        border-radius: 8px;
        cursor: pointer;
        transition: background 0.2s;
        display: flex;
        align-items: center;
        gap: 10px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.02);
      }
      .vfs-item:hover {
        background: rgba(255, 0, 51, 0.25);
      }
      #learning-visualizer {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
        width: 85vw;
        max-height: 75vh;
        z-index: 5;
        pointer-events: none;
        perspective: 1200px;
      }
      .ai-image-card-wrapper {
        position: relative;
        border-radius: 50%;
        animation: holoEnt 4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        opacity: 0;
        transform: translateY(40px) rotateX(25deg);
      }
      .ai-image-card {
        width: 150px;
        height: 150px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid var(--caine-red);
        box-shadow: 0 0 35px rgba(255, 0, 51, 0.8);
      }
      .ai-scan-line {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 3px;
        background: #ff0033;
        box-shadow:
          0 0 20px #ff0033,
          0 0 40px #ff0033;
        animation: scanAnim 2s linear infinite;
        z-index: 10;
        border-radius: 50%;
      }
      @keyframes scanAnim {
        0% { top: 0; opacity: 0; }
        10% { opacity: 1; }
        90% { opacity: 1; }
        100% { top: 100%; opacity: 0; }
      }
      @keyframes holoEnt {
        0% { opacity: 0; transform: translateY(50px) rotateX(30deg) scale(0.8); filter: blur(10px); }
        15% { opacity: 1; transform: translateY(0) rotateX(0deg) scale(1.05); filter: blur(0); box-shadow: 0 0 50px rgba(255, 0, 51, 0.9); }
        80% { opacity: 1; transform: translateY(-10px) rotateX(0deg) scale(1); box-shadow: 0 0 20px rgba(255, 0, 51, 0.5); filter: blur(0); }
        100% { opacity: 0; transform: translateY(-60px) rotateX(-20deg) scale(1.1); filter: blur(15px); }
      }
      #file-modal {
        display: none;
        opacity: 0;
        transition: opacity 0.3s;
      }
      #file-modal.active {
        display: flex;
        opacity: 1;
      }
      #caine-vision-container {
        position: fixed;
        bottom: 1.5rem;
        left: 1.5rem;
        width: 180px;
        background: rgba(15, 15, 20, 0.85);
        backdrop-filter: blur(40px);
        -webkit-backdrop-filter: blur(40px);
        border: 1px solid rgba(255, 0, 51, 0.4);
        border-radius: 20px;
        box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 0, 51, 0.2);
        z-index: 9998;
        pointer-events: auto;
        display: none;
        flex-direction: column;
        overflow: hidden;
        transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
        user-select: none;
        touch-action: none;
      }
      #caine-vision-container:active {
        transform: scale(1.02);
        box-shadow: 0 20px 55px rgba(0, 0, 0, 0.9), 0 0 30px rgba(255, 0, 51, 0.3);
      }
      #caine-vision-header {
        background: rgba(255, 0, 51, 0.15);
        color: #fff;
        padding: 8px 12px;
        font-size: 10px;
        font-family: "SF Pro Display", sans-serif;
        letter-spacing: 0.1em;
        font-weight: 800;
        cursor: move;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        text-transform: uppercase;
      }
      #caine-vision-preview {
        width: 100%;
        height: 120px;
        object-fit: cover;
        background: #000;
        pointer-events: none;
      }

      /* ====== CUSTOM DROPDOWN ====== */
      .custom-dropdown {
        position: relative;
        display: inline-block;
        pointer-events: auto;
      }
      .custom-dropdown-trigger {
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 12px;
        color: #fff;
        padding: 8px 14px;
        font-size: 11px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.25s ease;
        user-select: none;
        min-width: 130px;
        white-space: nowrap;
      }
      .custom-dropdown-trigger:hover {
        background: rgba(255,255,255,0.10);
        border-color: rgba(255,0,51,0.4);
      }
      .custom-dropdown-trigger .dd-arrow {
        margin-left: auto;
        transition: transform 0.25s ease;
        font-size: 10px;
        opacity: 0.5;
      }
      .custom-dropdown.open .dd-arrow {
        transform: rotate(180deg);
      }
      .custom-dropdown-menu {
        position: absolute;
        bottom: calc(100% + 6px);
        left: 0;
        min-width: 100%;
        max-height: 45vh; /* Prevents overflow going upwards off-screen */
        overflow-y: auto;
        background: rgba(15,15,20,0.97);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 14px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.9), 0 0 20px rgba(255,0,51,0.15);
        padding: 6px;
        z-index: 100;
        opacity: 0;
        transform: translateY(8px) scale(0.96);
        pointer-events: none;
        transition: all 0.2s cubic-bezier(0.16,1,0.3,1);
      }
      .custom-dropdown.open .custom-dropdown-menu {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
      }
      .custom-dropdown-item {
        padding: 8px 12px;
        border-radius: 8px;
        color: #ccc;
        font-size: 11px;
        cursor: pointer;
        transition: all 0.15s ease;
        white-space: nowrap;
        display: flex;
        align-items: center;
        gap: 8px;
      }
      .custom-dropdown-item:hover {
        background: rgba(255,0,51,0.2);
        color: #fff;
      }
      .custom-dropdown-item.selected {
        background: rgba(255,0,51,0.15);
        color: #ff3366;
        font-weight: 700;
      }
      .custom-dropdown-item .dd-check {
        opacity: 0;
        font-size: 10px;
        color: var(--caine-red);
      }
      .custom-dropdown-item.selected .dd-check {
        opacity: 1;
      }

      /* ====== MICROPHONE BUTTON ====== */
      #btn-mic {
        position: relative;
        overflow: hidden;
      }
      #btn-mic.recording {
        background: rgba(255,0,51,0.3) !important;
        border-color: rgba(255,0,51,0.8) !important;
        color: #ff3366 !important;
        animation: micPulse 1s ease-in-out infinite;
      }
      @keyframes micPulse {
        0%, 100% { box-shadow: 0 0 0 0 rgba(255,0,51,0.4); }
        50% { box-shadow: 0 0 0 8px rgba(255,0,51,0); }
      }
      #btn-mic.recording::after {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(circle, rgba(255,0,51,0.3) 0%, transparent 70%);
        animation: micGlow 0.8s ease-in-out infinite alternate;
      }
      @keyframes micGlow {
        0% { opacity: 0.3; }
        100% { opacity: 0.8; }
      }

      /* ====== LOG ENTRY ANIMATION ====== */
      #ai-log > div {
        animation: logSlideIn 0.3s cubic-bezier(0.16,1,0.3,1) forwards;
      }
      @keyframes logSlideIn {
        0% { opacity: 0; transform: translateX(-12px); }
        100% { opacity: 1; transform: translateX(0); }
      }

      /* ====== CROSSHAIR ====== */
      #crosshair {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 24px;
        height: 24px;
        z-index: 30;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
      }
      #crosshair.active {
        opacity: 0.6;
      }
      #crosshair::before, #crosshair::after {
        content: '';
        position: absolute;
        background: rgba(255,255,255,0.7);
        border-radius: 1px;
      }
      #crosshair::before {
        left: 50%;
        top: 0;
        width: 2px;
        height: 100%;
        transform: translateX(-50%);
      }
      #crosshair::after {
        top: 50%;
        left: 0;
        width: 100%;
        height: 2px;
        transform: translateY(-50%);
      }

      /* ====== D-PAD CONTROLS ====== */
      :root {
        --ctrl-size: 40vw;   /* portrait default */
        --btn-size: calc(var(--ctrl-size) / 3.3);
        --btn-gap: calc(var(--ctrl-size) * 0.02);
        --btn-radius: 12px;
        --fly-btn-size: calc(var(--ctrl-size) / 2.3);
      }
      @media (orientation: landscape) {
        :root {
          --ctrl-size: 25vw;
        }
      }

      #dpad-controls {
        position: fixed;
        bottom: 1rem;
        left: 1rem;
        z-index: 9999;
        width: var(--ctrl-size);
        display: grid;
        grid-template-columns: var(--btn-size) var(--btn-size) var(--btn-size);
        grid-template-rows: var(--btn-size) var(--btn-size) var(--btn-size);
        gap: var(--btn-gap);
        justify-items: center;
        align-items: center;
        pointer-events: auto;
      }
      .dpad-btn {
        width: var(--btn-size);
        height: var(--btn-size);
        border-radius: var(--btn-radius);
        background: rgba(10,10,15,0.7);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 2px solid rgba(255,255,255,0.2);
        color: rgba(255,255,255,0.85);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: calc(var(--btn-size) * 0.4);
        cursor: pointer;
        transition: all 0.08s ease;
        user-select: none;
        -webkit-user-select: none;
        touch-action: none;
        box-shadow: 0 4px 20px rgba(0,0,0,0.6);
      }
      .dpad-btn:active, .dpad-btn.pressed {
        background: rgba(255,0,51,0.45);
        border-color: rgba(255,0,51,0.8);
        transform: scale(0.93);
        color: #fff;
        box-shadow: 0 0 25px rgba(255,0,51,0.4);
      }
      /* Grid placements for the cross pattern */
      #dpad-up    { grid-column: 2; grid-row: 1; }
      #dpad-left  { grid-column: 1; grid-row: 2; }
      #dpad-right { grid-column: 3; grid-row: 2; }
      #dpad-down  { grid-column: 2; grid-row: 3; }
      .dpad-center { display: none; }
      .dpad-middle { display: contents; }

      /* ====== FLY BUTTONS ====== */
      #mobile-fly-buttons {
        position: fixed;
        bottom: 1rem;
        right: 1rem;
        z-index: 9999;
        display: flex;
        flex-direction: column;
        gap: var(--btn-gap);
        pointer-events: auto;
      }
      .fly-btn {
        width: var(--fly-btn-size);
        height: var(--fly-btn-size);
        border-radius: var(--btn-radius);
        background: rgba(10,10,15,0.7);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 2px solid rgba(255,255,255,0.2);
        color: rgba(255,255,255,0.85);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: calc(var(--fly-btn-size) * 0.35);
        cursor: pointer;
        transition: all 0.08s ease;
        user-select: none;
        -webkit-user-select: none;
        touch-action: none;
        box-shadow: 0 4px 20px rgba(0,0,0,0.6);
      }
      .fly-btn:active, .fly-btn.pressed {
        background: rgba(255,0,51,0.45);
        border-color: rgba(255,0,51,0.8);
        transform: scale(0.93);
        color: #fff;
        box-shadow: 0 0 25px rgba(255,0,51,0.4);
      }

      /* ====== PARTICLE BURST ====== */
      .particle-burst {
        position: absolute;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        pointer-events: none;
        z-index: 100;
        animation: burstFade 0.8s cubic-bezier(0.16,1,0.3,1) forwards;
      }
      @keyframes burstFade {
        0% { opacity: 1; transform: scale(1); }
        100% { opacity: 0; transform: scale(0) translateY(-30px); }
      }

      /* ====== SPEAKING INDICATOR ====== */
      #speaking-indicator {
        position: fixed;
        bottom: 2rem;
        left: 50%;
        transform: translateX(-50%);
        z-index: 60;
        background: rgba(255,0,51,0.15);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255,0,51,0.4);
        border-radius: 20px;
        padding: 8px 20px;
        color: #ff6688;
        font-size: 11px;
        font-weight: 700;
        font-family: monospace;
        display: none;
        align-items: center;
        gap: 10px;
        pointer-events: none;
        animation: speakPulse 1.5s ease-in-out infinite;
      }
      #speaking-indicator.active { display: flex; }
      @keyframes speakPulse {
        0%, 100% { box-shadow: 0 0 10px rgba(255,0,51,0.2); }
        50% { box-shadow: 0 0 25px rgba(255,0,51,0.5); }
      }
      .speak-bars {
        display: flex; align-items: center; gap: 2px; height: 14px;
      }
      .speak-bar {
        width: 3px;
        background: #ff3366;
        border-radius: 2px;
        animation: speakBar 0.6s ease-in-out infinite alternate;
      }
      .speak-bar:nth-child(1) { height: 6px; animation-delay: 0s; }
      .speak-bar:nth-child(2) { height: 10px; animation-delay: 0.15s; }
      .speak-bar:nth-child(3) { height: 14px; animation-delay: 0.3s; }
      .speak-bar:nth-child(4) { height: 10px; animation-delay: 0.45s; }
      .speak-bar:nth-child(5) { height: 6px; animation-delay: 0.6s; }
      @keyframes speakBar {
        0% { height: 4px; }
        100% { height: 14px; }
      }