@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --link-color: #0000EE;
    --link-visited: #551A8B;
    --link-hover: #FF0000;
    --theme-sync-duration: 0.3s;
    --main-image-fade-duration: 0.14s;
}

body.dark-theme {
    --bg-color: #000000;
    --text-color: #e0e0e0;
    --link-color: #6BBAFF;
    --link-visited: #B695FF;
    --link-hover: #FF6B6B;
}

body {
    font-family: 'Lora', Georgia, serif;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color var(--theme-sync-duration) ease, color var(--theme-sync-duration) ease;
}

body:not(.dark-theme) {
    --bg-color: #ffffff;
    --text-color: #000000;
}

a {
    color: var(--link-color);
    transition: color 0.3s ease;
}

a:not([href*="fems.lol"]) {
    display: inline-block;
    padding: 8px 16px;
    margin: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-weight: normal;
}

body.dark-theme a:not([href*="fems.lol"]) {
    background: linear-gradient(135deg, #434343 0%, #000000 100%);
}

a:not([href*="fems.lol"]):hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    color: #ffffff !important;
}

a:not([href*="fems.lol"]):active {
    transform: scale(0.98);
}

a[href*="fems.lol"] {
    text-decoration: underline;
}

a:visited {
    color: var(--link-visited);
}

a:not([href*="fems.lol"]):visited {
    color: #ffffff !important;
}

a:hover {
    color: var(--link-hover);
}

a[href*="fems.lol"]:hover {
    color: var(--link-hover);
}

.theme-toggle-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-toggle-checkbox {
    display: none;
}

.theme-toggle-label {
    display: block;
    width: 70px;
    height: 34px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50px;
    position: relative;
    cursor: pointer;
    transition: background var(--theme-sync-duration) ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.theme-toggle-checkbox:checked + .theme-toggle-label {
    background: linear-gradient(135deg, #434343 0%, #000000 100%);
}

.theme-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 28px;
    height: 28px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform var(--theme-sync-duration) cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-checkbox:checked + .theme-toggle-label .theme-toggle-slider {
    transform: translateX(36px);
}

.sun-icon {
    width: 18px;
    height: 18px;
    opacity: 1;
    transition: opacity var(--theme-sync-duration) ease, transform var(--theme-sync-duration) ease;
}

.theme-toggle-checkbox:checked + .theme-toggle-label .sun-icon {
    opacity: 0;
    transform: rotate(180deg) scale(0);
}

.moon-icon {
    width: 16px;
    height: 16px;
    position: absolute;
    opacity: 0;
    transition: opacity var(--theme-sync-duration) ease, transform var(--theme-sync-duration) ease;
    transform: rotate(-180deg) scale(0);
}

.theme-toggle-checkbox:checked + .theme-toggle-label .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.main-image-frame {
    width: 425px;
    max-width: 100%;
    height: 256px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    background-color: var(--bg-color);
    transition: background-color var(--theme-sync-duration) ease;
    box-sizing: border-box;
}

.main-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    vertical-align: top;
    opacity: 1;
    transition: opacity var(--main-image-fade-duration) ease;
    will-change: opacity;
}

body.dark-theme table, body.dark-theme td {
    color: var(--text-color);
}

body.dark-theme img:not(.theme-icon):not(.main-image) {
    filter: brightness(0.95);
    transition: filter var(--theme-sync-duration) ease;
}

body.dark-theme font {
    color: inherit;
}

body:not(.dark-theme) table,
body:not(.dark-theme) td,
body:not(.dark-theme) th {
    color: var(--text-color);
}

body:not(.dark-theme) font:not([color]) {
    color: inherit;
}

body:not(.dark-theme) li,
body:not(.dark-theme) dd,
body:not(.dark-theme) dt,
body:not(.dark-theme) blockquote,
body:not(.dark-theme) center {
    color: var(--text-color);
}

body:not(.dark-theme) pre {
    color: var(--text-color);
}

.theme-toggle-label:hover {
    transform: scale(1.05);
}

.theme-toggle-label:active {
    transform: scale(0.98);
}

.collections-title {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.collections-box {
    display: inline-block;
    padding: 20px 30px;
    border: 2px solid #667eea;
    border-radius: 15px;
    background: rgba(102, 126, 234, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.5s ease;
    text-align: left;
}

body.dark-theme .collections-box {
    border: 2px solid #434343;
    background: rgba(67, 67, 67, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.collections-box ul {
    margin: 0;
    padding-left: 0;
    list-style-position: inside;
}

@media (max-width: 768px) {
    body {
        padding-top: 56px;
        padding-left: 12px;
        padding-right: 12px;
        font-size: 16px;
        -webkit-text-size-adjust: 100%;
    }

    div:has(> a.home-button) {
        top: 12px !important;
        left: 12px !important;
        padding: 4px;
    }
    a.home-button {
        padding: 10px 14px !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        font-size: 15px;
    }

    .theme-toggle-container {
        top: 12px !important;
        right: 12px !important;
    }
    .theme-toggle-label {
        width: 70px;
        min-height: 44px;
        height: 44px;
        padding: 8px 0;
        box-sizing: border-box;
    }
    .theme-toggle-slider {
        width: 28px;
        height: 28px;
    }
    .theme-toggle-checkbox:checked + .theme-toggle-label .theme-toggle-slider {
        transform: translateX(36px);
    }
    .theme-toggle-slider {
        position: relative;
    }
    .theme-toggle-slider .sun-icon,
    .theme-toggle-slider .moon-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        margin: 0;
    }
    .theme-toggle-slider .sun-icon {
        transform: translate(-50%, -50%);
    }
    .theme-toggle-checkbox:checked + .theme-toggle-label .theme-toggle-slider .sun-icon {
        transform: translate(-50%, -50%) rotate(180deg) scale(0);
    }
    .theme-toggle-slider .moon-icon {
        transform: translate(-50%, -50%) rotate(-180deg) scale(0);
    }
    .theme-toggle-checkbox:checked + .theme-toggle-label .theme-toggle-slider .moon-icon {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }

    a:not([href*="fems.lol"]) {
        padding: 8px 14px !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        margin: 6px 4px;
        font-size: 15px;
    }

    td, th, p, li, blockquote, center {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    table {
        width: 100% !important;
        max-width: 100%;
        table-layout: fixed;
    }
    table td {
        text-align: center;
    }
    table td p {
        text-align: center;
    }
    table a:not([href*="fems.lol"]) {
        max-width: 100%;
        box-sizing: border-box;
        white-space: normal;
    }
    pre {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    img {
        max-width: 100% !important;
        height: auto !important;
    }
    .main-image-frame {
        max-width: 100%;
        width: 100%;
        height: auto;
        min-height: 180px;
    }

    .collections-box {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 16px 20px;
    }
    .collections-box ul {
        font-size: 17px;
    }
    .collections-box a {
        display: block;
        margin: 8px 0;
    }

    html {
        overflow-x: hidden;
    }
    body {
        overflow-x: hidden;
    }
}