* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a1a2e;
    background: linear-gradient(
        -45deg,
        #2f80ed,
        #56ccf2,
        #a367f7,
        #f2994a,
        #eb5757,
        #2f80ed
    );
    background-size: 400% 400%;
    animation: gradientShift 18s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 48px 56px;
    text-align: center;
    min-width: 320px;
}

h1 {
    margin: 0 0 32px;
    font-size: 24px;
    font-weight: 600;
}

.metrics {
    display: flex;
    gap: 48px;
    justify-content: center;
    margin-bottom: 32px;
}

.metric .value {
    font-size: 48px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #2c3e50;
    transition: color 0.2s;
}

.metric .value.active {
    color: #2f80ed;
}

.metric .label {
    margin-top: 4px;
    font-size: 13px;
    color: #8a8f98;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric .peak {
    margin-top: 6px;
    font-size: 12px;
    color: #b0b5bd;
    font-variant-numeric: tabular-nums;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: #e6e9ee;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 24px;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: #2f80ed;
    border-radius: 999px;
    transition: width 0.1s linear;
}

.button-row {
    display: flex;
    gap: 12px;
    justify-content: center;
}

button {
    background: #2f80ed;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

button:disabled {
    background: #a9c6f0;
    cursor: not-allowed;
}

#stopBtn {
    background: #eb5757;
}

.status {
    margin-top: 20px;
    font-size: 14px;
    color: #5b6270;
    min-height: 20px;
}

.result-summary {
    margin-top: 16px;
    padding: 16px 20px;
    background: #f6f8fb;
    border-radius: 10px;
    text-align: left;
}

.result-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 4px 16px;
    font-size: 14px;
    padding: 4px 0;
}

.result-row + .result-row {
    border-top: 1px solid #e6e9ee;
    margin-top: 4px;
    padding-top: 8px;
}

.result-label {
    color: #5b6270;
    font-weight: 600;
}

.result-value {
    color: #1a1a2e;
    font-variant-numeric: tabular-nums;
}

.debug-log {
    margin-top: 16px;
    background: #1a1a2e;
    border-radius: 10px;
    overflow: hidden;
    text-align: left;
}

.debug-log-header {
    padding: 8px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8a8f98;
    background: #12121f;
}

.debug-log pre {
    margin: 0;
    padding: 10px 14px;
    max-height: 160px;
    overflow-y: auto;
    font-family: "SF Mono", Consolas, monospace;
    font-size: 11px;
    line-height: 1.5;
    color: #a9e6b8;
    white-space: pre-wrap;
    word-break: break-word;
}
