@font-face {
    font-family: "gamefont";
    src: url(./fonts/font.ttf);
}

html,
body{
    padding: 0px;
    margin: 0px;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

html{
    cursor: url("./images/cursor/hand.png"), auto;
    font-family: "gamefont", serif;
    font-size: 16px;
    background-color: #050806;
}

#renderCanvas {
    width: 100%;
    height: 100%;
    touch-action: none;
    background: transparent;
}

#bgVideo {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    background: #0A0F0B;
}

#loadingScreen {
    width: 100%;
    height: 100%;
    color: #E8F2E8;
    text-align: center;
    z-index: 9999;
    position: relative;
    font-family: "Marcellus", serif;
    /* deep-purple base + soft central gold glow (no busy texture) */
    background:
        radial-gradient(120% 90% at 50% 20%, rgba(0,200,5,0.10) 0%, rgba(0,200,5,0) 55%),
        radial-gradient(130% 110% at 50% 100%, #121A14 0%, #0A0F0B 60%, #050806 100%);
    overflow: hidden;
}

/* faint vignette so the card floats */
#loadingScreen::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 220px 40px rgba(3,6,4,0.60);
}

/* --- frosted glass "foundry plate" card ------------------- */
.load-card {
    box-sizing: border-box;
    width: 360px;
    max-width: calc(100vw - 48px);
    margin: 0 auto;
    padding: 40px 36px 32px;
    position: relative;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(18,28,20,0.60) 0%, rgba(8,12,9,0.74) 100%);
    -webkit-backdrop-filter: blur(16px) saturate(118%);
    backdrop-filter: blur(16px) saturate(118%);
    border: 1px solid rgba(0,200,5,0.26);            /* hairline green */
    box-shadow:
        0 28px 74px -22px rgba(0,0,0,0.72),               /* deep soft drop */
        0 2px 0 rgba(255,255,255,0.04) inset,             /* top sheen */
        0 0 0 1px rgba(255,255,255,0.03) inset;           /* crisp inner edge */
    animation: load-card-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* hairline green foil highlight along the top edge */
.load-card::before {
    content: "";
    position: absolute;
    left: 24px; right: 24px; top: 0;
    height: 1px;
    background: linear-gradient(90deg,
        rgba(0,200,5,0) 0%,
        rgba(0,200,5,0.75) 50%,
        rgba(0,200,5,0) 100%);
}

@keyframes load-card-in {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* --- emblem: logo + rotating conic-green halo ------------- */
.load-emblem {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 4px;
}

.load-emblem::before {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
        rgba(0,200,5,0) 0deg,
        rgba(0,200,5,0.55) 90deg,
        rgba(0,200,5,0) 180deg,
        rgba(0,200,5,0.55) 300deg,
        rgba(0,200,5,0) 360deg);
    /* donut mask so only a ring shows */
    -webkit-mask: radial-gradient(closest-side, transparent 73%, #000 74%);
            mask: radial-gradient(closest-side, transparent 73%, #000 74%);
    animation: load-ring 3.6s linear infinite;
    pointer-events: none;
}

#loadingLogo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: block;
    box-shadow:
        0 8px 30px rgba(0,0,0,0.55),
        0 0 0 2px rgba(0,200,5,0.42);
    animation: bw-pulse 2.6s ease-in-out infinite;
}

@keyframes load-ring { to { transform: rotate(360deg); } }

/* keep the original keyframe name so nothing else breaks */
@keyframes bw-pulse {
    0%, 100% { transform: scale(1);    opacity: 1;    }
    50%      { transform: scale(1.04); opacity: 0.94; }
}

/* --- brand + tagline -------------------------------------- */
#loadingBrand {
    margin-top: 18px;
    color: #00C805;
    font-family: "Cinzel", serif;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: 4px;
    text-indent: 4px;   /* optical centering vs. trailing letter-spacing */
    white-space: nowrap;
    text-shadow: 0 2px 14px rgba(0,0,0,0.55), 0 0 22px rgba(0,200,5,0.18);
}

#loadingTagline {
    margin-top: 8px;
    color: #9BA89C;
    font-family: "Marcellus", serif;
    font-size: 13px;
    letter-spacing: 0.4px;
}

/* --- progress block --------------------------------------- */
.load-progress { margin-top: 26px; }

