:root {
    --brand-neon: #D4FF00; 
    --bg-dark: #000000;
    --surface: #141414;
    --surface-hover: #1F1F1F;
}

[hidden] {
    display: none !important;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    -webkit-tap-highlight-color: transparent;
    margin: 0;
}

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.premium-gradient {
    display: none;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(212, 255, 0, 0.4); }
    70% { box-shadow: 0 0 0 4px rgba(212, 255, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 255, 0, 0); }
}
.story-ring {
    border: 2px solid var(--brand-neon);
    padding: 2px;
    animation: pulse-ring 2.5s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.stagger-item {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.neon-glow {
    box-shadow: 0 0 15px -3px var(--brand-neon);
}

/* PC Card Hover Effects */
.card-zoom:hover img {
    transform: scale(1.05);
}

/* Editor Specific Styles */
#editor {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #08080a;
    color: #efedf4;
    touch-action: none;
}

#stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: #08080a;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 70px 16px 110px 16px;
    box-sizing: border-box;
    z-index: 0;
    transition: background-color 0.3s ease;
}

#surface {
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95);
    border-radius: 12px;
    overflow: hidden;
}

#editor[data-mode="edit"] #surface {
    flex: none;
}

#image, #handles {
    display: block;
    width: 100%;
    height: 100%;
}

#handles {
    position: absolute;
    inset: 0;
    touch-action: none;
}

main[data-mode="play"] #handles {
    opacity: 0;
}

/* Tool Buttons matching user's template */
.tool-btn {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes jiggleSquish {
    0%   { transform: scale(1, 1) rotate(0deg); }
    25%  { transform: scale(1.18, 0.84) rotate(-5deg); }
    50%  { transform: scale(0.88, 1.15) rotate(4deg); }
    75%  { transform: scale(1.07, 0.94) rotate(-2deg); }
    100% { transform: scale(1, 1) rotate(0deg); }
}

.jiggle-plus-btn:hover .jiggle-plus-svg,
.jiggle-plus-btn[aria-pressed="true"] .jiggle-plus-svg {
    animation: jiggleSquish 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.jiggle-plus-btn:active .jiggle-plus-svg {
    transform: scale(1.16, 0.84);
}

@media (hover: hover) and (pointer: fine) {
    .tool-btn:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.08);
    }
}

#editor button[aria-pressed="true"] {
    color: var(--brand-neon) !important;
    background: rgba(212, 255, 0, 0.12) !important;
    border-color: rgba(212, 255, 0, 0.35) !important;
    box-shadow: none !important;
}

#open, #backHome, #adjust, #historyTools {
    -webkit-backdrop-filter: blur(24px) !important;
    backdrop-filter: blur(24px) !important;
}

#editor button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

#play, #edit {
    background: var(--brand-neon) !important;
    color: #000000 !important;
    box-shadow: none !important;
}

/* Play / Preview Mode: Ultra-clean, distraction-free */
main[data-mode="play"] #editorDock,
#editor[data-mode="play"] #editorDock {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    max-width: fit-content !important;
}

main[data-mode="play"] #playDivider1,
main[data-mode="play"] #historyTools,
#editor[data-mode="play"] #playDivider1,
#editor[data-mode="play"] #historyTools,
main[data-mode="play"] #open,
main[data-mode="play"] #demo,
main[data-mode="play"] #save,
#editor[data-mode="play"] #demo,
#editor[data-mode="play"] #save {
    display: none !important;
}

/* Keep the playback image against a flat background, including fullscreen. */
#editor[data-mode="play"] #surface {
    box-shadow: none;
}

#editor.jiggle-fullscreen #surface {
    flex: none;
}

@media (max-width: 767px) {
    #editor[data-mode="play"]:not(.jiggle-fullscreen) #stage {
        inset-block: calc(76px + max(env(safe-area-inset-top), env(safe-area-inset-bottom)));
        inset-inline: 9px;
        width: auto;
        height: auto;
        padding: 0;
    }

    #editor[data-mode="play"] #surface {
        flex: none;
    }
}

@media (min-width: 768px) {
    #editor[data-mode="play"] #stage {
        padding-block: 0;
    }
}

@media (hover: hover) and (pointer: fine) {
    #likeBtn:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
}

#likeBtn.liked svg {
    fill: #FF2D55 !important;
    stroke: #FF2D55 !important;
}

#likeBtn.liked span {
    color: #FF2D55 !important;
}

