:root {
    --scale: 0.75;
    --bg-dark: #000000;
    --bg-light: #ffffff;
    --fg-dark: #ffffff;
    --fg-light: #000000;
    --accent: #a855f7;
    --accent-light: rgba(168, 85, 247, 0.15);
    --border-dark: rgba(255, 255, 255, 0.2);
    --border-light: rgba(0, 0, 0, 0.2);
    --card-dark: rgba(0, 0, 0, 0.5);
    --card-light: rgba(255, 255, 255, 0.9);
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
body {
    background: var(--bg-dark);
    color: var(--fg-dark);
    font-family: system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
    touch-action: manipulation;
    font-size: 16px;
}
body.light {
    background: var(--bg-light);
    color: var(--fg-light);
}
.nav {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 500;
}
.nav-btn {
    background: rgba(0, 0, 0, 0.75);
    border: 2px solid var(--fg-dark);
    color: var(--fg-dark);
    font-size: 20px;
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 10px;
    backdrop-filter: blur(6px);
    transition: background 0.2s;
    user-select: none;
    min-height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.light .nav-btn {
    border-color: var(--fg-light);
    color: var(--fg-light);
}
.nav-btn:hover, .nav-btn:active {
    background: rgba(255, 255, 255, 0.12);
}
.nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid var(--fg-dark);
    border-radius: 10px;
    padding: 8px 0;
    min-width: 140px;
    backdrop-filter: blur(10px);
    margin-top: 5px;
    z-index: 1000;
}
body.light .nav-menu {
    border-color: var(--fg-light);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.nav-menu a {
    display: block;
    width: 100%;
    padding: 10px 16px;
    color: var(--fg-dark);
    text-decoration: none;
    font-family: monospace;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}
body.light .nav-menu a {
    color: var(--fg-light);
}
.nav-menu a:hover, .nav-menu a:active {
    background: rgba(255, 255, 255, 0.12);
}
.nav-menu a.active {
    color: var(--accent);
    background: var(--accent-light);
}
#snow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}
.options-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.75);
    border: 2px solid var(--fg-dark);
    color: var(--fg-dark);
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
    z-index: 200;
    backdrop-filter: blur(6px);
    transition: all 0.2s;
    font-size: 14px;
    user-select: none;
    min-height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.light .options-btn {
    border-color: var(--fg-light);
    color: var(--fg-light);
}
.options-btn:hover, .options-btn:active {
    background: rgba(255, 255, 255, 0.12);
}
.panel {
    position: fixed;
    top: 56px;
    right: 12px;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid var(--fg-dark);
    color: var(--fg-dark);
    border-radius: 12px;
    padding: 14px;
    width: 180px;
    display: none;
    z-index: 300;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}
body.light .panel {
    background: rgba(255, 255, 255, 0.98);
    border-color: var(--fg-light);
    color: var(--fg-light);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.panel label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 500;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.panel input[type="range"] {
    width: 100%;
    margin-bottom: 15px;
    accent-color: var(--accent);
    cursor: pointer;
    height: 6px;
    border-radius: 3px;
}
.theme-btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid var(--fg-dark);
    background: transparent;
    color: var(--fg-dark);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    font-size: 14px;
    margin-top: 5px;
}
body.light .theme-btn {
    border-color: var(--fg-light);
    color: var(--fg-light);
}
.theme-btn:hover, .theme-btn:active {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}
.wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 20px 40px;
    transform: scale(var(--scale));
    transform-origin: center;
    transition: transform 0.3s ease;
}
.card {
    position: relative;
    text-align: center;
    max-width: 400px;
    width: 100%;
    background: var(--card-dark);
    border: 2px solid var(--border-dark);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}
body.light .card {
    background: var(--card-light);
    border-color: var(--border-light);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}
