
* {
   margin: 0;
   padding: 0;
   box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    color: #e2e8f0;
    min-height: 100vh;
    font-weight: 400;
}

header {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

header::before {
   content: '';
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background: radial-gradient(circle at 50% 50%, rgba(0, 255, 136, 0.1) 0%, transparent 70%);
   pointer-events: none;
}

header h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #00ff88;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 30px;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.container::before {
   content: '';
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   height: 1px;
   background: linear-gradient(90deg, transparent, #00ff88, transparent);
}

#startStopBtn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 auto 3rem auto;
    color: #000;
    background: linear-gradient(135deg, #00ff88 0%, #00cc66 100%);
    border: none;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 255, 136, 0.3);
    position: relative;
    overflow: hidden;
}

#startStopBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 255, 136, 0.4);
    background: linear-gradient(135deg, #00ff88 0%, #00aa55 100%);
}

#startStopBtn.running {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

#startStopBtn.running:hover {
    box-shadow: 0 15px 35px rgba(239, 68, 68, 0.4);
}

#startStopBtn::before {
   content: '';
   position: absolute;
   top: 0;
   left: -100%;
   width: 100%;
   height: 100%;
   background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
   transition: left 0.6s;
}

#startStopBtn:hover::before {
   left: 100%;
}

#test {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.testGroup {
    display: block;
    margin: 0 auto;
    text-align: center;
}

div.testArea {
    display: inline-block;
    width: 16em;
    height: 12.5em;
    position: relative;
    box-sizing: border-box;
    margin: 1em;
    background: rgba(51, 65, 85, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    transition: all 0.3s ease;
}

div.testArea:hover {
   transform: translateY(-4px);
   border-color: rgba(0, 255, 136, 0.3);
   box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

div.testArea2 {
    display: inline-block;
    width: 14em;
    height: 7em;
    position: relative;
    box-sizing: border-box;
    text-align: center;
    margin: 1em;
    background: rgba(51, 65, 85, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    transition: all 0.3s ease;
}

div.testArea2:hover {
   transform: translateY(-4px);
   border-color: rgba(0, 255, 136, 0.3);
   box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

div.testArea div.testName {
    position: absolute;
    top: 0.5em;
    left: 0;
    width: 100%;
    font-size: 1.25rem;
    z-index: 9;
    font-weight: 600;
    color: #00ff88;
    text-align: center;
}

div.testArea2 div.testName {
    display: block;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #00ff88;
    padding-top: 0.5em;
}

div.testArea div.meterText {
    position: absolute;
    bottom: 1.55em;
    left: 0;
    width: 100%;
    font-size: 3rem;
    z-index: 9;
    font-weight: 700;
    color: #00ff88;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
    line-height: 1;
    font-feature-settings: 'tnum';
    transition: color 0.3s ease;
}

div.testArea2 div.meterText {
    display: inline-block;
    font-size: 3rem;
    font-weight: 700;
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
    line-height: 1;
    font-feature-settings: 'tnum';
    transition: color 0.3s ease;
}

div.meterText:empty:before {
    content: "0";
}

div.testArea div.unit {
    position: absolute;
    bottom: 2em;
    left: 0;
    width: 100%;
    z-index: 9;
    font-weight: 500;
    color: #94a3b8;
    text-align: center;
    font-size: 1rem;
}

div.testArea2 div.unit {
    display: inline-block;
    font-weight: 500;
    color: #94a3b8;
    font-size: 1rem;
}

div.testArea canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    border-radius: 16px;
}

.avgGroup {
    display: block;
    margin: 2em auto;
    text-align: center;
}

.avgCircle {
    display: inline-block;
    width: 150px;
    height: 150px;
    margin: 1em;
    border-radius: 50%;
    border: 3px solid #00ff88;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.2);
    background: rgba(51, 65, 85, 0.4);
    backdrop-filter: blur(10px);
}

#ipArea {
    background: rgba(51, 65, 85, 0.6);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.1);
    margin: 30px 0;
}

#ipArea h2 {
    color: #00ff88;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#ip {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f1f5f9;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0, 255, 136, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.results-section {
   background: rgba(51, 65, 85, 0.6);
   backdrop-filter: blur(20px);
   border-radius: 16px;
   padding: 2rem;
   margin-top: 2rem;
   border: 1px solid rgba(148, 163, 184, 0.1);
   display: none;
}

