/* Created by Graaphix */
/* Designed by Graaphix */

:root {
    --bg-main: #0c0f17;
    --bg-body: #0c0f17;
    --bg-card: rgba(23, 28, 44, 0.88);
    --bg-cell: #1a2133;
    --bg-cell-hover: #26314d;
    --border-color: rgba(255, 255, 255, 0.12);
    --text-main: #f3f4f6;
    --text-color: #f3f4f6;
    --text-muted: #94a3b8;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.45);
    --accent-red: #ef4444;
    --accent-green: #10b981;
    --gold: #f59e0b;
    --gold-glow: rgba(245, 158, 11, 0.45);
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-bingo: 'Outfit', sans-serif;
    --paper-grid: radial-gradient(circle, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    overflow-x: hidden;
    background-color: var(--bg-main);
    background-image: var(--paper-grid);
    background-size: 24px 24px;
    color: var(--text-main);
    font-family: var(--font-body);
    display: flex;
    flex-direction: column;
}

/* =============================================================
   NAVBAR (DESKTOP & MOBILE RESPONSIVE)
============================================================= */
.navbar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 2rem;
    background: rgba(12, 15, 23, 0.92);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease;
}

.brand-wrapper:hover {
    transform: translateY(-1px);
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0 15px var(--gold-glow);
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fcd34d, #f59e0b, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge-version {
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
    border-radius: 999px;
    font-weight: 600;
    margin-left: 0.25rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* =============================================================
   MAIN CONTENT & VIEW CONTAINER
============================================================= */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem 3rem 1rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.game-view {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.game-view.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =============================================================
   HERO & MENU VIEW
============================================================= */
.hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    text-align: center;
    width: 100%;
    max-width: 560px;
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55), 0 0 30px rgba(99, 102, 241, 0.1);
}

.hero-badge {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--gold);
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 999px;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.3rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #ffffff, #d1d5db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 1.75rem;
}

/* Menu Mode Selection */
.mode-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
}

.mode-btn {
    background: linear-gradient(135deg, rgba(30, 37, 56, 0.85), rgba(20, 25, 40, 0.95));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.15rem 1.35rem;
    display: flex;
    align-items: center;
    gap: 1.15rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: left;
    color: var(--text-main);
    width: 100%;
}

.mode-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 10px 25px var(--primary-glow);
    background: linear-gradient(135deg, rgba(40, 50, 75, 0.9), rgba(25, 32, 52, 0.95));
}

.mode-btn:active {
    transform: translateY(1px);
}

.mode-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mode-info h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: #fff;
}

.mode-info p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.35;
}

