/* assets/css/games.css — Oyun sistemi stilleri */

/* =============================================
   GAME LIST / GRID
   ============================================= */
.games-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0;
}

.game-card-btn {
    position: relative;
    background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.game-card-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 20px;
}

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

.game-card-btn:active::before {
    opacity: 0.15;
}

.game-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), rgba(255,255,255,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}

.game-card-btn:active .game-card-icon {
    transform: scale(0.9);
}

.game-card-name {
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

.game-card-meta {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    display: flex;
    align-items: center;
    gap: 4px;
}

.games-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.games-empty i {
    font-size: 48px;
    opacity: 0.15;
    margin-bottom: 12px;
    display: block;
}

/* =============================================
   GAME LANDING PAGE
   ============================================= */
.game-landing {
    width: 100%;
    max-width: 400px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeInUp 0.4s ease-out;
    overflow: hidden;
}

@keyframes fadeInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.gl-hero {
    text-align: center;
    padding: 10px 0 4px;
    flex-shrink: 0;
}

.gl-hero-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), rgba(255,255,255,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    margin: 0 auto 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    animation: heroFloat 3s ease-in-out infinite alternate;
}

@keyframes heroFloat {
    from { transform: translateY(0); }
    to { transform: translateY(-6px); }
}

.gl-hero-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 2px;
}

.gl-hero-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.gl-my-stats {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
}

.gl-my-stat {
    text-align: center;
    padding: 5px 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    min-width: 60px;
}

.gl-my-stat-val {
    font-size: 15px;
    font-weight: 800;
}

.gl-my-stat-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.gl-section {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
}

.gl-section.gl-section-flex {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 1;
}

.gl-section-header {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.gl-section-header i {
    font-size: 14px;
}

/* Rewards table — compact grid */
.gl-rewards-table {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
}

.gl-reward-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    font-size: 11px;
    border: 1px solid rgba(255,255,255,0.05);
}

.gl-reward-row.gl-reward-win {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
}

.gl-reward-diff {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
}

.gl-reward-diff i { font-size: 10px; }

.gl-reward-values {
    display: flex;
    gap: 4px;
    font-size: 11px;
}

.gl-reward-cost {
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 2px;
}

.gl-reward-prize {
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Winners list */
.gl-winners-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.gl-winner-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 11px;
}

.gl-winner-row:last-child {
    border-bottom: none;
}

.gl-winner-rank {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    flex-shrink: 0;
}

.gl-winner-rank.top1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #000; }
.gl-winner-rank.top2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.gl-winner-rank.top3 { background: linear-gradient(135deg, #cd7f32, #a0522d); color: #fff; }

.gl-winner-name {
    flex: 1;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gl-winner-score {
    font-weight: 700;
    color: #fbbf24;
}

.gl-winner-time {
    color: var(--text-muted);
    font-size: 10px;
}

.gl-winner-date {
    color: var(--text-muted);
    font-size: 10px;
    min-width: 36px;
    text-align: right;
}

.gl-no-data {
    padding: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
}

/* Start button */
.gl-start-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: var(--primary-gradient);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.gl-start-btn:active {
    transform: scale(0.96);
}

.gl-start-btn i {
    font-size: 18px;
}

.gl-limit-badge {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: -4px;
    flex-shrink: 0;
}

/* =============================================
   GAME OVERLAY / FULLSCREEN
   ============================================= */
.game-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    animation: gameSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes gameSlideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes gameSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.game-overlay.closing {
    animation: gameSlideOut 0.25s ease-in forwards;
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.game-header-title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-header-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--glass-border);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.game-header-close:active {
    background: rgba(255,255,255,0.15);
}

.game-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* =============================================
   MINESWEEPER — DIFFICULTY SELECT
   ============================================= */
.ms-difficulty-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 340px;
}

.ms-difficulty-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 4px;
}

.ms-difficulty-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-align: center;
}

.ms-diff-btn {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.ms-diff-btn:active {
    transform: scale(0.97);
    background: rgba(255,255,255,0.1);
}

.ms-diff-btn-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ms-diff-label {
    font-size: 15px;
    font-weight: 700;
}

.ms-diff-info {
    font-size: 11px;
    color: var(--text-muted);
}

.ms-diff-icon {
    font-size: 20px;
    opacity: 0.4;
}

/* =============================================
   MINESWEEPER — GAME BOARD
   ============================================= */
.ms-stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 500px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    margin-bottom: 12px;
    flex-shrink: 0;
}

.ms-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
}

.ms-stat i {
    font-size: 14px;
}

.ms-stat-mines {
    color: #ef4444;
}

.ms-stat-timer {
    color: #fbbf24;
}

.ms-stat-flag {
    color: #3b82f6;
}

