* { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: #000; overflow: hidden; }

#game-container { width: 100vw; height: 100vh; position: relative; overflow: hidden; }
#scenes-wrapper { width: 100%; height: 100%; position: relative; }

.scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    visibility: hidden;
    background-size: cover;
    background-position: bottom left;
    background-repeat: no-repeat;
    overflow: hidden;
}
.scene.active { opacity: 1; visibility: visible; }

.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
    z-index: 1;
    pointer-events: none;
}

.wide-scene { background-size: 100% 100%; background-repeat: no-repeat; }
.obstacle, .door-trigger, .action-trigger { z-index: 10; }

#scene-8 .bg-video {
    object-fit: fill;
    object-position: center center;
}

#transition-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.portal-video {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
}

.obstacle { position: absolute; z-index: 90; bottom: 85px; height: 1px; pointer-events: none; }
.door-trigger, .action-trigger { position: absolute; height: 200px; z-index: 95; bottom: 85px; pointer-events: none; }

#character {
    position: absolute;
    bottom: 85px;
    left: 0;
    width: 196px;
    height: 196px;
    background-size: auto 100%;
    background-repeat: repeat-x;
    z-index: 100;
}

.sprite-idle { background-image: url('assets/sprite-idle.png'); animation: anim-idle 0.8s steps(4) infinite; }
.sprite-walk1 { background-image: url('assets/sprite-walk-right.png'); animation: anim-walk-2frames 0.6s steps(2) infinite; }
.sprite-walk2 { background-image: url('assets/sprite-walk-left.png'); animation: anim-walk-2frames 0.6s steps(2) infinite; }
.sprite-jump1 { background-image: url('assets/sprite-jump1.png'); animation: anim-jump 0.6s steps(4) forwards; }
.sprite-jump2 { background-image: url('assets/sprite-jump2.png'); animation: anim-jump 0.6s steps(4) forwards; }

.sprite-sit { background-image: url('assets/sprite-sit.png'), url('assets/sprite-idle.png'); animation: anim-idle 0.8s steps(4) infinite; }
.sprite-sleep { background-image: url('assets/sprite-sleep.png'), url('assets/sprite-idle.png'); animation: anim-idle 1.1s steps(4) infinite; }
.sprite-pc { background-image: url('assets/sprite-pc.png'), url('assets/sprite-idle.png'); animation: anim-idle 0.8s steps(4) infinite; }
.sprite-read { background-image: url('assets/sprite-read.png'), url('assets/sprite-idle.png'); animation: anim-idle 0.9s steps(4) infinite; }
.sprite-phone { background-image: url('assets/sprite-phone.png'), url('assets/sprite-idle.png'); animation: anim-idle 0.8s steps(4) infinite; }
.sprite-check { background-image: url('assets/sprite-check.png'), url('assets/sprite-idle.png'); animation: anim-idle 0.8s steps(4) infinite; }

@keyframes anim-idle { from { background-position: 0px; } to { background-position: -784px; } }
@keyframes anim-walk-2frames { from { background-position: 0px; } to { background-position: -392px; } }
@keyframes anim-jump { from { background-position: 0px; } to { background-position: -784px; } }


/* Loading awal: tampil 6 detik agar semua asset/rendering lebih siap */
#transition-overlay.initial-loading {
    opacity: 1;
    pointer-events: auto;
}

/* Bubble hint retro game saat karakter dekat portal / pintu kantor */
#portal-hint {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 250;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -18px) scale(0.92);
    transition: opacity 0.18s ease, transform 0.18s ease;
}
#portal-hint.show {
    opacity: 1;
    transform: translate(-50%, -34px) scale(1);
}
#portal-hint .hint-bubble {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    background: rgba(17, 22, 35, 0.94);
    border: 3px solid #fff;
    color: #fff;
    font-family: "Courier New", monospace;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .2px;
    white-space: nowrap;
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28);
    text-shadow: 0 2px 0 rgba(0,0,0,.45);
}
#portal-hint .hint-bubble::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -11px;
    width: 14px;
    height: 14px;
    background: rgba(17, 22, 35, 0.94);
    border-right: 3px solid #fff;
    border-bottom: 3px solid #fff;
    transform: translateX(-50%) rotate(45deg);
}
#portal-hint .hint-key {
    display: inline-grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border: 2px solid #fff;
    background: rgba(255,255,255,.12);
    font-size: 18px;
    line-height: 1;
}

#detail-hint {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 245;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 0) scale(0.92);
    transition: opacity 0.18s ease, transform 0.18s ease;
}
#detail-hint.show {
    opacity: 1;
    transform: translate(-50%, -10px) scale(1);
}
#detail-hint .hint-bubble {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    background: rgba(11, 24, 43, 0.96);
    border: 3px solid #d8faff;
    color: #f2fdff;
    font-family: "Courier New", monospace;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .2px;
    white-space: nowrap;
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28);
    text-shadow: 0 2px 0 rgba(0,0,0,.45);
}
#detail-hint .hint-bubble::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -11px;
    width: 14px;
    height: 14px;
    background: rgba(11, 24, 43, 0.96);
    border-right: 3px solid #d8faff;
    border-bottom: 3px solid #d8faff;
    transform: translateX(-50%) rotate(45deg);
}
#detail-hint .hint-key {
    display: inline-grid;
    place-items: center;
    min-width: 25px;
    width: auto;
    padding: 0 6px;
    height: 25px;
    border: 2px solid #d8faff;
    background: rgba(105,235,255,.16);
    color: #8ff4ff;
    font-size: 18px;
    line-height: 1;
}


/* Detail HUD: tekan Arrow Down untuk membuka detail setiap background */
#detail-hud {
    position: absolute;
    inset: 0;
    z-index: 850;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4vh 5vw;
    background: rgba(0, 0, 0, 0.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}
