/* ============================================================
   Speed Comparison Block — Frontend Styles
   ============================================================ */

.scb-block {
    --scb-btn-default-bg: #c8f0c8;
    --scb-btn-default-text: #1a4a3a;
    --scb-btn-active-bg: #2d7a5f;
    --scb-btn-active-text: #ffffff;
    --scb-bar-color: #a8d840;
    --scb-icon-light: #a8d840;
    --scb-icon-dark: #2d7a5f;
    --scb-label-color: #333333;
    --scb-time-color: #555555;
    --scb-bg: #e8e8e8;
    --scb-bar-radius: 50px;
    --scb-transition: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);

    background: var(--scb-bg);
    padding: 32px 36px 40px;
    border-radius: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ---- Buttons ---- */
.scb-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
    padding-left: 130px; /* align with bar track */
}

.scb-btn {
    background: var(--scb-btn-default-bg);
    color: var(--scb-btn-default-text);
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.25s, color 0.25s, transform 0.15s;
    outline: none;
}

.scb-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    background-color: #d4e9f7 !important;
    color: #000 !important;
}

.scb-btn:active {
    transform: scale(0.97);
	background-color: #d4e9f7 !important;
	color: #000 !important;
}

.scb-btn:focus {
	background-color: #d4e9f7 !important;
	color: #000 !important;
}

.scb-btn--active:focus {
		background-color: #d4e9f7 !important;
	color: #000 !important;
}

.scb-btn--active {
    background-color: #d4e9f7 !important;
    color: #000 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ---- Rows ---- */
.scb-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.scb-tier-row {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 20px 0;
    position: relative;
}

/* ---- Tier Label ---- */
.scb-tier-label {
    min-width: 110px;
    text-align: right;
    padding-right: 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--scb-label-color);
    flex-shrink: 0;
}

/* ---- Bar Track ---- */
.scb-bar-track {
    flex: 1;
    height: 28px;
    background: transparent;
    position: relative;
    display: flex;
    align-items: center;
    overflow: visible;
}

.scb-bar {
    height: 28px;
    background: var(--scb-bar-color);
    border-radius: var(--scb-bar-radius);
    width: 0%;
    position: relative;
    min-width: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Clip counter strictly inside the bar */
    overflow: hidden;
    z-index: 0;
}

/* Subtle shine on the bar */
.scb-bar::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 8px;
    right: 8px;
    height: 6px;
    background: rgba(255,255,255,0.22);
    border-radius: 10px;
    pointer-events: none;
}

/* "Done" glow pulse when bar finishes */
.scb-bar.scb-bar--done {
    animation: scb-done-pulse 0.55s ease-out;
}

@keyframes scb-done-pulse {
    0%   { filter: brightness(1); }
    45%  { filter: brightness(1.3); }
    100% { filter: brightness(1); }
}

/* Counter — right-aligned inside the bar, clipped by overflow:hidden */
.scb-bar-counter {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    pointer-events: none;
    letter-spacing: 0.02em;
    z-index: 1;
}

/* ---- Donut Icon — rolls along bar tip ---- */
.scb-donut {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    position: absolute;
    top: 50%;
    left: 0px;
    margin-top: -24px;
    z-index: 2;
    will-change: transform, left;
    transition: none;
}

.scb-donut svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Bounce pop when donut arrives at the end */
.scb-donut--arrived {
    animation: scb-donut-arrive 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scb-donut-arrive {
    0%   { transform: rotate(var(--scb-final-rot, 0deg)) scale(1); }
    50%  { transform: rotate(var(--scb-final-rot, 0deg)) scale(1.25); }
    100% { transform: rotate(var(--scb-final-rot, 0deg)) scale(1); }
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .scb-block {
        padding: 20px 16px 28px;
    }
    .scb-buttons {
        padding-left: 0;
    }
    .scb-tier-label {
        min-width: 80px;
        font-size: 13px;
    }
    .scb-btn {
        font-size: 11px;
        padding: 8px 12px;
    }
    .scb-donut {
        width: 36px;
        height: 36px;
        margin-top: -18px;
    }
}