/* Enlarge / Fullscreen Mode */
#editor.jiggle-fullscreen > main > header {
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#editor.jiggle-fullscreen #stage {
    padding: 0 !important;
}

#editor.jiggle-fullscreen #surface {
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.98);
}

#editor.jiggle-fullscreen #exitFullscreenBtn {
    display: flex !important;
}

/* Custom range sliders in Settings matching template */
#editor input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    outline: none;
}

#settings:not([hidden]) {
    animation: settingsSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes settingsSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#editor input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--brand-neon);
    cursor: pointer;
    margin-top: -6px;
    box-shadow: none;
    border: 2px solid #000000;
    transition: transform 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    #editor input[type=range]::-webkit-slider-thumb:hover {
        transform: scale(1.2);
    }
}

#editor input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
}

/* Region badges */
#editor #regions button {
    padding: 5px 12px;
    border-radius: 9999px;
    background: rgba(26, 26, 32, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #d1d1db;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) and (pointer: fine) {
    #editor #regions button:hover {
        background: rgba(40, 40, 50, 0.9);
        color: #ffffff;
    }
}

#editor #regions button[aria-pressed="true"] {
    background: var(--brand-neon) !important;
    color: #000000 !important;
    border-color: transparent !important;
    box-shadow: none !important;
    font-weight: 700;
}

#editor.edit-panning #handles {
    cursor: grabbing;
}

@media (max-width: 767px) {
    main[data-mode="edit"] #tools > button {
        width: 48px;
        height: 48px;
    }

    main[data-mode="edit"] #play {
        width: 64px;
        height: 48px;
    }
}

@media (hover: hover) and (pointer: fine) {
    #accountSubmit:not(:disabled):hover {
        background-color: #e1ff58;
    }
}

#accountForm input:focus {
    outline: 2px solid var(--brand-neon);
    outline-offset: 2px;
}

#accountForm input[aria-invalid="true"] {
    border-color: #fb7185;
}

#accountForm input[aria-invalid="true"]:focus {
    outline-color: #fb7185;
}

#accountForm :is(.account-field-error, .account-field-hint) {
    margin-top: 4px;
    font-size: 13px;
}

.account-field-error {
    color: #fda4af;
}

.account-field-hint {
    color: #a1a1aa;
}

#editor.jiggle-fullscreen :is(#recordMotion, #editorDock, #status) {
    display: none !important;
}

#recordMotion[aria-pressed="true"] #recordMotionIcon {
    border-radius: 2px;
}

@media (max-width: 767px) {
    #editor :is(#recordMotion, #fullscreenBtn, #exitFullscreenBtn) {
        width: 48px;
        height: 40px;
        min-height: 40px;
        justify-content: center;
        padding: 0;
    }

    #recordMotionLabel {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

#settingsSection {
    --settings-line: rgba(255, 255, 255, 0.08);
}

.settings-content {
    display: grid;
    gap: 20px;
}

.settings-note {
    font-size: 13px;
    color: #a1a1aa;
}

.settings-privacy summary {
    list-style: none;
    cursor: pointer;
}

.settings-privacy summary::-webkit-details-marker {
    display: none;
}

.settings-privacy[open] .settings-chevron {
    transform: rotate(180deg);
    color: var(--brand-neon);
}

#editor #regions {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    max-width: 100%;
    touch-action: pan-x;
}
#regions button { flex-shrink: 0; }
.platform-tools, .platform-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
    margin: .4rem 0;
}
.platform-button, .platform-row button, .card-title {
    padding: .45rem .7rem;
    border-radius: .8rem;
    color: white;
    background: #262629;
    min-height: 40px;
}
.platform-row button:hover, .platform-button:hover { color: var(--brand-neon); }
.platform-row button:focus-visible, .card-title:focus-visible { outline: 2px solid var(--brand-neon); }
.card-title { position:absolute; bottom:2.7rem; left:.45rem; max-width:90%; background:#080808cc; text-align:left; font-size:.8rem; }
#editor.jiggle-fullscreen #pubActions { display:none; }

#profileTabs {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}
#profileTabs > button { flex: none; }
#home, #home > div, #galleryMain, #profileSection { min-width: 0; }
#profileSection { max-width: min(760px, 100%); }
.platform-row { overflow-wrap:anywhere; }
.platform-row input, .platform-row select {
    max-width:100%;
    border-radius:.6rem;
    padding:.5rem;
    background:#262629;
    color:white;
}
