*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent;user-select:none;}
html,body{width:100%;height:100%;overflow:hidden;background:#0b0d10;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;}
#app{position:fixed;inset:0;}
#scene{position:absolute;inset:0;display:block;touch-action:none;}

.hidden{display:none!important;}

#loading-screen,#start-screen{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:radial-gradient(ellipse at center,#1a1d22 0%,#0b0d10 100%);z-index:50;}
.loading-box,.start-box{text-align:center;color:#fff;padding:24px;}
.loading-logo{font-size:28px;font-weight:800;letter-spacing:2px;color:#e11d2a;margin-bottom:18px;}
.loading-bar{width:260px;height:6px;background:#22262c;border-radius:4px;overflow:hidden;margin:0 auto;}
.loading-bar-fill{height:100%;width:0%;background:linear-gradient(90deg,#e11d2a,#ff5b3d);transition:width .2s;}
.loading-text{margin-top:12px;font-size:13px;color:#9aa0a8;}
.start-box p{margin:8px 0 20px;color:#c7ccd1;font-size:15px;}
.hint{font-size:12px;color:#7a828c;margin-top:14px;}

.btn-primary{background:linear-gradient(180deg,#ff3b30,#e11d2a);color:#fff;border:none;padding:13px 28px;border-radius:10px;font-size:15px;font-weight:700;cursor:pointer;box-shadow:0 6px 16px rgba(225,29,42,.35);}
.btn-primary:active{transform:scale(.97);}

#hud{position:absolute;inset:0;pointer-events:none;}
#hud > *{pointer-events:auto;}
#crosshair{position:absolute;top:50%;left:50%;width:6px;height:6px;margin:-3px 0 0 -3px;border-radius:50%;background:rgba(255,255,255,.85);box-shadow:0 0 0 1.5px rgba(0,0,0,.4);pointer-events:none;}

.hud-btn{position:absolute;top:16px;width:44px;height:44px;border-radius:50%;border:none;background:rgba(20,22,26,.65);backdrop-filter:blur(6px);color:#fff;font-size:16px;font-weight:700;display:flex;align-items:center;justify-content:center;cursor:pointer;text-decoration:none;}
#btn-exit{right:16px;}
#btn-whatsapp{right:70px;background:#25D366;font-size:12px;}
#btn-view-mode{right:124px;font-size:18px;}

#interact-hint{position:absolute;bottom:120px;left:50%;transform:translateX(-50%);background:rgba(20,22,26,.75);color:#fff;padding:8px 16px;border-radius:20px;font-size:13px;white-space:nowrap;}

#mobile-controls{position:absolute;inset:0;}
#joystick-zone{position:absolute;left:24px;bottom:24px;width:130px;height:130px;}
#joystick-base{position:absolute;inset:0;border-radius:50%;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.25);}
#joystick-knob{position:absolute;width:56px;height:56px;border-radius:50%;background:rgba(255,255,255,.55);top:37px;left:37px;}
#look-zone{position:absolute;right:0;top:0;bottom:0;width:60%;}

.desktop-only{display:block;}
.mobile-only{display:none;}
body.is-touch .desktop-only{display:none;}
body.is-touch .mobile-only{display:block;}

#product-panel,#chat-panel{position:absolute;background:rgba(16,18,22,.92);backdrop-filter:blur(10px);color:#fff;border-radius:16px 16px 0 0;box-shadow:0 -8px 30px rgba(0,0,0,.4);}
#product-panel{left:0;right:0;bottom:0;padding:20px 20px 26px;max-height:60%;overflow-y:auto;}
@media(min-width:640px){#product-panel{left:50%;right:auto;transform:translateX(-50%);width:420px;border-radius:16px;bottom:24px;}}
.panel-close{position:absolute;top:14px;right:14px;background:rgba(255,255,255,.1);border:none;color:#fff;width:30px;height:30px;border-radius:50%;font-size:14px;cursor:pointer;}
#product-nama{font-size:20px;margin-bottom:4px;padding-right:30px;}
.product-harga{color:#ff5b3d;font-weight:700;font-size:18px;margin-bottom:10px;}
#product-ringkas{color:#c7ccd1;font-size:13.5px;line-height:1.5;margin-bottom:12px;}
.product-specs{display:grid;grid-template-columns:1fr 1fr;gap:6px 12px;font-size:12.5px;color:#9aa0a8;margin-bottom:14px;}
.product-specs span{color:#e6e8eb;}
.color-picker{display:flex;gap:10px;margin-bottom:16px;}
.color-swatch{width:32px;height:32px;border-radius:50%;border:2px solid rgba(255,255,255,.25);cursor:pointer;}
.color-swatch.active{border-color:#fff;box-shadow:0 0 0 2px #e11d2a;}
#product-panel .btn-primary{width:100%;}

#chat-panel{left:0;right:0;bottom:0;height:62%;display:flex;flex-direction:column;border-radius:16px 16px 0 0;}
@media(min-width:640px){#chat-panel{left:auto;right:24px;bottom:24px;width:360px;height:480px;border-radius:16px;}}
.chat-header{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid rgba(255,255,255,.08);}
.chat-avatar{width:36px;height:36px;border-radius:50%;background:#e11d2a;object-fit:cover;flex-shrink:0;}
.chat-name{font-weight:700;font-size:14px;}
.chat-role{font-size:11px;color:#9aa0a8;}
.chat-messages{flex:1;overflow-y:auto;padding:14px 16px;display:flex;flex-direction:column;gap:10px;}
.msg{max-width:80%;padding:9px 13px;border-radius:14px;font-size:13.5px;line-height:1.4;}
.msg-npc{align-self:flex-start;background:#22262c;border-bottom-left-radius:4px;}
.msg-user{align-self:flex-end;background:#e11d2a;border-bottom-right-radius:4px;}
.msg-typing{align-self:flex-start;color:#9aa0a8;font-size:12px;font-style:italic;}
.lead-form{padding:12px 16px;border-top:1px solid rgba(255,255,255,.08);display:flex;flex-direction:column;gap:8px;}
.lead-form p{font-size:12.5px;color:#c7ccd1;}
.lead-form input{background:#1a1d22;border:1px solid rgba(255,255,255,.15);border-radius:8px;color:#fff;padding:9px 12px;font-size:13px;}
.lead-form .btn-primary{padding:9px;font-size:13px;}
.chat-input-row{display:flex;gap:8px;padding:12px 14px;border-top:1px solid rgba(255,255,255,.08);}
#chat-input{flex:1;background:#1a1d22;border:1px solid rgba(255,255,255,.15);border-radius:20px;color:#fff;padding:10px 16px;font-size:13.5px;}
#chat-send{background:#e11d2a;border:none;color:#fff;width:40px;height:40px;border-radius:50%;font-size:12px;cursor:pointer;flex-shrink:0;}
