:root {
    --bg-page: linear-gradient(180deg, #34424D 0%, #44535E 100%);
    --bg-console: linear-gradient(180deg, #1F2B34 0%, #44535E 100%); /*34424D*/
    --blue-btn: #34A8FF;
    --grey-btn: #5E6F7A;
    --box-shadow: 0px 73px 29px rgba(0, 0, 0, 0.01), 0px 41px 25px rgba(0, 0, 0, 0.05), 0px 18px 18px rgba(0, 0, 0, 0.09), 0px 5px 10px rgba(0, 0, 0, 0.1), inset 0px -12px 12px 4px rgba(0, 36, 136, 0.08);
    --feedback-shadow: 0px -64px 29px rgba(0, 0, 0, 0.01), 0px 41px 25px rgba(0, 0, 0, 0.05), 0px 18px 18px rgba(0, 0, 0, 0.09), 0px 5px 10px rgba(0, 0, 0, 0.1), inset 0px -12px 12px 4px rgba(0, 36, 136, 0.08);
    --light-txt: #ffffff99;
    --accent: #58a6ff;
    --error: #f85149;
    --success: #3fb950;
    --neutral-card: #5E6F7A;
    --card-bg: #252F39;
    --card-width: 160px;
    --card-height: 190px;
    --card-img-h: 100px;
    --card-font-size: 1rem;
    --top-min: calc(env(safe-area-inset-top) + 10px);
    --bottom-min: calc(env(safe-area-inset-bottom) + 20px);
    --top-part: calc(env(safe-area-inset-top) + 140px);
    --bottom-part: calc(env(safe-area-inset-bottom) + 240px);
    --logo-main-width: 180px;
    --feedback-origin: translate(-50%,101%);
    --feedback-position: translate(-50%,-10px);
    --feedback-width: calc(100% - 20px);
    --feedback-left: 50%;
    --feedback-radius: 48px;
    --ease-interactive: cubic-bezier(0.2, 0.8, 0.2, 1);
    --duration-animation: 0.4s;
    --breakpoint-tablet: 481px;
    --gap-width: 12px;
}
* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
@media (min-height: 700px) {
    :root {
        --logo-main-width: 240px;
    }
    .settings-grid { column-count: 3; }
}
@media (max-width: 400px) {
    .settings-grid { column-count: 1; }
}
@media screen and (min-width: 481px) {
    :root {
        --feedback-width: 400px;
        --card-width: 180px;
        --card-height: 220px;
        --card-img-h: 120px;
        --card-font-size: 1.05rem;
        --gap-width: 14px;
    }

    .century-nav--left { left: 10px; }
    .century-nav--right { right: 10px; }
}
@media screen and (min-width: 481px) and (min-height: 900px) {
    :root {
        --card-width: 200px;
        --card-height: 250px;
        --card-img-h: 140px;
        --card-font-size: 1.1rem;
        --gap-width: 16px;
    }
    #marker-layer::after {
        content: url(img/icon-up.svg); opacity: 0.6; width: 20px;
        position: absolute; bottom: -26vh; left: -10px;
    }
}
@media screen and (min-width: 600px) and (min-height: 900px) {
    :root {
        --card-width: 220px; --card-height: 280px; --card-img-h: 160px;
        --card-font-size: 1.2rem;
        --gap-width: 18px;
    }
}

body, html {
    margin: 0; padding: 0;
    background: var(--bg-page);
    background: linear-gradient(180deg, #34424D 0%, #44535E 100%);
    color: white;
    font-family: 'SF Pro Display', -apple-system, sans-serif;
    height: 100lvh; width: 100vw;
    overflow: hidden;
    touch-action: none;
}
#welcome-grey-btns {
    width: 100%; max-width: 160px; display: flex; flex-direction: column; gap: 20px; margin-bottom: 40px; justify-content: center;
}
#welcome-grey-btns button {
    justify-content: center;}
hr.divider {
    width: 100%; height: 1px; margin: 0 auto;
    border: none; background: var(--grey-btn);
}
.uppercase { text-transform: uppercase;}

/* --- FAILSAFE --- */
#failsafe {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; z-index: 20000;
    display: none; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 20px; box-sizing: border-box;
}

/* --- GAME SURFACE (SCROLL) --- */
#game-surface {
    position: absolute; top: 0; left: 0; 
    width: 100vw; height: 100dvh;
    overflow-x: scroll; overflow-y: hidden;
    display: flex; align-items: flex-start;
    scrollbar-width: none;
    z-index: 10;
    touch-action: pan-x; 
    -webkit-overflow-scrolling: touch;
    align-items: center;
    padding-top: var(--top-part);
    padding-bottom: var(--bottom-part);
    box-sizing: border-box;
}
#game-surface::-webkit-scrollbar { display: none; }
#timeline { 
    display: flex; align-items: center; 
    height: var(--card-height); pointer-events: none;
}
.spacer { width: 50vw; flex-shrink: 0; }

