:root {
    --bg-color: #0D0D0D;
    --surface-color: rgba(26, 26, 26, 0.7); 
    --primary-color: #FFFFFF;
    --accent-glow: rgba(255, 255, 255, 0.15);
    --muted-color: #8a8a8a;
    --border-color: rgba(255, 255, 255, 0.08);
    --font-heading: 'Unbounded', sans-serif;
    --font-body: 'Manrope', sans-serif;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --error-color: #e74c3c;
    --card-bg-color: #171717;
    --card-hover-bg-color: #222222;
}

html { 
    scroll-behavior: smooth; 
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    background-color: var(--bg-color);
    color: var(--primary-color);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
    line-height: 1.7; 
}

body.noscroll { 
    overflow: hidden; 
}

a { 
    color: var(--primary-color);
    text-decoration: none;
}
a:hover {
    text-decoration: none;
}

strong, b {
    color: var(--primary-color); 
    font-weight: 700;
}

ul {
    padding-left: 20px;
}

#particles-js {
    position: fixed;
    width: 100%; height: 100%;
    top: 0; left: 0;
    z-index: -1;
    background-color: var(--bg-color);
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}
#preloader img {
    width: 60px;
    height: auto;
    animation: pulse 1.5s infinite ease-in-out;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}
main.hidden-on-load {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.header {
    position: sticky; 
    top: 0; 
    left: 0; 
    width: 100%;
    z-index: 120;
    background: rgba(13, 13, 13, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    min-height: 72px; 
    padding: 0; 
}

body.is-index-page .header {
    position: fixed;
}

.container { 
    max-width: 1100px; 
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo { 
    height: 30px; 
} 

.logo-link {
    display: flex;
    align-items: center;
}

.nav-links { 
    display: flex; 
    align-items: center; 
    gap: 30px; 
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.nav-links a { 
    color: var(--muted-color); 
    text-decoration: none; 
    font-size: 0.9rem; 
    font-weight: 700; 
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-links a:hover { 
    color: var(--primary-color); 
}
.nav-links a svg {
    width: 18px;
    height: 18px;
}

.burger-menu {
    display: none; 
    width: 28px;   
    height: 22px;  
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    z-index: 110;

    flex-direction: column;
    justify-content: space-between; 
}


.burger-menu .bar1,
.burger-menu .bar2,
.burger-menu .bar3 {
    width: 100%;
    height: 3px; 
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

.burger-menu.open .bar1 {
    transform: translateY(9.5px) rotate(45deg);
}

.burger-menu.open .bar2 {
    opacity: 0;
}

.burger-menu.open .bar3 {
    transform: translateY(-9.5px) rotate(-45deg);
}

@media (max-width: 768px) {
    .burger-menu {
        display: flex;
    }
}

.burger-icon {
    width: 28px;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: all 0.2s ease-in-out;
    position: relative; 
}

.burger-icon::before,
.burger-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

.burger-icon::before {
    transform: translateY(-8px); 
}

.burger-icon::after {
    transform: translateY(8px); 
}

.burger-menu.open .burger-icon {
    background-color: transparent;
}

.burger-menu.open .burger-icon::before {
    transform: translateY(0) rotate(45deg); 
}

.burger-menu.open .burger-icon::after {
    transform: translateY(0) rotate(-45deg); 
}

.button {
    padding: 10px 20px; 
    border-radius: 14px; 
    text-decoration: none;
    font-weight: 700; 
    transition: all 0.2s ease;
    font-family: var(--font-body); 
    display: inline-block; 
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
}
.button:hover:not(:disabled) { 
    transform: translateY(-2px); 
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); 
    text-decoration: none;
}
.button-primary { 
    background: var(--primary-color); 
    color: #000; 
}
.button-primary:hover:not(:disabled) { 
    background: #e0e0e0; 
}

.header .button-primary {
    padding: 8px 18px;
    font-size: 0.9rem;
    border-radius: 12px;
}

.button-secondary { 
    background: transparent; 
    border-color: var(--border-color); 
    color: var(--muted-color); 
}
.button-secondary:hover:not(:disabled) { 
    background: var(--surface-color); 
    color: var(--primary-color); 
    border-color: rgba(255, 255, 255, 0.2); 
}
.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

main {
    padding: 80px 0;
}

h1, h2, h3, h4 { 
    font-family: var(--font-heading); 
    color: var(--primary-color);  
}
h1 { font-size: 3rem; margin-bottom: 30px; text-transform: uppercase;}
h2 { font-size: 1.8rem; text-transform: uppercase;}

.section-title { 
    text-align: center; 
    font-size: clamp(2.2rem, 7vw, 3rem);
    text-transform: uppercase;
    margin-bottom: 60px; 
    margin-top: 40px;
}

.card {
    background-color: var(--surface-color); 
    border: 1px solid var(--border-color); 
    padding: 25px; 
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at var(--mouse-x) var(--mouse-y),
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0) 25%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none; 
}

.card:hover::before {
    opacity: 1;
}


.card:hover { 
    transform: translateY(-5px); 
    border-color: rgba(255, 255, 255, 0.2); 
    box-shadow: 0 0 30px var(--accent-glow); 
}

.animate-on-scroll { 
    opacity: 0; 
    transform: translateY(20px); 
    transition: opacity 0.6s ease-out, transform 0.6s ease-out; 
}
.animate-on-scroll.visible { 
    opacity: 1; 
    transform: translateY(0); 
}

body.is-index-page main { padding-top: 0; }
body.is-index-page main > section { padding: 80px 0; }
body.is-index-page main > section:first-of-type { padding: 0; }
body.is-index-page #stats { padding-top: 40px; }
body.is-index-page .section-title {margin-top:0;}

.hero { 
    min-height: 100vh; 
    display: flex; 
    align-items: center; 
    padding: 120px 0 80px 0; 
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    gap: 60px;
}

.hero-text h1 {
    font-size: clamp(1.5rem, 5.5vw, 3.0rem);
    line-height: 1.25;
    text-transform: uppercase;
    margin: 0 0 30px 0;
    font-weight: 700;
}

.animated-word-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

.animated-word-wrapper.is-changing {
    opacity: 0;
    transform: translateY(10px);
}

#animated-icon {
    display: inline-block;
    color: var(--primary-color);
}
#animated-icon svg {
    width: 0.8em;
    height: 0.8em;
    vertical-align: -0.1em;
}

.hero-text p {
    font-size: 1.1rem;
    max-width: 500px;
    margin-bottom: 40px;
    color: var(--muted-color);
    line-height: 1.7;
}

.hero-cta-container {
    display: flex;
    gap: 15px;
    align-items: center;
}
.hero-cta-container .button {
    padding: 14px 30px;
    font-size: 1rem;
}

.hero-image {
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-image img {
    width: 100%;
    max-width: 400px;
    height: auto;
    filter: drop-shadow(0 0 50px var(--accent-glow)) 
            drop-shadow(0 0 20px rgba(20, 20, 20, 0.342));
}

#stats {
    padding-top: 0;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.stat-item {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
}
.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px auto;
    color: var(--primary-color);
}
.stat-icon svg {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.stat-item:hover .stat-icon svg {
    transform: scale(1.2) rotate(10deg);
}
.stat-item h3 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}
.stat-item p {
    color: var(--muted-color);
    font-size: 0.9rem;
}

.server-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; max-width: 800px; margin: 0 auto;}
.server-item { display: flex; justify-content: space-between; align-items: center; padding: 20px 25px;}
.server-info-container { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 15px; flex-wrap: wrap;}
.server-info { display: flex; align-items: center; gap: 16px; font-weight: 700; font-size: 1.1rem;}
.server-info .flag { width: 30px; height: auto; border-radius: 5px; border: 1px solid var(--border-color);}
.ping-container { display: flex; align-items: center; gap: 10px;}
.ping-status-dot { width: 10px; height: 10px; border-radius: 50%;}
.ping-status-dot.good { background-color: var(--success-color); box-shadow: 0 0 8px var(--success-color);}
.ping-status-dot.medium { background-color: var(--warning-color); box-shadow: 0 0 8px var(--warning-color);}
.ping-status-dot.bad { background-color: var(--error-color); box-shadow: 0 0 8px var(--error-color);}
.ping-value { font-weight: 700; color: var(--muted-color); min-width: 60px; text-align: right;}
.status-page-link-container { text-align: center; margin-top: 40px;}

.faq-list { display: flex; flex-direction: column; gap: 12px; max-width: 800px; margin: 0 auto;}

.faq-item {
    transition: background-color 0.2s ease;
}
.faq-item summary { 
    font-size: 1.2rem; 
    cursor: pointer; 
    list-style: none; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    position: relative;
    padding-right: 35px; 
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--muted-color);
    transition: transform 0.3s ease, color 0.3s ease;
}

