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;
}

.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;
}

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;
}