#detail-hud.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.hud-frame {
    --hud-left: 13%;
    --hud-right: 13%;
    --hud-top: 15%;
    --hud-bottom: 13%;
    position: relative;
    width: min(76vw, 1080px);
    max-height: 82vh;
    aspect-ratio: 16 / 9;
    background-image: url("assets/hud-landscape.png");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    filter: drop-shadow(0 20px 32px rgba(0,0,0,.52));
    transform: translateY(14px) scale(0.98);
    transition: transform 0.22s ease;
}
#detail-hud.show .hud-frame {
    transform: translateY(0) scale(1);
}
.hud-content {
    position: absolute;
    left: var(--hud-left);
    right: var(--hud-right);
    top: var(--hud-top);
    bottom: var(--hud-bottom);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    color: #eafaff;
    font-family: "Courier New", monospace;
    text-shadow: 0 2px 0 rgba(0,0,0,.45);
}
.hud-kicker {
    align-self: flex-start;
    padding: 6px 10px;
    border: 2px solid rgba(105, 235, 255, .92);
    background: rgba(4, 18, 34, .72);
    color: #69ebff;
    font-size: clamp(9px, 0.78vw, 11px);
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
    box-shadow: 0 0 18px rgba(105,235,255,.14);
}
.hud-content h2 {
    margin: 0;
    font-size: clamp(18px, 2.2vw, 32px);
    line-height: 1.02;
    color: #ffffff;
    letter-spacing: -0.06em;
}
.hud-content p {
    max-width: 760px;
    font-size: clamp(11px, 0.92vw, 14px);
    line-height: 1.5;
    color: rgba(234, 250, 255, .88);
}
.hud-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 4px 0 2px;
}
.hud-stats div {
    min-height: 64px;
    padding: 10px 12px;
    border: 2px solid rgba(105, 235, 255, .6);
    background: linear-gradient(180deg, rgba(0, 225, 255, .12), rgba(255, 72, 211, .06));
    box-shadow: inset 0 0 18px rgba(105,235,255,.08);
}
.hud-stats b {
    display: block;
    color: #69ebff;
    font-size: clamp(15px, 1.45vw, 22px);
    line-height: 1;
}
.hud-stats span {
    display: block;
    margin-top: 6px;
    color: rgba(255,255,255,.74);
    font-size: clamp(9px, 0.74vw, 11px);
    text-transform: uppercase;
    letter-spacing: .08em;
}
.hud-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 20px;
    font-size: clamp(10px, 0.84vw, 13px);
    line-height: 1.35;
    color: rgba(255,255,255,.86);
}
.hud-list li::marker {
    color: #ff58cb;
}
.hud-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.hud-link {
    min-width: 138px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 2px solid rgba(255,255,255,.36);
    background: rgba(255,255,255,.05);
    color: #fff;
    text-decoration: none;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
    transition: transform .14s ease, background .14s ease;
}
.hud-link:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,.10);
}
.hud-link-icon,
.hud-icon-pixel {
    display: inline-grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 2px solid currentColor;
    font-weight: 900;
    letter-spacing: -.03em;
    font-size: 16px;
    background: rgba(0,0,0,.18);
    text-transform: none;
}

