        :root {
            --orange: #E8501A;
            --ease: cubic-bezier(0.16, 1, 0.3, 1);
        }

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

        html,
        body {
            width: 100%;
            height: 100%;
            height: var(--app-height, 100%);
            height: 100dvh;
            overflow: hidden;
            font-family: 'DM Sans', -apple-system, sans-serif;
            background: #050505;
            color: #1a1a1a;
            -webkit-font-smoothing: antialiased;
        }

        #canvas-3d-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            height: var(--app-height, 100%);
            height: 100dvh;
            z-index: 1;
        }

        #menu {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            height: var(--app-height, 100%);
            height: 100dvh;
            background: rgba(12, 12, 12, 0.85);
            backdrop-filter: blur(16px);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            pointer-events: auto;
            z-index: 20;
            transition: opacity 0.8s ease;
            color: #fff;
            text-align: center;
            padding: 20px;
        }
        #menu h1 {
            font-family: 'Playfair Display', serif;
            font-size: 42px;
            font-weight: 600;
            margin-bottom: 14px;
            letter-spacing: 1px;
        }
        #menu p {
            color: rgba(255, 255, 255, 0.75);
            font-size: 15px;
            margin-bottom: 40px;
            line-height: 1.8;
            max-width: 480px;
            font-weight: 300;
        }
        #btn-start {
            padding: 18px 54px;
            font-size: 13px;
            font-weight: 700;
            background: var(--orange);
            color: #fff;
            border: none;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.4s var(--ease);
            text-transform: uppercase;
            letter-spacing: 3px;
            box-shadow: 0 8px 30px rgba(232, 80, 26, 0.35);
        }
        #btn-start:hover {
            transform: translateY(-4px) scale(1.02);
            box-shadow: 0 14px 40px rgba(232, 80, 26, 0.55);
        }

        #room-label {
            position: absolute;
            top: 40px;
            left: 50%;
            transform: translateX(-50%);
            color: #fff;
            font-family: 'Playfair Display', serif;
            font-size: 26px;
            letter-spacing: 4px;
            text-transform: uppercase;
            text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
            opacity: 0;
            transition: opacity 0.5s ease;
            pointer-events: none;
            z-index: 15;
        }
        #room-label.visible {
            opacity: 1;
        }

        #minimap {
            position: absolute;
            top: 20px;
            right: 20px;
            width: 200px;
            height: 160px;
            background: rgba(10, 10, 10, 0.65);
            backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            z-index: 10;
            display: none;
        }
        #minimap canvas {
            width: 100%;
            height: 100%;
            display: block;
            border-radius: 8px;
        }

        #crosshair {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 6px;
            height: 6px;
            background: var(--orange);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            display: none;
            z-index: 10;
        }

        #hud-instructions {
            position: absolute;
            bottom: max(30px, env(safe-area-inset-bottom));
            left: 50%;
            transform: translateX(-50%);
            text-align: center;
            pointer-events: none;
            z-index: 10;
            display: none;
        }
        #hud-instructions p {
            margin: 0;
            color: rgba(255, 255, 255, 0.7);
            font-size: 11px;
            letter-spacing: 4px;
            text-transform: uppercase;
            line-height: 2;
        }

        #mobile-controls {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            height: var(--app-height, 100%);
            height: 100dvh;
            z-index: 9998;
            pointer-events: none;
        }
        #joystick-zone {
            position: absolute;
            bottom: max(20px, env(safe-area-inset-bottom));
            left: max(30px, env(safe-area-inset-left));
            width: 120px;
            height: 120px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            pointer-events: auto;
            border: 2px solid rgba(232, 80, 26, 0.3);
            backdrop-filter: blur(4px);
        }
        #joystick-knob {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 50px;
            height: 50px;
            transform: translate(-50%, -50%);
            background: var(--orange);
            border-radius: 50%;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        }
        #look-zone {
            position: absolute;
            top: 0;
            right: 0;
            width: 50%;
            height: 100%;
            height: var(--app-height, 100%);
            height: 100dvh;
            pointer-events: auto;
        }

        #btn-exit-3d {
            position: absolute;
            bottom: max(20px, env(safe-area-inset-bottom));
            right: max(30px, env(safe-area-inset-right));
            padding: 12px 16px;
            z-index: 10000;
            pointer-events: auto;
            background: rgba(0, 0, 0, 0.8);
            border: 2px solid rgba(255, 255, 255, 0.2);
            color: #fff;
            border-radius: 8px;
            font-weight: bold;
            backdrop-filter: blur(4px);
            font-size: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            -webkit-tap-highlight-color: transparent;
        }

        @media (max-width: 900px) {
            #menu h1 {
                font-size: 30px;
            }
            #menu p {
                font-size: 13px;
                padding: 0 15px;
            }
            #room-label {
                font-size: 18px;
                letter-spacing: 3px;
            }
            #minimap {
                width: 140px;
                height: 110px;
            }
        }

        @media (max-width: 480px) {
            #menu h1 {
                font-size: 24px;
            }
            #menu p {
                font-size: 12px;
                margin-bottom: 28px;
            }
            #btn-start {
                padding: 14px 40px;
                font-size: 12px;
            }
            #room-label {
                top: 20px;
                font-size: 15px;
                letter-spacing: 2px;
            }
            #minimap {
                top: 12px;
                right: 12px;
                width: 110px;
                height: 88px;
            }
        }

        /* Landscape phones — short viewport height, not width, is the real
           constraint here: #menu's title+copy+button stack and the dialogue
           box's avatar+padding can otherwise overflow or get clipped. */
        @media (max-height: 500px) {
            #menu {
                padding: 30px 20px;
            }
            #menu h1 {
                font-size: 24px;
                margin-bottom: 8px;
            }
            #menu p {
                font-size: 12px;
                margin-bottom: 18px;
                line-height: 1.4;
            }
            #btn-start {
                padding: 12px 32px;
                font-size: 11px;
            }
            #room-label {
                top: 14px;
                font-size: 15px;
            }
            #minimap {
                top: 10px;
                right: 10px;
                width: 110px;
                height: 88px;
            }
            #hud-instructions {
                bottom: max(10px, env(safe-area-inset-bottom));
            }
            #hud-instructions p {
                font-size: 9px;
                letter-spacing: 2px;
            }
        }

