/* 2048 Modern Glassmorphic Dark Theme Styling */
.game-2048-container {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
    touch-action: none;
    padding: 10px;
}

.g2048-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.g2048-score-box {
    display: flex;
    gap: 8px;
}

.g2048-pill {
    background: var(--bg-card, #181c2b);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.1));
    border-radius: 12px;
    padding: 6px 12px;
    text-align: center;
}

.g2048-pill-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted, #94a3b8);
    font-weight: 700;
}

.g2048-pill-val {
    font-family: var(--font-game, 'Fredoka', sans-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.g2048-board {
    width: 320px;
    height: 320px;
    background: #141724;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 8px;
    padding: 8px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    touch-action: none;
}

.g2048-cell {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-game, 'Fredoka', sans-serif);
    font-size: 1.4rem;
    font-weight: 700;
    transition: transform 0.1s ease, background-color 0.15s ease;
}

/* Vibrant Tile Colors */
.g2048-cell[data-val="2"] { background: #3b3f58; color: #f1f2f6; }
.g2048-cell[data-val="4"] { background: #4b4b74; color: #f1f2f6; }
.g2048-cell[data-val="8"] { background: #e17055; color: #ffffff; box-shadow: 0 0 10px rgba(225, 112, 85, 0.4); }
.g2048-cell[data-val="16"] { background: #d63031; color: #ffffff; box-shadow: 0 0 12px rgba(214, 48, 49, 0.5); }
.g2048-cell[data-val="32"] { background: #e84393; color: #ffffff; box-shadow: 0 0 14px rgba(232, 67, 147, 0.5); }
.g2048-cell[data-val="64"] { background: #fd79a8; color: #ffffff; box-shadow: 0 0 16px rgba(253, 121, 168, 0.6); }
.g2048-cell[data-val="128"] { background: #fdcb6e; color: #2d3436; font-size: 1.25rem; box-shadow: 0 0 18px rgba(253, 203, 110, 0.6); }
.g2048-cell[data-val="256"] { background: #ffeaa7; color: #2d3436; font-size: 1.25rem; box-shadow: 0 0 20px rgba(255, 234, 167, 0.7); }
.g2048-cell[data-val="512"] { background: #00b894; color: #ffffff; font-size: 1.25rem; box-shadow: 0 0 22px rgba(0, 184, 148, 0.7); }
.g2048-cell[data-val="1024"] { background: #0984e3; color: #ffffff; font-size: 1.1rem; box-shadow: 0 0 25px rgba(9, 132, 227, 0.8); }
.g2048-cell[data-val="2048"] { background: #6c5ce7; color: #ffffff; font-size: 1.1rem; box-shadow: 0 0 30px rgba(108, 92, 231, 1); animation: pulse-gold 1.5s infinite; }

@keyframes pulse-gold {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.g2048-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 19, 0.88);
    backdrop-filter: blur(8px);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 10;
}

.g2048-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.g2048-overlay-title {
    font-family: var(--font-game, 'Fredoka', sans-serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: #ff4757;
    margin-bottom: 12px;
}

.g2048-controls {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.g2048-btn {
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.1));
    background: var(--bg-card, #181c2b);
    color: #ffffff;
    font-family: var(--font-game, 'Fredoka', sans-serif);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.g2048-btn:active {
    transform: scale(0.95);
    background: var(--bg-card-hover, #22283d);
}

.g2048-btn.primary {
    background: linear-gradient(135deg, #6c5ce7, #5352ed);
    border: none;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
}
