* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;

    color: #222;

    background:
        linear-gradient(#213d63, #10243e 260px, #d7d7d7 260px);
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

/* main shell */

.page {
    width: min(1100px, calc(100% - 24px));
    margin: 18px auto 40px;

    background: #fff;

    border: 1px solid #09192a;
    box-shadow: 0 4px 20px rgba(0,0,0,.45);
}

/* header */

.top {
    min-height: 92px;

    padding: 15px 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    color: white;

    background:
        linear-gradient(
            180deg,
            #3878ba 0%,
            #205b96 50%,
            #154574 51%,
            #123b65 100%
        );

    border-bottom: 1px solid #092b4b;
}

.logo {
    position: relative;

    font-family: Arial Black, Impact, sans-serif;
    font-size: 38px;

    letter-spacing: -3px;

    text-shadow:
        0 2px 0 rgba(0,0,0,.4),
        0 0 4px rgba(255,255,255,.2);
}

.logo-flix {
    color: #fff;
}

.logo-play {
    color: #ffcc19;
}

.logo small {
    display: block;

    margin-top: -5px;

    font-family: Verdana, sans-serif;
    font-size: 9px;

    letter-spacing: 3px;

    color: #b9d8f6;
}

.top-links {
    display: flex;
    gap: 18px;
}

.top-links a {
    color: white;
    font-weight: bold;
    text-decoration: none;
}

.top-links a:hover {
    text-decoration: underline;
}

/* navigation */

.nav {
    display: flex;
    flex-wrap: wrap;

    background:
        linear-gradient(#f8f8f8, #d8d8d8);

    border-bottom: 1px solid #aaa;
}

.nav-item {
    border: 0;
    border-right: 1px solid #bbb;

    padding: 11px 17px;

    background: transparent;

    color: #333;
    font-weight: bold;
}

.nav-item:hover {
    background: #eee;
}

.nav-item.active {
    color: white;

    background:
        linear-gradient(#f6a724, #df7a05);

    text-shadow: 0 1px 0 rgba(0,0,0,.3);
}

/* hero */

.hero {
    padding: 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;

    color: white;

    background:
        radial-gradient(
            circle at 20% 20%,
            #4b8bcb,
            #245c92 55%,
            #16436e
        );

    border-bottom: 4px solid #f29410;
}

.hero h1 {
    margin: 0 0 7px;

    font-size: 27px;
}

.hero p {
    margin: 0;

    color: #d8eafa;
}

.play-random {
    flex-shrink: 0;

    padding: 13px 23px;

    color: #fff;

    font-weight: bold;

    border: 1px solid #a95400;
    border-radius: 3px;

    background:
        linear-gradient(#ffb529, #e77d00);

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.5),
        0 2px 3px rgba(0,0,0,.25);

    text-shadow: 0 1px 0 rgba(0,0,0,.4);
}

.play-random:hover {
    background:
        linear-gradient(#ffc03e, #ef8a0b);
}

/* toolbar */

.toolbar {
    padding: 13px 16px;

    display: flex;
    gap: 10px;

    background: #eee;

    border-bottom: 1px solid #ccc;
}

.search {
    flex: 1;
}

.search input,
.toolbar select {
    width: 100%;

    height: 34px;

    padding: 6px 10px;

    border: 1px solid #aaa;

    background: white;
}

.toolbar select {
    width: 160px;
}

/* content */

main {
    padding: 18px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 14px;

    padding-bottom: 7px;

    border-bottom: 2px solid #e38a0b;
}

.section-title h2 {
    margin: 0;

    color: #234f7e;

    font-size: 18px;
}

#gameCount {
    color: #777;
}

/* games */

.game-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(155px, 1fr));

    gap: 14px;
}

.game-card {
    overflow: hidden;

    border: 1px solid #aaa;

    background: #f8f8f8;

    box-shadow: 0 1px 2px rgba(0,0,0,.14);

    transition:
        transform .1s ease,
        box-shadow .1s ease;
}

.game-card:hover {
    transform: translateY(-2px);

    box-shadow: 0 4px 10px rgba(0,0,0,.22);
}

.game-thumb {
    height: 110px;

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

    color: white;

    font-family: Arial Black, Arial, sans-serif;
    font-size: 36px;

    text-shadow: 0 2px 2px rgba(0,0,0,.4);

    background:
        radial-gradient(
            circle at 30% 20%,
            #5e9bd2,
            #285f93 60%,
            #173e65
        );

    border-bottom: 1px solid #16426d;
}

.game-info {
    padding: 9px;
}

.game-title {
    height: 30px;

    overflow: hidden;

    font-weight: bold;
    font-size: 12px;

    line-height: 15px;

    color: #1b4e7c;
}

.game-meta {
    height: 24px;

    margin-top: 5px;

    overflow: hidden;

    color: #777;

    font-size: 10px;
}

.game-play {
    width: 100%;

    margin-top: 8px;

    padding: 6px;

    color: white;

    font-weight: bold;

    border: 1px solid #a75f00;

    background:
        linear-gradient(#f5a321, #db7705);

    text-shadow: 0 1px 0 rgba(0,0,0,.3);
}

.game-play:hover {
    background:
        linear-gradient(#ffb632, #e98510);
}

.no-results {
    padding: 50px;

    text-align: center;

    color: #777;
}

.hidden {
    display: none;
}

/* footer */

footer {
    padding: 15px 20px;

    display: flex;
    justify-content: space-between;

    color: #bbb;

    background: #16283c;

    border-top: 4px solid #e68b0b;
}

footer strong {
    color: white;
    margin-right: 10px;
}

/* mobile */

@media (max-width: 650px) {

    .page {
        width: 100%;
        margin: 0;
        border: 0;
    }

    .top {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
    }

    .hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .toolbar {
        flex-direction: column;
    }

    .toolbar select {
        width: 100%;
    }

    .game-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


.game-thumb {
    overflow: hidden;
}

.game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    background: #fff;
}
