/* Graaphix */
/* Created by Graaphix */
/* Designed by Graaphix */

:root {
    --primary: #4F46E5;
    --primary-gradient: linear-gradient(135deg, #6366F1, #4338CA);
    --secondary: #10B981;
    --secondary-gradient: linear-gradient(135deg, #34D399, #059669);
    --gold-gradient: linear-gradient(135deg, #F59E0B, #B45309);
    --whatsapp: #25D366;
    --bg-color: #0F172A; /* Dark theme to match cyber arcade */
    --card-bg: #1E293B;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border: #334155;
    --daubed: #EF4444;
    --ticket-bg: #FFFFFF;
    --ticket-text: #0F172A;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

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

body {
    background: linear-gradient(-45deg, #0F172A, #2E1065, #000000, #0F172A);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    height: 100%;
    overflow-x: hidden;
}

/* Mobile Constraint: 9:16 ratio */
.app-container {
    width: 100%;
    max-width: 480px; 
    height: 100dvh; /* Dynamic viewport height accounts for mobile URL bars */
    max-height: 853px; 
    background-color: var(--bg-color);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.15);
    padding-bottom: env(safe-area-inset-bottom); /* iOS swipe bar safety */
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    width: 100%;
}

.hidden {
    display: none !important;
}

/* Typography & General Elements */
h1, h2, h3 { 
    color: var(--text-main); 
    font-family: 'Space Grotesk', sans-serif;
}
.text-center { text-align: center; }

input[type="text"] {
    width: 100%;
    padding: 16px;
    background: #0F172A;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    color: var(--text-main);
    margin-bottom: 16px;
    outline: none;
    transition: all 0.2s ease;
    font-family: 'Outfit', sans-serif;
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    color: white;
    margin-bottom: 12px;
    transition: transform 0.1s, filter 0.2s;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.5px;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { filter: grayscale(1); opacity: 0.6; cursor: not-allowed; }

.btn.primary { background: var(--primary-gradient); box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3); }
.btn.secondary { background: var(--border); color: var(--text-main); }
.btn.green { background: var(--whatsapp); box-shadow: 0 4px 15px rgba(37, 211, 102, 0.2); color: #000; }
.btn.small { padding: 10px 16px; font-size: 14px; width: auto; background: var(--border); color: var(--text-main); }

.card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.05);
}

.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}
.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border);
    z-index: 1;
}
.divider span {
    background: var(--card-bg);
    padding: 0 15px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    position: relative;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Lobby Specifics */
.logo-container {
    text-align: center;
    margin: 40px 0;
}
.logo {
    width: 120px;
    height: 120px;
    margin-bottom: 15px;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}
.logo-container h1 {
    font-size: 32px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Waiting Room */
.header { text-align: center; margin-bottom: 24px; }
.header h2 { font-size: 28px; color: var(--text-main); }
.header h2 span { color: var(--primary); }

.waiting-card h3 {
    margin-bottom: 16px;
    font-size: 18px;
    color: var(--text-muted);
}
.player-list { 
    list-style: none; 
    margin: 0 0 24px 0; 
    max-height: 250px; 
    overflow-y: auto; 
    background: #0F172A;
    border-radius: 12px;
    padding: 8px;
    border: 1px solid var(--border);
}
.player-list li {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    color: var(--text-main);
}
.player-list li::before {
    content: '👤';
    margin-right: 12px;
    font-size: 18px;
}
.player-list li:last-child {
    border-bottom: none;
}
.waiting-text { text-align: center; color: var(--text-muted); margin-top: 15px; font-weight: 500; }

/* Zero-Scroll Game Screen */
.screen-game-zero-scroll {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px 12px;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

/* 1. Top Bar */
.game-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    flex-shrink: 0;
}
.btn-icon-back {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0 8px 0 0;
    transition: transform 0.2s;
}
.btn-icon-back:active {
    transform: scale(0.9);
}
.room-badge {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
}
.room-badge span {
    color: var(--primary);
}
.last-called-compact {
    display: flex;
    align-items: center;
    gap: 12px;
}
.last-called-compact .label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}
@keyframes numberPop {
    0% { transform: scale(0.5) rotate(-15deg); opacity: 0.5; }
    50% { transform: scale(1.3) rotate(10deg); box-shadow: 0 0 30px rgba(79, 70, 229, 0.8); }
    100% { transform: scale(1) rotate(0); }
}
.number-circle-small {
    width: 44px;
    height: 44px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    font-weight: 800;
    font-family: 'Space Grotesk', sans-serif;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.4);
    transition: all 0.3s ease;
}
.number-circle-small.animate-pop {
    animation: numberPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 2. Ticket */
.ticket-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
}
.ticket-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 0 40px rgba(79, 70, 229, 0.3), inset 0 0 20px rgba(79, 70, 229, 0.1);
    width: 100%;
    max-width: 400px;
}
.ticket-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1px;
    background: #475569;
    border: 2px solid #475569;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}
