body {
    background: #1b2838;
    color: #c7d5e0;
    font-family: Arial, sans-serif;
    text-align: center;
    margin: 0;
}

.header {
    padding: 20px;
    background: #171a21;
}

h2 {
    margin: 0 0 15px;
}

.controls-container {
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
}

.controls {
    display: flex;
}

.c_input label {
    width: 120px;
    display: inline-block;
    text-align: right;
    white-space: nowrap;
    margin-right: 10px;
}

a {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    font-size: 12px;
}

.input-row {
    display: flex;
    align-items: center;
    justify-content: center;
}

input {
    width: 240px;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #3a3a3a;
    background: #333;
    color: #fff;
    margin: 0 5px 0 0;
}

button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    background: #63b1e3;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

button:hover {
    background: #7ac4f5;
}

button:disabled {
    background: #4a5863;
    cursor: not-allowed;
}

#history-container {
    margin-top: 15px;
}

#history-container button {
    background: #3a4755;
    margin: 2px 4px;
    font-size: 12px;
    padding: 4px 8px;
}

#history-container button:hover {
    background: #526375;
}

.main-content {
    max-width: 1800px;
    margin: 20px auto;
    padding: 5px;
}

#message-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.message-text {
    color: #c7d5e0;
    font-size: 1.2em;
    line-height: 1.6;
    text-align: center;
}

.hidden {
    display: none !important;
}

#grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    grid-auto-rows: 80px;
    grid-gap: 5px;
    grid-auto-flow: dense;
    background-color: #1b2838;
}

.game {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: #000;

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.grid--capturing .game:hover {
    transform: none;
    box-shadow: none;
    z-index: 1;
}

.game:hover {
    transform: scale(1.03);
    box-shadow: 0 0 15px rgba(100, 180, 255, 0.5);
    z-index: 10;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 6px;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 40%, transparent 60%, rgba(0, 0, 0, 0.8) 100%);
}

.game:hover .overlay {
    opacity: 1;
}

.grid--capturing .overlay {
    display: none;
}

.playtime {
    align-self: flex-end;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
}

.game-name {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 3px #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.github-corner:hover .octo-arm {
    animation: octocat-wave 560ms ease-in-out
}

@keyframes octocat-wave {
    0%, 100% {
        transform: rotate(0)
    }
    20%, 60% {
        transform: rotate(-25deg)
    }
    40%, 80% {
        transform: rotate(10deg)
    }
}

@media (max-width: 500px) {
    .github-corner:hover .octo-arm {
        animation: none
    }

    .github-corner .octo-arm {
        animation: octocat-wave 560ms ease-in-out
    }
}
