/* ==========================================================================
   EcoSeaVerse - Metaverse 3D Styles
   ========================================================================== */

   :root {
    --primary: #00d2ff;
    --primary-dark: #0088cc;
    --primary-glow: rgba(0, 210, 255, 0.5);
    --secondary: #00ff88;
    --bg-dark: #050b14;
    --panel-bg: rgba(5, 15, 30, 0.75);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-main: #ffffff;
    --text-muted: #a0b0c0;
    --danger: #ff4444;
    --success: #00ff88;
    --warning: #ffbb00;
    
    --font-main: 'Poppins', sans-serif;
    
    --z-canvas: 1;
    --z-vignette: 5;
    --z-hud: 10;
    --z-popup: 50;
    --z-loading: 100;
  }
  
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
  }
  
  body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: var(--font-main);
    color: var(--text-main);
  }
  
  /* ==========================================================================
     3D CANVAS & OVERLAYS
     ========================================================================== */
  
  #metaverse-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-canvas);
    display: block;
  }
  
  .underwater-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--z-vignette);
    background: radial-gradient(circle at center, transparent 30%, rgba(0, 20, 50, 0.6) 100%);
    box-shadow: inset 0 0 100px rgba(0, 100, 200, 0.2);
    mix-blend-mode: multiply;
  }
  
  /* ==========================================================================
     CROSSHAIR
     ========================================================================== */
  
  .crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: var(--z-hud);
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .xhair-dot {
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  }
  
  .xhair-ring {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.2s ease;
  }
  
  .crosshair.active .xhair-ring {
    width: 30px;
    height: 30px;
    border-color: var(--primary);
    background: rgba(0, 210, 255, 0.1);
  }
  
  /* ==========================================================================
     LOADING SCREEN
     ========================================================================== */
  
  .loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #020b18 0%, #002244 100%);
    z-index: var(--z-loading);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease;
  }
  
  .loading-content {
    text-align: center;
    z-index: 2;
    max-width: 500px;
    width: 90%;
  }
  
  .loading-logo {
    margin-bottom: 40px;
  }
  
  .loading-logo i {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 10px;
    text-shadow: 0 0 20px var(--primary-glow);
    animation: float 3s ease-in-out infinite;
  }
  
  .loading-logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin: 0;
    background: linear-gradient(90deg, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  .loading-logo p {
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-size: 0.9rem;
  }
  
  .loading-bar-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
  }
  
  .loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    border-radius: 10px;
    box-shadow: 0 0 10px var(--primary-glow);
    transition: width 0.3s ease;
  }
  
  .loading-status {
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 30px;
    font-weight: 600;
  }
  
  .loading-hint {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .loading-hint kbd {
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #fff;
    border-bottom: 2px solid rgba(0,0,0,0.5);
  }
  
  .loading-waves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30vh;
    overflow: hidden;
    z-index: 1;
    opacity: 0.2;
    pointer-events: none;
  }
  
  /* ==========================================================================
     START OVERLAY (Pointer Lock Info)
     ========================================================================== */
  
  .start-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 11, 24, 0.85);
    backdrop-filter: blur(8px);
    z-index: var(--z-popup);
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .start-content {
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    max-width: 700px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.2);
  }
  
  .start-logo h1 {
    font-size: 2rem;
    margin-bottom: 5px;
    color: var(--primary);
  }
  
  .start-logo p {
    color: var(--text-muted);
    margin-bottom: 30px;
  }
  
  .controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
  }
  
  .ctrl-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }
  
  .ctrl-item span {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .key-cluster {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
  
  .key-row {
    display: flex;
    gap: 4px;
  }
  
  kbd {
    background: #1a2233;
    border: 1px solid #334455;
    border-radius: 6px;
    padding: 6px 12px;
    font-family: monospace;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 4px 0 #0f1522;
    min-width: 30px;
    display: inline-flex;
    justify-content: center;
  }
  
  kbd.key-wide {
    padding: 6px 20px;
  }
  
  .btn-start {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 210, 255, 0.3);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-main);
  }
  
  .btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(0, 210, 255, 0.4);
    filter: brightness(1.1);
  }
  
  .start-hint {
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
  }
  
  /* ==========================================================================
     HUD TOP BAR
     ========================================================================== */
  
  .hud-top {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: var(--z-hud);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none; /* Let clicks pass through to 3D */
  }
  
  .hud-brand {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  }
  
  .hud-scores {
    display: flex;
    gap: 10px;
  }
  
  .hud-stat {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 10px 15px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
  }
  
  .hud-stat i {
    color: var(--primary);
    margin-bottom: 5px;
    font-size: 1.1rem;
  }
  
  .hud-stat span {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  
  .hud-stat strong {
    font-size: 1.2rem;
    font-weight: 800;
  }
  
  .hud-health-wrap .mini-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin: 5px 0;
    overflow: hidden;
  }
  
  .hud-health-wrap .mini-bar-fill {
    height: 100%;
    width: 35%;
    background: var(--secondary);
    transition: width 0.5s ease;
  }
  
  .hud-depth {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(4px);
  }
  
  /* ==========================================================================
     HUD MISSIONS MAP (Left Side)
     ========================================================================== */
  
  .hud-missions {
    position: absolute;
    top: 90px;
    left: 20px;
    z-index: var(--z-hud);
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    width: 250px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    pointer-events: auto; /* allow scrolling/clicking */
  }
  
  /* Scrollbar styling for panels */
  .hud-missions::-webkit-scrollbar {
    width: 6px;
  }
  .hud-missions::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
  }
  .hud-missions::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
  }
  
  .hud-missions-title {
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    background: rgba(5, 15, 30, 0.95);
    z-index: 2;
  }
  
  .hud-missions-title i {
    color: var(--primary);
  }
  
  .hud-prog-label {
    margin-left: auto;
    background: rgba(0, 210, 255, 0.2);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
  }
  
  .hud-mission-list {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .m-node {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border: 1px solid transparent;
    border-radius: 10px;
    opacity: 0.5;
    transition: all 0.2s;
  }
  
  .m-node-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
  }
  
  .m-node-info {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
  }
  
  .m-node-info strong {
    color: var(--text-main);
  }
  
  .m-node-info small {
    color: var(--text-muted);
    font-size: 0.65rem;
  }
  
  .m-node.is-open {
    opacity: 1;
    background: rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.05);
  }
  
  .m-node.is-done .m-node-num {
    background: var(--success);
    color: #000;
  }
  
  .m-node.is-current {
    border-color: var(--primary);
    background: rgba(0, 210, 255, 0.1);
    opacity: 1;
  }
  
  .m-node.is-current .m-node-num {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 10px var(--primary-glow);
  }
  
  /* ==========================================================================
     AI GUARDIAN (Bottom Left)
     ========================================================================== */
  
  .ai-guardian {
    position: absolute;
    bottom: 30px;
    left: 20px;
    z-index: var(--z-hud);
    display: flex;
    align-items: flex-end;
    gap: 15px;
    pointer-events: none;
  }
  
  .ai-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--panel-bg);
    border: 2px solid var(--primary);
    padding: 5px;
    position: relative;
    box-shadow: 0 0 20px var(--primary-glow);
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.2s;
  }
  
  .ai-avatar:hover {
    transform: scale(1.1);
  }
  
  .ai-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
  }
  
  .ai-ping {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    animation: ping 2s infinite;
  }
  
  @keyframes ping {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
  }
  
  .ai-bubble {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--primary-glow);
    border-radius: 15px 15px 15px 0;
    padding: 15px 20px;
    max-width: 300px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    pointer-events: auto;
    transform-origin: bottom left;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }
  
  .ai-bubble.collapsed {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
  }
  
  .ai-bubble-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--primary);
  }
  
  .ai-close-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
  }
  
  .ai-close-btn:hover {
    color: #fff;
  }
  
  .ai-bubble p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
  }
  
  /* ==========================================================================
     PROMPTS (Center Bottom)
     ========================================================================== */
  
  .zone-prompt, .dive-prompt {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    border: 1px solid var(--primary);
    padding: 12px 25px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: var(--z-hud);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.2);
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
  }
  
  .zone-prompt.hidden, .dive-prompt.hidden {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  
  .zone-prompt i, .dive-prompt i {
    color: var(--primary);
    font-size: 1.2rem;
  }
  
  .zone-name {
    color: var(--primary);
    font-weight: 700;
  }
  
  .zone-prompt kbd, .dive-prompt kbd {
    background: #fff;
    color: #000;
    border: none;
    box-shadow: 0 2px 0 #ccc;
    padding: 2px 8px;
    border-radius: 4px;
  }
  
  .dive-prompt {
    bottom: 100px;
    border-color: rgba(255,255,255,0.2);
    color: #ccc;
    font-size: 0.9rem;
  }
  .dive-prompt i { color: #ccc; }
  
  /* ==========================================================================
     MISSION POPUP (Interaction UI)
     ========================================================================== */
  
  .mission-popup {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: var(--z-popup);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s;
  }
  
  .mission-popup.hidden {
    opacity: 0;
    pointer-events: none;
  }
  
  .mission-popup-inner {
    background: var(--panel-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }
  
  .mission-popup.hidden .mission-popup-inner {
    transform: scale(0.9);
  }
  
  .popup-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: background 0.2s;
    z-index: 2;
  }
  
  .popup-close-btn:hover {
    background: rgba(255,255,255,0.2);
  }
  
  .popup-header {
    padding: 30px 40px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: linear-gradient(to right, rgba(0, 210, 255, 0.1), transparent);
  }
  
  .popup-eyebrow {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .popup-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
  }
  
  .popup-header p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
  }
  
  .popup-ai-panel {
    display: flex;
    gap: 20px;
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.2);
    align-items: center;
  }
  
  .popup-ai-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    padding: 5px;
    background: rgba(0,0,0,0.5);
  }
  
  .popup-ai-name {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
  }
  
  .popup-ai-panel p {
    font-size: 0.95rem;
    line-height: 1.5;
  }
  
  .popup-char-value {
    margin: 0 40px;
    padding: 12px 20px;
    background: rgba(255, 187, 0, 0.1);
    border-left: 4px solid var(--warning);
    color: var(--warning);
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 600;
  }
  
  .popup-task {
    padding: 20px 40px;
    flex: 1;
  }
  
  .popup-task h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .popup-task h3 i {
    color: var(--secondary);
  }
  
  .task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
  }
  
  .task-choice {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .task-choice::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    flex-shrink: 0;
  }
  
  .task-choice:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
  }
  
  .task-choice.is-selected {
    background: rgba(0, 210, 255, 0.15);
    border-color: var(--primary);
  }
  
  .task-choice.is-selected::before {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: inset 0 0 0 2px var(--bg-dark);
  }
  
  .task-choice.is-correct {
    background: rgba(0, 255, 136, 0.15);
    border-color: var(--success);
  }
  .task-choice.is-correct::after {
    content: '\f00c'; /* check */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--success);
    margin-left: auto;
  }
  
  .task-choice.is-wrong {
    background: rgba(255, 68, 68, 0.15);
    border-color: var(--danger);
    opacity: 0.7;
  }
  .task-choice.is-wrong::after {
    content: '\f00d'; /* xmark */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--danger);
    margin-left: auto;
  }
  
  .popup-footer {
    padding: 20px 40px;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 20px 20px;
  }
  
  .popup-badge-row {
    display: flex;
    gap: 10px;
  }
  
  .badge-icon {
    background: rgba(255,255,255,0.1);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 187, 0, 0.3);
  }
  
  .btn-primary {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    font-family: inherit;
  }
  
  .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 210, 255, 0.3);
  }
  
  .btn-primary:disabled {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.3);
    cursor: not-allowed;
  }
  
  /* Utilities */
  .hidden {
    display: none !important;
  }
  
  .damage-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle, transparent 20%, rgba(255,0,0,0.8) 100%); z-index: var(--z-loading); pointer-events: none; opacity: 0; transition: opacity 0.2s ease; } .damage-overlay.active { opacity: 1; transition: opacity 0.05s ease; }