/* Visszapillantó (visszapillanto-terv.md).
   Alapból görgethető oldal (kártyák egymás alatt) — JS nélkül is olvasható.
   html.retro-open: teljes képernyős, lapozható story. */

:root {
    --r-navy:   #1d3557;
    --r-red:    #e63946;
    --r-cream:  #f1faee;
    --r-teal:   #457b9d;
    --r-sky:    #a8dadc;
    --r-yellow: #ffb703;
    --r-ink:    #0b132b;
}

/* ───────────── Témák (diánkénti háttér) ───────────── */

.theme-navy   { --bg: var(--r-navy);   --fg: var(--r-cream); --accent: var(--r-yellow); --retro-win: var(--r-navy); }
.theme-red    { --bg: var(--r-red);    --fg: #fff;           --accent: #fff;           --retro-win: var(--r-red); }
.theme-cream  { --bg: var(--r-cream);  --fg: var(--r-navy);  --accent: var(--r-red);   --retro-win: var(--r-cream); }
.theme-yellow { --bg: var(--r-yellow); --fg: var(--r-ink);   --accent: var(--r-navy);  --retro-win: var(--r-yellow); }
.theme-teal   { --bg: var(--r-teal);   --fg: #fff;           --accent: var(--r-yellow); --retro-win: var(--r-teal); }
.theme-sky    { --bg: var(--r-sky);    --fg: var(--r-ink);   --accent: var(--r-red);   --retro-win: var(--r-sky); }
.theme-ink    { --bg: var(--r-ink);    --fg: var(--r-cream); --accent: var(--r-yellow); --retro-win: var(--r-ink); }

/* ───────────── Görgethető nézet (alap) ───────────── */

.retro-head { margin-bottom: 20px; }
.retro-head-sub { color: var(--muted); margin-top: 4px; }
.retro-play {
    margin-top: 14px;
    font: inherit; font-weight: 700; font-size: 15px;
    background: var(--r-red); color: #fff; border: 0; border-radius: 999px;
    padding: 10px 20px; cursor: pointer;
}
.retro-play:hover { filter: brightness(1.08); }

.retro-progress, .retro-topbar, .retro-rail, .retro-tap { display: none; }

.retro-slide {
    position: relative;
    background-color: var(--bg); color: var(--fg);
    background-image:
        radial-gradient(circle at 115% -5%, rgba(255,255,255,.14) 0 34%, transparent 34.5%),
        radial-gradient(circle at -20% 110%, rgba(0,0,0,.08) 0 30%, transparent 30.5%);
    border-radius: 20px;
    padding: 36px 26px;
    margin-bottom: 16px;
    overflow: hidden;
}
.retro-body { display: flex; flex-direction: column; gap: 14px; }

/* ───────────── Tipográfia, elemek ───────────── */

.retro-kicker {
    font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
    opacity: .8;
}
.retro-title {
    color: inherit; margin: 0;
    font-size: clamp(28px, 7.4vw, 40px); line-height: 1.08; font-weight: 900; letter-spacing: -.02em;
}
.retro-title--section { font-size: clamp(24px, 6.4vw, 32px); }
.retro-big {
    font-size: clamp(96px, 32vw, 160px); line-height: .9; font-weight: 900; letter-spacing: -.04em;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}
.retro-big small { font-size: .3em; letter-spacing: 0; color: var(--fg); font-weight: 800; }
.retro-big--long { font-size: clamp(56px, 17vw, 96px); }
.retro-lead { font-size: 21px; line-height: 1.35; font-weight: 600; }
.retro-lead strong, .retro-text strong { color: var(--accent); font-weight: 900; }
.retro-text { font-size: 17px; line-height: 1.5; }
.retro-text--sub { font-size: 15px; opacity: .85; }
.retro-text a, .retro-more a { color: inherit; }
.retro-serious {
    font-size: 15px; line-height: 1.45; font-weight: 600;
    border-left: 4px solid currentColor; padding-left: 12px;
}
.retro-tag {
    align-self: flex-start;
    background: var(--fg); color: var(--bg);
    font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    padding: 4px 10px; border-radius: 6px;
}
.retro-stamp {
    align-self: flex-start;
    border: 2px dashed currentColor; border-radius: 10px;
    padding: 8px 14px;
    font-weight: 800; font-size: 17px; line-height: 1.3;
    transform: rotate(-2.5deg);
}
.retro-stamp small { font-weight: 500; font-size: 14px; opacity: .85; }
.retro-hint { font-size: 14px; opacity: .7; margin-top: 18px; }

/* Műfaj: megoszlás-csík */
.retro-split { display: flex; height: 18px; border-radius: 9px; overflow: hidden; gap: 2px; }
.retro-split-seg { min-width: 6px; }
.retro-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; font-weight: 600; }
.retro-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.type-auto     { background: var(--r-red); }
.type-gyalogos { background: var(--r-navy); }
.type-kisvasut { background: var(--r-teal); }
.type-egyeb    { background: var(--r-yellow); }
.type-muszaki  { background: var(--r-sky); }

/* Top 5 szakasz */
.retro-chart { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.retro-chart li {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,.08); border-radius: 12px; padding: 10px 12px;
}
.retro-chart .rank {
    flex: 0 0 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--accent); color: var(--bg); font-weight: 900;
}
.retro-chart .name { flex: 1; font-weight: 700; line-height: 1.25; font-size: 16px; }
.retro-chart .cnt { font-weight: 900; font-size: 20px; color: var(--accent); }