.card:hover {
    transform: translateY(-5px);
}
.frame {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-dark);
}
body.light .frame {
    border-color: var(--border-light);
}
.frame h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--accent), #8a7dff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
    line-height: 1.2;
}
.subtitle {
    margin-top: 6px;
    font-size: 12px;
    opacity: 0.7;
    font-style: italic;
}
.desc {
    margin-bottom: 20px;
    line-height: 1.5;
    font-size: 14px;
    opacity: 0.9;
}
.desc p {
    margin-bottom: 12px;
}
.highlight {
    color: var(--accent);
    font-weight: 600;
}
.note-box {
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0;
    font-size: 13px;
    line-height: 1.4;
}
body.light .note-box {
    background: rgba(168, 85, 247, 0.05);
    border-color: rgba(168, 85, 247, 0.2);
}
.note-box p {
    margin: 6px 0;
}
.links {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid var(--accent);
    border-radius: 10px;
    text-decoration: none;
    color: var(--accent);
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    max-width: 240px;
    background: rgba(168, 85, 247, 0.1);
    user-select: none;
}
.link-btn:hover, .link-btn:active {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(168, 85, 247, 0.3);
}
.footer-links {
    margin-top: 15px;
    font-size: 11px;
    opacity: 0.6;
}
.footer-links a {
    color: var(--accent);
    text-decoration: none;
    margin: 0 4px;
    transition: opacity 0.2s;
}
.footer-links a:hover, .footer-links a:active {
    opacity: 1;
    text-decoration: underline;
}
.tooltip {
    display: none;
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 9999;
    pointer-events: none;
    max-width: 200px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
body.light .tooltip {
    background: rgba(0, 0, 0, 0.9);
    color: white;
}
@media (max-width: 768px) {
    .wrapper {
        padding: 70px 15px 30px;
    }
    .card {
        padding: 20px;
        max-width: 380px;
    }
    .frame h1 {
        font-size: 1.6rem;
    }
    .desc {
        font-size: 13px;
    }
    .link-btn {
        max-width: 220px;
        padding: 10px 18px;
        font-size: 13px;
    }
    .panel {
        width: 160px;
        padding: 12px;
        top: 52px;
        right: 10px;
    }
    .nav-menu {
        min-width: 130px;
    }
    .nav-menu a {
        padding: 8px 14px;
        font-size: 13px;
    }
}
@media (max-width: 480px) {
    body {
        font-size: 15px;
    }
    .wrapper {
        padding: 60px 12px 25px;
        transform-origin: top center;
    }
    .card {
        padding: 18px;
        max-width: 340px;
        border-radius: 14px;
    }
    .frame h1 {
        font-size: 1.4rem;
    }
    .subtitle {
        font-size: 11px;
    }
    .desc {
        font-size: 12.5px;
    }
    .note-box {
        font-size: 12px;
        padding: 10px;
    }
    .link-btn {
        max-width: 100%;
        font-size: 13px;
        padding: 11px 16px;
    }
    .panel {
        width: 150px;
        padding: 10px;
        top: 50px;
        right: 8px;
        font-size: 13px;
    }
    .panel input[type="range"] {
        margin-bottom: 12px;
    }
    .theme-btn {
        padding: 9px;
        font-size: 13px;
    }
    .nav-btn, .options-btn {
        padding: 7px 12px;
        font-size: 18px;
        min-height: 38px;
        min-width: 38px;
    }
    .nav-menu {
        min-width: 120px;
        padding: 6px 0;
    }
    .nav-menu a {
        padding: 7px 12px;
        font-size: 12px;
    }
    .footer-links {
        font-size: 10px;
    }
}
@media (max-width: 360px) {
    .card {
        max-width: 300px;
        padding: 16px;
    }
    .frame h1 {
        font-size: 1.3rem;
    }
    .panel {
        width: 140px;
        right: 6px;
    }
    .nav-btn, .options-btn {
        padding: 6px 10px;
        font-size: 16px;
    }
}
@media (max-height: 500px) and (orientation: landscape) {
    .wrapper {
        padding: 50px 15px 20px;
    }
    .card {
        padding: 15px;
        max-width: 320px;
    }
    .frame {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    .desc {
        margin-bottom: 15px;
        font-size: 12px;
    }
    .links {
        margin: 15px 0;
        gap: 8px;
    }
    .link-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}
@media (hover: none) and (pointer: coarse) {
    .nav-btn:hover,
    .options-btn:hover,
    .theme-btn:hover,
    .link-btn:hover,
    .nav-menu a:hover {
        transform: none;
        background: none;
    }
    .nav-btn:active,
    .options-btn:active {
        background: rgba(255, 255, 255, 0.12);
        transform: scale(0.95);
    }
    .theme-btn:active {
        background: var(--accent-light);
        transform: scale(0.98);
    }
    .link-btn:active {
        background: var(--accent);
        color: white;
        transform: translateY(-1px) scale(0.98);
    }
    .nav-menu a:active {
        background: rgba(255, 255, 255, 0.12);
    }
    * {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    }
}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .nav-btn,
    .options-btn,
    .theme-btn,
    .link-btn {
        border-width: 1.5px;
    }
    .card {
        border-width: 1.5px;
    }
    .frame {
        border-bottom-width: 1px;
    }
}
.offline-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 71, 87, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}
@keyframes slideIn {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
.offline-indicator.show {
    display: flex;
    align-items: center;
    gap: 8px;
}
.offline-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    animation: pulse 2s infinite;
}
html.offline::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff4757, #ff6b81);
    z-index: 9999;
    animation: slide 2s infinite linear;
}
@keyframes slide {
    0% { background-position: -100px 0; }
    100% { background-position: 100px 0; }
}
.about-btn {
    position: fixed;
    top: 12px;
    right: 90px;
    background: rgba(0, 0, 0, 0.75);
    border: 2px solid var(--fg-dark);
    color: var(--fg-dark);
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
    z-index: 200;
    backdrop-filter: blur(6px);
    transition: all 0.2s;
    font-size: 14px;
    user-select: none;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
body.light .about-btn {
    border-color: var(--fg-light);
    color: var(--fg-light);
}
.about-btn:hover, .about-btn:active {
    background: rgba(255, 255, 255, 0.12);
}
.link-corner {
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 10px;
    opacity: 0.6;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    background: rgba(0, 0, 0, 0.1);
    z-index: 2;
    pointer-events: auto;
}
body.light .link-corner {
    background: rgba(255, 255, 255, 0.2);
}
.link-btn {
    position: relative;
    overflow: hidden;
}
.link-corner:hover, .link-corner:active {
    opacity: 1;
    background: rgba(168, 85, 247, 0.2);
    transform: scale(1.05);
}
.faq-section {
    margin-top: 20px;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}
body.light .faq-section {
    background: rgba(168, 85, 247, 0.05);
    border-color: rgba(168, 85, 247, 0.2);
}
.faq-content h3 {
    margin: 0 0 15px 0;
    color: var(--accent);
    font-size: 18px;
    text-align: center;
}
.faq-content p {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
}
.faq-close {
    margin-top: 15px;
    width: 100%;
    padding: 10px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}
.faq-close:hover, .faq-close:active {
    background: var(--accent);
    color: white;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.nav-menu .faq-link {
    color: var(--accent);
}
.footer-links a[href="#faq"] {
    color: var(--accent);
}
@media (max-width: 480px) {
    .link-corner {
        top: 3px;
        right: 6px;
        font-size: 9px;
        padding: 1px 4px;
    }
    .faq-section {
        padding: 15px;
    }
    .faq-content h3 {
        font-size: 16px;
    }
    .faq-content p {
        font-size: 13px;
    }
}
@media (max-width: 360px) {
    .link-corner {
        font-size: 8px;
        padding: 1px 3px;
    }
}