/* Arhiva: grilă de carduri cu imaginea câștigătorilor; pagina unui meci: banner, statistici și timeline. */

.history-container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

/* --- Cardul unui meci --- */
.match-tile {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9.5;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background:
        radial-gradient(ellipse at 72% 45%, rgba(250, 190, 55, 0.22), transparent 60%),
        radial-gradient(ellipse at 100% 100%, rgba(217, 119, 6, 0.18), transparent 55%),
        linear-gradient(135deg, #0d0d0f, #17140c);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.match-tile.featured {
    grid-column: 1 / -1;
    aspect-ratio: 27 / 10;
}

/* Grila de pixeli din fundal, ca pe restul site-ului. */
.match-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(90deg, transparent 20%, black 80%);
}

.match-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(250, 204, 21, 0.45);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(250, 204, 21, 0.08);
}

.match-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
    opacity: 0;
    transform: scale(1.03);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.match-thumb.is-ready { opacity: 1; transform: none; }
.match-tile:hover .match-thumb.is-ready { transform: scale(1.03); }

/* Umbra din stânga-jos ține textul lizibil peste personaje. */
.match-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.25) 45%, transparent 70%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, transparent 55%);
}

.match-number {
    position: absolute;
    top: 14px;
    left: 16px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.55);
}

.match-badges {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    gap: 6px;
}

.badge {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 4px 9px;
    border-radius: 5px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: rgba(250, 204, 21, 0.16);
    border: 1px solid rgba(250, 204, 21, 0.5);
    color: var(--accent);
}



.match-info {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.match-kicker {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
}

.match-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.9rem;
    line-height: 1;
    letter-spacing: 1px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
}

.match-tile.featured .match-name { font-size: 3.4rem; }

.match-winners {
    font-weight: 700;
    font-size: 0.9rem;
    color: #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-tile.featured .match-winners { font-size: 1.05rem; }

.match-meta {
    font-size: 0.78rem;
    color: var(--text-sec);
}

.match-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-sec);
    padding: 40px 0;
}

/* ===================== Pagina unui meci ===================== */
.match-page {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-sec);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 18px;
    transition: color 0.2s;
}

.back-link:hover { color: var(--accent); }

.match-banner {
    aspect-ratio: 27 / 10;
    cursor: default;
}

.match-banner:hover { transform: none; }

.match-banner .match-name { font-size: 4rem; }

.match-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.stat-box {
    background: var(--bg-row);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 10px;
    text-align: center;
}

.stat-label { font-size: 0.75rem; color: var(--text-sec); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; margin-bottom: 4px; }
.stat-value { font-family: 'Bebas Neue', sans-serif; font-size: 1.8rem; line-height: 1.1; }
.stat-value.accent { color: var(--accent); }

.match-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.panel {
    background: var(--bg-row);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
}

.panel-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: 1.7rem;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.player-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.player-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.player-row img { width: 30px; height: 30px; image-rendering: pixelated; border-radius: 4px; }
.player-row .name { font-weight: 800; flex: 1; text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.92rem; }
.player-row .value { font-family: 'Bebas Neue', sans-serif; font-size: 1.4rem; color: var(--accent); }
.player-row .crown { color: var(--accent); width: 18px; height: 18px; }

/* --- Timeline --- */
.timeline { display: flex; flex-direction: column; gap: 4px; }

.timeline-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s;
    min-height: 36px;
}

.timeline-item:hover { background: rgba(255, 255, 255, 0.04); }

.tl-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; border: 2px solid rgba(0, 0, 0, 0.4); }
.tl-dot.kill  { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
.tl-dot.death { background: #6b7280; box-shadow: 0 0 8px rgba(107, 114, 128, 0.4); }
.tl-dot.event { background: #3b82f6; box-shadow: 0 0 8px rgba(59, 130, 246, 0.5); }
.tl-dot.win   { background: #facc15; box-shadow: 0 0 8px rgba(250, 204, 21, 0.5); }

.tl-time { font-size: 0.82rem; font-weight: 700; color: var(--text-sec); min-width: 52px; font-variant-numeric: tabular-nums; }
.tl-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }

.tl-icon { width: 18px; height: 18px; flex-shrink: 0; display: block; }
.timeline-item.kill  .tl-icon { color: #ef4444; }
.timeline-item.death .tl-icon { color: #6b7280; }
.timeline-item.event .tl-icon { color: #3b82f6; }
.timeline-item.win   .tl-icon { color: #facc15; }

.tl-head { width: 22px; height: 22px; flex-shrink: 0; image-rendering: pixelated; border-radius: 3px; }
.tl-action { font-size: 0.88rem; color: var(--text-sec); font-weight: 500; white-space: nowrap; }
.tl-action.event { color: #93c5fd; }
.tl-action.win { color: #facc15; }
.tl-name { font-size: 0.88rem; font-weight: 700; white-space: nowrap; }
.tl-name.killer { color: #f87171; }
.tl-name.victim { color: #d1d5db; }
.tl-name.winner { color: #facc15; }

.not-found { text-align: center; padding: 60px 0; color: var(--text-sec); }
.not-found a { color: var(--accent); }

@media (max-width: 768px) {
    .history-container { grid-template-columns: 1fr; gap: 14px; }
    .match-tile.featured,
    .match-banner { aspect-ratio: 16 / 10; }
    .match-tile.featured .match-name,
    .match-banner .match-name { font-size: 2.4rem; }
    .match-name { font-size: 1.7rem; }

    .match-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .match-columns { grid-template-columns: 1fr; }
    .panel { padding: 15px; }

    .timeline-item { padding: 5px 6px; gap: 6px; overflow-x: auto; overflow-y: hidden; }
    .tl-time { font-size: 0.72rem; min-width: 40px; }
    .tl-icon { width: 14px; height: 14px; }
    .tl-head { width: 18px; height: 18px; }
    .tl-name,
    .tl-action { font-size: 0.78rem; }
}
