/* ========================================
   PenangTime Games - Shared Styles
   ======================================== */

/* Game Container */
.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 60vh;
}

/* Game Header */
.game-header {
    text-align: center;
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
}
.game-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 0.25rem;
}
.game-header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Game Controls Bar */
.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.game-score {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
}
.game-timer {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e53e3e;
}
.game-controls-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Buttons */
.game-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.game-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.game-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}
.game-btn-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}
.game-btn-warning {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
}
.game-btn-danger {
    background: linear-gradient(135deg, #fc8181, #e53e3e);
    color: white;
}
.game-btn-outline {
    background: white;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}
.game-btn-outline:hover {
    border-color: #667eea;
    color: #667eea;
}
.game-btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}
.game-btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Score Display */
.game-final-score {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f6d365, #fda085);
    border-radius: 16px;
    margin: 1.5rem 0;
    color: white;
}
.game-final-score h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}
.game-final-score .score-number {
    font-size: 3rem;
    font-weight: 900;
    display: block;
    line-height: 1.2;
}
.game-final-score .score-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Leaderboard */
.leaderboard-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin: 1.5rem 0;
    overflow: hidden;
}
.leaderboard-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}
.leaderboard-item:last-child {
    border-bottom: none;
}
.leaderboard-item:hover {
    background: #f7fafc;
}
.leaderboard-item.is-you {
    background: #fffff0;
    font-weight: 600;
}
.leaderboard-rank {
    width: 2rem;
    text-align: center;
    font-weight: 700;
    color: #a0aec0;
    font-size: 0.9rem;
}
.leaderboard-rank.gold { color: #d69e2e; }
.leaderboard-rank.silver { color: #a0aec0; }
.leaderboard-rank.bronze { color: #c05621; }
.leaderboard-name {
    flex: 1;
    margin-left: 0.75rem;
    color: #2d3748;
}
.leaderboard-score {
    font-weight: 700;
    color: #667eea;
}
.leaderboard-empty {
    text-align: center;
    padding: 2rem;
    color: #a0aec0;
}

/* Share Panel */
.share-panel {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1rem 0;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.share-btn-facebook { background: #1877f2; }
.share-btn-twitter { background: #1da1f2; }
.share-btn-whatsapp { background: #25d366; }
.share-btn-telegram { background: #0088cc; }
.share-btn-copy { background: #718096; }

/* Fun Fact Box */
.fun-fact-box {
    background: linear-gradient(135deg, #ebf8ff, #e9d8fd);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    border-left: 4px solid #667eea;
}
.fun-fact-box .fun-fact-label {
    font-weight: 700;
    color: #5a67d8;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.fun-fact-box p {
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* Fullscreen mode */
.game-fullscreen-wrapper {
    transition: all 0.3s ease;
}
.game-fullscreen-wrapper:fullscreen,
.game-fullscreen-wrapper:-webkit-full-screen {
    background: #f7fafc;
    overflow-y: auto;
}

/* Modal */
.game-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.game-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.game-modal {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.game-modal-overlay.active .game-modal {
    transform: scale(1);
}
.game-modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.game-modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2d3748;
}
.game-modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #a0aec0;
    cursor: pointer;
    padding: 0.25rem;
}
.game-modal-body {
    padding: 1.25rem;
}

/* Responsive */
@media (max-width: 640px) {
    .game-header h1 {
        font-size: 1.5rem;
    }
    .game-controls {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .game-controls-buttons {
        justify-content: center;
    }
    .game-final-score .score-number {
        font-size: 2.5rem;
    }
}