/* --- UI LAYERS --- */
#fixed-ui {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh;
    pointer-events: none; z-index: 100;
}

.century-nav {
    position: absolute;
    top: calc((100dvh + var(--top-part) - var(--bottom-part)) / 2 - (var(--card-height) / 2) - 30px);
    min-height: 36px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 1.5px;
    color: var(--light-txt);
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    cursor: pointer;
    user-select: none;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    --century-nav-shift: 0px;
    transform: translateY(-50%) translateX(var(--century-nav-shift));
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
    z-index: 50;
}

.century-nav--left { left: 6px; }
.century-nav--right { right: 6px; }

.century-nav.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0s;
}

.century-nav.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.century-nav.is-enter-from-left {
    --century-nav-shift: -6px;
    opacity: 0;
}

.century-nav.is-enter-from-right {
    --century-nav-shift: 6px;
    opacity: 0;
}

.century-nav.is-leaving-left {
    --century-nav-shift: -6px;
    opacity: 0;
    pointer-events: none;
}

.century-nav.is-leaving-right {
    --century-nav-shift: 6px;
    opacity: 0;
    pointer-events: none;
}

.century-nav-arrow {
    width: 12px;
    height: 12px;
    vertical-align: middle;
    opacity: 0.7;
    margin: 0 4px;
}

#overlay-welcome {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-page); z-index: 9000;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; box-sizing: border-box;
    pointer-events: auto;
}

/* --- HEADER --- */
#header {
    position: absolute; top: calc(env(safe-area-inset-top) + 20px); left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; width: 90%;
}
#logo-main { width: 220px; margin-bottom: 15px; }

#stats-bar {
    background: rgba(0,0,0,0.5); padding: 8px 16px; border-radius: 30px;
    display: flex; gap: 15px; align-items: center; font-size: 0.85rem;
    backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1);
}
.hearts { display: flex; gap: 4px; }
.heart-icon { width: 18px; height: 18px; }

/* --- MARKER --- */
#marker-layer {
    position: fixed; left: 50%; transform: translateX(-50%); margin-top: -16px;
    height: calc(var(--card-height) + 80px); width: 2px; background: var(--light-txt);
    z-index: 1; opacity: 0.5; pointer-events: none;
}
.time-label {
    position: absolute; top: 10px; width: 80px; font-weight: bold; font-size: 0.7rem;
    color: var(--light-txt); letter-spacing: 2px;
    transition: opacity 0.16s ease, visibility 0s linear 0.16s;
}

@media (max-width: 480px) {
    #marker-layer.hide-time-labels .time-label {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.16s ease, visibility 0s linear 0s;
    }
}


/* --- CARDS --- */
.card {
    width: var(--card-width); height: var(--card-height); font-size: var(--card-font-size);
    background: var(--card-bg); border-radius: 16px; padding: 8px;
    box-sizing: border-box; display: flex; flex-direction: column;
    border: 1px solid rgba(255,255,255,0.1); text-align: center;
    flex-shrink: 0; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative; transition: transform var(--duration-animation) ease;
    pointer-events: auto;
}
.card img { width: 100%; height: var(--card-img-h); object-fit: cover; border-radius: 10px; pointer-events: auto; cursor: pointer;}
.card-meta { display: flex; flex-direction: column; align-items: center; position: relative; flex-grow: 1;}
.card .year {
    color: #fff; font-weight: bold; font-size: 0.85em;
    line-height: 1.2; min-height: 1.2em; margin-top: -12px; padding: 4px 8px; border-radius: 6px;
    background: var(--card-bg);
}
.card .year-placeholder { visibility: hidden; }
.card h4 {
    font-size: 0.75em; margin: 6px 0 0; height: 60px;
    overflow: hidden; line-height: 1.4; font-weight: 500; color: var(--light-txt);
}
.card .series-mini {
    position: absolute;
    bottom: 2px; right: 2px;
    font-size: 0.58em;
    line-height: 1.2;
    color: #69767e;
    min-height: 1.2em;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gap { width: var(--gap-width); flex-shrink: 0; height: 100px; }

.card.timeline-card { z-index: 15; pointer-events: auto;}
.preview-card {
    z-index: 5000 !important; border: 1px solid var(--accent) !important;  pointer-events: none;
    transition: transform 0.6s var(--ease-interactive), opacity 0.3s ease;
    will-change: transform;
}
#active-card-slot { position:relative; top: -16px; pointer-events: none; }

.spread-left { transform: translateX(calc(var(--card-width) / -2 - (var(--gap-width) / 2))); }
.spread-right { transform: translateX(calc(var(--card-width) / 2 + (var(--gap-width) / 2))); }

/* --- CONSOLE --- */
#console {
    position: absolute; bottom: 0; width: 100%; height: var(--bottom-part);
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    padding-bottom: calc(env(safe-area-inset-bottom) + 20px);
    pointer-events: none;
}
#console::before {
    content:""; background: var(--bg-console);
    position: absolute; top: calc(var(--card-height) / 6); left: 0; right: 0; bottom: 0; z-index: 1;
}
#console button {
    z-index: 10;
}

