/* __V3D_TEMPLATE__ - template-based file; delete this line to prevent this file from being updated */

body {
    margin: 0px;
    overflow: hidden;
    min-height: 100vh;
    /* kid-friendly soft gradient background (3D canvas stays transparent above) */
    background-color: #eef3f8;
    background-image:
        radial-gradient(900px 520px at 12% 18%, rgba(255, 214, 165, 0.40), rgba(255, 214, 165, 0) 62%),
        radial-gradient(820px 520px at 86% 26%, rgba(186, 230, 253, 0.52), rgba(186, 230, 253, 0) 60%),
        radial-gradient(760px 520px at 52% 86%, rgba(255, 204, 227, 0.40), rgba(255, 204, 227, 0) 62%),
        linear-gradient(180deg, #eef3f8 0%, #f5eef4 55%, #eef7f3 100%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.06) 0%, rgba(15, 23, 42, 0.02) 65%, rgba(15, 23, 42, 0.03) 100%);
    background-attachment: fixed;
}

noscript {
    display: block;
    text-align: center;
    padding-top: 100px;
    font-size: 20px;
}

.v3d-container {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    background: transparent;
}

.fullscreen-button {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    background-size: 100% 100%;
    display: none;
    z-index: 1;
}

.fullscreen-open {
    background-image: url('media/fullscreen_open.svg');
}

.fullscreen-close {
    background-image: url('media/fullscreen_close.svg');
}

*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* ---------------- Bottom UI panel ---------------- */
.top-panel {
    position: fixed;
    left: 0;
    right: 0;
    top: 14px;
    z-index: 60;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.top-panel .ui-hint {
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 12px 18px;
    width: min(720px, calc(100% - 28px));
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 10px 26px rgba(0,0,0,0.08);

    color: rgba(15, 23, 42, 0.90);
    font: 900 18px/1.25 system-ui, -apple-system, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
    letter-spacing: 0.2px;
}

.top-panel .ui-hint.error {
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.22);
}

.bottom-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 96px;
    height: auto;
    padding: 10px 14px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    pointer-events: none; /* allow canvas interactions except on controls */

    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(15, 23, 42, 0.14);
    box-shadow: 0 -8px 18px rgba(0,0,0,0.06);
}

.bottom-panel__content {
    width: min(720px, 100%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.bottom-panel__row {
    display: flex;
    gap: 12px;
    justify-content: center;
    pointer-events: none;
    flex-wrap: wrap;
}

.bottom-panel__row--slider,
.bottom-panel__row--controls {
    width: min(720px, 100%);
    margin: 0 auto;
}

.bottom-panel__row--slider {
    flex-wrap: nowrap;
}

.bottom-panel__row--controls {
    justify-content: stretch;
    flex-wrap: nowrap;
}

.bottom-panel__row--controls .ui-field,
.bottom-panel__row--controls .ui-btn {
    flex: 1 1 0;
    min-width: 0;
}

.bottom-panel__row--controls .ui-btn {
    min-width: 0;
}

.bottom-panel__row--controls .ui-select {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ui-slider-wrap {
    pointer-events: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.ui-slider-wrap.hidden {
    display: none;
}

.ui-slider__labels {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    color: rgba(15, 23, 42, 0.86);
    font: 900 12px/1 system-ui, -apple-system, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
    user-select: none;
}

.ui-slider__label {
    opacity: 0.76;
}

.ui-slider__title {
    opacity: 0.92;
    letter-spacing: 0.2px;
}

.ui-slider__value {
    text-align: right;
    opacity: 0.76;
    font-variant-numeric: tabular-nums;
}

.ui-slider {
    --slider-p: 100%;
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 26px;
    padding: 0 11px;
    margin: 0;
    background: transparent;
    touch-action: pan-x;
}

@media (max-width: 900px) {
    .bottom-panel__row--controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        justify-content: stretch;
        flex-wrap: wrap;
    }
}

.ui-slider:disabled {
    opacity: 0.65;
}

.ui-slider::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6 var(--slider-p), rgba(15, 23, 42, 0.16) var(--slider-p));
}

.ui-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.18);
    box-shadow: 0 8px 18px rgba(0,0,0,0.14);
    margin-top: -7px;
}