.faq-item[open] > summary { 
    color: var(--primary-color);
    margin-bottom: 15px; 
}

.faq-item[open] > summary::after {
    transform: translateY(-50%) rotate(45deg);
    color: var(--primary-color);
}

.faq-answer {
    color: var(--muted-color);
    overflow: hidden;
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease-out;
}

.faq-answer > p {
    margin-bottom: 0;
    overflow: hidden;
}

.faq-item[open] > .faq-answer {
    grid-template-rows: 1fr;
}


#support { padding: 60px 0; }
#support-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}
.support-icon {
    color: var(--muted-color);
    margin-bottom: 20px;
}
.support-icon svg {
    transition: color 0.3s ease, transform 0.3s ease;
}
#support-card:hover .support-icon svg {
    color: #e74c3c;
    transform: scale(1.1);
}
.support-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    text-transform: uppercase;
    margin-bottom: 15px;
}
.support-text {
    color: var(--muted-color);
    max-width: 500px;
    margin: 0 auto 30px;
    line-height: 1.7;
}
#support-card .button-primary {
    font-size: 1rem;
    padding: 12px 28px;
}

#how-it-works {
    padding: 80px 0;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.step-item {
    text-align: center;
    position: relative;
    padding-top: 50px; 
}

.step-number {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 3rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.05);
    font-family: var(--font-heading);
    line-height: 1;
}