/* Az év villamosa: pályaszám-kijelző */
.retro-plates { display: flex; flex-wrap: wrap; gap: 12px; }
.retro-plate {
    display: inline-block;
    background: #111; color: #ffb703;
    border: 3px solid rgba(255,255,255,.25); border-radius: 12px;
    padding: 4px 18px 6px;
    font-size: clamp(64px, 20vw, 96px); font-weight: 900; letter-spacing: .04em; line-height: 1.05;
    font-variant-numeric: tabular-nums;
    box-shadow: inset 0 0 18px rgba(255,183,3,.18), 0 8px 24px rgba(0,0,0,.25);
    text-shadow: 0 0 12px rgba(255,183,3,.45);
}

/* Havi oszlopok */
.retro-bars { display: flex; align-items: flex-end; gap: 5px; }
.retro-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.retro-bar .col { height: 120px; width: 100%; display: flex; align-items: flex-end; }
.retro-bar .fill { width: 100%; border-radius: 4px 4px 0 0; background: currentColor; opacity: .35; }
.retro-bar.is-top .fill { background: var(--accent); opacity: 1; }
.retro-bar.is-future .fill { opacity: .12; }
.retro-bar .cnt { font-size: 12px; font-weight: 800; min-height: 15px; line-height: 15px; }
.retro-bar .lbl { font-size: 12px; font-weight: 700; opacity: .75; text-transform: uppercase; }