.ticket-cell {
    background: #FFFFFF;
    aspect-ratio: 1/1.1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(12px, 3.5vw, 18px);
    font-weight: 800;
    user-select: none;
    cursor: pointer;
    position: relative;
    color: #0F172A;
    font-family: 'Space Grotesk', sans-serif;
}
.ticket-cell.empty {
    background: #E2E8F0;
    cursor: default;
}
.ticket-cell.daubed {
    color: var(--daubed);
    background: linear-gradient(135deg, #FFF1F2, #FFE4E6);
}
@keyframes stamp {
    0% { transform: translate(-50%, -50%) scale(3) rotate(-20deg); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(0.8) rotate(10deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 0.9; }
}
.ticket-cell.daubed::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 80%;
    border: 3px solid var(--daubed);
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.15);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5), inset 0 0 10px rgba(239, 68, 68, 0.5);
    animation: stamp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* 3. Prize Dashboard */
.claims-dashboard {
    flex-shrink: 0;
}
.claims-grid-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.claim-btn-compact {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
}
.claim-btn-compact:active {
    background: rgba(79, 70, 229, 0.2);
    border-color: var(--primary);
}
.claim-btn-compact.claimed {
    background: var(--bg-color);
    border-color: transparent;
    color: var(--text-muted);
    pointer-events: none;
    font-size: 11px;
}
.claim-btn-compact.full-house {
    background: var(--gold-gradient);
    color: white;
    border: none;
    padding: 10px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
}
.claim-btn-compact.full-house.claimed {
    background: var(--border);
    color: var(--text-muted);
}

/* 4. Bottom Action */
.bottom-action-bar {
    flex-shrink: 0;
}
.btn-full-width {
    width: 100%;
    margin-bottom: 0;
    padding: 14px;
}

/* 5. Board Modal */
.board-modal {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: transform 0.3s ease;
}
.board-modal.modal-closed {
    transform: translateY(100%);
    pointer-events: none;
}
.board-modal-content {
    background: var(--card-bg);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 24px 16px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.board-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.board-modal-header h3 {
    font-size: 18px;
    margin: 0;
}
.btn-close-modal {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}
.full-board-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
}
.board-cell {
    background: #0F172A;
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    color: #475569;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}
.board-cell.called {
    background: var(--primary-gradient);
    color: white;
    font-weight: 800;
    border: none;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
    transform: scale(1.05);
    z-index: 2;
}

/* Toast */
.toast {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    color: var(--text-main);
    padding: 14px 24px;
    border-radius: 30px;
    z-index: 200;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    width: 90%;
    opacity: 1;
    transition: opacity 0.3s, top 0.3s;
}
.toast.error { border-left: 4px solid var(--daubed); }
.toast.success { border-left: 4px solid var(--secondary); }

/* Mandatory Footer */
.universal-footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.universal-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
}
/* Graaphix */
/* Created by Graaphix */
/* Designed by Graaphix */