.step-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    color: var(--primary-color);
}
.step-icon svg {
    width: 100%;
    height: 100%;
}

.step-item h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.step-item p {
    color: var(--muted-color);
    font-size: 0.9rem;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .steps-grid {
        grid-template-columns: 1fr;
    }
}

.site-footer { background-color: #0a0a0a; padding: 60px 0 0 0; border-top: 1px solid var(--border-color); color: var(--muted-color); margin-top: auto; }
body:not(.is-setup-page) .site-footer { margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px;}
.footer-brand .footer-logo { height: 32px; margin-bottom: 15px;}
.footer-brand .footer-tagline { font-size: 0.9rem; line-height: 1.6; max-width: 250px;}
.footer-links h4 { font-family: var(--font-heading); color: var(--primary-color); font-size: 1rem; margin-bottom: 20px; text-transform: uppercase;}
.footer-links ul { list-style: none; padding: 0;}
.footer-links ul li { margin-bottom: 12px;}
.footer-links a { color: var(--muted-color); font-size: 0.9rem; transition: color 0.2s ease;}
.footer-links a:hover { color: var(--primary-color);}
.footer-bottom { padding: 25px 0; text-align: center; border-top: 1px solid var(--border-color);}
.footer-credits { margin-top: 25px; font-size: 0.8rem; color: var(--muted-color); }
.footer-credits a { color: var(--muted-color); transition: color 0.2s ease; text-decoration: none; }
.footer-credits a:hover { color: var(--primary-color); text-decoration: underline; }

@media (max-width: 992px) {
    .nav-links {
        gap: 20px;
    }
    .hero-grid {
        gap: 30px;
        grid-template-columns: 1fr 0.8fr;
    }
}


@media (max-width: 768px) {
    .nav-links { 
        position: fixed; 
        top: 0; 
        left: -100%; 
        width: 100%; 
        height: 100vh; 
        flex-direction: column; 
        justify-content: center; 
        align-items: center; 
        gap: 40px; 
        background-color: var(--bg-color); 
        transition: left 0.4s ease-in-out; 
        z-index: 105; 
        transform: none;
    }
    .nav-links.active { 
        left: 0;
    }
    .nav-links a { 
        font-size: 1.5rem; 
        color: var(--primary-color);
    }
    .burger-menu { 
        display: flex;
    }
    .header .button-primary { 
        display: none;
    }
    
    .hero {
        min-height: 100vh;
        padding: 72px 20px 60px 20px;
        justify-content: center;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
        align-items: center; 
    }
    .hero-text h1 {
        font-size: clamp(1.2rem, 8vw, 2.5rem); 
        line-height: 1.2;
        overflow-wrap: break-word;             
        -webkit-hyphens: auto;                 
        -ms-hyphens: auto;
        hyphens: auto;
    }
    .hero-text p {
        font-size: 1rem;
    }
    .hero-image {
        display: none;
    }
    .hero-cta-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    .hero-cta-container .button {
        width: 100%;
        max-width: 350px;
    }

    .section-title {
        font-size: clamp(2rem, 6vw, 2.5rem);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
    .stat-item h3 {
        font-size: 1.2rem;
    }

    .faq-list details summary {
        font-size: 1.1rem;
    }
    .support-title {
        font-size: 1.6rem;
    }
    .support-text {
        font-size: 0.95rem;
    }


    .footer-grid { 
        grid-template-columns: 1fr 1fr; 
        gap: 30px;
    }
    .footer-brand { 
        grid-column: 1 / -1; 
        text-align: center; 
        margin-bottom: 20px;
    }
    .footer-brand .footer-tagline, .footer-brand .footer-credits { 
        margin: 0 auto;
        margin-top: 15px;
    }
    
    .server-info-container {
        display: grid;
        grid-template-columns: 1fr auto; 
        align-items: center;
        gap: 15px;
    }

    body.is-ping-page main { padding-top: 40px; padding-bottom: 40px; }
    .main-info { 
        grid-template-columns: 1fr; 
        gap: 15px; 
        position: relative; 
    }
    .metrics-summary { 
        justify-content: flex-start; 
        border-top: 1px solid var(--border-color); 
        padding-top: 15px; 
    }
    .row-actions { 
        position: absolute; 
        top: 15px; 
        right: 15px; 
    }
    .panel-content { 
        flex-direction: column; 
        gap: 20px; 
        align-items: stretch; 
    }
    .details-panel .speed-test-btn { 
        min-width: 100%; 
    }
    .speed-test-controls { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 10px; 
    }
}
@media (max-width: 540px) {
    .selector-text h1 { 
        font-size: 3rem; 
    }
    .choice-card { 
        padding: 25px; 
    }
    .instruction-content { 
        padding: 25px; 
    }
    .import-method-manual { 
        text-align: center; 
    }

    .footer-grid { 
        grid-template-columns: 1fr; 
        text-align: center;
    }
    
    .card {
        padding: 20px;
    }
    #support-card {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    
    .metrics-summary { 
        display: grid; 
        grid-template-columns: 1fr 1fr 1fr; 
    }
    .metric-item { 
        min-width: 0; 
    }
    .file-size-selector { 
        display: grid; 
        grid-template-columns: 1fr 1fr; 
        width: 100%; 
    }

}

body.is-setup-page { 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh;
}
body.is-setup-page main { 
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}
body.is-setup-page main > .container { 
    max-width: 960px; 
}

.key-prompt-card { text-align: center; max-width: 500px; margin: 0 auto; padding: 40px; }
.key-prompt-card .prompt-icon { width: 48px; height: 48px; margin: 0 auto 20px; color: var(--muted-color); }
.key-prompt-card h2 { font-size: 1.7rem; margin-bottom: 10px; }
.key-prompt-card p { color: var(--muted-color); margin-top: 0; margin-bottom: 25px; }

.input-wrapper { position: relative; margin-bottom: 20px; }
.key-prompt-card input[type="text"] {
    width: 100%; padding: 14px; padding-right: 45px; border-radius: 8px; border: 1px solid var(--border-color); background-color: var(--bg-color); color: var(--primary-color); font-size: 1rem; font-family: var(--font-body); line-height: 1.5; transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.key-prompt-card input[type="text"]:focus { outline: none; border-color: rgba(255, 255, 255, 0.5); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1); }
.key-prompt-actions { display: flex; gap: 12px; }
#validation-icon { position: absolute; right: 5px; top: 0; width: 40px; height: 100%; display: flex; align-items: center; justify-content: center; transition: color 0.3s ease, opacity 0.3s ease; opacity: 0; }
#validation-icon.valid { color: var(--success-color); opacity: 1; }
#validation-icon.invalid { color: var(--error-color); opacity: 1; }
#validation-icon svg { width: 22px; height: 22px; }
input.valid { border-color: var(--success-color) !important; }
input.invalid { border-color: var(--error-color) !important; }
        
#platform-selector { display: flex; flex-direction: column; gap: 40px; align-items: center; width: 100%; text-align: center;}
.selector-text h1 { font-size: 4rem; line-height: 1.1; margin-bottom: 20px;}
.selector-text p { color: var(--muted-color); max-width: 450px; margin: 0 auto; font-size: 0.95rem; }
.platform-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; width: 100%; max-width: 600px; }
.platform-card { background-color: var(--card-bg-color); border: 1px solid var(--border-color); border-radius: 16px; padding: 25px 20px; text-align: center; cursor: pointer; transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s, box-shadow 0.2s; height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center;}
.platform-card:hover { transform: translateY(-5px); background-color: var(--card-hover-bg-color); }
.platform-card svg { width: 40px; height: 40px; margin-bottom: 15px; color: var(--primary-color);}
.platform-card h3 { font-size: 1rem; }
.platform-card.highlighted { border: 2px solid var(--primary-color); box-shadow: 0 0 25px rgba(255, 255, 255, 0.1); }

.instruction-content { background: var(--card-bg-color); border: 1px solid var(--border-color); border-radius: 16px; padding: 40px; max-width: 800px; margin: 0 auto; display: flex; flex-direction: column;}
.instruction-header { display: flex; align-items: center; gap: 20px; padding-bottom: 25px; margin-bottom: 25px; border-bottom: 1px solid var(--border-color); }
.instruction-header .header-icon { width: 48px; height: 48px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.instruction-header svg { width: 100%; height: 100%; }
.instruction-header h2 { margin: 0; padding: 0; font-size: 1.8rem; line-height: 1.2; }

.steps-container { min-height: 400px; flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
.instruction-step { width: 100%; }
.instruction-step h4 { font-size: 1.4rem; margin-bottom: 15px; text-align: center; font-family: var(--font-heading); text-transform: uppercase; letter-spacing: 1px; color: var(--muted-color); }
.step-content-wrapper { display: flex; flex-direction: column; align-items: center; text-align: center; }
.step-content-wrapper p { color: var(--muted-color); line-height: 1.7; font-size: 1rem; max-width: 550px; margin-bottom: 25px; }
.step-content-wrapper p code { background-color: var(--bg-color); padding: 3px 6px; border-radius: 6px; font-size: 0.9em; }

.download-button-wrapper { margin-top: 20px; }
.download-source-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; border-radius: 14px; padding: 12px 24px; text-decoration: none; }
.download-source-button svg { width: 22px; height: 22px; fill: #000; }

.primary-method a.button { padding: 12px 28px; font-size: 1rem; }
.primary-method p { font-size: 0.8rem; color: var(--muted-color); margin-top: 15px; line-height: 1.4; max-width: 400px; }

.alternatives-title { text-align: center; color: var(--muted-color); font-size: 0.85rem; margin-top: 30px; margin-bottom: 20px; position: relative; font-weight: 700; width: 100%; max-width: 500px; }
.alternatives-title::before, .alternatives-title::after { content: ''; position: absolute; top: 50%; width: 35%; height: 1px; background-color: var(--border-color); }
.alternatives-title::before { left: 0; }
.alternatives-title::after { right: 0; }

.import-methods { display: grid; grid-template-columns: auto 1fr; gap: 30px; align-items: center; max-width: 500px; width: 100%; }
.import-method-qr { display: flex; flex-direction: column; align-items: center; }
.qr-code-wrapper { background-color: white; padding: 10px; border-radius: 12px; border: 1px solid var(--border-color); transition: transform 0.2s ease, box-shadow 0.2s ease; display: inline-block; }
.qr-code-wrapper:hover { transform: scale(1.05); box-shadow: 0 0 15px var(--accent-glow); }
.qr-code-wrapper > div { display: flex; align-items: center; justify-content: center; }
.import-method-manual p { margin-bottom: 10px !important; text-align: left; font-size: 0.9rem; }
.manual-input-wrapper { display: flex; gap: 10px; width: 100%; }
.manual-input-wrapper input { width: 100%; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border-color); background-color: var(--bg-color); color: var(--primary-color); font-size: 0.9rem; flex-grow: 1; }
.copy-button { background: transparent; border: 1px solid var(--border-color); color: var(--muted-color); flex-shrink: 0; padding: 0 12px; cursor: pointer; border-radius: 8px; transition: all .2s ease; display: flex; align-items: center; justify-content: center; }
.copy-button:hover:not(:disabled) { background-color: var(--surface-color); color: var(--primary-color); }
.copy-button svg { width: 20px; height: 20px; }
.copy-button.copied { background-color: var(--success-color); border-color: var(--success-color); color: white; }

.slider-nav { display: flex; justify-content: space-between; align-items: center; padding-top: 25px; border-top: 1px solid var(--border-color); margin-top: 25px; }
.step-dots { display: flex; gap: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background-color: var(--border-color); transition: all 0.3s ease; }
.dot.active { background-color: var(--primary-color); transform: scale(1.2); box-shadow: 0 0 8px var(--primary-color); }
.instruction-footer { text-align: center; margin-top: 30px; }
.instruction-footer a { color: var(--muted-color); transition: color 0.2s ease; }
.instruction-footer a:hover { color: var(--primary-color); }

.choice-container-v4 { max-width: 850px; width: 100%; margin: 0 auto; }
.choice-grid-v4 { display: grid; grid-template-columns: 1fr 1.1fr; gap: 60px; align-items: center; }
.welcome-panel { text-align: left; }
.welcome-icon { width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; color: var(--muted-color); margin-bottom: 25px; }
.welcome-icon svg { width: 100%; height: 100%; }
.welcome-panel h1 { font-size: 3rem; line-height: 1.1; margin-bottom: 20px; }
.welcome-panel p { color: var(--muted-color); line-height: 1.7; max-width: 350px; }
.choice-list-v4 { display: flex; flex-direction: column; gap: 15px; }
.choice-item-v4 { display: flex; align-items: center; gap: 20px; background-color: var(--card-bg-color); border: 1px solid var(--border-color); padding: 20px; border-radius: 16px; text-decoration: none; color: var(--primary-color); transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease; }
.choice-item-v4:hover { transform: scale(1.03); border-color: rgba(255, 255, 255, 0.3); background-color: var(--card-hover-bg-color); }
.choice-item-icon { flex-shrink: 0; width: 44px; height: 44px; background-color: rgba(255, 255, 255, 0.05); border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.choice-item-icon svg { width: 24px; height: 24px; }
.choice-item-text { flex-grow: 1; text-align: left; }
.choice-item-text h3 { margin: 0 0 4px 0; font-size: 1.1rem; color: var(--primary-color); font-family: var(--font-heading); }
.choice-item-text span { font-size: 0.9rem; color: var(--muted-color); }
.choice-item-arrow { font-size: 1.5rem; color: var(--muted-color); transition: transform 0.2s ease, color 0.2s ease; }
.choice-item-v4:hover .choice-item-arrow { transform: translateX(5px); color: var(--primary-color); }

@media (max-width: 768px) {
    .choice-grid-v4 { grid-template-columns: 1fr; gap: 40px; }
    .welcome-panel { text-align: center; }
    .welcome-panel p { margin-left: auto; margin-right: auto; }
    .welcome-icon { margin: 0 auto 20px auto; }
    .welcome-panel h1 { font-size: 2.5rem; }
}

body.is-text-page main {
    padding-top: 40px;
}

.text-content {
    padding-bottom: 40px;
    max-width: 800px;
    margin: 0 auto;
}


.text-content h1 {
    font-family: var(--font-body); 
    font-size: 2.5rem;
    font-weight: 800; 
    line-height: 1.3;
    text-transform: none;
    border-bottom: none;
    margin-bottom: 8px;
}


.text-content h1 + p {
    font-size: 0.95rem;
    color: var(--muted-color);
    margin-bottom: 50px;
    font-style: normal;
}


.text-content h2 {
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 700; 
    text-transform: none;
    margin-top: 40px;
    margin-bottom: 20px;
}


.text-content p {
    margin-bottom: 24px;
    color: var(--muted-color);
    line-height: 1.8;
}


.text-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid var(--muted-color);
    padding-bottom: 1px;
    transition: all 0.2s ease;
}

.text-content a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}


.text-content ul {
    padding-left: 25px;
    list-style-type: none;
}

.text-content li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    color: var(--muted-color);
}


