/* Games Page Styles */

/* Hide WordPress header, navigation, and footer elements */
.site-header,
header,
header.site-header,
#masthead,
.header-two,
.header-area,
.top-header,
.affix,
.logo-wrap,
.logo,
.site-title,
.site-description,
.site-branding,
.main-navigation,
nav.main-navigation,
nav.navbar,
.navbar,
.main-menu,
.menu,
.site-footer,
footer,
footer.site-footer,
#colophon,
.footer-widgets,
.site-info,
.footer-area,
.foot-bottom {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Reset body for games page */
body.page-template-page-games {
    margin: 0 !important;
    padding: 0 !important;
}

* {
    box-sizing: border-box;
}

#games-page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* AdSense Banner Area */
#adsense-banner {
    width: 100%;
    margin-bottom: 20px;
    text-align: center;
}

.ad-placeholder {
    background: #f0f0f0;
    border: 2px dashed #ccc;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

/* Main Content Wrapper */
#games-content-wrapper {
    display: flex;
    gap: 20px;
    min-height: 600px;
}

/* Left Navigation Sidebar */
.games-sidebar {
    flex: 0 0 200px;
    background: #2c3e50;
    border-radius: 8px;
    padding: 20px;
    color: white;
}

.games-sidebar h2 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #ecf0f1;
    border-bottom: 2px solid #34495e;
    padding-bottom: 10px;
}

#game-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

#game-menu li {
    margin-bottom: 10px;
}

.game-link {
    display: block;
    padding: 12px 15px;
    background: #34495e;
    color: #ecf0f1;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.game-link:hover {
    background: #4a5f7f;
    transform: translateX(5px);
}

.game-link.active {
    background: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* Main Game Area */
.games-content {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#game-container {
    width: 100%;
    min-height: 500px;
    position: relative;
}

#loading {
    text-align: center;
    padding: 50px;
    color: #7f8c8d;
    font-size: 18px;
}

/* Game-specific containers */
.game-wrapper {
    display: none;
}

.game-wrapper.active {
    display: block;
}

.game-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

.game-canvas {
    display: block;
    margin: 0 auto;
    border: 2px solid #34495e;
    border-radius: 4px;
    background: #000;
}

/* Game Controls */
.game-controls {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: #ecf0f1;
    border-radius: 5px;
}

.game-button {
    padding: 10px 25px;
    margin: 5px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.game-button:hover {
    background: #2980b9;
}

.game-button:active {
    transform: scale(0.98);
}

/* Game Info Display */
.game-info {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

.info-item {
    text-align: center;
}

.info-label {
    font-size: 12px;
    color: #7f8c8d;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.info-value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

/* Word Game Styles (Hangman, Wordle) */
.word-display {
    font-size: 48px;
    letter-spacing: 10px;
    text-align: center;
    margin: 30px 0;
    font-family: 'Courier New', monospace;
    min-height: 60px;
}

.keyboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 8px;
    max-width: 600px;
    margin: 20px auto;
}

.key {
    padding: 15px;
    background: #ecf0f1;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    transition: all 0.2s ease;
}

.key:hover {
    background: #d5dbdb;
    transform: translateY(-2px);
}

.key:active {
    transform: translateY(0);
}

.key.used {
    background: #95a5a6;
    color: #7f8c8d;
    cursor: not-allowed;
}

.key.correct {
    background: #2ecc71;
    color: white;
    border-color: #27ae60;
}

.key.present {
    background: #f39c12;
    color: white;
    border-color: #e67e22;
}

.key.wrong {
    background: #e74c3c;
    color: white;
    border-color: #c0392b;
}

/* Wordle Grid */
.wordle-grid {
    display: grid;
    grid-template-rows: repeat(6, 60px);
    gap: 5px;
    max-width: 350px;
    margin: 20px auto;
}

.wordle-row {
    display: grid;
    grid-template-columns: repeat(5, 60px);
    gap: 5px;
    justify-content: center;
}

.wordle-cell {
    width: 60px;
    height: 60px;
    border: 2px solid #d3d6da;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    text-transform: uppercase;
    background: white;
}

.wordle-cell.filled {
    border-color: #878a8c;
}

.wordle-cell.correct {
    background: #6aaa64;
    border-color: #6aaa64;
    color: white;
}

.wordle-cell.present {
    background: #c9b458;
    border-color: #c9b458;
    color: white;
}

.wordle-cell.absent {
    background: #787c7e;
    border-color: #787c7e;
    color: white;
}

/* Canvas Games Instructions */
.game-instructions {
    text-align: center;
    padding: 15px;
    background: #e8f4f8;
    border-left: 4px solid #3498db;
    margin-bottom: 20px;
    border-radius: 4px;
}

.game-instructions h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.game-instructions p {
    margin: 5px 0;
    color: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    #games-content-wrapper {
        flex-direction: column;
    }

    .games-sidebar {
        flex: 1;
        margin-bottom: 20px;
    }

    #game-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    #game-menu li {
        flex: 1 1 calc(50% - 10px);
        margin-bottom: 0;
    }

    .game-canvas {
        max-width: 100%;
        height: auto;
    }

    .word-display {
        font-size: 32px;
        letter-spacing: 5px;
    }

    .keyboard {
        gap: 5px;
    }

    .key {
        padding: 10px;
        font-size: 14px;
    }

    .wordle-row {
        grid-template-columns: repeat(5, 50px);
    }

    .wordle-cell {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    #games-page-container {
        padding: 10px;
    }

    .games-sidebar h2 {
        font-size: 16px;
    }

    .game-title {
        font-size: 24px;
    }

    .word-display {
        font-size: 24px;
    }

    .wordle-row {
        grid-template-columns: repeat(5, 40px);
    }

    .wordle-cell {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* Game Over / Win Screen */
.game-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 1000;
}

.game-message h2 {
    margin: 0 0 20px 0;
    font-size: 32px;
    color: #2c3e50;
}

.game-message.win h2 {
    color: #27ae60;
}

.game-message.lose h2 {
    color: #e74c3c;
}