/* =============================================================
   GAME ARENA & BOARD (DESKTOP & MOBILE ADAPTIVE)
============================================================= */
.game-arena {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

/* Desktop 2-Column Mode for Game View */
@media (min-width: 992px) {
    .game-arena {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        gap: 2.5rem;
        max-width: 1050px;
    }
    .game-board-side {
        flex: 1;
        max-width: 480px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .game-intel-side {
        flex: 1;
        max-width: 460px;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
}

/* B-I-N-G-O Stamped Letters Banner */
.bingo-banner {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    width: 100%;
}

.bingo-letter {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.9rem;
    font-weight: 900;
    color: var(--text-muted);
    position: relative;
    user-select: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bingo-letter.stamped {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #fca5a5;
    color: #fff;
    transform: scale(1.08) rotate(-3deg);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.6);
}

.bingo-letter.stamped::after {
    content: '✖';
    position: absolute;
    font-size: 2.2rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 900;
    animation: stampCross 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes stampCross {
    0% { transform: scale(2.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Status and Turn Indicator */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.turn-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.92rem;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
    animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

.lines-indicator {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--gold);
}

/* 5x5 Grid Board Container */
.grid-container {
    position: relative;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 12px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(16px);
    display: flex;
    justify-content: center;
}

.bingo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    width: 380px;
    height: 380px;
    touch-action: manipulation;
}

.grid-cell {
    background: var(--bg-cell);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
}

.grid-cell:hover:not(.marked):not(.disabled) {
    background: var(--bg-cell-hover);
    border-color: var(--primary);
    transform: scale(1.05);
    z-index: 2;
    box-shadow: 0 0 15px var(--primary-glow);
}

.grid-cell.marked {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
}

.grid-cell.marked::after {
    content: '';
    position: absolute;
    width: 70%;
    height: 3px;
    background: #ef4444;
    transform: rotate(-35deg);
    border-radius: 2px;
    box-shadow: 0 0 8px #ef4444;
}

.grid-cell.line-completed {
    background: rgba(245, 158, 11, 0.25) !important;
    border-color: var(--gold) !important;
    color: #fbbf24 !important;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
}

/* History Bar */
.history-strip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow-x: auto;
    white-space: nowrap;
}

.history-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.history-badge.latest {
    background: var(--accent-red);
    color: #fff;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 0.95rem 1.5rem;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 6px 20px var(--primary-glow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.6);
    filter: brightness(1.1);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    width: 100%;
    padding: 0.85rem 1.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Setup View & Tray */
.setup-tray {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 1.25rem;
    width: 100%;
}

.tray-num {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tray-num:hover:not(.used) {
    background: var(--primary);
    transform: scale(1.08);
}

.tray-num.used {
    opacity: 0.25;
    cursor: not-allowed;
    text-decoration: line-through;
}

.actions-row {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    margin-top: 1rem;
}

.btn-action {
    flex: 1;
    padding: 0.65rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Lobby View */
.lobby-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.2rem 2rem;
    width: 100%;
    max-width: 520px;
    text-align: center;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
}

.room-code-display {
    font-family: var(--font-heading);
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: 6px;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    border: 2px dashed rgba(56, 189, 248, 0.4);
    border-radius: 16px;
    padding: 1rem;
    margin: 1.25rem 0;
    user-select: all;
    cursor: pointer;
    transition: all 0.2s ease;
}

.room-code-display:hover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

.input-field {
    width: 100%;
    padding: 0.85rem 1.1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 24px;
    padding: 2.2rem 2rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 50px rgba(245, 158, 11, 0.2);
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.88); }
    to { opacity: 1; transform: scale(1); }
}

.victory-title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fcd34d, #f59e0b, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

/* Arcade UI Styles */
.mode-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.mode-card:hover { 
    transform: translateY(-3px); 
    border-color: var(--primary); 
    box-shadow: 0 8px 24px rgba(0,0,0,0.4); 
}

.mode-card.arcade { border-color: #f59e0b; background: rgba(245, 158, 11, 0.08); }
.mode-card h3 { font-family: var(--font-heading); font-size: 1.35rem; margin-bottom: 0.4rem; color: #fff; }
.mode-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }

.mini-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    width: 40px;
    height: 40px;
}
.mini-cell {
    background: var(--border-color);
    border-radius: 2px;
}
.mini-cell.active {
    background: #ef4444;
}

.active-powerup {
    animation: pulsePowerUp 1.5s infinite;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.6) !important;
}
@keyframes pulsePowerUp {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.tension-glow {
    animation: tensionPulse 0.5s infinite alternate;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}
@keyframes tensionPulse {
    from { opacity: 0.8; transform: scale(1); }
    to { opacity: 1; transform: scale(1.05); }
}

/* Daily Quests Styles */
@keyframes firePulse {
    0% { transform: scale(1); filter: brightness(1); }
    100% { transform: scale(1.2); filter: brightness(1.2); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.quest-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}
.quest-item.completed {
    border-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
}
.quest-progress-bg {
    background: var(--border-color);
    height: 6px;
    border-radius: 3px;
    width: 100%;
    margin-top: 0.4rem;
    overflow: hidden;
}
.quest-progress-fill {
    background: var(--accent-green);
    height: 100%;
    transition: width 0.3s ease;
}
.quest-reward {
    font-weight: bold;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.85rem;
}

/* Universal Mandatory Footer */
footer {
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    background: rgba(12, 15, 23, 0.95);
    margin-top: auto;
    width: 100%;
}

footer a {
    color: #a5b4fc;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* =============================================================
   MOBILE PHONES RESPONSIVE MEDIA QUERY (max-width: 600px)
============================================================= */
@media (max-width: 600px) {
    .navbar {
        padding: 0.65rem 1rem;
    }
    .brand-logo {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }
    .brand-title {
        font-size: 1.15rem;
    }
    .badge-version {
        font-size: 0.68rem;
        padding: 0.15rem 0.45rem;
    }
    .btn-icon {
        width: 36px;
        height: 36px;
        font-size: 1.05rem;
    }
    
    .main-content {
        padding: 0.75rem 0.5rem 2rem 0.5rem;
    }
    .hero-card {
        padding: 1.5rem 1.15rem;
        border-radius: 18px;
    }
    .hero-title {
        font-size: 1.75rem;
    }
    .hero-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
    }
    
    .mode-btn {
        padding: 1rem 1.1rem;
        gap: 0.85rem;
        border-radius: 14px;
    }
    .mode-icon-box {
        width: 44px;
        height: 44px;
        font-size: 1.35rem;
        border-radius: 12px;
    }
    .mode-info h3 {
        font-size: 1.05rem;
    }
    .mode-info p {
        font-size: 0.78rem;
    }
    
    .bingo-banner {
        gap: 6px;
        margin-bottom: 0.85rem;
    }
    .bingo-letter {
        width: min(15vw, 54px);
        height: min(15vw, 54px);
        font-size: 1.45rem;
        border-radius: 12px;
    }
    
    .status-bar {
        padding: 0.65rem 1rem;
        border-radius: 14px;
        margin-bottom: 0.75rem;
    }
    .turn-pill {
        font-size: 0.82rem;
    }
    .lines-indicator {
        font-size: 0.85rem;
    }
    
    .grid-container {
        padding: 8px;
        border-radius: 16px;
    }
    .bingo-grid {
        width: min(92vw, 360px);
        height: min(92vw, 360px);
        gap: 6px;
    }
    .grid-cell {
        font-size: clamp(1.2rem, 5vw, 1.45rem);
        border-radius: 10px;
    }
    
    .history-strip {
        padding: 0.55rem 0.85rem;
        border-radius: 12px;
        margin-top: 0.75rem;
    }
    
    .lobby-card {
        padding: 1.5rem 1.25rem;
        border-radius: 18px;
    }
    .room-code-display {
        font-size: 2.2rem;
        letter-spacing: 4px;
        padding: 0.75rem;
    }
}