.hud-link-img,
.hud-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    display: block;
    padding: 2px;
}
.hud-icon-fallback {
    display: inline-grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-weight: 900;
    font-size: 12px;
    line-height: 1;
    text-align: center;
}
.hud-link-icon,
.hud-icon-pixel {
    overflow: hidden;
}
.hud-link-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 800;
}
.hud-bars {
    display: grid;
    gap: 8px;
}
.hud-bar-row {
    display: grid;
    gap: 5px;
}
.hud-bar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: clamp(10px, 0.78vw, 12px);
    text-transform: uppercase;
    letter-spacing: .05em;
}
.hud-bar-top span { color: rgba(255,255,255,.84); }
.hud-bar-top b { color: #fff; font-size: inherit; }
.hud-bar-track {
    position: relative;
    height: 14px;
    border: 2px solid rgba(255,255,255,.22);
    background:
      linear-gradient(90deg, rgba(255,255,255,.07) 0 25%, transparent 25% 50%, rgba(255,255,255,.07) 50% 75%, transparent 75% 100%),
      rgba(0,0,0,.26);
    overflow: hidden;
}
.hud-bar-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #69ebff, #ff58cb);
    box-shadow: 0 0 10px rgba(105,235,255,.28);
}
.hud-icons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}
.hud-icon-card {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 12px 10px;
    border: 2px solid rgba(255,255,255,.20);
    background: rgba(255,255,255,.05);
    text-align: center;
}
.hud-icon-card small {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: rgba(255,255,255,.86);
}
.hud-tone-cyan { color: #84efff; }
.hud-tone-pink { color: #ff9ae8; }
.hud-tone-gold { color: #ffd86b; }
.hud-tone-blue { color: #8db8ff; }
.hud-tone-green { color: #82f0b3; }
.hud-tone-red { color: #ff8b8b; }
.hud-tone-lilac { color: #d7bcff; }
.hud-tone-facebook { color: #93b7ff; }
.hud-tone-instagram { color: #ffb4da; }
.hud-tone-whatsapp { color: #98ffbe; }
.hud-tone-ps { color: #7fd1ff; }
.hud-tone-ai { color: #ffbf84; }
.hud-tone-canva { color: #8cf7ff; }
.hud-tone-capcut { color: #ffffff; }
.hud-tone-code { color: #a8ffa7; }
.hud-tone-facebook .hud-link-icon,
.hud-tone-instagram .hud-link-icon,
.hud-tone-whatsapp .hud-link-icon,
.hud-tone-ps .hud-icon-pixel,
.hud-tone-ai .hud-icon-pixel,
.hud-tone-canva .hud-icon-pixel,
.hud-tone-capcut .hud-icon-pixel,
.hud-tone-code .hud-icon-pixel,
.hud-tone-cyan .hud-icon-pixel,
.hud-tone-pink .hud-icon-pixel,
.hud-tone-gold .hud-icon-pixel,
.hud-tone-blue .hud-icon-pixel,
.hud-tone-green .hud-icon-pixel,
.hud-tone-red .hud-icon-pixel,
.hud-tone-lilac .hud-icon-pixel,
.hud-tone-cyan .hud-link-icon,
.hud-tone-pink .hud-link-icon,
.hud-tone-gold .hud-link-icon,
.hud-tone-blue .hud-link-icon,
.hud-tone-green .hud-link-icon,
.hud-tone-red .hud-link-icon,
.hud-tone-lilac .hud-link-icon { background: rgba(255,255,255,.08); }
.hud-tone-ps.hud-bar-fill { background: linear-gradient(90deg, #001e36, #31a8ff); }
.hud-tone-ai.hud-bar-fill { background: linear-gradient(90deg, #2c1200, #ff9a00); }
.hud-tone-canva.hud-bar-fill { background: linear-gradient(90deg, #00c4cc, #7dfff4); }
.hud-tone-capcut.hud-bar-fill { background: linear-gradient(90deg, #777, #fff); }
.hud-tone-code.hud-bar-fill { background: linear-gradient(90deg, #14532d, #86efac); }
.hud-tone-cyan.hud-bar-fill { background: linear-gradient(90deg, #25b9d7, #84efff); }
.hud-tone-pink.hud-bar-fill { background: linear-gradient(90deg, #b93594, #ff9ae8); }
.hud-tone-gold.hud-bar-fill { background: linear-gradient(90deg, #a46a00, #ffd86b); }
.hud-tone-blue.hud-bar-fill { background: linear-gradient(90deg, #2746bb, #8db8ff); }
.hud-tone-green.hud-bar-fill { background: linear-gradient(90deg, #0b7949, #82f0b3); }
.hud-tone-red.hud-bar-fill { background: linear-gradient(90deg, #a22323, #ff8b8b); }
.hud-tone-lilac.hud-bar-fill { background: linear-gradient(90deg, #7554b3, #d7bcff); }
.hud-footer {
    margin-top: auto;
    align-self: flex-end;
    padding: 6px 9px;
    border: 2px solid rgba(255, 88, 203, .70);
    color: #ffdff7;
    background: rgba(23, 5, 34, .68);
    font-size: clamp(9px, 0.76vw, 11px);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* desktop: HUD jangan terlalu memenuhi layar */
@media (min-width: 1200px) {
    .hud-frame {
        width: min(72vw, 1020px);
        max-height: 78vh;
    }
}

/* tablet / square */
@media (min-aspect-ratio: 4/5) and (max-aspect-ratio: 5/4) {
    .hud-frame {
        width: min(84vw, 880px);
    }
    .hud-stats {
        grid-template-columns: 1fr;
    }
}

/* mobile */
@media (max-aspect-ratio: 4/5) {
    #detail-hud { padding: 3vh 4vw; }
    .hud-frame {
        width: min(92vw, 760px);
        max-height: 92vh;
    }
    .hud-content {
        gap: 8px;
    }
    .hud-stats { grid-template-columns: 1fr; gap: 8px; }
    .hud-stats div { min-height: 54px; }
    .hud-content h2 { font-size: clamp(20px, 5.2vw, 30px); }
    .hud-content p { font-size: clamp(11px, 2.4vw, 14px); }
    .hud-list { font-size: clamp(10px, 2.2vw, 13px); }
    .hud-links { gap: 8px; }
    .hud-link { min-width: 118px; padding: 8px 10px; }
    .hud-link-icon, .hud-icon-pixel { width: 46px; height: 46px; font-size: 13px; }
    .hud-icons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Frame image per area */
#detail-hud.hud-theme-landscape .hud-frame { background-image: url("assets/hud-landscape.png"); }
#detail-hud.hud-theme-amc .hud-frame { background-image: url("assets/hud-amc.png"); }
#detail-hud.hud-theme-cilpa .hud-frame { background-image: url("assets/hud-cilpa.png"); }
#detail-hud.hud-theme-kun .hud-frame { background-image: url("assets/hud-kun.png"); }
#detail-hud.hud-theme-sd .hud-frame { background-image: url("assets/hud-sd.png"); }
#detail-hud.hud-theme-smp .hud-frame { background-image: url("assets/hud-smp.png"); }
#detail-hud.hud-theme-sma .hud-frame { background-image: url("assets/hud-sma.png"); }
#detail-hud.hud-theme-universitas .hud-frame { background-image: url("assets/hud-universitas.png"); }

/* inset per HUD supaya isi tidak menabrak dekorasi frame */
#detail-hud.hud-theme-landscape .hud-frame,
#detail-hud.hud-theme-amc .hud-frame,
#detail-hud.hud-theme-cilpa .hud-frame {
    --hud-left: 13.5%;
    --hud-right: 13.5%;
    --hud-top: 16%;
    --hud-bottom: 13%;
}
#detail-hud.hud-theme-kun .hud-frame {
    --hud-left: 11.5%;
    --hud-right: 11.5%;
    --hud-top: 13%;
    --hud-bottom: 12%;
}
#detail-hud.hud-theme-sd .hud-frame {
    --hud-left: 12%;
    --hud-right: 12%;
    --hud-top: 18%;
    --hud-bottom: 16%;
}
#detail-hud.hud-theme-smp .hud-frame,
#detail-hud.hud-theme-sma .hud-frame {
    --hud-left: 12.5%;
    --hud-right: 12.5%;
    --hud-top: 13%;
    --hud-bottom: 14%;
}
#detail-hud.hud-theme-universitas .hud-frame {
    --hud-left: 12%;
    --hud-right: 12%;
    --hud-top: 14%;
    --hud-bottom: 13%;
}

/* tone per theme */
#detail-hud.hud-theme-landscape {
    background: rgba(0, 0, 0, 0.30);
}
#detail-hud.hud-theme-amc {
    background: rgba(3, 22, 43, 0.26);
}
#detail-hud.hud-theme-amc .hud-content {
    color: #eaf8ff;
    text-shadow: 0 2px 0 rgba(5, 25, 52, .42);
}
#detail-hud.hud-theme-amc .hud-kicker {
    border-color: rgba(255,255,255,.92);
    background: rgba(31, 147, 219, .76);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(116, 214, 255, .28);
}
#detail-hud.hud-theme-amc .hud-content h2,
#detail-hud.hud-theme-amc .hud-stats b { color: #ffffff; }
#detail-hud.hud-theme-amc .hud-content p,
#detail-hud.hud-theme-amc .hud-list { color: rgba(235, 249, 255, .92); }
#detail-hud.hud-theme-amc .hud-stats div {
    border-color: rgba(255,255,255,.72);
    background: linear-gradient(180deg, rgba(83, 184, 255, .18), rgba(255,255,255,.07));
    box-shadow: inset 0 0 22px rgba(107, 210, 255, .16);
}
#detail-hud.hud-theme-amc .hud-list li::marker { color: #8ee4ff; }
#detail-hud.hud-theme-amc .hud-footer {
    border-color: rgba(255,255,255,.76);
    background: rgba(54, 155, 221, .62);
    color: #ffffff;
}

#detail-hud.hud-theme-cilpa {
    background: rgba(25, 19, 45, 0.30);
}
#detail-hud.hud-theme-cilpa .hud-content {
    color: #fff8ff;
    text-shadow: 0 2px 0 rgba(35, 21, 56, .38);
}
#detail-hud.hud-theme-cilpa .hud-kicker {
    border-color: rgba(255,255,255,.95);
    background: rgba(179, 144, 230, .74);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(220, 193, 255, .22);
}
#detail-hud.hud-theme-cilpa .hud-content h2,
#detail-hud.hud-theme-cilpa .hud-stats b { color: #fffaff; }
#detail-hud.hud-theme-cilpa .hud-content p,
#detail-hud.hud-theme-cilpa .hud-list { color: rgba(255, 249, 255, .90); }
#detail-hud.hud-theme-cilpa .hud-stats div {
    border-color: rgba(234, 215, 255, .76);
    background: linear-gradient(180deg, rgba(214, 190, 255, .18), rgba(255,255,255,.06));
    box-shadow: inset 0 0 20px rgba(214, 190, 255, .14);
}
#detail-hud.hud-theme-cilpa .hud-list li::marker { color: #d3a8ff; }
#detail-hud.hud-theme-cilpa .hud-footer {
    border-color: rgba(234, 215, 255, .76);
    background: rgba(124, 92, 172, .62);
    color: #fffaff;
}

#detail-hud.hud-theme-kun {
    background: rgba(0, 0, 0, 0.38);
}
#detail-hud.hud-theme-kun .hud-content {
    color: #f7f0df;
    text-shadow: 0 2px 0 rgba(0,0,0,.55);
}
#detail-hud.hud-theme-kun .hud-kicker {
    border-color: #f4d14a;
    background: #cf2724;
    color: #fff7d8;
    box-shadow: 7px 7px 0 rgba(18, 67, 171, .55);
}
#detail-hud.hud-theme-kun .hud-content h2,
#detail-hud.hud-theme-kun .hud-stats b { color: #f4d14a; }
#detail-hud.hud-theme-kun .hud-content p,
#detail-hud.hud-theme-kun .hud-list { color: rgba(255, 248, 224, .88); }
#detail-hud.hud-theme-kun .hud-stats div {
    border-color: rgba(244, 209, 74, .78);
    background: linear-gradient(180deg, rgba(18, 67, 171, .22), rgba(207, 39, 36, .14));
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.08);
}
#detail-hud.hud-theme-kun .hud-list li::marker { color: #cf2724; }
#detail-hud.hud-theme-kun .hud-footer {
    border-color: #f4d14a;
    background: rgba(18, 67, 171, .72);
    color: #fff7d8;
}

#detail-hud.hud-theme-sd,
#detail-hud.hud-theme-smp,
#detail-hud.hud-theme-sma,
#detail-hud.hud-theme-universitas {
    background: rgba(11, 13, 18, 0.28);
}
#detail-hud.hud-theme-sd .hud-kicker,
#detail-hud.hud-theme-smp .hud-kicker,
#detail-hud.hud-theme-sma .hud-kicker,
#detail-hud.hud-theme-universitas .hud-kicker {
    border-color: rgba(255,255,255,.88);
    background: rgba(107, 76, 39, .70);
    color: #fff6da;
}
#detail-hud.hud-theme-sd .hud-stats b,
#detail-hud.hud-theme-smp .hud-stats b,
#detail-hud.hud-theme-sma .hud-stats b,
#detail-hud.hud-theme-universitas .hud-stats b {
    color: #ffd86b;
}
#detail-hud.hud-theme-sd .hud-list li::marker,
#detail-hud.hud-theme-smp .hud-list li::marker,
#detail-hud.hud-theme-sma .hud-list li::marker,
#detail-hud.hud-theme-universitas .hud-list li::marker {
    color: #ffd86b;
}
#detail-hud.hud-theme-sd .hud-footer,
#detail-hud.hud-theme-smp .hud-footer,
#detail-hud.hud-theme-sma .hud-footer,
#detail-hud.hud-theme-universitas .hud-footer {
    border-color: rgba(255,216,107,.72);
    background: rgba(82, 55, 25, .68);
    color: #fff6da;
}



/* Lightweight MMORPG portal arrow + dynamic map title */
#portal-hint {
    z-index: 260;
    filter: drop-shadow(0 0 10px rgba(0,0,0,.55));
}
#portal-hint .hint-bubble { display: none !important; }
#portal-hint .portal-arrow-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    font-family: "Courier New", monospace;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    color: #ffffff;
    background: radial-gradient(circle, rgba(255,255,255,.20), rgba(7,12,24,.84) 64%);
    border: 2px solid rgba(255,255,255,.88);
    box-shadow:
        0 0 0 2px rgba(105,235,255,.25),
        0 0 16px rgba(105,235,255,.45),
        0 0 22px rgba(255,79,216,.25);
    text-shadow:
        0 2px 0 rgba(0,0,0,.55),
        0 0 9px rgba(105,235,255,.65);
    animation: portalArrowFloat 1.05s ease-in-out infinite;
}
@keyframes portalArrowFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

#mmo-ui {
    position: absolute;
    top: 2.2vh;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 180;
    pointer-events: none;
}
.mmo-zone-title {
    --zone-a: #69ebff;
    --zone-b: #ff4fd8;
    --zone-bg-a: rgba(8, 14, 28, .90);
    --zone-bg-b: rgba(10, 18, 32, .72);
    --zone-text: #ffffff;
    --zone-kicker: var(--zone-a);
    --zone-glow-a: rgba(105, 235, 255, .46);
    --zone-glow-b: rgba(255, 79, 216, .34);
    position: relative;
    min-width: min(72vw, 560px);
    padding: 12px 26px 14px;
    text-align: center;
    font-family: "Courier New", monospace;
    text-transform: uppercase;
    background: linear-gradient(180deg, var(--zone-bg-a), var(--zone-bg-b));
    border: 2px solid var(--zone-a);
    box-shadow:
        inset 0 0 0 2px color-mix(in srgb, var(--zone-b) 22%, transparent),
        0 10px 30px rgba(0,0,0,.35),
        0 0 22px var(--zone-glow-a);
    backdrop-filter: blur(4px);
    opacity: .96;
}
.mmo-zone-title::before,
.mmo-zone-title::after {
    content: "";
    position: absolute;
    left: -2px;
    width: calc(100% + 4px);
    height: 2px;
}
.mmo-zone-title::before {
    top: -2px;
    background: linear-gradient(90deg, transparent, var(--zone-a) 12%, var(--zone-a) 88%, transparent);
    box-shadow: 0 0 12px var(--zone-glow-a);
}
.mmo-zone-title::after {
    bottom: -2px;
    background: linear-gradient(90deg, transparent, var(--zone-b) 12%, var(--zone-b) 88%, transparent);
    box-shadow: 0 0 12px var(--zone-glow-b);
}
#mmo-zone-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--zone-kicker);
    font-size: clamp(10px, .9vw, 12px);
    font-weight: 900;
    letter-spacing: .18em;
    text-shadow: 0 0 8px var(--zone-glow-a);
}
#mmo-zone-name {
    display: block;
    color: var(--zone-text);
    font-size: clamp(22px, 2vw, 34px);
    line-height: 1.08;
    letter-spacing: .03em;
    text-shadow:
        0 2px 0 rgba(0,0,0,.45),
        0 0 10px var(--zone-glow-b);
}
.mmo-zone-title.show { animation: zonePulse .34s ease; }
@keyframes zonePulse {
    0% { transform: translateY(-8px); opacity: .72; }
    100% { transform: translateY(0); opacity: .96; }
}
.mmo-zone-title[data-theme="cyan-magenta"] { --zone-a:#69ebff; --zone-b:#ff4fd8; --zone-bg-a:rgba(8,14,28,.90); --zone-bg-b:rgba(10,18,32,.72); }
.mmo-zone-title[data-theme="nature"] { --zone-a:#9dff8f; --zone-b:#35c96d; --zone-bg-a:rgba(8,30,17,.88); --zone-bg-b:rgba(13,48,25,.70); --zone-glow-a:rgba(157,255,143,.45); --zone-glow-b:rgba(53,201,109,.38); }
.mmo-zone-title[data-theme="violet"] { --zone-a:#d9b8ff; --zone-b:#8b5cff; --zone-bg-a:rgba(25,14,45,.90); --zone-bg-b:rgba(37,22,65,.72); --zone-glow-a:rgba(217,184,255,.45); --zone-glow-b:rgba(139,92,255,.42); }
.mmo-zone-title[data-theme="kunpro"] { --zone-a:#ffd84d; --zone-b:#ef3131; --zone-bg-a:rgba(30,16,12,.92); --zone-bg-b:rgba(16,30,70,.76); --zone-glow-a:rgba(255,216,77,.45); --zone-glow-b:rgba(239,49,49,.42); }
.mmo-zone-title[data-theme="amc"] { --zone-a:#8be8ff; --zone-b:#37aaff; --zone-bg-a:rgba(3,22,43,.90); --zone-bg-b:rgba(8,50,90,.72); --zone-glow-a:rgba(139,232,255,.46); --zone-glow-b:rgba(55,170,255,.40); }
.mmo-zone-title[data-theme="gold"] { --zone-a:#ffe08a; --zone-b:#d79a28; --zone-bg-a:rgba(37,24,7,.90); --zone-bg-b:rgba(69,45,13,.72); --zone-glow-a:rgba(255,224,138,.45); --zone-glow-b:rgba(215,154,40,.40); }
.mmo-zone-title[data-theme="lenos"] { --zone-a:#fff7dd; --zone-b:#d9a53b; --zone-bg-a:rgba(91,63,31,.76); --zone-bg-b:rgba(255,247,221,.24); --zone-text:#fffaf0; }
.mmo-zone-title[data-theme="aquanest"] { --zone-a:#ffd1df; --zone-b:#ff7fab; --zone-bg-a:rgba(74,23,41,.84); --zone-bg-b:rgba(255,127,171,.22); --zone-text:#fff6fa; }
.mmo-zone-title[data-theme="dj"] { --zone-a:#cf8cff; --zone-b:#7b3cff; --zone-bg-a:rgba(24,7,45,.90); --zone-bg-b:rgba(44,14,84,.72); }
.mmo-zone-title[data-theme="property"] { --zone-a:#f1d3a2; --zone-b:#b6813f; --zone-bg-a:rgba(40,31,23,.90); --zone-bg-b:rgba(76,55,32,.72); --zone-text:#fff3df; }
.mmo-zone-title[data-theme="batik"] { --zone-a:#e6a443; --zone-b:#8a541e; --zone-bg-a:rgba(21,12,5,.92); --zone-bg-b:rgba(50,30,12,.78); --zone-text:#ffe6b0; }
.mmo-zone-title[data-theme="canio"] { --zone-a:#fff1c8; --zone-b:#d2a652; --zone-bg-a:rgba(74,52,29,.85); --zone-bg-b:rgba(120,83,44,.62); --zone-text:#fff7e1; }
.mmo-zone-title[data-theme="mandalia"] { --zone-a:#fff8e8; --zone-b:#b98a4f; --zone-bg-a:rgba(68,46,28,.84); --zone-bg-b:rgba(116,83,50,.62); --zone-text:#fffaf0; }
@media (max-width: 900px) {
    .mmo-zone-title { min-width: min(84vw, 560px); padding: 10px 20px 12px; }
    #mmo-zone-name { font-size: clamp(18px, 4vw, 26px); }
    #mmo-zone-kicker { font-size: 10px; }
    #portal-hint .portal-arrow-icon { width: 40px; height: 40px; font-size: 31px; }
}


/* Revisi bubble: hanya ikon panah, tanpa teks panjang yang mengganggu */
#portal-hint,
#detail-hint {
    --arrow-a: #69ebff;
    --arrow-b: #ff4fd8;
    z-index: 260;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,.55));
}
#portal-hint[data-theme="nature"],
#detail-hint[data-theme="nature"] { --arrow-a:#9dff8f; --arrow-b:#35c96d; }
#portal-hint[data-theme="violet"],
#detail-hint[data-theme="violet"] { --arrow-a:#d9b8ff; --arrow-b:#8b5cff; }
#portal-hint[data-theme="kunpro"],
#detail-hint[data-theme="kunpro"] { --arrow-a:#ffd84d; --arrow-b:#ef3131; }
#portal-hint[data-theme="amc"],
#detail-hint[data-theme="amc"] { --arrow-a:#8be8ff; --arrow-b:#37aaff; }
#portal-hint[data-theme="gold"],
#detail-hint[data-theme="gold"] { --arrow-a:#ffe08a; --arrow-b:#d79a28; }
#portal-hint[data-theme="lenos"],
#detail-hint[data-theme="lenos"] { --arrow-a:#fff7dd; --arrow-b:#d9a53b; }
#portal-hint[data-theme="aquanest"],
#detail-hint[data-theme="aquanest"] { --arrow-a:#ffd1df; --arrow-b:#ff7fab; }
#portal-hint[data-theme="dj"],
#detail-hint[data-theme="dj"] { --arrow-a:#cf8cff; --arrow-b:#7b3cff; }
#portal-hint[data-theme="property"],
#detail-hint[data-theme="property"] { --arrow-a:#f1d3a2; --arrow-b:#b6813f; }
#portal-hint[data-theme="batik"],
#detail-hint[data-theme="batik"] { --arrow-a:#e6a443; --arrow-b:#8a541e; }
#portal-hint[data-theme="canio"],
#detail-hint[data-theme="canio"] { --arrow-a:#fff1c8; --arrow-b:#d2a652; }
#portal-hint[data-theme="mandalia"],
#detail-hint[data-theme="mandalia"] { --arrow-a:#fff8e8; --arrow-b:#b98a4f; }

#portal-hint .hint-bubble,
#detail-hint .hint-bubble { display: none !important; }

#portal-hint .portal-arrow-icon,
#detail-hint .action-arrow-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    font-family: "Courier New", monospace;
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
    color: #fff;
    border-radius: 7px;
    border: 2px solid color-mix(in srgb, var(--arrow-a) 85%, white);
    background:
        radial-gradient(circle at 50% 38%, rgba(255,255,255,.22), rgba(7,12,24,.82) 68%),
        linear-gradient(135deg, color-mix(in srgb, var(--arrow-a) 25%, transparent), color-mix(in srgb, var(--arrow-b) 22%, transparent));
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,.16),
        0 0 13px color-mix(in srgb, var(--arrow-a) 55%, transparent),
        0 0 18px color-mix(in srgb, var(--arrow-b) 36%, transparent),
        0 3px 0 rgba(0,0,0,.34);
    text-shadow:
        0 2px 0 rgba(0,0,0,.55),
        0 0 9px color-mix(in srgb, var(--arrow-a) 72%, transparent);
}
#portal-hint .portal-arrow-icon { animation: portalArrowFloat 1.05s ease-in-out infinite; }
#detail-hint .action-arrow-icon { animation: actionArrowFloat 1.05s ease-in-out infinite; }
@keyframes actionArrowFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

@media (max-width: 900px) {
    #portal-hint .portal-arrow-icon,
    #detail-hint .action-arrow-icon { width: 34px; height: 34px; font-size: 27px; border-radius: 6px; }
}

/* Portfolio Client HUD: 6 desain sosmed + 3 reels, warna mengikuti aksen map */
#portfolio-hud {
    --pf-a: #69ebff;
    --pf-b: #ff4fd8;
    --pf-bg: rgba(8, 12, 24, .78);
    --pf-panel: rgba(255,255,255,.07);
    position: absolute;
    inset: 0;
    z-index: 880;
    display: grid;
    place-items: center;
    padding: 4vh 4vw;
    background:
        radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--pf-a) 14%, transparent), transparent 34%),
        rgba(0, 0, 0, .42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
    font-family: "Courier New", monospace;
}
#portfolio-hud.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
#portfolio-hud[data-theme="lenos"] { --pf-a:#fff6dc; --pf-b:#d9a53b; --pf-bg:rgba(30,22,8,.70); --pf-panel:rgba(255,246,220,.09); }
#portfolio-hud[data-theme="aquanest"] { --pf-a:#ffd0df; --pf-b:#ff7fab; --pf-bg:rgba(35,12,22,.70); --pf-panel:rgba(255,208,223,.10); }
#portfolio-hud[data-theme="dj"] { --pf-a:#cf8cff; --pf-b:#7b3cff; --pf-bg:rgba(16,8,35,.74); --pf-panel:rgba(207,140,255,.10); }
#portfolio-hud[data-theme="property"] { --pf-a:#f1d3a2; --pf-b:#b6813f; --pf-bg:rgba(28,19,11,.72); --pf-panel:rgba(241,211,162,.09); }
#portfolio-hud[data-theme="batik"] { --pf-a:#e6a443; --pf-b:#8a541e; --pf-bg:rgba(28,15,7,.76); --pf-panel:rgba(230,164,67,.10); }
#portfolio-hud[data-theme="canio"] { --pf-a:#fff1c8; --pf-b:#d2a652; --pf-bg:rgba(30,23,12,.70); --pf-panel:rgba(255,241,200,.10); }
#portfolio-hud[data-theme="mandalia"] { --pf-a:#fff8e8; --pf-b:#b98a4f; --pf-bg:rgba(30,22,15,.70); --pf-panel:rgba(255,248,232,.10); }

.portfolio-hud-frame {
    position: relative;
    width: min(94vw, 1240px);
    height: min(84vh, 760px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 16px;
    padding: clamp(18px, 2.3vw, 30px);
    border: 3px solid color-mix(in srgb, var(--pf-a) 76%, white);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--pf-a) 10%, transparent), transparent 38%),
        linear-gradient(180deg, var(--pf-bg), rgba(5, 7, 14, .86));
    box-shadow:
        inset 0 0 0 2px rgba(255,255,255,.10),
        inset 0 0 38px color-mix(in srgb, var(--pf-a) 10%, transparent),
        0 0 0 4px rgba(0,0,0,.40),
        0 26px 48px rgba(0,0,0,.58),
        0 0 34px color-mix(in srgb, var(--pf-b) 26%, transparent);
    border-radius: 8px;
    transform: translateY(14px) scale(.985);
    transition: transform .18s ease;
    overflow: hidden;
}
#portfolio-hud.show .portfolio-hud-frame { transform: translateY(0) scale(1); }
.portfolio-hud-frame::before,
.portfolio-hud-frame::after {
    content: "";
    position: absolute;
    width: 76px;
    height: 76px;
    pointer-events: none;
    opacity: .75;
}
.portfolio-hud-frame::before {
    left: 14px;
    top: 14px;
    border-left: 4px solid var(--pf-a);
    border-top: 4px solid var(--pf-a);
}
.portfolio-hud-frame::after {
    right: 14px;
    bottom: 14px;
    border-right: 4px solid var(--pf-b);
    border-bottom: 4px solid var(--pf-b);
}
.portfolio-close,
.portfolio-preview-close {
    position: absolute;
    right: 18px;
    top: 16px;
    z-index: 5;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 2px solid color-mix(in srgb, var(--pf-a) 80%, white);
    background: rgba(0,0,0,.38);
    color: #fff;
    font-family: "Courier New", monospace;
    font-size: 25px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 0 16px color-mix(in srgb, var(--pf-a) 24%, transparent);
}
.portfolio-close:hover,
.portfolio-preview-close:hover { background: color-mix(in srgb, var(--pf-b) 28%, rgba(0,0,0,.42)); }
.portfolio-hud-head {
    padding-right: 52px;
    display: grid;
    gap: 7px;
}
#portfolio-hud-kicker {
    width: max-content;
    padding: 6px 10px;
    border: 2px solid color-mix(in srgb, var(--pf-a) 72%, white);
    color: var(--pf-a);
    background: rgba(0,0,0,.26);
    font-size: clamp(9px, .85vw, 12px);
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}
#portfolio-hud-title {
    color: #fff;
    font-size: clamp(24px, 3.2vw, 48px);
    line-height: 1;
    letter-spacing: -.06em;
    text-transform: uppercase;
    text-shadow: 0 3px 0 rgba(0,0,0,.48), 0 0 22px color-mix(in srgb, var(--pf-b) 35%, transparent);
}
#portfolio-hud-desc {
    max-width: 850px;
    color: rgba(255,255,255,.82);
    font-size: clamp(11px, .96vw, 15px);
    line-height: 1.45;
}
.portfolio-hud-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.22fr) minmax(260px, .78fr);
    gap: 18px;
    overflow: hidden;
}
.portfolio-panel {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border: 2px solid color-mix(in srgb, var(--pf-a) 44%, transparent);
    background: linear-gradient(180deg, var(--pf-panel), rgba(0,0,0,.22));
    box-shadow: inset 0 0 22px color-mix(in srgb, var(--pf-a) 7%, transparent);
    overflow: hidden;
}
.portfolio-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-transform: uppercase;
}
.portfolio-panel-title span {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 28px;
    background: color-mix(in srgb, var(--pf-a) 20%, rgba(0,0,0,.35));
    border: 2px solid color-mix(in srgb, var(--pf-a) 65%, white);
    color: var(--pf-a);
    font-size: 12px;
    font-weight: 900;
}
.portfolio-panel-title b {
    font-size: clamp(13px, 1.16vw, 17px);
    letter-spacing: -.04em;
}
.portfolio-panel-title small {
    margin-left: auto;
    color: rgba(255,255,255,.58);
    font-size: 10px;
    letter-spacing: .08em;
}
.portfolio-card-grid {
    min-height: 0;
    overflow-y: auto;
    padding-right: 8px;
    display: grid;
    gap: 12px;
    align-items: start;
    grid-auto-flow: row;
    scrollbar-width: thin;
    scrollbar-color: var(--pf-a) rgba(255,255,255,.08);
}
.portfolio-card-grid::-webkit-scrollbar { width: 8px; }
.portfolio-card-grid::-webkit-scrollbar-track { background: rgba(255,255,255,.08); }
.portfolio-card-grid::-webkit-scrollbar-thumb { background: linear-gradient(var(--pf-a), var(--pf-b)); }
.design-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    align-items: start;
    column-gap: clamp(16px, 1.4vw, 22px);
    /* row-gap sengaja besar supaya desain 4,5,6 turun dan tidak menumpuk di desain 1,2,3 */
    row-gap: clamp(78px, 9vh, 112px);
    padding: 0 10px 80px 0;
}
.design-grid .portfolio-card:nth-child(n+4) {
    margin-top: clamp(18px, 3.5vh, 42px);
}
.reel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; align-items: start; column-gap: 14px; }
.portfolio-card {
    position: relative;
    width: 100%;
    min-height: 0;
    display: block;
    padding: 0;
    border: 2px solid color-mix(in srgb, var(--pf-a) 38%, white);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--pf-a) 13%, transparent), rgba(255,255,255,.03)),
        repeating-linear-gradient(45deg, rgba(255,255,255,.055) 0 2px, transparent 2px 8px),
        rgba(0,0,0,.28);
    cursor: pointer;
    overflow: hidden;
    color: #fff;
    box-shadow: 0 8px 0 rgba(0,0,0,.20), inset 0 0 18px color-mix(in srgb, var(--pf-a) 7%, transparent);
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.portfolio-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--pf-b) 70%, white);
    box-shadow: 0 12px 0 rgba(0,0,0,.18), 0 0 20px color-mix(in srgb, var(--pf-b) 24%, transparent);
}
.portfolio-card.is-design {
    aspect-ratio: 4 / 5;
    min-height: 225px;
}
.portfolio-card.is-reel { aspect-ratio: 9 / 16; }
.portfolio-card img,
.portfolio-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: rgba(0,0,0,.2);
}
.portfolio-card-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 7px;
    color: #111;
    background: var(--pf-a);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
    box-shadow: 0 2px 0 rgba(0,0,0,.32);
}
.portfolio-card strong {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 6px 8px;
    color: #fff;
    font-size: clamp(10px, .86vw, 13px);
    text-align: left;
    background: rgba(0,0,0,.58);
    text-shadow: 0 2px 0 rgba(0,0,0,.5);
}
.portfolio-missing {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: none;
    place-items: center;
    padding: 18px;
    color: color-mix(in srgb, var(--pf-a) 86%, white);
    font-size: clamp(10px, .85vw, 13px);
    text-align: center;
    line-height: 1.35;
    background: radial-gradient(circle, color-mix(in srgb, var(--pf-a) 14%, transparent), transparent 62%);
    opacity: .9;
}
.portfolio-hud-footer {
    color: rgba(255,255,255,.70);
    font-size: clamp(10px, .85vw, 12px);
    letter-spacing: .04em;
    text-align: center;
}
#portfolio-preview {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: none;
    place-items: center;
    padding: 4vh 4vw;
    background: rgba(0,0,0,.78);
}
#portfolio-preview.show { display: grid; }
.portfolio-preview-close {
    right: 28px;
    top: 24px;
    width: 44px;
    height: 44px;
}
.portfolio-preview-box {
    display: grid;
    gap: 10px;
    justify-items: center;
    max-width: 92vw;
    max-height: 88vh;
}
.portfolio-preview-box span {
    color: var(--pf-a);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .16em;
}
.portfolio-preview-box strong {
    color: #fff;
    font-size: clamp(16px, 2vw, 26px);
    text-transform: uppercase;
    text-shadow: 0 2px 0 rgba(0,0,0,.5);
}
.portfolio-preview-media {
    max-width: min(92vw, 1050px);
    max-height: 74vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 3px solid color-mix(in srgb, var(--pf-a) 70%, white);
    background: rgba(0,0,0,.32);
    box-shadow: 0 24px 44px rgba(0,0,0,.60), 0 0 24px color-mix(in srgb, var(--pf-b) 22%, transparent);
}
video.portfolio-preview-media { max-width: min(68vw, 520px); }

