/* ============================================
   Game Moto - Games Page Styles
   ============================================ */

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

body {
    font-family: 'Poppins', Arial, sans-serif;
    background: #0F0F1A;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

.page-wrapper {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px 24px;
    min-height: 100vh;
}

/* ---- Header ---- */
.header {
    padding: 20px 0 12px;
    text-align: center;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 28px;
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #FF6B6B, #FFD93D, #6BCB77, #4D96FF);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.08);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #888;
}

.header-badge.active .badge-dot {
    background: #4ECB71;
    box-shadow: 0 0 8px #4ECB71;
}

.header-badge.inactive .badge-dot {
    background: #FFD93D;
}

.tagline {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    font-weight: 400;
}

/* ---- Error Banner ---- */
.error-banner {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #FF6B6B;
}

.error-close {
    background: none;
    border: none;
    color: #FF6B6B;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
}

/* ---- Games Section ---- */
.games-section {
    margin-top: 8px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
}

.game-count {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.06);
    padding: 4px 10px;
    border-radius: 12px;
}

/* ---- Games Grid ---- */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

/* ---- Game Card ---- */
.game-card {
    position: relative;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 20px 12px 14px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.game-card:active {
    transform: scale(0.96);
}

.game-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.12);
}

.game-card-bg {
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    filter: blur(30px);
    opacity: 0.6;
    pointer-events: none;
}

.game-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.game-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.game-icon-emoji {
    font-size: 28px;
    line-height: 1;
}

.game-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    position: relative;
    z-index: 1;
}

.play-btn {
    color: #fff;
    border: none;
    padding: 6px 24px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: opacity 0.2s;
}

.play-btn:hover {
    opacity: 0.85;
}

/* ---- Subscribe Overlay / Modal ---- */
.subscribe-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
}

.subscribe-modal {
    background: #1A1A2E;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px 24px 16px 16px;
    padding: 32px 24px 24px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    position: relative;
    animation: slide-up 0.3s ease;
}

@keyframes slide-up {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.subscribe-modal h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-desc {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 12px;
}

.modal-price {
    margin-bottom: 4px;
}

.price-amount {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, #FFD93D, #FF6B6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-period {
    font-size: 16px;
    color: rgba(255,255,255,0.5);
}

.modal-note {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 20px;
}

.subscribe-btn {
    width: 100%;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.subscribe-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

.subscribe-btn:active {
    transform: scale(0.98);
}

/* Loading state in modal */
.subscribe-loading {
    padding: 16px 0;
}

.subscribe-loading p {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin-top: 12px;
}

.subscribe-loading .small-text {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-top: 4px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top: 4px solid #FF6B6B;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error state in modal */
.subscribe-error {
    padding: 12px 0;
}

.subscribe-error p {
    font-size: 14px;
    color: #FF6B6B;
    margin-bottom: 12px;
}

.retry-btn {
    background: rgba(255, 107, 107, 0.15);
    color: #FF6B6B;
    border: 1px solid rgba(255, 107, 107, 0.3);
    padding: 10px 28px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
}

.modal-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.modal-footer p {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
}

/* ---- Footer ---- */
.footer {
    text-align: center;
    padding: 24px 0 8px;
    margin-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.footer p {
    font-size: 12px;
    color: rgba(255,255,255,0.3);
}

.footer-unsub {
    margin-top: 4px;
    font-size: 11px !important;
}

/* ---- Responsive ---- */
@media (min-width: 400px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 600px) {
    .page-wrapper {
        max-width: 600px;
    }
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}