.btn {
    border: none; border-radius: 40px; font-weight: bold; cursor: pointer;
    transition: transform 0.1s, opacity 0.22s ease, filter 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
    color: white; padding: 12px 30px; font-size: 0.9rem; box-shadow: var(--box-shadow);
    pointer-events: auto; display: flex; flex-direction: row; align-items: center;
}
.btn-cta { padding: 16px 60px; font-size: 1.2rem;}
.btn:hover { box-shadow: none; filter: brightness(1.2);}
.btn-blue { background: var(--blue-btn); }
.btn-grey { background: var(--grey-btn); }
.btn-error { background: var(--error); }
.btn-soft { background: #ffffff1A; box-shadow: none; }
.btn-active { background: #133568; box-shadow:  inset 0 0 0 3px var(--accent) !important; }
.btn-disabled { opacity: 0.3 !important; cursor: not-allowed !important; }
.btn-disabled:hover { filter: none !important; box-shadow: var(--box-shadow) !important; }

.update-badge {
    position: absolute; top: 0; right: 0;
    width: 12px; height: 12px; background: var(--error);
    border-radius: 50%; box-shadow: 0 0 0 2px white;
}

/* --- FEEDBACK --- */
#feedback-panel {
    position: absolute; bottom: 0; left: var(--feedback-left); width: var(--feedback-width); height: 120%;
    border-radius: var(--feedback-radius); display: flex; flex-direction: column;
    align-items: center; justify-content: center; pointer-events: none;
    z-index: 5200; box-shadow: var(--feedback-shadow);
    transform: var(--feedback-origin);
    visibility: hidden;
    transition: transform 0.6s var(--ease-interactive), visibility 0s 0.6s;
}
#feedback-panel.active {
    transform: var(--feedback-position);
    visibility: visible;
    transition: transform 0.6s var(--ease-interactive), visibility 0s 0s;
}
#feedback-panel.fast {
    transition: transform 0.32s var(--ease-interactive), visibility 0s 0.32s;
}
#feedback-panel.fast.active {
    transition: transform 0.32s var(--ease-interactive), visibility 0s 0s;
}
.fb-icon { width: 60px; height: 60px; margin-bottom: 10px; }
.fb-actions { display: flex; gap: 40px; margin: 15px 0; align-items: center; }
.fb-tool { width: 30px; height: 30px; cursor: pointer; transition: transform 0.2s ease; }
.fb-tool:hover { transform: scale(1.1); }