@media (max-width: 980px) {
    #portfolio-hud { padding: 3vh 3vw; }
    .portfolio-hud-frame { height: 88vh; padding: 16px; gap: 12px; }
    .portfolio-hud-grid { grid-template-columns: 1fr; overflow-y: auto; padding-right: 4px; }
    .portfolio-panel { min-height: 380px; }
    .design-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 72px; padding-bottom: 80px; }
    .design-grid .portfolio-card:nth-child(n+3) { margin-top: 32px; }
    .reel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .portfolio-hud-footer { padding-bottom: 4px; }
}

@media (max-width: 560px) {
    #portfolio-hud-title { font-size: 24px; }
    #portfolio-hud-desc { font-size: 11px; }
    .portfolio-panel { padding: 10px; }
    .design-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 9px; }
    .design-grid .portfolio-card:nth-child(n+3) { margin-top: 10px; }
    .reel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .portfolio-close { right: 12px; top: 12px; width: 34px; height: 34px; }
    .portfolio-preview-close { right: 18px; top: 18px; }
}


/* Final portfolio gallery + mobile control fixes */
.portfolio-card-grid {
    grid-auto-rows: auto;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}
.design-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(250px, auto);
    gap: clamp(26px, 3.4vh, 42px) clamp(16px, 1.4vw, 22px);
    padding: 0 10px 70px 0;
}
.design-grid .portfolio-card:nth-child(n+4) {
    margin-top: 0 !important;
}
.portfolio-card.is-design {
    aspect-ratio: 4 / 5;
    min-height: 0;
}
.portfolio-card.is-wide-design {
    aspect-ratio: 3 / 1;
    min-height: 118px;
}
#portfolio-hud[data-client="dj"] .portfolio-hud-grid {
    grid-template-columns: minmax(0, 1.18fr) minmax(360px, .82fr);
    gap: 18px;
    overflow: hidden;
    align-items: start;
}
#portfolio-hud[data-client="dj"] .portfolio-panel {
    min-height: 0;
}
#portfolio-hud[data-client="dj"] .portfolio-panel-designs {
    min-height: 0;
}
#portfolio-hud[data-client="dj"] .portfolio-panel-designs .design-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 18px;
    padding: 0 8px 8px 0;
    max-height: 58vh;
    align-content: start;
}
#portfolio-hud[data-client="dj"] .portfolio-panel-designs .portfolio-card.is-wide-design {
    aspect-ratio: 3 / 1;
    min-height: 140px;
}
#portfolio-hud[data-client="dj"] .portfolio-panel-reels {
    min-height: 0;
}
#portfolio-hud[data-client="dj"] .portfolio-panel-reels .reel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
    padding: 0 8px 8px 0;
    max-height: 58vh;
    align-content: start;
}
#portfolio-hud[data-client="dj"] .portfolio-panel-reels .portfolio-card.is-reel {
    min-height: 220px;
}

