body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: #fdf6e3; /* Warm cream background */
    color: #5c3d2e; /* Deep warm brown text */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
    background-color: #fffaf0; /* Floral white */
    padding: 30px;
    box-shadow: 0 10px 30px rgba(139, 69, 19, 0.1);
    border-radius: 16px;
    border: 1px solid #f9ebc8;
}

h1 {
    text-align: center;
    color: #b85c38; /* Terracotta/Orange accent */
    margin-bottom: 40px;
    font-weight: 800;
}

.game-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.game-card {
    background-color: #fff;
    border: 1px solid #f9ebc8;
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(139, 69, 19, 0.15);
}

.game-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s;
}

.game-card:hover img {
    opacity: 0.9;
}

.game-card h2 {
    font-size: 1.3em;
    margin: 20px 15px;
    color: #8c4332;
}

.game-card a {
    text-decoration: none;
    color: inherit;
}

.game-detail {
    text-align: center;
    padding-top: 20px;
}

.game-detail img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.game-detail p {
    font-size: 1.1em;
    line-height: 1.8;
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
    color: #5c3d2e;
}

/* --- Embedded game iframe --- */
.game-embed {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 30px;
    border-radius: 12px;
    overflow: hidden;
    border: 4px solid #f9ebc8;
    background: #2d1e17; /* Dark warm brown background for loading/empty state */
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    aspect-ratio: 16 / 9;
}

.game-embed::before {
    content: "";
    display: block;
}

/* For browsers that don't support aspect-ratio (fallback) */
@supports not (aspect-ratio: 16 / 9) {
    .game-embed::before {
        padding-top: 56.25%;
    }
}

@supports (aspect-ratio: 16 / 9) {
    .game-embed::before {
        display: none;
    }
}

.game-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* --- Game description blocks (included via PHP) --- */
.game-desc {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.game-desc h2 {
    margin: 20px 0 15px;
    color: #b85c38;
    font-size: 1.8em;
    line-height: 1.2;
}

.game-desc h3 {
    margin: 25px 0 12px;
    color: #8c4332;
    font-size: 1.3em;
}

.game-desc p {
    margin: 15px 0;
    font-size: 1.05em;
    line-height: 1.8;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 30px;
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@supports not (aspect-ratio: 9 / 16) {
    .video-container {
        padding-top: 177.78%; /* 16 / 9 * 100 */
    }
}

.game-desc ul {
    margin: 15px 0 20px 25px;
    padding: 0;
}

.game-desc li {
    margin: 8px 0;
    line-height: 1.7;
}

.game-controls {
    margin: 20px 0 30px;
    border: 1px solid #f9ebc8;
    border-radius: 12px;
    overflow: hidden;
    background: #fffdf9;
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.05);
}

.game-controls table {
    width: 100%;
    border-collapse: collapse;
}

.game-controls th,
.game-controls td {
    padding: 12px 15px;
    border-bottom: 1px solid #f9ebc8;
    text-align: left;
    vertical-align: top;
}

.game-controls thead th {
    background: #fdf2d5;
    color: #8c4332;
    font-weight: 700;
}

.game-controls tbody tr:last-child td {
    border-bottom: none;
}

.game-desc pre {
    margin: 20px 0 0;
    padding: 15px 20px;
    background: #2d1e17; /* Dark warm brown */
    color: #f9ebc8; /* Light cream */
    border-radius: 12px;
    overflow: auto;
    font-size: 0.95em;
    line-height: 1.6;
    border: 1px solid #b85c38;
}

.game-desc code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.game-screenshots {
    margin-top: 40px;
    text-align: center;
}

.screenshot-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.screenshot-grid img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 2px solid #f9ebc8;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}



a {
    color: #e07a5f; /* Warm coral/orange */
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #b85c38;
    text-decoration: underline;
}

/* Back button specific */
.container > p a {
    display: inline-block;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Download button */
.download-container {
    text-align: center;
    margin: 30px 0;
}

.download-button {
    display: inline-block;
    background-color: #b85c38;
    color: #fff !important;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    text-decoration: none !important;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 15px rgba(184, 92, 56, 0.3);
}

.download-button:hover {
    background-color: #8c4332;
    transform: translateY(-2px);
    color: #fff !important;
    text-decoration: none !important;
}

/* Footer styling */
footer {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #f9ebc8;
    text-align: center;
}

footer p {
    font-size: 0.9em;
    color: #8c7365;
    margin-top: 10px;
}

.social-links {
    margin-bottom: 10px;
}

.social-links a {
    margin: 0 15px;
    display: inline-block;
    vertical-align: middle;
    transition: transform 0.2s;
}

.social-links a:hover {
    transform: scale(1.1);
}

.social-links img {
    width: 32px;
    height: 32px;
    transition: transform 0.2s;
}

.social-links a:hover img {
    transform: scale(1.1);
}