/* ==========================================================================
   Halaman publik — dari langit (overworld) turun sampai bedrock
   ========================================================================== */

/* ------------------------------------------------------------------ overworld / hero */
.overworld {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 680px;
    min-height: clamp(680px, 100svh, 1000px);
    background: linear-gradient(#6f9fff 0%, #93b8ff 45%, #c4dcff 85%);
}

.sky, .sky > * { position: absolute; }
.sky { inset: 0; z-index: 0; pointer-events: none; }

.sun {
    top: 9%;
    right: 12%;
    width: calc(var(--px) * 18);
    height: calc(var(--px) * 18);
    background: #fffbe0;
    box-shadow:
        0 0 0 calc(var(--px) * 3) #ffe46b,
        0 0 0 calc(var(--px) * 6) rgba(255, 228, 107, .32),
        0 0 90px 36px rgba(255, 240, 170, .5);
}

.stars {
    display: none;
    inset: 0 0 35% 0;
    background: url('../img/stars.png') repeat 0 0 / calc(128px * var(--s)) auto;
}

.clouds {
    top: 3%;
    left: 0;
    width: calc(100% + 256px * var(--s) * 2);
    height: calc(28px * var(--s) * 2);
    background: url('../img/layer-clouds.png') repeat-x 0 0 / calc(256px * var(--s) * 2) 100%;
    animation: drift 420s linear infinite;
    will-change: transform;
}
@keyframes drift {
    to { transform: translate3d(calc(-256px * var(--s) * 2), 0, 0); }
}

.mountains {
    left: 0;
    right: 0;
    bottom: calc(var(--block) * 1.5);
    height: calc(80px * var(--s));
    background: url('../img/layer-mountains.png') repeat-x 0 100% / calc(320px * var(--s)) 100%;
}
.hills {
    left: 0;
    right: 0;
    bottom: calc(var(--block) - var(--px) * 2);
    height: calc(64px * var(--s));
    background: url('../img/layer-hills.png') repeat-x calc(var(--block) * -3) 100% / calc(320px * var(--s)) 100%;
}

/* ------------------------------------------------------------------ hero */
.hero {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    padding: clamp(44px, 9vh, 104px) 16px calc(var(--block) * 3.3);
    text-align: center;
}

.logo-wrap { position: relative; display: inline-block; max-width: 100%; }
.logo {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5em;
    font-family: var(--font-logo);
    font-weight: 400;
    line-height: 1;
    filter:
        drop-shadow(0 3px 0 #8d8d8d)
        drop-shadow(0 3px 0 #5f5f5f)
        drop-shadow(0 3px 0 #3c3c3c)
        drop-shadow(3px 0 0 #000)
        drop-shadow(-3px 0 0 #000)
        drop-shadow(0 3px 0 #000)
        drop-shadow(0 -3px 0 #000)
        drop-shadow(0 12px 14px rgba(0, 0, 0, .3));
}
.logo-l1, .logo-l2 {
    display: block;
    color: #e6e6e6;
    letter-spacing: .02em;
    white-space: nowrap;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .logo-l1, .logo-l2 {
        background: url('../img/logo-fill.png') 0 0 / 24px 24px;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}
.logo-l1 { font-size: clamp(19px, 4.7vw, 44px); }
.logo-l2 { font-size: clamp(29px, 8.6vw, 82px); }

.splash {
    position: absolute;
    right: -4%;
    bottom: -8%;
    margin: 0;
    font: 700 clamp(15px, 2.6vw, 24px)/1 var(--font-ui);
    color: var(--mc-yellow);
    text-shadow: 3px 3px 0 #3f3f15;
    white-space: nowrap;
    --tilt: -16deg;
    transform: rotate(var(--tilt));
    animation: splash .42s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes splash {
    from { transform: rotate(var(--tilt)) scale(1); }
    to { transform: rotate(var(--tilt)) scale(1.09); }
}
@media (max-width: 719px) {
    /* di layar kecil splash diletakkan di bawah logo supaya tidak menutupi tulisan */
    .splash { --tilt: -6deg; right: 0; bottom: -40px; font-size: 15px; }
    .hero .edition { margin-top: 64px; }
}

.edition {
    margin: 26px 0 0;
    padding: 8px 18px 9px;
    font: 700 clamp(14px, 2.3vw, 20px)/1 var(--font-ui);
    letter-spacing: .14em;
    color: #fff;
    text-shadow: 2px 2px 0 #3f3f3f;
    background: #3a3a3a url('../img/btn-noise.png') 0 0 / 48px 48px;
    border: var(--u) solid #000;
    box-shadow: inset 0 var(--u) 0 #6a6a6a, inset 0 calc(var(--u) * -1) 0 #262626;
}

.hero-text {
    max-width: 640px;
    margin: 22px auto 0;
    padding: 12px 16px;
    font-size: clamp(17px, 2.2vw, 20px);
    line-height: 1.45;
    color: #fff;
    text-shadow: 2px 2px 0 #3f3f3f;
    background: rgba(0, 0, 0, .52);
}

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 14px;
    font-size: 17px;
    color: #fff;
    text-shadow: 2px 2px 0 #3f3f3f;
    background: rgba(0, 0, 0, .55);
}
.chip img { width: 24px; height: 24px; }
.chip .chip-2 { margin-left: -12px; }
.chip b { color: var(--mc-green); }

@media (min-width: 640px) {
    .hero-actions { flex-direction: row; justify-content: center; }
}

/* ------------------------------------------------------------------ pemandangan */
.scenery {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--block);
    z-index: 1;
    height: 0;
    pointer-events: none;
}
.scenery img { position: absolute; bottom: 0; height: auto; max-width: none; }
.tree-oak { left: calc(var(--block) * -1.2); width: calc(80px * var(--s)); }
.tree-birch { right: calc(var(--block) * -1.5); width: calc(80px * var(--s)); display: none; }
.mascot { right: calc(var(--block) * .6); width: calc(24px * var(--s)); }
.foliage {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--block);
    background: url('../img/foliage.png') repeat-x 0 0 / calc(512px * var(--s)) 100%;
}
.grass-row {
    position: relative;
    z-index: 3;
    flex: none;
    height: var(--block);
    background: url('../img/grass-side.png') repeat-x 0 0 / var(--block) var(--block);
}

@media (min-width: 720px) {
    .tree-birch { display: block; }
    .mascot { right: calc(var(--block) * 4.6); }
}
@media (min-width: 960px) {
    .tree-oak { left: calc(var(--block) * .5); }
    .tree-birch { right: calc(var(--block) * .5); }
    .mascot { right: calc(var(--block) * 6); }
}

/* ------------------------------------------------------------------ bawah tanah */
.underground {
    position: relative;
    padding: var(--block) 0 calc(var(--block) * 5 + 32px);
    background: #747474 url('../img/strata-stone.png') repeat 0 0 / calc(512px * var(--s)) auto;
}
.underground::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .12) 40%, rgba(0, 0, 0, .42) 100%);
    pointer-events: none;
}
.strata-top, .strata-deep {
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
}
.strata-top {
    top: 0;
    height: calc(var(--block) * 4);
    background: url('../img/strata-top.png') repeat-x 0 0 / calc(512px * var(--s)) auto;
}
.strata-deep {
    bottom: 0;
    height: calc(var(--block) * 5);
    background: url('../img/strata-deep.png') repeat-x 0 0 / calc(512px * var(--s)) auto;
}

.container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 16px;
}
.layout {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 28px;
    align-items: start;
}
@media (min-width: 960px) {
    .layout {
        grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
        gap: 36px;
        padding: 0 24px;
    }
    .side { position: sticky; top: 24px; }
}

/* ------------------------------------------------------------------ kartu formulir */
.form-card { scroll-margin-top: 16px; }
.gui-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 22px;
    padding-bottom: 14px;
    border-bottom: var(--u) solid var(--slot);
    box-shadow: 0 var(--u) 0 #fff;
}
.gui-title img { width: 32px; height: 32px; }
.gui-title h2 { margin: 0; font-size: clamp(22px, 3vw, 28px); color: var(--ink); }

.quota {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    padding: 8px 12px;
    font-size: 18px;
    color: #fff;
    text-shadow: 2px 2px 0 #3f3f3f;
    background: #373737;
}
.quota b { color: var(--mc-yellow); }
.quota img { width: 32px; height: 32px; }

.mc-form { margin: 0; }
.field { min-width: 0; margin: 0 0 24px; padding: 0; border: 0; }
.field > label, .field > legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    padding: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
}
.label-icon {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    background: var(--slot);
    box-shadow: inset 2px 2px 0 var(--slot-lo), inset -2px -2px 0 #fff;
}
.label-icon img { width: 32px; height: 32px; }
.req { color: var(--mc-dark-red); }
.opt {
    padding: 2px 8px 3px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #555;
}
.hint { margin: 8px 0 0; font-size: 16px; line-height: 1.35; color: var(--ink-soft); }
.has-error > label, .has-error > legend { color: var(--mc-dark-red); }

.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* pilihan berbentuk slot inventory */
.slot-picker { display: flex; flex-wrap: wrap; gap: 16px; }
.slot-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.slot-option input {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.slot-option:hover .slot { background: #a2a2a2; }
.slot-option input:checked + .slot {
    background: #a9a9a9;
    box-shadow:
        inset var(--u) var(--u) 0 var(--slot-lo),
        inset calc(var(--u) * -1) calc(var(--u) * -1) 0 #fff,
        0 0 0 var(--u) #000,
        0 0 0 calc(var(--u) * 2) #fff,
        0 0 0 calc(var(--u) * 3) #000;
}
.slot-option input:focus-visible + .slot { outline: var(--u) dashed #000; outline-offset: calc(var(--u) * 4); }
.slot-name { font-size: 17px; font-weight: 600; color: var(--ink); }
.slot-option input:checked ~ .slot-name { color: #000; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.captcha-q { margin: -2px 0 12px; }
@media (max-width: 420px) {
    .slot-picker { gap: 12px; }
    .slot-picker .slot { width: 62px; height: 62px; }
    .slot-picker .slot img { width: 40px; height: 40px; }
}

.privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 14px 0 0;
    font-size: 15px;
    color: var(--ink-soft);
    text-align: center;
}
.privacy img { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ hasil / ditutup */
.result { padding: 6px 0; text-align: center; outline: none; }
.result-icon {
    display: inline-grid;
    place-items: center;
    width: 104px;
    height: 104px;
    background: var(--slot);
    box-shadow: inset var(--u) var(--u) 0 var(--slot-lo), inset calc(var(--u) * -1) calc(var(--u) * -1) 0 #fff;
}
.result-icon img { width: 64px; height: 64px; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.result h3 { margin: 18px 0 6px; font-size: clamp(24px, 4vw, 30px); color: #245216; }
.result.closed h3 { color: #6e1717; }
.result-name { margin: 0 0 18px; font-size: 19px; }
.slot-row { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 18px; }
.result-label { font-size: 16px; color: var(--ink-soft); }
.reg-code {
    display: inline-block;
    padding: 14px 20px;
    font-family: var(--font-logo);
    font-size: clamp(20px, 5vw, 32px);
    letter-spacing: .06em;
    color: var(--mc-green);
    text-shadow: 3px 3px 0 #153f15;
    background: #000;
    border: var(--u) solid #a0a0a0;
    user-select: all;
}
.result-msg { max-width: 520px; margin: 0 auto 22px; font-size: 18px; color: var(--ink); }

/* ------------------------------------------------------------------ buku syarat */
.book {
    padding: 26px 24px 18px;
    color: #2b2116;
    background: #f6ecd2;
    border: var(--u) solid #2e1a0c;
    box-shadow: inset 0 0 0 calc(var(--u) * 2) #7a4a26, inset 0 0 0 calc(var(--u) * 3) #2e1a0c;
}
.book-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.book-head img { width: 32px; height: 32px; }
.book-head h2 { margin: 0; font-size: 23px; }
.book-list { margin: 0; padding: 0; list-style: none; counter-reset: rule; }
.book-list li {
    position: relative;
    margin: 0 0 12px;
    padding-left: 36px;
    font-size: 18px;
    line-height: 1.35;
    counter-increment: rule;
}
.book-list li::before {
    content: counter(rule);
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    font-size: 15px;
    font-weight: 700;
    color: #f6ecd2;
    background: #7a4a26;
}
.book-page { margin: 8px 0 0; font-size: 14px; color: #6f5f48; text-align: right; }

/* ------------------------------------------------------------------ panel gelap (gaya chat) */
.panel-dark {
    margin-top: 24px;
    padding: 20px;
    color: #fff;
    background: rgba(0, 0, 0, .74);
    border: var(--u) solid #000;
    box-shadow: inset 0 0 0 var(--u) #3c3c3c;
}
.panel-dark h2 { margin: 0 0 16px; font-size: 22px; color: var(--mc-yellow); text-shadow: 2px 2px 0 #3f3f15; }
.steps { margin: 0; padding: 0; list-style: none; }
.steps li {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    font-size: 18px;
    line-height: 1.3;
    text-shadow: 2px 2px 0 #3f3f3f;
}
.steps li:last-child { margin-bottom: 0; }
.step-no { display: block; font-size: 14px; font-weight: 600; color: var(--mc-gray); }

/* ------------------------------------------------------------------ footer bedrock */
.bedrock {
    padding: calc(var(--block) * 3 + 20px) 0 28px;
    color: #c8c8c8;
    background: #0e0e0e url('../img/strata-bedrock.png') repeat-x 0 0 / calc(512px * var(--s)) auto;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.footer-inner p { margin: 0; font-size: 16px; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: #fff; }
.footer-brand img { width: 32px; height: 32px; }
.footer-note { color: #9a9a9a; font-size: 14px !important; }

/* ------------------------------------------------------------------ layar loading */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 16px;
    background:
        linear-gradient(rgba(0, 0, 0, .72), rgba(0, 0, 0, .72)),
        url('../img/dirt.png') 0 0 / 64px 64px;
}
.loading-screen[hidden] { display: none; }
.loading-box { text-align: center; }
.loading-title { margin: 0; font-size: 24px; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; }
.loading-sub { margin: 6px 0 0; font-size: 18px; color: var(--mc-gray); text-shadow: 2px 2px 0 #2a2a2a; }
.loading-bar {
    width: min(320px, 80vw);
    height: 16px;
    margin: 20px auto 0;
    padding: 2px;
    background: #000;
    border: 2px solid #fff;
}
.loading-bar span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--mc-green);
    box-shadow: inset 0 -3px 0 #2c9a2c;
    animation: loadbar 7s cubic-bezier(.12, .75, .3, 1) forwards;
}
@keyframes loadbar { to { width: 94%; } }

/* ------------------------------------------------------------------ toast pencapaian */
.toast {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(340px, calc(100vw - 32px));
    padding: 12px 14px;
    color: #fff;
    background: #212121;
    border: var(--u) solid #000;
    box-shadow: inset 0 0 0 var(--u) #5c5c5c, 0 8px 0 rgba(0, 0, 0, .35);
    animation: toast 7s ease forwards;
}
.toast-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; }
.toast-icon img { width: 32px; height: 32px; }
.toast-text { display: flex; flex-direction: column; font-size: 17px; line-height: 1.25; }
.toast-text b { color: var(--mc-yellow); text-shadow: 2px 2px 0 #3f3f15; }
@keyframes toast {
    0% { transform: translateY(-160%); }
    7%, 88% { transform: translateY(0); }
    100% { transform: translateY(-160%); visibility: hidden; }
}

/* ------------------------------------------------------------------ mode malam */
@media (prefers-color-scheme: dark) {
    .overworld { background: linear-gradient(#070b1d 0%, #141c3c 55%, #263160 90%); }
    .sun {
        background: #e9edf7;
        box-shadow:
            inset calc(var(--px) * -4) calc(var(--px) * 3) 0 #c9cfdd,
            0 0 0 calc(var(--px) * 3) #b7bfd3,
            0 0 70px 24px rgba(190, 205, 255, .22);
    }
    .stars { display: block; }
    .clouds { opacity: .28; }
    .mountains, .hills, .scenery, .grass-row { filter: brightness(.5) saturate(.85); }
    .hero-text, .chip { background: rgba(0, 0, 0, .6); }
}

@media (prefers-reduced-motion: reduce) {
    .clouds, .splash, .result-icon img { animation: none; }
    .toast { animation: none; }
}