#mobile-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    z-index: 320;
    display: none;
    justify-content: space-between;
    align-items: end;
    padding: 0 18px;
    pointer-events: none;
}
.mobile-pad {
    display: flex;
    gap: 12px;
    pointer-events: auto;
}
.mobile-pad-right {
    display: grid;
    grid-template-columns: 58px;
    gap: 10px;
}
.mobile-control-btn {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    border: 2px solid rgba(255,255,255,.86);
    background:
        radial-gradient(circle at 50% 34%, rgba(255,255,255,.24), rgba(8,14,28,.83) 68%),
        linear-gradient(135deg, rgba(105,235,255,.28), rgba(255,79,216,.22));
    color: #fff;
    font-family: "Courier New", monospace;
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 5px 0 rgba(0,0,0,.32), 0 0 18px rgba(105,235,255,.24);
    text-shadow: 0 2px 0 rgba(0,0,0,.55);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.mobile-control-btn:active {
    transform: translateY(4px);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.20), 0 1px 0 rgba(0,0,0,.36), 0 0 20px rgba(255,79,216,.28);
}

@media (max-width: 980px) {
    .design-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: minmax(230px, auto);
        gap: 34px 14px;
        padding-bottom: 70px;
    }
    .design-grid .portfolio-card:nth-child(n+3) {
        margin-top: 0 !important;
    }
    #portfolio-hud[data-client="dj"] .portfolio-hud-grid {
        grid-template-columns: 1fr;
    }
    #portfolio-hud[data-client="dj"] .portfolio-panel-designs .design-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        max-height: 28vh;
    }
    #portfolio-hud[data-client="dj"] .portfolio-panel-reels .reel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        max-height: 34vh;
    }
}

