/* ==========================================================================
   PERSONA 5
   ========================================================================== */

body.theme-persona5 {
    --text-primary: #FFFFFF;
    --text-accent: #E60012;
}

body.theme-persona5 .os-window {
    background: #000000;
    border: 3px solid #E60012;
    box-shadow:
        0 0 20px rgba(230, 0, 18, 0.5),
        0 0 40px rgba(230, 0, 18, 0.3),
        inset 0 0 30px rgba(230, 0, 18, 0.1);
}

body.theme-persona5 .window-header {
    background: linear-gradient(135deg, #000000 0%, #1a0000 50%, #E60012 100%);
    color: #FFFFFF;
    border-bottom: 2px solid #E60012;
    font-family: 'VT323', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px #E60012, 0 0 20px #E60012;
}

body.theme-persona5 .window-content {
    background: #0a0a0a;
    color: #FFFFFF;
}

body.theme-persona5 .close-btn {
    background: #E60012;
    color: #FFFFFF;
    border: 2px solid #FFFFFF;
    text-shadow: 0 0 5px #000;
    transition: all 0.2s;
}

body.theme-persona5 .close-btn:hover {
    background: #FF1a2a;
    box-shadow: 0 0 15px #E60012;
    transform: scale(1.1);
}

body.theme-persona5 .taskbar {
    background: linear-gradient(to bottom, #000000 0%, #1a0000 100%);
    border-top: 2px solid #E60012;
    box-shadow: 0 -2px 20px rgba(230, 0, 18, 0.4);
}

body.theme-persona5 .start-btn {
    background: #E60012;
    color: #FFFFFF;
    border: 2px solid #FFFFFF;
    text-shadow: 0 0 10px #000;
    font-weight: bold;
}

body.theme-persona5 .start-btn:hover {
    background: #FF1a2a;
    box-shadow: 0 0 20px rgba(230, 0, 18, 0.8);
}

body.theme-persona5 .taskbar-clock {
    background: #000000;
    color: #E60012;
    border: 2px solid #E60012;
    text-shadow: 0 0 5px #E60012;
}

body.theme-persona5 .start-menu {
    background: #000000;
    border: 3px solid #E60012;
    box-shadow: 0 0 30px rgba(230, 0, 18, 0.6);
}

body.theme-persona5 .start-menu-header {
    background: linear-gradient(135deg, #E60012 0%, #000000 100%);
    color: #FFFFFF;
    border-bottom: 2px solid #E60012;
}

body.theme-persona5 .start-menu-item {
    color: #FFFFFF;
}

body.theme-persona5 .start-menu-item:hover {
    background: #E60012;
    color: #000000;
    transform: translateX(5px);
}

body.theme-persona5 .retro-btn {
    background: linear-gradient(to bottom, #1a0000 0%, #000000 100%);
    color: #E60012;
    border: 2px solid #E60012;
    text-shadow: 0 0 5px #E60012;
}

body.theme-persona5 .retro-btn:hover {
    background: #E60012;
    color: #000000;
    box-shadow: 0 0 15px rgba(230, 0, 18, 0.8);
}

body.theme-persona5 .icon-label {
    color: #FFFFFF;
    text-shadow:
        0 0 5px #E60012,
        0 0 10px #E60012,
        2px 2px 5px #000;
}

body.theme-persona5 .icon:hover .icon-label {
    color: #E60012;
}

body.theme-persona5 ::-webkit-scrollbar-track {
    background: #000000;
    border: 1px solid #E60012;
}

body.theme-persona5 ::-webkit-scrollbar-thumb {
    background: #E60012;
    border: 1px solid #FFFFFF;
}

body.theme-persona5 ::-webkit-scrollbar-thumb:hover {
    background: #FF1a2a;
    box-shadow: 0 0 10px #E60012;
}

/* ==========================================================================
   OMORI
   ========================================================================== */

@font-face {
    font-family: 'Omori';
    src: url('fonts/omori.ttf') format('truetype');
}

body.theme-omori {
    --text-primary: #000000;
    --text-accent: #666666;
}

body.theme-omori,
body.theme-omori * {
    font-family: 'Omori', 'VT323', monospace !important;
    font-size: 105% !important;
}

body.theme-omori .os-window {
    background: #FFFFFF;
    border: 4px solid #000000;
    box-shadow:
        8px 8px 0px #000000,
        0 0 0 1px #FFFFFF;
}

body.theme-omori .window-header {
    background: #000000;
    color: #FFFFFF;
    border: none;
    font-family: 'VT323', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 4px solid #000000;
}

body.theme-omori .window-content {
    background: #FFFFFF;
    color: #000000;
    border: 2px solid #000000;
}

body.theme-omori .close-btn {
    background: #FFFFFF;
    color: #000000;
    border: 2px solid #000000;
    font-weight: bold;
    transition: all 0.1s;
}

body.theme-omori .close-btn:hover {
    background: #000000;
    color: #FFFFFF;
}

/* Taskbar */
body.theme-omori .taskbar {
    background: #000000;
    border-top: 4px solid #FFFFFF;
    box-shadow: none;
}

body.theme-omori .start-btn {
    background: #FFFFFF;
    color: #000000;
    border: 3px solid #000000;
    font-weight: bold;
}

body.theme-omori .start-btn:hover {
    background: #000000;
    color: #FFFFFF;
}

body.theme-omori .taskbar-clock {
    background: #FFFFFF;
    color: #000000;
    border: 3px solid #000000;
    font-weight: bold;
}

body.theme-omori .start-menu {
    background: #FFFFFF;
    border: 4px solid #000000;
    box-shadow: 8px 8px 0px #000000;
}

body.theme-omori .start-menu-header {
    background: #000000;
    color: #FFFFFF;
    border-bottom: 4px solid #000000;
}

body.theme-omori .start-menu-item {
    color: #000000;
    border-bottom: 2px solid #e0e0e0;
}

body.theme-omori .start-menu-item:hover {
    background: #000000;
    color: #FFFFFF;
}

body.theme-omori .start-menu-separator {
    background: #000000;
    height: 3px;
}

body.theme-omori .retro-btn {
    background: #FFFFFF;
    color: #000000;
    border: 3px solid #000000;
    font-weight: bold;
    box-shadow: 4px 4px 0px #000000;
}

body.theme-omori .retro-btn:hover {
    background: #000000;
    color: #FFFFFF;
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #000000;
}

body.theme-omori .retro-btn:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

body.theme-omori .icon-label {
    color: #FFFFFF;
    text-shadow:
        2px 2px 0px #000000,
        -1px -1px 0px #000000,
        1px -1px 0px #000000,
        -1px 1px 0px #000000,
        1px 1px 0px #000000;
    font-weight: bold;
}

body.theme-omori .icon:hover .icon-label {
    color: #FFFFFF;
    text-shadow:
        3px 3px 0px #000000,
        -2px -2px 0px #000000,
        2px -2px 0px #000000,
        -2px 2px 0px #000000,
        2px 2px 0px #000000;
}

body.theme-omori ::-webkit-scrollbar-track {
    background: #FFFFFF;
    border: 2px solid #000000;
}

body.theme-omori ::-webkit-scrollbar-thumb {
    background: #000000;
    border: 2px solid #FFFFFF;
}

body.theme-omori ::-webkit-scrollbar-thumb:hover {
    background: #333333;
}

body.theme-omori .photo-grid {
    gap: 15px;
}

body.theme-omori .photo-thumb {
    border: 4px solid #000000;
    box-shadow: 4px 4px 0px #000000;
}

body.theme-omori .photo-thumb:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #000000;
}

body.theme-omori input[type="text"],
body.theme-omori textarea,
body.theme-omori select {
    background: #FFFFFF;
    color: #000000;
    border: 3px solid #000000;
    font-weight: bold;
}

body.theme-omori input[type="text"]:focus,
body.theme-omori textarea:focus {
    outline: 3px solid #666666;
    outline-offset: 2px;
}

body.theme-omori .task-item {
    background: #FFFFFF;
    color: #000000;
    border: 2px solid #000000;
}

body.theme-omori .task-item:hover {
    background: #000000;
    color: #FFFFFF;
}

/* ==========================================================================
   OMORI BLACK SPACE
   ========================================================================== */

body.bg-blackspace::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.15) 0%, transparent 50%);
    animation: blackspacePulse 4s ease-in-out infinite;
    z-index: 0;
}