.text-content li::before {
    content: '—';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary-color);
    font-weight: 700;
}

.text-content strong {
    color: var(--primary-color);
    font-weight: 700;
}


@media (max-width: 768px) {
    .text-content h1 {
        font-size: clamp(1.8rem, 7vw, 2.0rem);
    }
    .text-content h2 {
        font-size: 1.3rem;
    }
}

.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
.fade-in { animation: fadeIn 0.3s ease forwards; }
.fade-out { animation: fadeOut 0.2s ease forwards; }
.button-with-icon { display: flex; align-items: center; justify-content: center; gap: 10px; }
.button-with-icon svg { width: 20px; height: 20px; fill: #000; }
.header-link { color: var(--muted-color); text-decoration: none; font-size: 0.9rem; font-weight: 700; transition: color 0.2s ease; margin-left: auto; }
.header-link:hover { color: var(--primary-color); }
body.is-setup-page .site-footer { display: none; }
.key-prompt-footer { margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--border-color); text-align: center; }
.key-prompt-footer a { color: var(--muted-color); font-size: 0.9rem; text-decoration: none; transition: color 0.2s ease; }
.key-prompt-footer a:hover { color: var(--primary-color); }

.ping-value .ping-unit {
    font-size: 0.8em;
    color: var(--muted-color);
    margin-left: 3px;
    opacity: 0.7;
}
.ping-value.loading {
    letter-spacing: 2px;
}
.button:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 0 0 25px var(--accent-glow);
}