@media (max-width: 768px), (hover: none) and (pointer: coarse) {
    #mobile-controls {
        display: flex;
    }
    #character {
        width: 156px;
        height: 156px;
    }
    #portal-hint .portal-arrow-icon,
    #detail-hint .action-arrow-icon {
        width: 34px;
        height: 34px;
        font-size: 27px;
    }
    .mmo-zone-title {
        min-width: min(88vw, 480px);
        padding: 8px 14px 10px;
    }
    #mmo-zone-name {
        font-size: clamp(15px, 4.6vw, 22px);
    }
    #mmo-zone-kicker {
        font-size: 9px;
    }
}

@media (max-width: 560px) {
    .design-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 18px;
        padding-bottom: 56px;
    }
    .portfolio-card.is-design {
        min-height: 0;
    }
    .portfolio-card.is-wide-design {
        min-height: 100px;
    }
    #portfolio-hud[data-client="dj"] .portfolio-panel-designs .design-grid {
        gap: 14px;
        max-height: 24vh;
    }
    #portfolio-hud[data-client="dj"] .portfolio-panel-reels .reel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        max-height: 32vh;
    }
    .reel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .mobile-control-btn {
        width: 52px;
        height: 52px;
        font-size: 29px;
        border-radius: 12px;
    }
    .mobile-pad-right {
        grid-template-columns: 52px;
        gap: 8px;
    }
}


