body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    font-family: 'Arial', sans-serif;
    color: #fff;
    display: flex;
    flex-direction: column;
}

/* 광고 컨테이너 스타일 */
.ad-container {
    width: 100%;
    display: flex;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.top-ad {
    margin-bottom: 20px;
    min-height: 90px;
}

.bottom-ad {
    margin-top: 20px;
    min-height: 90px;
}

.sidebar-ad {
    width: 160px;
    min-height: 600px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    margin-left: 20px;
}

/* 메인 콘텐츠 영역 */
.main-content {
    flex-grow: 1;
    padding: 0 20px;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.hero-section {
    text-align: center;
    margin-bottom: 50px;
    padding: 60px 0;
}

.hero-section h1 {
    font-size: 3.2em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.highlight {
    background: linear-gradient(135deg, #ffeaa7, #fab1a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.3em;
    margin-bottom: 15px;
    opacity: 0.9;
    line-height: 1.5;
}

.hero-cta {
    font-size: 1.1em;
    color: #ffeaa7;
    font-weight: 500;
    margin-top: 10px;
}

.content-grid {
    display: flex;
    gap: 20px;
}

.content-area {
    flex: 1;
}

/* 게임 섹션 */
.games-section, .utilities-section {
    margin-bottom: 40px;
}

.games-section h2, .utilities-section h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #fff;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 10px;
}

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

.game-card, .utility-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

.game-card:hover, .utility-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.game-card img {
    width: 64px;
    height: 64px;
    margin-bottom: 15px;
    filter: brightness(0) invert(1);
}

.placeholder-img {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.7;
}

.game-card h3, .utility-card h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #fff;
}

.game-card p, .utility-card p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    line-height: 1.5;
}

.play-btn {
    background: linear-gradient(45deg, #74b9ff, #0984e3);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.95em;
}

.play-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(116, 185, 255, 0.4);
    background: linear-gradient(45deg, #0984e3, #74b9ff);
}

.play-btn.disabled {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    cursor: not-allowed;
    font-size: 0.9em;
}

.coming-soon::after {
    content: "COMING SOON";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff6b6b;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: bold;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .content-grid {
        flex-direction: column;
    }
    
    .sidebar-ad {
        width: 100%;
        margin-left: 0;
        margin-top: 20px;
        min-height: 250px;
    }
    
    .hero-section h1 {
        font-size: 2em;
    }
    
    .game-grid, .utility-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 0 10px;
    }
}

/* Game Page Specific Styles */
.game-main {
    flex-grow: 1;
    padding: 20px;
}

.game-layout {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.game-content {
    flex: 1;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.game-info {
    flex: 0 0 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-info h1 {
    font-size: 2.2em;
    margin-bottom: 15px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-description {
    font-size: 1.1em;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 25px;
}

.how-to-play {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.how-to-play h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #ffeaa7;
    display: flex;
    align-items: center;
    gap: 8px;
}

.how-to-play h3:before {
    content: "🎯";
    font-size: 1.2em;
}

.how-to-play ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.how-to-play li {
    margin-bottom: 12px;
    font-size: 1em;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.how-to-play li:last-child {
    margin-bottom: 0;
}

.game-sidebar-ad {
    width: 160px;
    min-height: 600px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Adjust existing game container for new layout */
#game-container {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Game page responsive design */
@media (max-width: 1024px) {
    .game-layout {
        flex-direction: column;
    }
    
    .game-content {
        flex-direction: column;
    }
    
    .game-info {
        flex: none;
        order: 2;
    }
    
    #game-container {
        order: 1;
    }
    
    .game-sidebar-ad {
        width: 100%;
        min-height: 250px;
        order: 3;
    }
}

@media (max-width: 768px) {
    .game-main {
        padding: 10px;
    }
    
    .game-content {
        gap: 20px;
    }
    
    .game-info {
        padding: 20px;
    }
    
    .game-info h1 {
        font-size: 1.8em;
    }
    
    .how-to-play {
        padding: 15px;
    }
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 900px; /* Max width for the game area */
    position: relative; /* Added for positioning children */
    height: 100%; /* Make game-container fill the height of its flex parent (main) */
}

#game-canvas {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1; /* Make game-canvas take available space within game-container */
    overflow: hidden; /* Hide overflow if canvas is too big */
}

canvas {
    display: block;
    width: 100%; /* Ensure canvas scales */
    height: auto; /* Maintain aspect ratio */
    max-height: 100%; /* Constrain canvas height to game-canvas height */
    background-color: #000;
}

#restartButton {
    position: absolute;
    top: 10px; /* Position from the top */
    right: 10px; /* Position from the right */
    left: auto; /* Remove left positioning */
    transform: none; /* Remove transform to center */
    padding: 10px 20px;
    font-size: 1.2em;
    cursor: pointer;
    background-color: #4CAF50; /* Green */
    color: white;
    border: none;
    border-radius: 5px;
    z-index: 10; /* Ensure it's above the canvas */
}

/* Global Navigation Bar (GNB) Styles */
.gnb-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    color: white;
    flex-shrink: 0;
}

.gnb-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.gnb-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-text {
    font-size: 1.8em;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.logo-tagline {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.8);
    margin-top: -2px;
    font-weight: 400;
}

.gnb-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.gnb-nav li {
    margin-right: 20px;
}

.gnb-nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.gnb-nav a:hover {
    color: #f8f9fa; /* Lighter white on hover */
}

.gnb-actions {
    display: flex;
    align-items: center;
}

.gnb-chill-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.gnb-chill-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
