/* ============================================================================
 * The 80s vs Evil - Hero x Locations x Boss Matrix + Game Log
 *
 * Mirrors the scorer app's Final Scoring card: notebook paper, comic black
 * borders with cyan/pink offset shadows, hot-pink title swash, lime brush
 * highlights and the sheet's KomikaTitle face.
 * ============================================================================ */

@font-face {
    font-family: 'E80Komika';
    src: url('../../fonts/80s-vs-evil-komika.woff') format('woff');
    font-display: swap;
    /* Only the characters this font really draws: its digits, '/', '&' and 'J' are empty
       shapes, which blanked every score. The rest falls back to Impact. */
    unicode-range: U+0021, U+002B, U+002D-002E, U+003A, U+003F, U+0041-0049, U+004B-005A,
                   U+0061-0065, U+0068-0069, U+006B-0070, U+0072-0077, U+0079, U+00AD, U+2019;
}

.e80-tracker {
    --e80-ink: #111;
    --e80-paper: #fffdf4;
    --e80-pink: #ec2087;
    --e80-cyan: #22b9df;
    --e80-lime: #d1e239;
    --e80-rule: #a7a6a0;
    --e80-night: #14121a;

    position: relative;
    box-sizing: border-box;
    margin: 20px 0;
    padding: 22px 20px 26px;
    overflow: hidden;
    background: var(--e80-night);
    color: var(--e80-ink);
    font-family: system-ui, -apple-system, sans-serif;
}
.e80-tracker *,
.e80-tracker *::before,
.e80-tracker *::after { box-sizing: border-box; }