/* Revisi portfolio: Batik hanya reels, DJ lebih rapi, Mandalia tanpa kata Clinic */
.portfolio-hud-grid.portfolio-hud-grid-reels-only {
    grid-template-columns: minmax(0, 1fr);
    max-width: 760px;
    width: min(100%, 760px);
    justify-self: center;
}
.portfolio-hud-grid.portfolio-hud-grid-reels-only .portfolio-panel-reels {
    min-height: 0;
}
.portfolio-hud-grid.portfolio-hud-grid-reels-only .portfolio-panel-reels .reel-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-content: start;
    padding: 0 8px 8px 0;
    overflow-y: auto;
}
.portfolio-hud-grid.portfolio-hud-grid-reels-only .portfolio-panel-reels .portfolio-card.is-reel {
    min-height: 0;
}

#portfolio-hud[data-client="dj"] .portfolio-hud-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr);
    gap: 18px;
    overflow: hidden;
    align-items: stretch;
}
#portfolio-hud[data-client="dj"] .portfolio-panel {
    min-height: 0;
    overflow: hidden;
}
#portfolio-hud[data-client="dj"] .portfolio-panel-designs .design-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 14px;
    padding: 0 8px 12px 0;
    max-height: 54vh;
    overflow-y: auto;
    align-content: start;
}
#portfolio-hud[data-client="dj"] .portfolio-panel-designs .portfolio-card.is-wide-design {
    aspect-ratio: 3 / 1;
    min-height: 96px;
}
#portfolio-hud[data-client="dj"] .portfolio-panel-reels .reel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 14px;
    padding: 0 8px 12px 0;
    max-height: 54vh;
    overflow-y: auto;
    align-content: start;
}
#portfolio-hud[data-client="dj"] .portfolio-panel-reels .portfolio-card.is-reel {
    aspect-ratio: 9 / 16;
    min-height: 0;
}