.load-bar-track {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(3,6,4,0.66);
    box-shadow:
        inset 0 1px 2px rgba(0,0,0,0.6),
        inset 0 0 0 1px rgba(0,200,5,0.14);
    overflow: hidden;
}

.load-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;                                     /* driven by JS */
    border-radius: 999px;
    background: linear-gradient(90deg, #00C805 0%, #00C805 55%, #5CFF5C 100%);
    box-shadow:
        0 0 10px rgba(0,200,5,0.55),
        0 0 2px rgba(0,200,5,0.9);
    transition: width 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

/* traveling sheen — ONLY while filling (removed at 100% via .is-complete) */
.load-bar-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.42) 50%,
        rgba(255,255,255,0) 100%);
    transform: translateX(-100%);
    animation: load-sheen 1.8s ease-in-out infinite;
}
.load-bar-fill.is-complete::after { animation: none; opacity: 0; }

@keyframes load-sheen {
    0%   { transform: translateX(-100%); }
    60%  { transform: translateX(100%);  }
    100% { transform: translateX(100%);  }
}

/* indeterminate: shown until the first real "NN%" arrives (plain status strings) */
.load-bar-fill.is-indeterminate {
    width: 34% !important;
    transition: none;
    animation: load-indeterminate 1.25s ease-in-out infinite;
}
.load-bar-fill.is-indeterminate::after { animation: none; }

@keyframes load-indeterminate {
    0%   { transform: translateX(-110%); }
    100% { transform: translateX(320%);  }
}

.load-progress-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 12px;
    gap: 12px;
}

.load-status {
    color: #9BA89C;
    font-family: "Marcellus", serif;
    font-size: 12px;
    letter-spacing: 0.3px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.load-pct {
    color: #00C805;
    font-family: "Cinzel", serif;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.5px;
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
}
.load-pct-sign { font-size: 11px; opacity: 0.8; margin-left: 1px; }

/* legacy Babylon node — kept in DOM, hidden (do NOT display:none the whole screen) */
#loadingText {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    opacity: 0;
    pointer-events: none;
}

.disable-selection {
    -moz-user-select: none;
    -ms-user-select: none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    user-select: none;
    outline: none;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0); /* mobile webkit */
}

.vertical-center {
    margin: 0 auto;
    position: absolute;
    top: 50%;
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    width: 100%;
  }

/* ------------------------------------------------------------------ */
/* HOOD VALLEY — mobile touch controls                                   */
/* ------------------------------------------------------------------ */
.bw-joy-base {
    position: fixed;
    left: 26px;
    bottom: 26px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(10,15,11, 0.35);
    border: 2px solid rgba(0,200,5, 0.5);
    z-index: 50;
    touch-action: none;
    display: none; /* shown on touch devices via media query below */
}
.bw-joy-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 56px;
    height: 56px;
    margin-left: -28px;
    margin-top: -28px;
    border-radius: 50%;
    background: rgba(0,200,5, 0.85);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.04s linear;
}
.bw-action-btn {
    position: fixed;
    right: 30px;
    bottom: 40px;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: rgba(0,200,5, 0.85);
    color: #04140A;
    font-size: 38px;
    line-height: 84px;
    text-align: center;
    z-index: 50;
    touch-action: none;
    user-select: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    display: none;
}
/* show the controls only on coarse-pointer (touch) devices */
@media (pointer: coarse) {
    .bw-joy-base,
    .bw-action-btn {
        display: block;
    }
}

/* ------------------------------------------------------------------ */
/* HOOD VALLEY — rotate-to-landscape overlay (phones in portrait)        */
/* ------------------------------------------------------------------ */
#rotateOverlay {
    display: none;
}
@media (pointer: coarse) and (orientation: portrait) {
    #rotateOverlay {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 9998;
        background: #0A0F0B;
        color: #00C805;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    /* hide touch controls while the rotate prompt is up */
    .bw-joy-base,
    .bw-action-btn {
        display: none !important;
    }
}
.rotate-icon {
    font-size: 64px;
    margin-bottom: 16px;
}
.rotate-title {
    font-family: "Cinzel", serif;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 4px;
    margin-bottom: 8px;
}
.rotate-text {
    font-size: 15px;
    color: #9BA89C;
    max-width: 280px;
    margin: 0 auto;
}