@font-face {
    font-family: 'Noto Sans Display';
    font-style: normal;
    font-weight: 400;
}

:root {
    --text-shadow-color-1: #ea36af;
    --text-shadow-color-2: #75fa69;
}

/* --- RESET & BASICS --- */
html {
    background: #050505;
    min-height: 100%;
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 2em;
    font-family: 'Noto Sans Display', monospace;
    color: #eee;
    font-size: 1.1em;
    line-height: 1.4;
    text-shadow: 0.1rem 0 0.1rem var(--text-shadow-color-1), -0.1rem 0 0.1rem var(--text-shadow-color-2);
    letter-spacing: 0.125em;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
}

/* --- FIREFOX SPECIFIC BUTTON RESET --- */
button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    cursor: pointer;
    outline: inherit;
    color: inherit;
    /* Firefox: Remove default inner spacing */
    border-style: solid; /* Firefox defaults to 'inset' on buttons */
}

/* Removes the inner border/padding Firefox adds to buttons */
button::-moz-focus-inner {
    border: 0;
    padding: 0;
    margin: 0;
}

/* --- LAYOUT --- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo {
    max-width: 300px;
    height: auto;
    display: block;
    margin-bottom: 2rem;
    animation: glitch-skew 8s infinite linear alternate-reverse;
}

.event-info {
    text-align: center;
    margin: 2rem 0;
    padding: 1.5rem;
    border: 2px solid #eee;
    box-shadow: 0 0 5px rgba(238, 238, 238, 0.4);
    animation: border-flicker 3s infinite;
}

/* --- GAME LIST GRID --- */
.games-section {
    width: 100%;
}

.game-wrapper {
    width: 100%;
    border-bottom: 1px solid #333;
}

.game-row {
    display: grid;
    /*
       FIX 1: Changed 'auto' to 'min-content' for Firefox.
       This forces the column to be wide enough for the buttons
       without them wrapping or overflowing.
    */
    grid-template-columns: 2fr 1.5fr 0.5fr min-content;
    gap: 1rem;
    width: 100%;
    align-items: center; /* Firefox respects this better with min-content */
    padding: 1rem 0;
    /* Prevent overflow issues in Firefox */
    min-width: 0;
}

.header-row {
    border-bottom: 2px solid #eee;
    font-weight: bold;
}

.platform-icon {
    max-height: 20px;
    width: auto;
    vertical-align: middle;
    display: inline-block;
    filter: drop-shadow(0 0 2px var(--text-shadow-color-2));
    transition: transform 0.2s;
    margin-right: 5px;
}

.game-row:hover .platform-icon {
    transform: scale(1.2);
}