@keyframes blackspacePulse {
    0%, 100% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* ==========================================================================
   UNDERTALE / MEGALOVANIA
   ========================================================================== */

body.theme-undertale {
    --text-primary: #FFFFFF;
    --text-accent: #FFFF00;
}

body.theme-undertale,
body.theme-undertale * {
    font-family: 'Comic Sans MS', 'Comic Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', cursive !important;
}

body.theme-undertale::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(0, 170, 255, 0.15) 0%, transparent 30%),
        radial-gradient(ellipse at 70% 60%, rgba(255, 170, 0, 0.1) 0%, transparent 25%);
    animation: sansGlow 2s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes sansGlow {
    0% { opacity: 0.3; }
    100% { opacity: 0.8; }
}

body.theme-undertale .os-window {
    background: #000000;
    border: 4px solid #FFFFFF;
    box-shadow:
        0 0 20px rgba(0, 170, 255, 0.5),
        0 0 40px rgba(0, 170, 255, 0.2),
        inset 0 0 20px rgba(0, 0, 0, 0.8);
    animation: windowShake 0.5s ease-in-out infinite;
    animation-play-state: paused;
}

body.theme-undertale .os-window:hover {
    animation-play-state: running;
}

@keyframes windowShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

body.theme-undertale .window-header {
    background: linear-gradient(180deg, #1a1a2e 0%, #000000 100%);
    color: #FFFFFF;
    border-bottom: 3px solid #FFFFFF;
    font-family: 'VT323', monospace;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 10px #00AAFF, 0 0 20px #00AAFF;
}

body.theme-undertale .window-content {
    background: #000000;
    color: #FFFFFF;
}

body.theme-undertale .close-btn {
    background: #000000;
    color: #FFFF00;
    border: 2px solid #FFFF00;
    text-shadow: 0 0 5px #FFFF00;
    transition: all 0.2s;
}

body.theme-undertale .close-btn:hover {
    background: #FFFF00;
    color: #000000;
    box-shadow: 0 0 15px #FFFF00;
}

body.theme-undertale .taskbar {
    background: linear-gradient(to top, #000000 0%, #0a0a1a 100%);
    border-top: 3px solid #FFFFFF;
    box-shadow: 0 -5px 30px rgba(0, 170, 255, 0.4);
}

body.theme-undertale .start-btn {
    background: #000000;
    color: #FFFF00;
    border: 3px solid #FFFFFF;
    font-weight: bold;
    text-shadow: 0 0 10px #FFFF00;
    animation: determination 1.5s ease-in-out infinite;
}

@keyframes determination {
    0%, 100% { box-shadow: 0 0 5px #FFFF00; }
    50% { box-shadow: 0 0 20px #FFFF00, 0 0 30px #FF0000; }
}

body.theme-undertale .start-btn:hover {
    background: #FFFF00;
    color: #000000;
    text-shadow: none;
}

body.theme-undertale .taskbar-clock {
    background: #000000;
    color: #00AAFF;
    border: 2px solid #FFFFFF;
    text-shadow: 0 0 10px #00AAFF;
    font-family: 'VT323', monospace;
}

body.theme-undertale .start-menu {
    background: #000000;
    border: 4px solid #FFFFFF;
    box-shadow: 0 0 30px rgba(0, 170, 255, 0.5);
}

body.theme-undertale .start-menu-header {
    background: linear-gradient(180deg, #1a1a2e 0%, #000000 100%);
    color: #FFFF00;
    border-bottom: 3px solid #FFFFFF;
    text-shadow: 0 0 10px #FFFF00;
}

body.theme-undertale .start-menu-item {
    color: #FFFFFF;
    font-family: 'VT323', monospace;
    letter-spacing: 1px;
    transition: all 0.1s;
}

body.theme-undertale .start-menu-item:hover {
    background: #FFFF00;
    color: #000000;
    padding-left: 25px;
}

body.theme-undertale .start-menu-item:hover::before {
    content: '❤ ';
    color: #FF0000;
}

body.theme-undertale .retro-btn {
    background: #000000;
    color: #FFFFFF;
    border: 3px solid #FFFFFF;
    font-family: 'VT323', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.1s;
    position: relative;
}

body.theme-undertale .retro-btn:hover {
    background: #FF6600;
    color: #FFFFFF;
    border-color: #FF6600;
    box-shadow: 0 0 15px #FF6600;
}

body.theme-undertale .retro-btn:active {
    transform: scale(0.95);
}

body.theme-undertale .icon-label {
    color: #FFFFFF;
    text-shadow:
        0 0 5px #00AAFF,
        2px 2px 4px #000000;
    font-family: 'VT323', monospace;
}

body.theme-undertale .icon:hover .icon-label {
    color: #FFFF00;
    text-shadow: 0 0 10px #FFFF00;
}

body.theme-undertale .icon:hover::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    color: #FF0000;
    font-size: 16px;
    animation: heartBeat 0.5s ease-in-out infinite;
}

@keyframes heartBeat {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.2); }
}

body.theme-undertale ::-webkit-scrollbar-track {
    background: #000000;
    border: 2px solid #FFFFFF;
}

body.theme-undertale ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00AAFF 0%, #0066AA 100%);
    border: 2px solid #FFFFFF;
}

body.theme-undertale ::-webkit-scrollbar-thumb:hover {
    background: #00DDFF;
    box-shadow: 0 0 10px #00AAFF;
}

body.theme-undertale .task-item {
    background: #000000;
    color: #FFFFFF;
    border: 2px solid #FFFFFF;
    position: relative;
    overflow: hidden;
}

body.theme-undertale .task-item:hover {
    background: #1a1a2e;
}

body.theme-undertale .task-item::after {
    content: '🦴';
    position: absolute;
    right: -30px;
    opacity: 0;
    transition: all 0.3s;
}

body.theme-undertale .task-item:hover::after {
    right: 10px;
    opacity: 1;
}

body.theme-undertale .close-btn:active {
    animation: blasterCharge 0.3s ease-out;
}

@keyframes blasterCharge {
    0% { box-shadow: 0 0 5px #00AAFF; }
    50% { box-shadow: 0 0 30px #00AAFF, 0 0 60px #FFFFFF; }
    100% { box-shadow: 0 0 5px #00AAFF; }
}

body.theme-undertale input[type="text"],
body.theme-undertale textarea,
body.theme-undertale select {
    background: #000000;
    color: #FFFFFF;
    border: 3px solid #FFFFFF;
    font-family: 'VT323', monospace;
}

body.theme-undertale input[type="text"]:focus,
body.theme-undertale textarea:focus {
    border-color: #00AAFF;
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.5);
    outline: none;
}

body.theme-undertale .photo-thumb {
    border: 3px solid #FFFFFF;
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.3);
    transition: all 0.2s;
}

body.theme-undertale .photo-thumb:hover {
    box-shadow: 0 0 20px #00AAFF, 0 0 40px rgba(0, 170, 255, 0.5);
    transform: scale(1.05);
}

body.theme-undertale.megalovania-active::after {
    content: '* You feel your sins crawling on your back.';
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    color: #FFFFFF;
    font-family: 'VT323', monospace;
    font-size: 18px;
    text-shadow: 0 0 10px #FF0000;
    animation: sinsText 3s ease-in-out infinite;
    z-index: 10000;
    pointer-events: none;
}

@keyframes sinsText {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

body.theme-undertale .bone-attack {
    position: fixed;
    font-size: 24px;
    color: #FFFFFF;
    text-shadow: 0 0 10px #FFFFFF;
    pointer-events: none;
    z-index: 9999;
    animation: boneFloat 2s linear forwards;
}

@keyframes boneFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

body.theme-undertale.megalovania-active,
body.theme-undertale.megalovania-active * {
    cursor: url('./img/megalovania_cursor.png') 0 0, auto !important;
}

body.theme-undertale.megalovania-active a,
body.theme-undertale.megalovania-active button,
body.theme-undertale.megalovania-active .retro-btn,
body.theme-undertale.megalovania-active .close-btn,
body.theme-undertale.megalovania-active .icon,
body.theme-undertale.megalovania-active .start-btn,
body.theme-undertale.megalovania-active .start-menu-item,
body.theme-undertale.megalovania-active .task-item,
body.theme-undertale.megalovania-active .photo-thumb,
body.theme-undertale.megalovania-active input,
body.theme-undertale.megalovania-active select,
body.theme-undertale.megalovania-active [onclick],
body.theme-undertale.megalovania-active [role="button"] {
    cursor: url('./img/megalovania_cursorSelect.png') 0 0, pointer !important;
}

body.theme-undertale .bone-line {
    position: fixed;
    height: 120px;
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
}

body.theme-undertale .bone-line.going-right {
    left: -750px;
    animation: boneLineRight 4s linear forwards;
}

body.theme-undertale .bone-line.going-left {
    right: -750px;
    animation: boneLineLeft 4s linear forwards;
}

body.theme-undertale .bone-in-line {
    position: absolute;
    width: 500px;
    height: auto;
    transform: rotate(0deg);
    filter: drop-shadow(0 0 15px #FFFFFF);
}

@keyframes boneLineRight {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(100vw + 1000px));
    }
}

@keyframes boneLineLeft {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-100vw - 1500px));
    }
}