.ms-board-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.ms-board {
    display: grid;
    gap: 2px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.ms-cell {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.1s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.ms-cell.unrevealed {
    background: linear-gradient(145deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ms-cell.unrevealed:active {
    transform: scale(0.9);
    background: rgba(255,255,255,0.18);
}

.ms-cell.revealed {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.04);
    cursor: default;
}

.ms-cell.flagged {
    background: linear-gradient(145deg, rgba(59,130,246,0.2), rgba(59,130,246,0.05));
    border: 1px solid rgba(59,130,246,0.3);
}

.ms-cell.flagged::after {
    content: '\f024';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #3b82f6;
    font-size: 14px;
}

.ms-cell.mine {
    background: linear-gradient(145deg, rgba(239,68,68,0.3), rgba(239,68,68,0.1));
    border: 1px solid rgba(239,68,68,0.4);
    animation: mineReveal 0.3s ease-out;
}

.ms-cell.mine::after {
    content: '\f1e2';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #ef4444;
    font-size: 14px;
}

.ms-cell.mine-exploded {
    background: #ef4444 !important;
    border-color: #dc2626 !important;
}

.ms-cell.mine-exploded::after {
    color: #fff !important;
}

@keyframes mineReveal {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

/* Number colors */
.ms-cell.n1 { color: #3b82f6; }
.ms-cell.n2 { color: #22c55e; }
.ms-cell.n3 { color: #ef4444; }
.ms-cell.n4 { color: #7c3aed; }
.ms-cell.n5 { color: #f59e0b; }
.ms-cell.n6 { color: #06b6d4; }
.ms-cell.n7 { color: #ec4899; }
.ms-cell.n8 { color: #94a3b8; }

.ms-cell.revealed-anim {
    animation: cellReveal 0.2s ease-out;
}

@keyframes cellReveal {
    from {
        transform: scale(0.5) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotateY(0);
        opacity: 1;
    }
}

/* =============================================
   GAME RESULT MODAL
   ============================================= */
.ms-result-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ms-result-card {
    background: linear-gradient(145deg, var(--bg-popup-start), var(--bg-popup-end));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px 28px;
    text-align: center;
    max-width: 300px;
    width: 85%;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
    animation: resultPop 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes resultPop {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.ms-result-icon {
    font-size: 56px;
    margin-bottom: 12px;
}

.ms-result-icon.won {
    color: #fbbf24;
    animation: winBounce 0.6s ease infinite alternate;
}

.ms-result-icon.lost {
    color: #ef4444;
}

@keyframes winBounce {
    from { transform: scale(1) rotate(-5deg); }
    to { transform: scale(1.15) rotate(5deg); }
}

.ms-result-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}

.ms-result-message {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.ms-result-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.ms-result-stat {
    text-align: center;
}

.ms-result-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.ms-result-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.ms-result-actions {
    display: flex;
    gap: 10px;
}

.ms-result-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 14px;
    border: none;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
}

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

.ms-result-btn.primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.ms-result-btn.secondary {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 1px solid var(--glass-border);
}

/* =============================================
   WIN CELEBRATION PARTICLES
   ============================================= */
.win-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3001;
    overflow: hidden;
}

.win-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: particleFall 2s ease-in forwards;
}

@keyframes particleFall {
    0% {
        transform: translateY(-20px) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg) scale(0);
        opacity: 0;
    }
}

/* =============================================
   LOADING STATE
   ============================================= */
.game-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.game-loading .spinner {
    width: 32px;
    height: 32px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 360px) {
    .ms-cell {
        font-size: 11px;
        border-radius: 3px;
    }

    .ms-cell.flagged::after,
    .ms-cell.mine::after {
        font-size: 11px;
    }

    .ms-stats-bar {
        padding: 8px 12px;
    }

    .ms-stat {
        font-size: 12px;
    }
}

/* =============================================
   PREMIUM IGAMING GAMES LOBBY & GRID
   ============================================= */
.games-grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 10px;
    padding-bottom: calc(80px + max(12px, env(safe-area-inset-bottom))); /* Space for iOS bottom navbar */
}

@media (min-width: 480px) {
    .games-grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

.game-card-premium {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 1 / 1.35;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    -webkit-tap-highlight-color: transparent;
}

.game-card-premium:active {
    transform: scale(0.96) translateY(2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.game-card-premium img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.game-card-premium:active img {
    transform: scale(1.04);
}

.game-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.45) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 10px;
    color: #fff;
    pointer-events: none;
}

.game-card-title {
    font-size: 11px;
    font-weight: 750;
    line-height: 1.3;
    margin-bottom: 2px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.game-card-subtitle {
    font-size: 8px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}

.game-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(16, 185, 129, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #fff;
    font-size: 8px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    pointer-events: none;
}

/* Horizontal Scrolling Providers */
.provider-filters-scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 10px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch; /* Momentum scrolling on iOS */
    width: 100%;
    min-width: 0; /* Critical flex layout overflow fix */
}

.provider-filters-scroll::-webkit-scrollbar {
    display: none;
}

.provider-filter-pill {
    flex-shrink: 0; /* Prevent pills from squeezing */
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    margin: 0; /* Remove default browser margin */
    line-height: 1.2;
    text-align: center;
    text-transform: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.provider-filter-pill:active {
    transform: scale(0.95);
}

.provider-filter-pill.active {
    background: var(--primary-gradient);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