#testimonials {
    background-color: var(--bg-color);
    padding: 80px 0;
    overflow: hidden;
}
#testimonials .container {
    max-width: 1200px;
}
.testimonial-marquee {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.testimonial-scroller {
    display: flex;
    width: 100%;
    position: relative;
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.testimonial-scroller:hover .testimonial-track {
    animation-play-state: paused;
}
.testimonial-track {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
    will-change: transform;
}
.testimonial-scroller[data-direction="left"] .testimonial-track {
    animation: scroll-left 50s linear infinite;
}
.testimonial-scroller[data-direction="right"] .testimonial-track {
    animation: scroll-right 50s linear infinite;
}
@keyframes scroll-left {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
@keyframes scroll-right {
    from { transform: translateX(-50%); }
    to { transform: translateX(0); }
}
.testimonial-card-v2 {
    width: 320px;
    flex-shrink: 0;
    padding: 25px;
    background-color: var(--card-bg-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.testimonial-card-v2:hover {
    transform: translateY(-5px);
    background-color: var(--card-hover-bg-color);
}
.testimonial-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.testimonial-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}
.testimonial-author-v2 {
    font-weight: 700;
    font-size: 1.1rem;
    font-family: var(--font-heading);
}
.testimonial-stars-v2 {
    font-size: 1rem;
    color: var(--warning-color);
}
.testimonial-text-v2 {
    font-size: 0.95rem;
    color: var(--muted-color);
    line-height: 1.6;
    flex-grow: 1;
}

.donation-progress-container {
    width: 100%;
    max-width: 400px;
    margin-bottom: 30px;
}
.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted-color);
    margin-bottom: 10px;
}
#donation-percentage {
    color: var(--primary-color);
}
.progress-bar-bg {
    width: 100%;
    height: 10px;
    background-color: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}
#donation-progress-bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #5e5ce6, #785ce9);
    border-radius: 5px;
    transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.diagnostic-container {
    max-width: 850px;
    width: 100%;
}
body.is-ping-page main {
    display: flex;
    justify-content: flex-start; 
    align-items: flex-start; 
    flex-grow: 1;
    padding: 60px 20px; 
    min-height: calc(100vh - 72px);
}
body.is-ping-page.results-active main {
    align-items: flex-start;
}

#results-view {
    width: 100%;
}