#dialogue-box {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%) translateY(120%);
            width: min(720px, calc(100vw - 40px));
            background: #ffffff; /* Fundo branco limpo */
            border-radius: 24px;
            padding: 24px 32px;
            z-index: 100;
            display: flex;
            gap: 20px;
            align-items: center;
            transition: transform 0.6s var(--ease), opacity 0.5s var(--ease);
            opacity: 0;
            pointer-events: none;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08); /* Sombra elegante */
        }
         
        #dialogue-box.visible {
            transform: translateX(-50%) translateY(0);
            opacity: 1;
            pointer-events: auto;
        }
         
        #dialogue-avatar {
            flex-shrink: 0;
            width: 80px;
            height: 80px;
            border-radius: 50%; /* Avatar redondo e moderno */
            background: #f5f5f5;
            overflow: hidden;
            border: 2px solid #f0f0f0;
            background-image: url('https://res.cloudinary.com/dxolk5cse/image/upload/v1777125953/samuc_zlyj7o.png');
            background-size: cover;
            background-position: center;
        }
         
        #dialogue-content {
            flex: 1;
            min-height: 80px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            color: #1a1a1a; /* Texto escuro */
        }
         
        #dialogue-name {
            font-size: 11px;
            font-weight: 700;
            color: var(--orange);
            text-transform: uppercase;
            letter-spacing: 0.15em;
            margin-bottom: 6px;
        }
         
        #dialogue-text {
            font-size: 15px;
            line-height: 1.6;
            color: #555555; /* Texto cinza escuro suave */
            margin-bottom: 12px;
            min-height: 2.2em;
            font-weight: 400;
        }
         
        #dialogue-text .cursor {
            display: inline-block;
            width: 8px;
            height: 14px;
            background: var(--orange);
            margin-left: 3px;
            animation: dialogueBlink 1s steps(2) infinite;
            vertical-align: middle;
        }
         
        @keyframes dialogueBlink {
            50% { opacity: 0; }
        }
         
        #dialogue-controls {
            display: flex;
            gap: 10px;
            align-items: center;
            justify-content: space-between;
        }
         
        #dialogue-progress {
            font-size: 12px;
            color: #999999;
            font-weight: 500;
            letter-spacing: 0.05em;
        }
         
        #dialogue-next {
            background: var(--orange);
            color: white;
            border: none;
            padding: 10px 24px;
            border-radius: 10px;
            font-family: inherit;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
            transition: transform 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            box-shadow: 0 4px 15px rgba(232,80,26,0.2);
        }
         
        #dialogue-next:hover {
            background: #D14515;
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(232,80,26,0.3);
        }
         
        #dialogue-next.contact {
            background: #25d366; /* Cor do WhatsApp */
            box-shadow: 0 4px 15px rgba(37,211,102,0.2);
        }
         
        #dialogue-next.contact:hover {
            background: #128c7e;
            box-shadow: 0 6px 20px rgba(37,211,102,0.3);
        }
         
        @media (max-width: 600px) {
            #dialogue-box {
                bottom: 20px;
                padding: 16px 20px;
                gap: 14px;
                border-radius: 16px;
            }
            #dialogue-avatar {
                width: 60px;
                height: 60px;
            }
            #dialogue-text {
                font-size: 14px;
            }
        }

        @media (max-height: 500px) {
            #dialogue-box {
                bottom: 10px;
                padding: 12px 18px;
                gap: 12px;
            }
            #dialogue-avatar {
                width: 48px;
                height: 48px;
            }
            #dialogue-content {
                min-height: 48px;
            }
            #dialogue-text {
                font-size: 13px;
                margin-bottom: 6px;
                min-height: 1.6em;
            }
            #dialogue-controls {
                gap: 6px;
            }
        }