/* --- SETTINGS --- */
#panel-settings {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh;
    background: #1A242D; z-index: 9500;
    transform: translateY(100%); transition: transform 0.4s var(--ease-interactive);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-sizing: border-box; pointer-events: auto;
}
.settings-body { flex: 1; overflow-y: auto; width: 100%; display: flex; flex-direction: column; align-items: center; padding: var(--top-min) 20px 20px; pointer-events: auto; box-sizing: border-box;}
.settings-body * { max-width: 480px; }
#panel-settings.active { transform: translateY(0); pointer-events: auto;}
#panel-settings h4 { text-align: center; color: var(--light-txt); margin: 10px 0;}
#language-toggle-container { pointer-events: auto; margin:0; display: flex; gap: 0; justify-content: center; border-radius: 40px; border: var(--light-txt); margin: 20px;}
#language-toggle-container button { border-radius: 0; margin: 0; padding: 12px 20px; font-weight: 400;}
#language-toggle-container button:first-child { border-radius: 40px 0 0 40px;}
#language-toggle-container button:last-child { border-radius: 0 40px 40px 0;}
.settings-note { color: var(--light-txt); font-weight: normal; line-height: 1.4; margin:0;}
#settings-info { font-weight: bold; }
.settings-error {
    color: var(--error);
    font-weight: 600; font-size: 0.9rem; text-align: center;
    margin: 0; padding: 10px 12px; border-radius: 4px;
}
.settings-footer {
    width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 20px; box-sizing: border-box; pointer-events: auto; border-top: 1px solid var(--grey-btn);
    transition: background 0.3s ease;
}
.settings-footer.error {
    background: rgba(248, 81, 73, 0.15);
}
#settings-footer-content {
    display: flex; align-items: center; justify-content: center; min-height: 46px;
}
.settings-grid {
    column-count: 2; column-gap: 30px; width: 100%;
    margin: 5px 0 0; display: block; pointer-events: auto;
}
.switch-item {
    break-inside: avoid;  display: flex; align-items: center;
    gap: 10px; padding-bottom: 15px; font-size: 0.9rem;
}
.switch-item input[type="checkbox"] { display: none; }
.switch-item label {
    position: relative; display: flex; align-items: center;
    cursor: pointer;
    font-size: 0.9rem; padding-left: 45px; min-height: 24px;
}
.switch-item label::before {
    content: ""; position: absolute; left: 0; width: 34px; height: 18px;
    background-color: #5d6872; border-radius: 20px;
    transition: background-color 0.2s;
}
.switch-item label::after {
    content: ""; position: absolute; left: 3px; width: 12px; height: 12px;
    background-color: #1F2B34; border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.switch-item input[type="checkbox"] + label {color: var(--light-txt);}
.switch-item input[type="checkbox"]:checked + label {color: white;}
.switch-item input[type="checkbox"]:checked + label::before {
    background-color: var(--blue-btn);
}
.switch-item input[type="checkbox"]:checked + label::after {
    transform: translateX(16px);
}
.switch-item:hover label::before {
    filter: brightness(1.2);
}
.switch-item .filter-count { color: var(--light-txt); margin-left: 4px;}
.series-control { width: 100%; margin: 20px 0; display: flex; flex-direction: row; align-items: center; justify-content: space-between;}

.offline-section {
    width: 100%;
    margin: 20px 0;
}

.offline-estimate {
    margin: 0;
    color: var(--light-txt);
    font-size: 0.78rem;
}

.offline-actions-row {
    width: 100%;
    display: grid;
    gap: 16px;
    padding: 20px 0;
}
.offline-actions-row.single {
    grid-template-columns: 1fr;
}

.offline-actions-row.dual {
    grid-template-columns: 1fr 1fr;
}

.offline-actions-row .btn {
    width: 100%;
    justify-content: center;
}

.offline-status {
    font-size: 0.75rem;
    text-align: center;
    margin: 0;
    min-height: 1.2em;
    color: var(--light-txt);
}

@media (max-width: 700px) {
    .offline-actions-row.dual {
        grid-template-columns: 1fr;
    }
}

/* --- HELP PANEL --- */
#panel-help {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh;
    background: #1A242D; z-index: 9500;
    transform: translateY(100%);
    transition: transform 0.4s var(--ease-interactive);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-sizing: border-box; pointer-events: auto;
    overflow: hidden;
}
#panel-help.active {
    transform: translateY(0);
    pointer-events: auto;
}
#panel-help h4 { text-align: center; color: #fff; margin: 10px 0;}
#panel-help h5 {
    color: var(--light-txt);
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 600;
}
.help-section-title {
    text-align: center;
    color: var(--light-txt);
    margin: 10px 0 14px;
    font-size: 1rem;
    font-weight: 600;
}
.help-guide-desc {
    margin: 0;
}
.help-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.help-feature-list li {
    color: var(--light-txt);
    padding: 4px 0;
}
.help-section {
    width: 100%;
    margin: 16px 0 10px;
}
.shortcut-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.shortcut-row {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--light-txt);
}
.shortcut-key {
    background: var(--grey-btn);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', monospace;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* --- UTILS --- */
.hidden { display: none !important; }
.shake { animation: shakeAnim 0.6s ease-in-out; border-color: var(--error) !important; }
@keyframes shakeAnim { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-10px); } 80% { transform: translateX(10px); } }
.btn, 
#start-btn, 
#place-btn, 
#continue-btn, 
#end-game-btn,
.fb-tool,
.wiki-link,
input[type="checkbox"] {
    pointer-events: auto !important;
}
/* ZOOM LIGHTBOX */
#zoom-overlay {
    position: fixed; inset: 0;
    background: rgba(5, 7, 10, 0.95);
    z-index: 20000; display: none;
    align-items: center; justify-content: center;
    touch-action: none; /* Prevents browser pull-to-refresh during zoom */
}

