/* Common styles for all games */
body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overscroll-behavior-y: contain;
}

/* Header (Common for all game pages) */
header {
    background-color: #fff;
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #eee;
    position: relative; /* For positioning home-link */
}

.game-title {
    margin: 0;
    font-size: 2.5em; /* Consistent with index.css h1 */
    font-weight: bold; /* Consistent with index.css h1 */
    color: #333; /* Default color */
    margin-bottom: 5px; /* Reduced margin to bring link closer */
}

header p {
    margin: 5px 0 0;
    color: #777;
}

/* Home Link Styles (Common for all games) */
.home-link {
    margin-top: 10px;
    display: flex; /* Flexbox 적용 */
    align-items: center; /* 세로 중앙 정렬 */
    justify-content: center; /* 가로 중앙 정렬 */
    gap: 15px; /* 아이콘 사이 간격 */
}

.home-icon {
    display: inline-block;
    width: 35px; /* 아이콘 크기 */
    height: 35px; /* 아이콘 크기 */
    vertical-align: middle;
    cursor: pointer;
    transition: fill 0.3s ease; /* 부드러운 전환 효과 */
}

.home-icon svg {
    fill: #ccc; /* 연한 회색 */
    transition: fill 0.3s ease; /* 부드러운 전환 효과 */
}

.home-icon:hover svg {
    fill: #333; /* 검은색 */
}

.game-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

h2 {
    font-size: 2.5em;
    font-weight: 700;
    color: #4a4a4a;
    margin-bottom: 30px;
}

.game-area {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    width: 100%;
    max-width: 800px; /* Set max width to game width */
    margin: 0 auto; /* Center the game area horizontally */
}

@media (max-width: 480px) {
    .game-area {
        padding: 10px;
    }
}

.button-group {
    margin-top: 20px;
}

.game-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.game-button:hover {
    background-color: #0056b3;
}

/* Specific button styles */
#start-game-button {
    background-color: #28a745; /* Start button specific color */
}

#start-game-button:hover {
    background-color: #218838; /* Darker green on hover */
}

#download-result {
    background-color: #007bff;
}

#download-result:hover {
    background-color: #0069d9;
}

#reset {
    background-color: #dc3545;
}

#reset:hover {
    background-color: #c82333;
}

/* Ad Placeholder Styles */
.ad-placeholder {
    width: 100%;
    height: auto;
    min-height: 50px; /* Minimum height for banner ads */
    background-color: #e0e0e0;
    border: 1px dashed #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #888;
    font-size: 0.9em;
    text-align: center;
    margin-bottom: 10px; /* Space between ads and content */
}

/* Specific ad sizes for responsiveness */
@media (min-width: 768px) {
    .ad-placeholder.top-banner, .ad-placeholder.bottom-banner {
        min-height: 90px; /* Larger height for desktop banners */
    }
}

@media (max-width: 767px) {
    .ad-placeholder.top-banner, .ad-placeholder.bottom-banner {
        min-height: 50px; /* Smaller height for mobile banners */
    }
}

.ad-placeholder.interstitial {
    min-height: 300px; /* Example height for interstitial ads */
    font-size: 1.2em;
}

.ad-placeholder.rewarded {
    min-height: 150px; /* Example height for rewarded ads */
}

/* Footer (Common for all game pages) */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    background-color: #fff;
    border-top: 1px solid #eee;
    color: #777;
    width: 100%; /* Ensure footer spans full width */
}

.related-games {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.share-icon {
    display: inline-block;
    width: 35px; /* 더 크게 조정 */
    height: 35px; /* 더 크게 조정 */
    vertical-align: middle;
    cursor: pointer;
    transition: fill 0.3s ease; /* 부드러운 전환 효과 */
}

.share-icon svg {
    fill: #ADD8E6; /* 연한 하늘색 */
    transition: fill 0.3s ease; /* 부드러운 전환 효과 */
}

.share-icon:hover svg {
    fill: #007bff; /* 파란색 */
}