.results-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
   gap: 1rem;
   margin: 1.5rem 0;
}

.result-item {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 0.75rem 1rem;
   background: rgba(0, 255, 136, 0.1);
   border-radius: 8px;
   border: 1px solid rgba(0, 255, 136, 0.2);
}

.result-label {
   font-weight: 500;
   color: #cbd5e1;
}

.result-value {
   font-weight: 700;
   color: #00ff88;
   font-size: 1.1rem;
}

.interpretation {
   padding: 1rem;
   border-radius: 8px;
   margin-top: 1rem;
   text-align: center;
   font-weight: 600;
}

.excellent { background: rgba(16, 185, 129, 0.2); border: 1px solid #10b981; color: #10b981; }
.good { background: rgba(59, 130, 246, 0.2); border: 1px solid #3b82f6; color: #3b82f6; }
.fair { background: rgba(245, 158, 11, 0.2); border: 1px solid #f59e0b; color: #f59e0b; }
.poor { background: rgba(239, 68, 68, 0.2); border: 1px solid #ef4444; color: #ef4444; }

.additional-info {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(51, 65, 85, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin: 0.5rem 0;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #94a3b8;
    font-weight: 500;
}

.info-value {
    color: #cbd5e1;
    font-weight: 600;
    font-family: monospace;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #00ff88 0%, #00cc66 100%);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

.share-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.share-btn:hover {
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

.download-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.download-btn:hover {
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

.restart-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.restart-btn:hover {
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.3);
}

.status-active {
   color: #00ff88 !important;
   text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
   animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
   0%, 100% {
       opacity: 1;
   }
   50% {
       opacity: 0.7;
   }
}

.text {
    margin-top: 40px;
    color: #e0e0e0;
}

.text h2 {
    color: #00ff88;
    font-size: 2rem;
    font-weight: 700;
    margin: 3rem 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #00ff88;
    position: relative;
}

.text h2::after {
   content: '';
   position: absolute;
   bottom: -2px;
   left: 0;
   width: 60px;
   height: 2px;
   background: linear-gradient(90deg, #00ff88, #00cc66);
}

.text h3 {
    color: #00cc66;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem 0;
}

.text h4 {
    color: #00aa55;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
}

.text p {
    margin: 1.5rem 0;
    color: #cbd5e1;
    line-height: 1.8;
    font-size: 1.05rem;
}

.text ul, .text ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.text li {
    margin: 0.75rem 0;
    color: #cbd5e1;
    line-height: 1.7;
}

.highlight-box {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 204, 102, 0.05) 100%);
    border-left: 4px solid #00ff88;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid rgba(0, 255, 136, 0.2);
    position: relative;
    overflow: hidden;
}

.highlight-box::before {
   content: '';
   position: absolute;
   top: 0;
   left: 0;
   width: 4px;
   height: 100%;
   background: linear-gradient(180deg, #00ff88, #00cc66);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.info-card {
    background: rgba(51, 65, 85, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    border-top: 4px solid #00ff88;
    border: 1px solid rgba(148, 163, 184, 0.1);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 255, 136, 0.3);
}

.info-card h4 {
    color: #00ff88;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: rgba(51, 65, 85, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.stats-table th,
.stats-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.stats-table th {
    background: linear-gradient(135deg, #00ff88 0%, #00cc66 100%);
    color: #000;
    font-weight: 600;
    font-size: 1rem;
}

.stats-table tr:hover {
    background: rgba(0, 255, 136, 0.05);
}

.stats-table td {
    color: #cbd5e1;
    font-weight: 500;
}

a {
    color: #00ff88;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

a:hover {
    color: #00cc66;
    text-decoration: underline;
}

@media all and (max-width: 768px) {
    body {
        font-size: 0.9em;
    }
    
    .container {
        margin: 10px;
        padding: 20px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    div.testArea, div.testArea2 {
        width: 90%;
        margin: 0.5em auto;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .avgCircle {
        width: 120px;
        height: 120px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .text h2 {
        font-size: 1.75rem;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

img {
    max-width: 100%;
    height: auto;
}