.ui-slider::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.16);
}

.ui-slider::-moz-range-progress {
    height: 8px;
    border-radius: 999px;
    background: #3b82f6;
}

.ui-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.18);
    box-shadow: 0 8px 18px rgba(0,0,0,0.14);
}

@media (max-width: 680px) {
    .bottom-panel {
        height: auto;
        padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .bottom-panel__content {
        width: min(560px, 100%);
    }

    .bottom-panel__row--slider {
        width: min(560px, 100%);
        flex-wrap: nowrap;
    }

    .bottom-panel__row--controls {
        width: min(560px, 100%);
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        justify-content: stretch;
    }

    .bottom-panel__row--slider {
        display: block;
    }

    .bottom-panel__row--controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        justify-content: stretch;
    }

    .ui-slider-wrap {
        padding: 10px 10px;
        border-radius: 12px;
    }

    .ui-slider__labels {
        font: 900 11px/1 system-ui, -apple-system, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
    }


    .ui-field,
    .ui-btn {
        width: 100%;
        min-width: 0;
        height: 42px;
        border-radius: 10px;
    }

    .ui-field {
        padding: 0 8px;
        box-shadow: 0 5px 12px rgba(15, 23, 42, 0.10);
    }

    .ui-select {
        width: 100%;
        min-width: 0;
        height: 32px;
        padding: 0 30px 0 10px;
        font: 800 13px/1 system-ui, -apple-system, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
        background-position:
            calc(100% - 16px) 50%,
            calc(100% - 10px) 50%,
            calc(100% - 28px) 50%;
        background-size:
            6px 6px,
            6px 6px,
            1px 16px;
    }

    .ui-btn {
        padding: 10px 10px;
        font: 800 14px/1 system-ui, -apple-system, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
    }
}

.ui-field {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.22);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.10);
}

.ui-field__label {
    font: 800 14px/1 system-ui, -apple-system, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
    color: rgba(15, 23, 42, 0.86);
    user-select: none;
}

.ui-field--select-only {
    padding: 0 10px;
}

.ui-select {
    appearance: none;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 8px;
    height: 34px;
    padding: 0 34px 0 12px;
    min-width: 168px;
    background: #ffffff;
    color: rgba(15, 23, 42, 0.92);
    font: 800 14px/1 system-ui, -apple-system, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
    cursor: pointer;
    outline: none;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(15, 23, 42, 0.65) 50%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.65) 50%, transparent 50%),
        linear-gradient(to right, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.08));
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 12px) 50%,
        calc(100% - 32px) 50%;
    background-size:
        6px 6px,
        6px 6px,
        1px 18px;
    background-repeat: no-repeat;
}

.ui-select:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}

.ui-btn {
    pointer-events: auto;
    appearance: none;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 10px;
    padding: 12px 14px;
    min-width: 120px;
    height: 48px;
    background: #2563eb; /* blue */
    color: #ffffff;
    font: 800 16px/1 system-ui, -apple-system, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
    cursor: pointer;
    user-select: none;
    transition: transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease, filter 120ms ease;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.22);
}

.ui-btn--secondary {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.22);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.10);
}

.ui-btn--secondary:hover {
    background: #f8fafc;
}

.ui-btn--secondary:active {
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.10);
}

.ui-hint {
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    padding: 0 8px;
    color: rgba(15, 23, 42, 0.78);
    font: 700 13px/1 system-ui, -apple-system, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-hint.error {
    color: #dc2626;
}

.ui-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}
.ui-btn:hover {
    background: #1d4ed8;
}

.ui-btn:active {
    transform: scale(0.98);
    filter: brightness(0.98);
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.18);
}

.ui-btn:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}


.v3d-simple-preloader-logo {
    background-image: url('media/logo180.png');
}

/* (debug overlays removed) */