body.theme-undertale .gaster-blaster {
    position: fixed;
    font-size: 40px;
    pointer-events: none;
    z-index: 9998;
    animation: blasterAppear 1s ease-out forwards;
    filter: drop-shadow(0 0 20px #00AAFF);
}

@keyframes blasterAppear {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-30deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) rotate(0deg);
    }
    70% {
        transform: scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: scale(1.5) rotate(0deg);
    }
}

body.screen-shake {
    animation: screenShakeAnim 0.2s ease-out;
}

@keyframes screenShakeAnim {
    0% { transform: translate(0, 0); }
    15% { transform: translate(-12px, 8px); }
    30% { transform: translate(12px, -8px); }
    45% { transform: translate(-8px, 12px); }
    60% { transform: translate(8px, -12px); }
    75% { transform: translate(-5px, 5px); }
    90% { transform: translate(5px, -5px); }
    100% { transform: translate(0, 0); }
}

body.theme-undertale .os-window.soul-moving {
    transition: left 0.12s cubic-bezier(0.2, 0, 0.8, 1),
                top 0.12s cubic-bezier(0.2, 0, 0.8, 1) !important;
}

body.theme-undertale .os-window.soul-slam {
    transition: none !important;
    box-shadow:
        0 0 40px rgba(0, 170, 255, 1),
        0 0 80px rgba(0, 170, 255, 0.8),
        0 0 120px rgba(255, 255, 255, 0.5),
        inset 0 0 30px rgba(0, 170, 255, 0.3) !important;
    border-color: #00AAFF !important;
}
