/* ── Popup so štatistikami hráčov (zapasy) ───────────────────────── */
.match-card--stats { cursor: pointer; position: relative; }
.match-card--stats::after {
    content: '📊 ' attr(data-stats-label);
    position: absolute;
    top: 22px;
    right: 22px;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(201, 168, 76, .12);
    border: 1px solid rgba(201, 168, 76, .4);
    color: var(--gold);
    font-family: var(--font-head);
    font-size: .6rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
    transition: background .25s ease, box-shadow .25s ease;
}
.match-card--stats:hover::after,
.match-card--stats:focus-visible::after { background: rgba(201, 168, 76, .25); box-shadow: 0 0 18px rgba(201, 168, 76, .35); }
.match-card--stats:hover { border-color: rgba(201, 168, 76, .55); box-shadow: 0 10px 40px rgba(201, 168, 76, .12); }

.ms-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transition: opacity .3s ease, visibility 0s linear .3s;
}
.ms-modal.is-open { visibility: visible; opacity: 1; transition: opacity .3s ease; }
.ms-modal__backdrop {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at top, rgba(201, 168, 76, .12), transparent 60%), rgba(5, 5, 5, .82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.ms-dialog {
    position: relative;
    width: 100%;
    max-width: 1080px;
    border-radius: 22px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(201, 168, 76, .75), rgba(201, 168, 76, .05) 40%, rgba(201, 168, 76, .05) 60%, rgba(201, 168, 76, .6));
    transform: translateY(40px) scale(.96);
    transition: transform .5s cubic-bezier(.2, .9, .25, 1.15);
    box-shadow: 0 40px 120px rgba(0, 0, 0, .65);
}
.ms-modal.is-open .ms-dialog { transform: none; }
.ms-dialog__inner {
    position: relative;
    overflow: hidden;
    border-radius: 21px;
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(201, 168, 76, .13), transparent 70%),
        linear-gradient(180deg, #121212, #0a0a0a);
    padding: 34px 34px 28px;
}
.ms-dialog__inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(201, 168, 76, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 168, 76, .035) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(180deg, #000, transparent 55%);
    pointer-events: none;
}
.ms-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.ms-close:hover { transform: rotate(90deg); border-color: var(--gold); background: rgba(201, 168, 76, .12); }