#zoom-close-x {
    position: absolute; top: 30px; right: 30px;
    font-size: 40px; color: white; cursor: pointer; z-index: 20010;
}

#zoom-stage {
    width: 90%; max-width: 1200px; /*max-height: 80svh;*/
    position: relative;
}

#zoom-card {
    width: 100%; text-align: center;
    transition: transform var(--duration-animation) var(--ease-interactive), opacity var(--duration-animation);
}
.zoom-ghost {
    position: absolute; top: 0; left: 0; width: 100%; text-align: center;
    transition: transform var(--duration-animation) var(--ease-interactive), opacity var(--duration-animation);
}

#zoom-img {
    max-width: 100%; max-height: 80svh; border-radius: 20px;
    border: 2px solid var(--grey-btn);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}
#zoom-img.preview-mode { border-color: var(--accent) !important; }

#zoom-year { font-size: 1.6rem; font-weight: bold; color: #fff; margin: 15px 0 5px; }
#zoom-name { font-size: 1.2rem; color:var(--light-txt); margin-top:10px;}

.zoom-nav-zone {
    position: absolute; top: 0; bottom: 0; width: 20%; z-index: 20005; cursor: pointer; transition: background-color 0.2s ease;
}
.zoom-nav-zone:hover {
    background-color: rgba(88, 166, 255, 0.05);
}
.zoom-nav-zone.left { left: 0; }
.zoom-nav-zone.right { right: 0; }
.bounce-left { transform: translateX(-150px) !important; }
.bounce-right { transform: translateX(150px) !important; }
.exit-left { transform: translateX(-150px); opacity: 0; pointer-events: none; }
.exit-right { transform: translateX(150px); opacity: 0; pointer-events: none; }
.prep-left { transform: translateX(-150px); opacity: 0; transition: none !important; }
.prep-right { transform: translateX(150px); opacity: 0; transition: none !important; }

#feedback-panel.end-mode {
    background: linear-gradient(180deg, #6C7B86 0%, var(--neutral-card) 100%);
}

.end-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    pointer-events: auto;
    padding: 28px 20px 18px;
    box-sizing: border-box;
}

.end-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
    flex-shrink: 0;
}

.end-panel-content {
    width: 100%;
    max-width: 320px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    transition: opacity 280ms var(--ease-interactive), transform 280ms var(--ease-interactive);
}

.end-panel-content.is-enter-from-right {
    transform: translateX(40px);
    opacity: 0;
    transition: none !important;
}

.end-panel-content.is-enter-from-left {
    transform: translateX(-40px);
    opacity: 0;
    transition: none !important;
}

.end-panel-content.is-leaving-left {
    transform: translateX(-40px);
    opacity: 0;
    pointer-events: none;
}

.end-panel-content.is-leaving-right {
    transform: translateX(40px);
    opacity: 0;
    pointer-events: none;
}

.end-step-title {
    font-size: 0.85rem;
    color: var(--light-txt);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.end-rank-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
}

.end-rank-badge-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 68px;
    margin-top: 4px;
}

.end-rank-badge {
    display: block;
    width: auto;
    max-width: min(180px, 100%);
    height: 52px;
    object-fit: contain;
}

.end-stats-cols {
    display: flex;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.end-stat-col {
    width: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border-radius: 12px;
}

.end-stat-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}
.end-stat-icon img {
    width: 22px;
    height: 22px;
}

.end-stat-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    line-height: 1;
}

.end-stat-label {
    font-size: 0.72rem;
    color: var(--light-txt);
    text-transform: lowercase;
}

.end-save-instructions {
    width: 100%;
    max-width: 280px;
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.4;
}

.end-step-indicators {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.end-step-indicator {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.3);
    display: inline-block;
    overflow: hidden;
    flex-shrink: 0;
    transition: width 280ms var(--ease-interactive), background 280ms var(--ease-interactive);
}

.end-step-indicator.active {
    width: 36px;
    background: rgba(255, 255, 255, 0.15);
    position: relative;
}

.end-step-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    animation: stepFill 4s linear forwards;
}

@keyframes stepFill {
    0%   { width: 0%;    background: rgba(255, 255, 255, 0.9); }
    85%  { width: 100%;  background: rgba(255, 255, 255, 0.9); }
    100% { width: 100%;  background: rgba(255, 255, 255, 0.15); }
}

#end-exit-btn {
    margin-bottom: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .end-panel-content {
        transition: opacity 80ms linear, transform 80ms linear;
    }
    .end-step-indicator {
        transition: width 80ms linear, background 80ms linear;
    }
    .end-step-fill {
        animation-delay: 0ms;
    }
}