.results-header {
    display: flex;
    flex-direction: column; 
    align-items: center; 
    text-align: center; 
    margin-bottom: 40px; 
}
.results-header h1 {
    font-size: clamp(2.2rem, 7vw, 3rem); 
    margin: 0 0 10px 0;
    line-height: 1.2; 
}
.results-header p {
    font-size: 1.1rem;
    color: var(--muted-color);
    max-width: 500px;
    margin: 0 auto 30px auto;
}
.results-header .button-large {
    padding: 14px 30px;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.results-header .button-large svg { width: 20px; height: 20px; }


.radar-animation {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 300px; height: 300px;
    z-index: -1;
    opacity: 0.1;
}
.radar-circle {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border: 1px solid var(--primary-color);
    border-radius: 50%;
    animation: radar-pulse 4s infinite cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.radar-circle:nth-child(2) { animation-delay: 1.3s; }
.radar-circle:nth-child(3) { animation-delay: 2.6s; }
@keyframes radar-pulse {
    0% { transform: scale(0); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}

.server-list-v2 {
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: filter 0.3s ease, opacity 0.3s ease;
}
.server-list-v2.re-testing {
    filter: blur(2px);
    opacity: 0.6;
    pointer-events: none;
}
.server-row {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    transition: all 0.3s ease;
    overflow: hidden;
}
.server-row:hover:not(.expanded) {
    background-color: var(--card-hover-bg-color);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}
.server-row.best {
    border-color: var(--success-color);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.15);
}
.server-row.error { opacity: 0.6; border-style: dashed; }

.main-info {
    display: grid;
    grid-template-columns: 2fr 3fr auto;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
    cursor: pointer;
}
.server-details { display: flex; align-items: center; gap: 15px; font-weight: 700; }
.server-details .flag { width: 28px; height: auto; border-radius: 4px; }
.best-tag {
    background-color: var(--success-color);
    color: var(--bg-color);
    font-size: 0.7rem; font-weight: 700;
    padding: 3px 8px; border-radius: 6px; text-transform: uppercase;
}
.metrics-summary { display: flex; justify-content: space-around; gap: 15px; font-size: 0.9rem; }
.metric-item { text-align: center; min-width: 80px; }
.metric-item .label { font-size: 0.8rem; color: var(--muted-color); }
.metric-item .value { display: block; font-weight: 700; margin-top: 2px; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; }
.expand-arrow { color: var(--muted-color); transition: transform 0.3s ease; padding: 5px; }
.server-row.expanded .expand-arrow { transform: rotate(180deg); }

.details-panel {
    max-height: 0;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}
.server-row.expanded .details-panel { max-height: 300px; opacity: 1; padding: 0 20px 20px 20px; }
.panel-content {
    background-color: var(--bg-color);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.speed-test-controls { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.speed-test-controls .controls-label { font-size: 0.9rem; color: var(--muted-color); font-weight: 700; white-space: nowrap; }
.file-size-selector { display: flex; gap: 8px; }
.button-size {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--muted-color);
    padding: 6px 12px; border-radius: 8px; cursor: pointer;
    font-size: 0.8rem; font-weight: 700; transition: all 0.2s;
}
.button-size:hover { color: var(--primary-color); }
.button-size.active { background-color: var(--primary-color); color: var(--bg-color); }

.details-panel .speed-test-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 0.9rem;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    min-width: 260px;
}
.details-panel .speed-test-btn .loader { width: 16px; height: 16px; }

.speed-test-btn.cancel-mode {
    background-color: var(--error-color);
    border-color: var(--error-color);
    color: var(--primary-color);
}
.speed-test-btn.cancel-mode:hover {
    background-color: #c0392b;
    border-color: #c0392b;
}
.speed-test-btn.cancel-mode svg { width: 18px; height: 18px; }

.speed-progress-container {
    padding: 15px 20px 0px 20px;
    transition: opacity 0.3s, visibility 0.3s, min-height 0.4s ease-out;
    min-height: 30px;
}
.speed-progress-container.hidden {
    opacity: 0;
    visibility: hidden;
    min-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}
.progress-bar {
    width: 100%; height: 8px; background-color: var(--border-color);
    border-radius: 4px; overflow: hidden; margin-bottom: 8px;
}
.progress-bar-fill {
    width: 0%; height: 100%;
    background: linear-gradient(90deg, var(--success-color), #27ae60);
    border-radius: 4px; transition: width 0.25s linear;
}
.progress-bar-fill.error { background: var(--error-color); width: 100% !important; }
.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--muted-color);
    font-weight: 700;
}
.progress-text-left, .progress-text-right { text-align: left; }
.progress-text-right { text-align: right; white-space: nowrap; }

.loader {
    width: 18px; height: 18px; border: 2px solid #FFF;
    border-bottom-color: transparent; border-radius: 50%;
    display: inline-block; animation: rotation 1s linear infinite;
}
.loader-small {
     width: 12px; height: 12px; border: 2px solid var(--muted-color);
     border-bottom-color: transparent; border-radius: 50%;
     display: inline-block; animation: rotation 1s linear infinite;
}
@keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

@media (max-width: 768px) {
    body.is-ping-page main { padding-top: 40px; padding-bottom: 40px; }
    .main-info { grid-template-columns: 1fr; gap: 15px; position: relative; }
    .metrics-summary { justify-content: flex-start; border-top: 1px solid var(--border-color); padding-top: 15px; }
    .row-actions { position: absolute; top: 15px; right: 15px; }
    .panel-content { flex-direction: column; gap: 20px; align-items: stretch; }
    .details-panel .speed-test-btn { min-width: 100%; }
    .speed-test-controls { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (max-width: 480px) {
    .metrics-summary { display: grid; grid-template-columns: 1fr 1fr 1fr; }
    .metric-item { min-width: 0; }
    .file-size-selector { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
}

.button.loading-state {
    background-color: var(--surface-color) !important;
    color: var(--muted-color) !important;
    border-color: var(--border-color) !important;
    pointer-events: none; 
    cursor: wait;
}

.button.loading-state:hover {
    transform: none;
    box-shadow: none;
}

.button.loading-state .loader {
    border: 2px solid var(--muted-color);
    border-bottom-color: transparent;
}

.error-container-v3 {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px; 
    position: relative;
    z-index: 1;
    gap: 5vw;
}

.error-code {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-right: 5vw;
    border-right: 2px solid var(--border-color);
}

.error-code span:first-child {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-family: var(--font-heading);
    color: var(--muted-color);
    text-transform: uppercase;
    line-height: 1;
    letter-spacing: 1px;
}

.error-code span:last-child {
    font-size: clamp(8rem, 25vw, 14rem);
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 0.85;
    color: var(--primary-color);
}

.error-details {
    max-width: 400px;
    text-align: left;
}

.error-details h2 {
    font-size: 2rem;
    text-transform: none;
    font-weight: 700;
    margin-bottom: 15px;
}

.error-details p {
    color: var(--muted-color);
    margin-bottom: 30px;
    line-height: 1.7;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .error-container-v3 {
        flex-direction: column;
        gap: 40px; 
    }

    .error-code {
        flex-direction: column; 
        align-items: center;    
        border-right: none;
        border-bottom: 2px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 30px;
        width: 100%;
    }

  
    .error-code span:first-child {
        font-size: 1.2rem;
        text-align: center;
        margin-bottom: -0px; 
    }

    .error-code span:last-child {
        font-size: clamp(8rem, 30vw, 10rem); 
        line-height: 1;
    }

    .error-details {
        text-align: center;
    }
    
    .error-details h2 {
        font-size: 1.5rem;
    }
}