/* ---- Header ---- */
.e80-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-bottom: 22px; }
.e80-tracker .e80-title {
    position: relative;
    margin: 0;
    padding: 10px 26px 12px;
    font: normal 40px/1 'E80Komika', Impact, sans-serif;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 3px 4px 0 var(--e80-ink);
    transform: rotate(-3deg);
    isolation: isolate;
}
.e80-tracker .e80-title::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--e80-pink);
    clip-path: polygon(2% 7%, 99% 0, 96% 14%, 100% 20%, 98% 31%, 100% 36%, 98% 47%, 100% 52%, 97% 64%, 100% 72%, 95% 80%, 99% 89%, 0 100%, 3% 84%, 0 77%, 3% 65%, 0 56%, 2% 41%, 0 30%, 3% 21%, 0 12%);
}
.e80-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.e80-stat {
    padding: 6px 12px;
    background: var(--e80-night);
    border-bottom: 4px solid var(--e80-pink);
    color: #fff;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.e80-stat b { font: normal 24px/1 'E80Komika', Impact, sans-serif; color: var(--e80-lime); margin-right: 4px; }

/* ---- Matrix cards ---- */
.e80-grids { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 26px; }
.e80-card {
    padding: 14px 14px 16px;
    background: var(--e80-paper);
    border: 4px solid var(--e80-ink);
    box-shadow: 7px 8px 0 var(--e80-cyan), -5px -5px 0 var(--e80-pink);
    transform: rotate(-.45deg);
}
.e80-card:nth-child(even) { transform: rotate(.45deg); }
.e80-tracker .e80-card__title {
    margin: 0 0 10px;
    font: normal 17px/1.15 'E80Komika', Impact, sans-serif;
    text-transform: uppercase;
    text-align: center;
}
.e80-matrix { width: 100%; margin: 0; border-collapse: collapse; table-layout: fixed; }
.e80-matrix th,
.e80-matrix td { padding: 4px; border: 0; text-align: center; vertical-align: middle; }
.e80-corner { width: 25%; }
.e80-boss img,
.e80-hero img {
    display: block;
    width: 100%;
    max-width: 74px;
    aspect-ratio: 1;
    margin: 0 auto 4px;
    object-fit: cover;
    background: #fff;
    border: 3px solid var(--e80-ink);
    box-shadow: 3px 4px 0 var(--e80-ink);
}
.e80-boss img { object-fit: contain; transform: rotate(4deg); }
.e80-hero img { transform: rotate(-4deg); }
.e80-boss span,
.e80-hero span { display: block; font-size: 11px; font-weight: 800; line-height: 1.15; text-transform: uppercase; }

.e80-cell { height: 78px; border-bottom: 1px solid var(--e80-rule) !important; }
.e80-cell__empty { color: #b9b6aa; font-size: 20px; }
.e80-cell__best {
    position: relative;
    display: inline-block;
    padding: 0 6px;
    font: normal 26px/1.1 'E80Komika', Impact, sans-serif;
    font-variant-numeric: tabular-nums;
    isolation: isolate;
}
.e80-cell.is-won .e80-cell__best::before {
    content: '';
    position: absolute;
    inset: 0 -2px;
    z-index: -1;
    background: var(--e80-lime);
    clip-path: polygon(4% 10%, 100% 0, 95% 25%, 100% 38%, 95% 57%, 100% 75%, 96% 93%, 0 100%, 5% 75%, 0 62%, 5% 42%, 0 28%);
    transform: rotate(-5deg);
}
.e80-tracker .e80-cell__best { color: var(--e80-ink); } /* the site theme makes <strong> light grey */
.e80-cell.is-tried .e80-cell__best { color: #6b6860; }
.e80-cell__meta { display: block; margin-top: 3px; font-size: 11px; font-weight: 700; color: #26232b; text-transform: uppercase; }

/* ---- Game log ---- */
.e80-log {
    margin-top: 30px;
    padding: 16px 18px 20px;
    background: var(--e80-night);
    border-bottom: 8px solid var(--e80-pink);
    color: #fff;
}
.e80-tracker .e80-log__title { margin: 0 0 12px; font: normal 26px/1 'E80Komika', Impact, sans-serif; text-transform: uppercase; color: var(--e80-lime); }
.e80-log__empty { margin: 0; color: #a7a7bd; }
.e80-log__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.e80-game {
    display: grid;
    grid-template-columns: 44px 104px 1fr 120px 80px 84px;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #1f1b28;
    border-left: 6px solid #3a3446;
}
.e80-game--win { border-left-color: var(--e80-lime); }
.e80-game__n { color: #a7a7bd; }
.e80-game__date { font-size: 13px; color: #d6d3e0; }
.e80-game__match small { display: block; font-size: 12px; color: #a7a7bd; }
.e80-game__result { font-weight: 700; font-size: 13px; text-transform: uppercase; color: #a7a7bd; }
.e80-game--win .e80-game__result { color: var(--e80-lime); }
.e80-game__score { font-size: 12px; color: #a7a7bd; text-transform: uppercase; }
.e80-game__score b { font: normal 22px/1 'E80Komika', Impact, sans-serif; color: #fff; }
.e80-game__video a {
    display: inline-block;
    padding: 4px 10px;
    background: var(--e80-pink);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    text-decoration: none;
    text-transform: uppercase;
}
.e80-game__video a:hover { background: var(--e80-cyan); color: var(--e80-ink); }
.e80-game__extra { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.e80-game__extra:empty { display: none; }
.e80-chip { padding: 2px 8px; border: 1px solid var(--e80-cyan); color: var(--e80-cyan); font-size: 11px; text-transform: uppercase; }
.e80-game__note { font-size: 13px; color: #c9c6d4; font-style: italic; }

@media (max-width: 900px) {
    .e80-game { grid-template-columns: 40px 1fr auto; row-gap: 4px; }
    .e80-game__date, .e80-game__match { grid-column: 2; }
    .e80-game__result, .e80-game__score, .e80-game__video { grid-column: 3; justify-self: end; }
}
@media (max-width: 640px) {
    .e80-tracker { padding: 16px 12px 20px; }
    .e80-tracker .e80-title { font-size: 30px; }
    .e80-grids { grid-template-columns: 1fr; }
    .e80-cell { height: 66px; }
    .e80-log { padding: 14px 12px 18px; }
}