.status-yes { color: #75fa69; }
.status-no { color: #ea36af; }

/* --- BUTTONS & ACTIONS --- */
.game-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    /* FIX 2: Prevent Firefox from wrapping buttons to next line */
    flex-wrap: nowrap;
    /* Ensure the container doesn't shrink below content size */
    min-width: max-content;
}

/* Shared class for <button> and <a> to make them identical */
.action-btn {
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    /* FIX 3: Firefox vertical alignment fix */
    vertical-align: middle;

    height: 32px;
    width: 80px;
    padding: 0;
    box-sizing: border-box;

    font-family: 'Noto Sans Display', monospace;
    font-size: 0.8rem;
    font-weight: bold;
    text-decoration: none;
    line-height: 1;

    /* FIX 4: Prevent Firefox from breaking text inside buttons */
    white-space: nowrap;
    /* FIX 5: Prevent flex/grid from shrinking buttons in Firefox */
    flex-shrink: 0;

    border: 1px solid white;
    background: transparent;
    color: white;
    transition: all 0.2s ease;

    /* Optional: Prevent text selection which can look odd in Firefox */
    user-select: none;
}

.action-btn:hover {
    background: white;
    color: black;
    text-shadow: none;
}

.action-btn.active {
    background: var(--text-shadow-color-2);
    border-color: var(--text-shadow-color-2);
    color: black;
    text-shadow: none;
}

/* --- SLIDING DESCRIPTION --- */
.game-description {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.4s ease;
    opacity: 0;
    background: rgba(255, 255, 255, 0.05);
}

.game-description.open {
    max-height: 500px;
    opacity: 1;
    border-top: 1px dashed #333;
}

.game-description p {
    padding: 1rem;
    margin: 0;
    font-size: 0.9em;
    color: #ccc;
    line-height: 1.6;
}

/* --- ANIMATIONS --- */
@keyframes glitch-skew {
    0% { transform: skew(0deg); opacity: 1; filter: drop-shadow(2px 0 0 var(--text-shadow-color-1)); }
    15% { transform: skew(0deg); opacity: 1; }
    16% { transform: skew(-15deg); opacity: 0.8; filter: drop-shadow(-2px 0 0 var(--text-shadow-color-2)); }
    17% { transform: skew(15deg); opacity: 1; }
    18% { transform: skew(0deg); opacity: 1; }
    40% { transform: skew(0deg); opacity: 1; }
    41% { transform: skew(10deg); opacity: 0.8; filter: none; }
    42% { transform: skew(-10deg); opacity: 0.5; }
    43% { transform: skew(0deg); opacity: 1; filter: drop-shadow(2px 0 0 var(--text-shadow-color-1)); }
    70% { transform: skew(0deg); opacity: 1; }
    71% { transform: skew(-5deg); opacity: 0.1; }
    72% { transform: skew(20deg); opacity: 1; filter: drop-shadow(-5px 0 0 var(--text-shadow-color-2)); }
    73% { transform: skew(0deg); opacity: 1; }
    100% { transform: skew(0deg); opacity: 1; }
}

@keyframes border-flicker {
    0% { border-color: #eee; box-shadow: 0 0 5px #eee; }
    40% { border-color: #eee; box-shadow: 0 0 5px #eee; }
    41% { border-color: var(--text-shadow-color-1); box-shadow: 0 0 15px var(--text-shadow-color-1), inset 0 0 10px var(--text-shadow-color-1); }
    42% { border-color: #eee; box-shadow: 0 0 5px #eee; }
    60% { opacity: 1; }
    61% { border-color: transparent; box-shadow: none; }
    62% { border-color: transparent; box-shadow: none; }
    63% { border-color: #eee; box-shadow: 0 0 5px #eee; }
    80% { border-color: #eee; }
    81% { border-color: var(--text-shadow-color-2); box-shadow: 0 0 15px var(--text-shadow-color-2); }
    82% { border-color: #eee; }
    100% { border-color: #eee; }
}

/* --- MEDIA QUERIES --- */
@media screen and (max-width: 768px) {
    .game-row {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0.5rem;
    }

    .game-actions {
        justify-content: center;
        margin-top: 0.5rem;
        /* Allow wrapping on mobile since we have space */
        flex-wrap: wrap;
    }

    .header-row {
        display: none;
    }
}
/* --- CRT OVERLAY EFFECT --- */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    pointer-events: none; /* Ensures you can still click buttons behind it */
    background:
    /* Layer 1: Vignette (Darkens the corners) */
    radial-gradient(
        circle,
        rgba(0, 0, 0, 0) 60%,
                    rgba(0, 0, 0, 0.4) 100%
    ),
    /* Layer 2: Scanlines */
    linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 50%,
                    rgba(0, 0, 0, 0.1) 50%
    );
    background-size: 100% 100%, 100% 4px; /* 4px is the size of the scanlines */

    /* Optional: A very subtle flicker animation */
    animation: monitor-flicker 0.15s infinite;
}

/* Reduces the intensity of the flicker */
@keyframes monitor-flicker {
    0% { opacity: 0.97; }
    50% { opacity: 1; }
    100% { opacity: 0.98; }
}

/* Optional: Hide the effect on mobile if the screen is too small */
@media screen and (max-width: 768px) {
    .crt-overlay {
        background: radial-gradient(circle, rgba(0,0,0,0) 60%, rgba(0,0,0,0.4) 100%);
        animation: none;
    }
}