@media (max-width: 980px) {
    .portfolio-hud-grid.portfolio-hud-grid-reels-only {
        max-width: 100%;
        width: 100%;
    }
    .portfolio-hud-grid.portfolio-hud-grid-reels-only .portfolio-panel-reels .reel-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    #portfolio-hud[data-client="dj"] .portfolio-hud-grid {
        grid-template-columns: 1fr;
    }
    #portfolio-hud[data-client="dj"] .portfolio-panel-designs .design-grid {
        max-height: 28vh;
    }
    #portfolio-hud[data-client="dj"] .portfolio-panel-reels .reel-grid {
        max-height: 34vh;
    }
}

@media (max-width: 560px) {
    .portfolio-hud-grid.portfolio-hud-grid-reels-only .portfolio-panel-reels .reel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #portfolio-hud[data-client="dj"] .portfolio-panel-designs .design-grid {
        max-height: 24vh;
    }
    #portfolio-hud[data-client="dj"] .portfolio-panel-reels .reel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 32vh;
    }
}

/* FIX FINAL DJ BOBOBOYZ: cegah desain 3:1 saling bertumpuk */
#portfolio-hud[data-client="dj"] .portfolio-panel-designs .design-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    grid-template-columns: none !important;
    grid-auto-rows: unset !important;
    align-content: stretch !important;
    align-items: stretch !important;
    max-height: 54vh !important;
    overflow-y: auto !important;
    padding: 0 8px 14px 0 !important;
}

#portfolio-hud[data-client="dj"] .portfolio-panel-designs .portfolio-card,
#portfolio-hud[data-client="dj"] .portfolio-panel-designs .portfolio-card.is-design,
#portfolio-hud[data-client="dj"] .portfolio-panel-designs .portfolio-card.is-wide-design {
    display: block !important;
    width: 100% !important;
    height: 180px !important;
    min-height: 180px !important;
    max-height: 180px !important;
    flex: 0 0 180px !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
    overflow: hidden !important;
}

#portfolio-hud[data-client="dj"] .portfolio-panel-designs .portfolio-card img,
#portfolio-hud[data-client="dj"] .portfolio-panel-designs .portfolio-card video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

#portfolio-hud[data-client="dj"] .portfolio-panel-designs .portfolio-card-tag,
#portfolio-hud[data-client="dj"] .portfolio-panel-designs .portfolio-card strong {
    z-index: 3 !important;
}

@media (max-width: 980px) {
    #portfolio-hud[data-client="dj"] .portfolio-panel-designs .design-grid {
        max-height: 30vh !important;
    }

    #portfolio-hud[data-client="dj"] .portfolio-panel-designs .portfolio-card,
    #portfolio-hud[data-client="dj"] .portfolio-panel-designs .portfolio-card.is-design,
    #portfolio-hud[data-client="dj"] .portfolio-panel-designs .portfolio-card.is-wide-design {
        height: 150px !important;
        min-height: 150px !important;
        max-height: 150px !important;
        flex-basis: 150px !important;
    }
}

@media (max-width: 560px) {
    #portfolio-hud[data-client="dj"] .portfolio-panel-designs .design-grid {
        max-height: 26vh !important;
    }

    #portfolio-hud[data-client="dj"] .portfolio-panel-designs .portfolio-card,
    #portfolio-hud[data-client="dj"] .portfolio-panel-designs .portfolio-card.is-design,
    #portfolio-hud[data-client="dj"] .portfolio-panel-designs .portfolio-card.is-wide-design {
        height: 120px !important;
        min-height: 120px !important;
        max-height: 120px !important;
        flex-basis: 120px !important;
    }
}
