.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 20px;
    /* margin-top: 32px;  */
}

body {
    background: url('/assets/img/background.png') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: hidden;
    font-family: 'Roboto Mono', 'Microsoft YaHei', 'PingFang SC', sans-serif;

}

#article-container {
    background: #FFF;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 700px;
    transition: height 0.25s ease-out;
}

#article {
    transition: transform 0.25s ease-out;
}

#article-container-wrapper.replaying #article-container {
    border: 4px solid #00b6ed;
}

#article-container-wrapper.result #article-container {
    height: 700px;
}

.replay-container {
    display: none;
}

#article-container-wrapper.replaying .replay-container {
    display: block;
}

.replay-container {
    position: relative;
}

.replay-container-text {
    background: #00b6ed;
    padding: 6px 20px;
    border-radius: 26px;
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    color: #FFF;
    z-index: 10;
}

.timer-container {
    position: relative;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.timer-container.active {
    opacity: 1;
    visibility: visible;
}

.timer-container-text {
    background: #365a92;
    padding: 6px 20px;
    border-radius: 16px;
    color: #FFF;
    font-weight: bold;
    font-size: 16px;
    letter-spacing: 1px;
    z-index: 10;
}

/* ── Result Overlay ── */
#article-container-wrapper {
    position: relative;
}

#article-container {
    position: relative;
}

.result-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #2a4775 0%, #024559 100%);
    border-radius: 8px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    overflow: hidden;
}

.result-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.result-overlay-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 14px 32px 18px;
    box-sizing: border-box;
}

.result-overlay-title {
    font-size: 28px;
    font-weight: 700;
    color: #FFF;
    text-align: center;
    letter-spacing: 8px;
    margin-bottom: 12px;
}

/* Two-column body */
.result-overlay-body {
    display: flex;
    gap: 24px;
    flex: 1;
    min-height: 0;
    border-top: 2px solid rgba(160, 230, 220, 0.45);
    border-bottom: 2px solid rgba(160, 230, 220, 0.45);
    padding: 24px 0;
}

.result-left {
    flex: 0 0 380px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-right {
    flex: 1;
    min-width: 0;
    position: relative;
}

.result-right canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Stat boxes */
.result-box {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(180, 230, 225, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
}

.result-box-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 0;
}

.result-box-row-primary {
    padding-bottom: 4px;
}

.result-box-label {
    font-size: 18px;
    color: #ffffff;
    flex: 1;
}

.result-box-value {
    font-size: 18px;
    font-weight: 700;
    color: #FFF;
}

.result-box-row-primary .result-box-value {
    font-size: 26px;
    color: #ffffff;
}

.result-box-unit {
    font-size: 11px;
    color: #FFF;
}

.result-box-row-primary .result-box-unit {
    font-size: 13px;
}

/* Score row */
.result-score-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 8px;
}

.result-score-stars {
    font-size: 24px;
    line-height: 1;
}

.result-score-number {
    font-size: 42px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.result-score-label {
    font-size: 18px;
    color: #eee;
    align-self: flex-end;
    margin-bottom: 4px;
}

/* Action buttons */
.result-actions {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin-top: 16px;
    padding-top: 12px;
}



.result-btn {
    padding: 12px 32px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(180, 240, 230, 0.5);
    color: #ffffff;
    font-family: 'Roboto Mono', monospace;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    border-radius: 32px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.result-btn:hover {
    background: #e6f3f1;
    color: #1a6060;
    border-color: #c8f5ed;
}

.result-box-row-primary {
    font-size: 24px;
    font-weight: 700;
    border-bottom: 1px solid rgba(160, 230, 220, 0.45);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.result-box-row-primary .result-box-label {
    font-size: 24px;
}

/* ── Hero Gauges Row ── */
.result-hero {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 36px;
    margin-bottom: 18px;
    flex-shrink: 0;
}

.result-gauge {
    position: relative;
    width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.result-gauge-center {
    width: 180px;
    align-items: center;
}

.gauge-svg {
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
}

.result-gauge-center .gauge-svg {
    width: 140px;
    height: 140px;
}

.gauge-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.18);
    stroke-width: 8;
}

.gauge-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 314.16;
    stroke-dashoffset: 314.16;
    transition: stroke-dashoffset 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-fill-accuracy {
    stroke: #f5c842;
}

.gauge-fill-time {
    stroke: rgba(255, 255, 255, 0.7);
}

.gauge-fill-wpm {
    stroke: #7ecfdf;
}

.gauge-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.gauge-value {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
}

.gauge-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 1px;
    margin-top: 2px;
}

.result-stars-row {
    font-size: 26px;
    letter-spacing: 2px;
    line-height: 1;
    display: flex;
    gap: 2px;
}

@keyframes starPop {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-20deg);
    }

    60% {
        opacity: 1;
        transform: scale(1.35) rotate(5deg);
    }

    80% {
        transform: scale(0.9) rotate(-3deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.result-stars-row .star {
    display: inline-block;
    opacity: 0;
    animation: starPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.result-stars-row .star-filled {
    color: #ffe44d;
    text-shadow: 0 0 10px rgba(255, 220, 60, 0.85);
}

.result-stars-row .star-empty {
    color: rgba(200, 240, 235, 0.3);
}

.result-hero-score {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: 6px;
}

.hero-score-number {
    font-size: 42px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    text-shadow: 0 0 20px rgba(100, 240, 210, 0.45);
}

.hero-score-unit {
    font-size: 16px;
    color: #ffffff;
}

.hero-score-label {
    font-size: 11px;
    color: #c0ede5;
    letter-spacing: 1px;
    margin-top: 2px;
    border-top: 1px solid rgba(160, 230, 220, 0.35);
    padding-top: 4px;
    width: 100%;
    text-align: center;
}