/* Versus (cápa, év vége) */
.retro-versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px; }
.retro-versus > div { display: flex; flex-direction: column; gap: 6px; }
.retro-versus .num { font-size: clamp(56px, 18vw, 88px); font-weight: 900; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.retro-versus .lbl { font-size: 14px; font-weight: 600; line-height: 1.3; }
.retro-versus .vs { font-size: 20px; font-weight: 900; font-style: italic; opacity: .7; padding-top: 22px; }

/* Személyiség */
.retro-persona {
    display: flex; flex-direction: column; gap: 12px;
    background: var(--fg); color: var(--bg);
    --retro-win: var(--fg);
    border-radius: 18px; padding: 22px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.retro-persona-icon { width: 120px; height: 36px; color: var(--accent); }
.theme-cream .retro-persona-icon { color: var(--r-yellow); }

/* Meme */
.retro-meme { position: relative; margin: 0; }
.retro-meme img {
    display: block; max-width: 100%; max-height: 46vh; margin: 0 auto;
    border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.retro-meme a { position: relative; display: block; }
.retro-meme-play {
    position: absolute; inset: 0; display: grid; place-items: center;
    font-size: 54px; color: #fff; text-shadow: 0 4px 16px rgba(0,0,0,.5);
}
.retro-meme figcaption { font-size: 14px; margin-top: 8px; opacity: .85; text-align: center; }

/* Záró dia */
.retro-card { display: flex; justify-content: center; }
.retro-card-img {
    display: block; width: auto; max-width: 100%;
    height: min(34vh, 360px); aspect-ratio: 9 / 16;
    border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.45);
}
.retro-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.retro-btn {
    font: inherit; font-weight: 700; font-size: 15px;
    color: var(--fg); background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.3); border-radius: 999px;
    padding: 10px 18px; cursor: pointer;
}
.retro-btn:hover { background: rgba(255,255,255,.18); }
.retro-btn--primary { background: var(--r-yellow); color: var(--r-ink); border-color: var(--r-yellow); }
.retro-btn--primary:hover { background: #ffc633; }
.retro-more { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; font-size: 14px; font-weight: 600; }
.retro-link-btn { font: inherit; color: inherit; background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 0; }

/* ───────────── Story-mód ───────────── */

html.retro-open, html.retro-open body { overflow: hidden; }

.retro-open .retro-stage {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    background: var(--r-ink);
    background-image: radial-gradient(circle at 50% 30%, #1d3557 0, var(--r-ink) 70%);
}
.retro-open .retro-frame {
    position: relative;
    width: 100vw; height: 100vh; height: 100dvh;
    overflow: hidden;
    color: var(--r-cream);
    user-select: none; -webkit-user-select: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}
@media (min-width: 640px) {
    .retro-open .retro-frame {
        height: min(calc(100vh - 48px), 900px);
        height: min(calc(100dvh - 48px), 900px);
        width: calc(min(calc(100vh - 48px), 900px) * 0.5625);
        width: calc(min(calc(100dvh - 48px), 900px) * 0.5625);
        border-radius: 24px;
        box-shadow: 0 30px 80px rgba(0,0,0,.5);
    }
}

.retro-open .retro-slides { position: absolute; inset: 0; }
.retro-open .retro-slide {
    position: absolute; inset: 0;
    margin: 0; border-radius: 0;
    padding: 76px 28px 92px;
    display: flex; flex-direction: column; justify-content: center;
    visibility: hidden; opacity: 0;
    transition: opacity .35s ease, visibility 0s linear .35s;
}
.retro-open .retro-slide.is-active { visibility: visible; opacity: 1; transition: opacity .35s ease, visibility 0s; }
/* A JS elindulása előtt az első dia látszik */
.retro-open .retro-slides:not(.is-ready) .retro-slide:first-child { visibility: visible; opacity: 1; }
.retro-open .retro-body { max-height: 100%; }
.retro-open .retro-slide--toplista .retro-body,
.retro-open .retro-slide--vege .retro-body { gap: 12px; }

/* Belépő animáció: a .a elemek egymás után úsznak be (--d: sorrend) */
@keyframes retro-in {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}
.retro-open .retro-slide.is-active .a {
    animation: retro-in .6s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: calc(var(--d, 0) * 110ms);
}
.retro-open .retro-slide.is-active .retro-stamp.a { animation-name: retro-stamp; }
@keyframes retro-stamp {
    from { opacity: 0; transform: rotate(-2.5deg) scale(1.4); }
    to   { opacity: 1; transform: rotate(-2.5deg) scale(1); }
}
.retro-open .retro-slide.is-active .retro-hint { animation: retro-in .6s both, retro-nudge 1.6s ease-in-out 1.4s infinite; }
@keyframes retro-nudge { 0%, 100% { transform: none; } 50% { transform: translateX(6px); } }

/* Haladásjelző */
.retro-open .retro-progress {
    display: flex; gap: 4px;
    position: absolute; top: 12px; left: 12px; right: 12px; z-index: 6;
}
.retro-progress span { flex: 1; height: 3px; border-radius: 2px; position: relative; overflow: hidden; }
.retro-progress span::before { content: ''; position: absolute; inset: 0; background: currentColor; opacity: .3; }
.retro-progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: currentColor; }
.retro-progress span.is-done i { width: 100%; }

/* Felső sáv */
.retro-open .retro-topbar {
    display: flex; align-items: center; gap: 6px;
    position: absolute; top: 24px; left: 16px; right: 10px; z-index: 6;
}
.retro-brand { flex: 1; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.retro-icon-btn {
    width: 38px; height: 38px; border-radius: 50%;
    border: 0; background: transparent; color: inherit; cursor: pointer;
    font-size: 16px; font-weight: 900; line-height: 1;
}
.retro-icon-btn:hover { background: rgba(127,127,127,.2); }

/* A felső sáv, a haladásjelző és a sín színe az aktuális dia témájához igazodik */
.retro-frame[data-theme="cream"], .retro-frame[data-theme="yellow"], .retro-frame[data-theme="sky"] { color: var(--r-ink); }
.retro-frame[data-theme="cream"] .retro-rail { --retro-win: var(--r-cream); }
.retro-frame[data-theme="yellow"] .retro-rail { --retro-win: var(--r-yellow); }
.retro-frame[data-theme="sky"] .retro-rail { --retro-win: var(--r-sky); }
.retro-frame[data-theme="navy"] .retro-rail { --retro-win: var(--r-navy); }
.retro-frame[data-theme="red"] .retro-rail { --retro-win: var(--r-red); }
.retro-frame[data-theme="teal"] .retro-rail { --retro-win: var(--r-teal); }
.retro-frame[data-theme="ink"] .retro-rail { --retro-win: var(--r-ink); }

/* Sín + villamos */
.retro-open .retro-rail {
    display: block;
    position: absolute; left: 20px; right: 20px; bottom: 26px; height: 40px; z-index: 5;
    pointer-events: none;
    --p: 0;
}
.retro-rail::before { /* sín */
    content: ''; position: absolute; left: 0; right: 0; bottom: 6px; height: 3px;
    background: currentColor; opacity: .55; border-radius: 2px;
}
.retro-rail::after { /* talpfák */
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
    background: repeating-linear-gradient(90deg, currentColor 0 3px, transparent 3px 16px);
    opacity: .3;
}
.retro-rail-tram {
    position: absolute; bottom: 7px; width: 84px; height: 25px;
    left: calc(var(--p) * (100% - 84px));
    transition: left .7s cubic-bezier(.4, 0, .2, 1);
}

/* Előző/következő gombok: mobilon a koppintás kezeli (JS), asztalin a keret mellett */
@media (min-width: 640px) {
    .retro-open .retro-tap {
        display: grid; place-items: center;
        position: fixed; top: 50%; z-index: 1001;
        width: 48px; height: 48px; margin-top: -24px; border-radius: 50%;
        border: 0; cursor: pointer;
        background: rgba(255,255,255,.12); color: #fff;
        font-size: 22px; font-weight: 900;
    }
    .retro-open .retro-tap:hover { background: rgba(255,255,255,.22); }
    .retro-open .retro-tap--prev { left: calc(50% - (min(calc(100dvh - 48px), 900px) * 0.5625) / 2 - 68px); }
    .retro-open .retro-tap--next { right: calc(50% - (min(calc(100dvh - 48px), 900px) * 0.5625) / 2 - 68px); }
    .retro-open .retro-tap--prev::before { content: '‹'; }
    .retro-open .retro-tap--next::before { content: '›'; }
    .retro-open .retro-tap[disabled] { opacity: .25; cursor: default; }
}

/* Alacsony képernyő (pl. fekvő telefon): kisebb betűk */
@media (max-height: 640px) {
    .retro-open .retro-slide { padding-top: 64px; padding-bottom: 76px; }
    .retro-open .retro-big { font-size: clamp(64px, 18vh, 120px); }
    .retro-open .retro-title { font-size: clamp(24px, 5.5vh, 34px); }
    .retro-open .retro-lead { font-size: 18px; }
    .retro-open .retro-text { font-size: 15px; }
    .retro-bar .col { height: 80px; }
    .retro-card-img { height: 28vh; }
}

@media (prefers-reduced-motion: reduce) {
    .retro-open .retro-slide, .retro-open .retro-slide.is-active { transition: none; }
    .retro-open .retro-slide.is-active .a,
    .retro-open .retro-slide.is-active .retro-hint { animation: none; }
    .retro-rail-tram { transition: none; }
}

/* Évszám ragja ne törjön sort ("2026-os") */
.nobr { white-space: nowrap; }
