/* Shared Game Styles for Ant Tea Games
 * Standardized styles used across all games
 */

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: #000;
    color: #00ff00;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

h1 {
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-size: 2.5rem;
}

h1 a {
    color: #00ff00;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

h1 a:hover {
    text-shadow: 0 0 20px #00ff00, 0 0 30px #00ff00;
    transform: scale(1.05);
}

/* Game Container */
.game-container {
    max-width: 900px;
    width: 100%;
    background: #001100;
    border: 3px solid #00ff00;
    box-shadow: 0 0 30px #00ff00;
    padding: 30px;
}

/* Standardized Layout Sections */
.game-score-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #000;
    border: 2px solid #00ff00;
    text-align: center;
}

.game-window-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #000;
    border: 2px solid #00ff00;
    position: relative;
}

.game-controls-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #001100;
    border: 1px solid #00ff00;
}

.game-instructions-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #000;
    border: 1px solid #00ff00;
    font-size: 0.9rem;
    line-height: 1.6;
}

.game-instructions-section h3 {
    color: #00ff00;
    text-transform: uppercase;
    margin-bottom: 10px;
    text-shadow: 0 0 5px #00ff00;
}

.game-instructions-section ul {
    list-style: none;
    padding-left: 0;
}

.game-instructions-section li {
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
    color: #00ff88;
}

.game-instructions-section li::before {
    content: '> ';
    position: absolute;
    left: 0;
    color: #00ff00;
}

/* Buttons */
.game-btn {
    background: #000;
    color: #00ff00;
    border: 2px solid #00ff00;
    padding: 12px 24px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 10px #00ff00;
}

.game-btn:hover {
    background: #00ff00;
    color: #000;
    box-shadow: 0 0 20px #00ff00;
}

.game-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.game-btn-primary {
    background: #00ff00;
    color: #000;
    border: 2px solid #00ff00;
    box-shadow: 0 0 15px #00ff00;
}

.game-btn-primary:hover:not(:disabled) {
    background: #000;
    color: #00ff00;
    box-shadow: 0 0 25px #00ff00;
}

.game-btn-secondary {
    background: #001100;
    color: #00ff00;
    border: 2px solid #00ff00;
}

.game-btn-secondary:hover:not(:disabled) {
    background: #00ff00;
    color: #000;
}

/* Input Fields */
.game-input {
    background: #000;
    color: #00ff00;
    border: 2px solid #00ff00;
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

.game-input:focus {
    outline: none;
    box-shadow: 0 0 10px #00ff00;
}

/* Messages */
.game-message {
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-message-success {
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
    background: #001100;
    border: 2px solid #00ff00;
}

.game-message-error {
    color: #ff0000;
    text-shadow: 0 0 10px #ff0000;
    background: #110000;
    border: 2px solid #ff0000;
}

.game-message-info {
    color: #00ff88;
    text-shadow: 0 0 10px #00ff88;
    background: #001100;
    border: 2px solid #00ff00;
}

/* Username Section */
.username-section {
    margin-top: 20px;
    padding: 15px;
    background: #001100;
    border: 1px solid #00ff00;
    text-align: center;
    width: 100%;
}

.username-section > div:first-child {
    color: #00ff88;
    margin-bottom: 10px;
}

.username-input {
    background: #000;
    color: #00ff00;
    border: 2px solid #00ff00;
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    width: 200px;
    max-width: calc(100% - 20px);
    margin: 0 10px;
}

.username-input:focus {
    outline: none;
    box-shadow: 0 0 10px #00ff00;
}

/* Rank Display */
.rank-display {
    margin-top: 15px;
    padding: 10px;
    background: #001100;
    border: 1px solid #00ff00;
    text-align: center;
    color: #00ff88;
    font-size: 1.1rem;
}

/* Leaderboard Section */
.leaderboard-section {
    margin-top: 30px;
    padding: 20px;
    background: #000;
    border: 2px solid #00ff00;
    box-shadow: 0 0 20px #00ff00;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.leaderboard-title {
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
    text-transform: uppercase;
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-align: center;
}

.leaderboard-table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.leaderboard-table th {
    color: #00ff88;
    text-transform: uppercase;
    padding: 10px;
    border-bottom: 2px solid #00ff00;
    text-align: left;
}

.leaderboard-table td {
    color: #00ff00;
    padding: 8px 10px;
    border-bottom: 1px solid #003300;
}

.leaderboard-table tr:hover {
    background: #001100;
}

.leaderboard-table .player-rank {
    font-weight: bold;
    color: #00ff88;
}

.leaderboard-table .player-you {
    background: #002200;
    font-weight: bold;
}

.loading {
    text-align: center;
    color: #00ff88;
    padding: 20px;
}

/* API Status */
.api-status {
    font-size: 0.8rem;
    color: #00ff88;
    text-align: center;
    margin-top: 10px;
}

/* PWA Install Section */
.pwa-install-section {
    margin-top: 20px;
    padding: 15px;
    background: #001100;
    border: 1px solid #00ff00;
    text-align: center;
    width: 100%;
}

.pwa-install-section > div:first-child {
    color: #00ff88;
    margin-bottom: 10px;
}

.pwa-install-section p {
    font-size: 0.9rem;
    color: #00ff00;
    margin-bottom: 10px;
}

.pwa-install-btn {
    background: #00ff00;
    color: #000;
    border: 2px solid #00ff00;
    padding: 10px 20px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s;
    box-shadow: 0 0 10px #00ff00;
    font-size: 0.9rem;
}

.pwa-install-btn:hover {
    background: #000;
    color: #00ff00;
    box-shadow: 0 0 20px #00ff00;
}

.pwa-install-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Fullscreen Button */
.fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    background: rgba(0, 17, 0, 0.7);
    border: none;
    border-radius: 8px;
    color: #00ff00;
    padding: 0;
    font-size: 1.3rem;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 255, 0, 0.2), inset 0 0 10px rgba(0, 255, 0, 0.1);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    line-height: 1;
}

.fullscreen-btn::before {
    content: '⛶';
    font-size: 1.2rem;
    display: block;
}

.fullscreen-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 4px 16px rgba(0, 255, 0, 0.4), inset 0 0 15px rgba(0, 255, 0, 0.2);
    transform: scale(1.1);
}

.fullscreen-btn:active {
    transform: scale(0.95);
}

.fullscreen-btn.fullscreen-active::before {
    content: '⛶';
}


/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .game-container {
        padding: 20px;
    }

    .leaderboard-table {
        font-size: 0.75rem;
        min-width: 400px;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 6px 8px;
    }

    .username-input {
        width: 150px;
        font-size: 0.9rem;
        padding: 6px 10px;
    }

    .game-score-section,
    .game-window-section,
    .game-controls-section,
    .game-instructions-section {
        padding: 15px;
        margin-bottom: 20px;
    }

    .fullscreen-btn {
        top: 8px;
        right: 8px;
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .fullscreen-btn::before {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    .game-container {
        padding: 15px;
    }

    .leaderboard-table {
        font-size: 0.7rem;
        min-width: 350px;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 5px 6px;
    }

    .username-input {
        width: 120px;
        font-size: 0.85rem;
        padding: 5px 8px;
    }

    .game-score-section,
    .game-window-section,
    .game-controls-section,
    .game-instructions-section {
        padding: 10px;
        margin-bottom: 15px;
    }

    .fullscreen-btn {
        top: 6px;
        right: 6px;
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .fullscreen-btn::before {
        font-size: 0.9rem;
    }
}