/* Hlavička – tímy a skóre */
.ms-head { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.ms-team { display: flex; align-items: center; gap: 16px; min-width: 0; }
.ms-team--b { flex-direction: row-reverse; text-align: right; }
.ms-team__logo {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: contain;
    padding: 8px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--border);
}
.ms-team__logo--ph { display: flex; align-items: center; justify-content: center; font-family: var(--font-head); color: var(--gold); font-size: 1.1rem; }
.ms-team__name { font-family: var(--font-head); font-size: clamp(1rem, 2.4vw, 1.6rem); text-transform: uppercase; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-team--a { animation: msSlideL .7s cubic-bezier(.2, .9, .25, 1) both .1s; }
.ms-team--b { animation: msSlideR .7s cubic-bezier(.2, .9, .25, 1) both .1s; }
.ms-score { text-align: center; animation: msPop .6s cubic-bezier(.2, .9, .25, 1.3) both .25s; }
.ms-score__nums { font-family: var(--font-head); font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: 1; letter-spacing: .04em; }
.ms-score__win { color: var(--gold); text-shadow: 0 0 30px rgba(201, 168, 76, .45); }
.ms-score__loss { color: var(--text-muted); }
.ms-score__sep { color: var(--text-faint); margin: 0 10px; }
.ms-result {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 14px;
    border-radius: 999px;
    font-family: var(--font-head);
    font-size: .66rem;
    letter-spacing: .24em;
    text-transform: uppercase;
}
.ms-result--win { background: rgba(70, 200, 120, .12); color: #5fdc8f; border: 1px solid rgba(70, 200, 120, .4); }
.ms-result--loss { background: rgba(239, 53, 94, .1); color: #ff6b88; border: 1px solid rgba(239, 53, 94, .38); }
.ms-meta { position: relative; margin: 18px 0 30px; text-align: center; color: var(--text-faint); font-size: .82rem; letter-spacing: .06em; animation: msFade .6s ease both .35s; }
.ms-meta span + span::before { content: '·'; margin: 0 10px; color: var(--gold); }

/* MVP */
.ms-mvp {
    position: relative;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 30px;
    align-items: center;
    padding: 24px;
    margin-bottom: 26px;
    border-radius: 18px;
    border: 1px solid rgba(201, 168, 76, .35);
    background: linear-gradient(110deg, rgba(201, 168, 76, .14), rgba(201, 168, 76, .02) 55%);
    overflow: hidden;
    animation: msRise .7s cubic-bezier(.2, .9, .25, 1) both .4s;
}
.ms-mvp::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .08), transparent);
    transform: skewX(-18deg);
    animation: msShine 3.2s ease-in-out infinite 1.2s;
}
.ms-mvp__photo-wrap { position: relative; height: 240px; display: flex; align-items: flex-end; justify-content: center; }
.ms-mvp__photo-wrap::before {
    content: '';
    position: absolute;
    bottom: 0;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 168, 76, .55), transparent 68%);
    filter: blur(8px);
    animation: msGlow 2.6s ease-in-out infinite;
}
.ms-mvp__photo { position: relative; max-height: 100%; max-width: 100%; object-fit: contain; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .6)); animation: msFloatIn .9s cubic-bezier(.2, .9, .25, 1) both .55s; }
.ms-mvp__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--gold);
    color: #0a0a0a;
    font-family: var(--font-head);
    font-size: .7rem;
    letter-spacing: .2em;
    text-transform: uppercase;
}
.ms-mvp__nick { font-family: var(--font-head); font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1; text-transform: uppercase; margin: 14px 0 4px; }
.ms-mvp__name { color: var(--text-muted); margin-bottom: 18px; }
.ms-mvp__nums { display: flex; flex-wrap: wrap; gap: 26px; align-items: center; }
.ms-ring { position: relative; width: 96px; height: 96px; }
.ms-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ms-ring__bg { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 7; }
.ms-ring__fg { fill: none; stroke: var(--gold); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 1.4s cubic-bezier(.2, .9, .25, 1); filter: drop-shadow(0 0 6px rgba(201, 168, 76, .6)); }
.ms-ring__val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 1.5rem; }
.ms-ring__val small { font-size: .55rem; letter-spacing: .18em; color: var(--text-muted); text-transform: uppercase; }
.ms-stat { min-width: 70px; }
.ms-stat__val { font-family: var(--font-head); font-size: 1.6rem; line-height: 1.1; }
.ms-stat__lbl { font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-faint); }
.ms-pos { color: #5fdc8f; }
.ms-neg { color: #ff6b88; }

/* Karty hráčov */
.ms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.ms-player {
    position: relative;
    display: block;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #171717, #0d0d0d);
    color: inherit;
    text-decoration: none;
    opacity: 0;
    transform: translateY(26px);
    animation: msRise .6s cubic-bezier(.2, .9, .25, 1) forwards;
    transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.ms-player:hover { transform: translateY(-6px); border-color: rgba(201, 168, 76, .5); box-shadow: 0 16px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(201, 168, 76, .15); }
.ms-player__photo-wrap { position: relative; height: 170px; display: flex; align-items: flex-end; justify-content: center; background: radial-gradient(ellipse at 50% 100%, rgba(201, 168, 76, .2), transparent 70%); }
.ms-player__photo { max-height: 100%; max-width: 100%; object-fit: contain; transition: transform .4s ease; }
.ms-player:hover .ms-player__photo { transform: scale(1.06); }
.ms-player__photo--ph { font-family: var(--font-head); font-size: 3rem; color: rgba(201, 168, 76, .35); margin-bottom: 40px; }
.ms-player__photo-wrap::after { content: ''; position: absolute; inset: auto 0 0; height: 50%; background: linear-gradient(transparent, #0f0f0f); }
.ms-player__rating {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 999px;
    font-family: var(--font-head);
    font-size: .85rem;
    background: rgba(0, 0, 0, .55);
    border: 1px solid var(--border);
    backdrop-filter: blur(4px);
}
.ms-player__rating.is-good { color: #5fdc8f; border-color: rgba(70, 200, 120, .45); }
.ms-player__rating.is-bad { color: #ff6b88; border-color: rgba(239, 53, 94, .4); }
.ms-player__flag { position: absolute; top: 14px; left: 12px; z-index: 2; width: 22px; border-radius: 3px; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.ms-player__body { position: relative; padding: 4px 16px 16px; }
.ms-player__nick { font-family: var(--font-head); font-size: 1.15rem; text-transform: uppercase; letter-spacing: .03em; }
.ms-player__name { font-size: .74rem; color: var(--text-faint); margin-bottom: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-player__kd { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-family: var(--font-head); }
.ms-player__kd b { font-size: 1.1rem; font-weight: 700; }
.ms-bar { margin-top: 8px; }
.ms-bar__top { display: flex; justify-content: space-between; font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px; }
.ms-bar__top span:last-child { color: var(--text); font-family: var(--font-head); letter-spacing: .04em; }
.ms-bar__track { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.ms-bar__fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, rgba(201, 168, 76, .55), var(--gold)); transition: width 1.2s cubic-bezier(.2, .9, .25, 1); }

.ms-foot { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 26px; color: var(--text-faint); font-size: .78rem; }
.ms-foot a { color: var(--gold); }
.ms-empty { position: relative; text-align: center; padding: 40px 10px 20px; color: var(--text-muted); }
.ms-empty__icon { font-size: 2.4rem; margin-bottom: 10px; }
.ms-loading { position: relative; display: flex; justify-content: center; padding: 80px 0; }
.ms-spinner { width: 46px; height: 46px; border-radius: 50%; border: 3px solid rgba(201, 168, 76, .15); border-top-color: var(--gold); animation: msSpin .8s linear infinite; }

body.ms-lock { overflow: hidden; }

@keyframes msSlideL { from { opacity: 0; transform: translateX(-50px); } to { opacity: 1; transform: none; } }
@keyframes msSlideR { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: none; } }
@keyframes msPop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes msFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes msRise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes msFloatIn { from { opacity: 0; transform: translateY(30px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes msShine { 0% { left: -60%; } 55%, 100% { left: 130%; } }
@keyframes msGlow { 0%, 100% { opacity: .7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes msSpin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
    .ms-modal { padding: 16px 10px; }
    .ms-dialog__inner { padding: 52px 16px 20px; }
    .ms-head { gap: 8px; }
    .ms-team, .ms-team--b { flex-direction: column; text-align: center; gap: 8px; }
    .ms-team__logo { flex-basis: 48px; width: 48px; height: 48px; border-radius: 12px; padding: 6px; }
    .ms-team__name { font-size: .78rem; white-space: normal; }
    .ms-score__nums { font-size: 2.2rem; }
    .ms-score__sep { margin: 0 4px; }
    .ms-close { top: 10px; right: 10px; width: 34px; height: 34px; }
    .ms-mvp { grid-template-columns: 1fr; text-align: center; padding: 18px; }
    .ms-mvp__photo-wrap { height: 200px; }
    .ms-mvp__nums { justify-content: center; }
    .ms-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .ms-player__photo-wrap { height: 130px; }
}

@media (prefers-reduced-motion: reduce) {
    .ms-modal *, .ms-modal *::before, .ms-modal *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
