@font-face {
    font-family: "Comic Neue";
    src: local("Comic Neue Bold"), local("ComicNeue-Bold"),
        url("ComicNeue-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #f462c6;
    --background-color: #211f2b;
    --text-color: #ffffff;
    --overlay-background: rgba(0, 0, 0, 0.2);
    --hover-background: rgba(244, 98, 198, 0.1);
}

html,
body {
    margin: 0;
    width: 100%;
    min-height: 100vh;
    background-color: var(--background-color);
}

body {
    font-size: 1rem;
    color: var(--primary-color);
    text-align: center;
    font-family: "Comic Neue", "Comic Sans MS", "Comic Sans", cursive, sans-serif;
    font-weight: 700;
    font-style: normal;
}

h1 {
    font-size: 2.5rem;
    margin: 1rem 0;
}

h1 a {
    color: var(--primary-color);
}

h1 a:hover {
    text-decoration: none;
}

h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

h3 {
    font-size: 1.2rem;
    margin: 0;
    font-weight: normal;
}

h6 {
    font-size: 0.75rem;
    color: var(--text-color);
    margin: 0.5rem 0;
}

iframe {
    border: none;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

#flash-container {
    --splash-screen-background: #000000;
    position: relative;
    margin: 0 auto 2rem auto;
    background: var(--overlay-background);
    border-radius: 8px;
}

.game-controls {
    position: absolute;
    top: 20px;
    right: 5px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    transition: all 0.3s ease;
    background: var(--overlay-background);
    padding: 10px;
    border-radius: 8px;
}

.game-controls.controls-horizontal {
    flex-direction: row;
    padding: 5px 10px;
}

.game-controls.controls-top {
    top: -50px;
    right: 20px;
    flex-direction: row;
}

.control-btn {
    background: var(--overlay-background);
    color: var(--text-color);
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.control-btn:hover {
    background: var(--hover-background);
    transform: scale(1.1);
}

.favorite-btn.active {
    color: gold;
    background: var(--hover-background);
}

#search-container {
    margin: 1rem auto;
    max-width: 300px;
    padding: 0 1rem;
}

#game-search {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: var(--overlay-background);
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
}

#game-search::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#game-search:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--overlay-background);
    box-shadow: 0 0 10px var(--primary-color);
}

#list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
    max-width: 1600px;
    margin: 0 auto;
}

.category {
    background: var(--overlay-background);
    border-radius: 8px;
    padding: 1rem;
    text-align: left;
}

.category h2 {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.category a {
    display: block;
    padding: 0.5rem;
    margin: 0.2rem 0;
    border-radius: 4px;
    transition: all 0.2s;
}

.category a:hover {
    background: var(--hover-background);
    transform: translateX(5px);
}

.play-count {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 10px;
}

.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.7);
}

.error-container {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
}

.error-container button {
    margin-top: 10px;
    padding: 8px 16px;
    background: var(--hover-background);
    color: var(--text-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.error-container button:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

#offline-mode {
    margin: 2rem auto;
    padding: 1rem;
    max-width: 300px;
    background: var(--overlay-background);
    border-radius: 8px;
}

footer {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--overlay-background);
}

footer h3 {
    margin: 0.5rem 0;
}

.current-game {
    background: var(--hover-background);
    border-left: 3px solid var(--primary-color);
}

.current-game:hover {
    transform: none;
    background: var(--hover-background);
}

.volume-slider {
    width: 100px;
    height: 0.5rem;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.25rem;
    outline: none;
    margin: auto 0;
    cursor: pointer;
}

.controls-horizontal .volume-slider {
    width: 5rem;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 1rem;
    height: 1rem;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.volume-slider:hover {
    background: rgba(255, 255, 255, 0.3);
}

.volume-btn {
    font-size: 16px;
    padding: 8px 10px;
}