/* ==========================================================================
   Webliner Jeux - Premium Design System (app.css)
   Thème : Glassmorphism, Luxury Dark & Vibrant Neons, Mobile-First
   ========================================================================== */

:root {
    --brand-primary: #FF6B35;
    --brand-secondary: #7928CA;
    --brand-accent: #FFD166;
    --brand-primary-rgb: 255, 107, 53;
    
    --bg-dark: #0B0E14;
    --bg-surface: rgba(22, 27, 34, 0.85);
    --bg-surface-elevated: rgba(30, 36, 46, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --border-glass: rgba(255, 255, 255, 0.12);
    --border-glow: rgba(var(--brand-primary-rgb), 0.4);
    
    --text-main: #FFFFFF;
    --text-muted: #94A3B8;
    --text-dim: #64748B;
    
    --gold: #F59E0B;
    --gold-glow: rgba(245, 158, 11, 0.4);
    --success: #10B981;
    --danger: #EF4444;
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
    
    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 10px 30px rgba(var(--brand-primary-rgb), 0.35);
    --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.65), 0 0 40px rgba(var(--brand-primary-rgb), 0.2);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    line-height: 1.5;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Arrière-plan animé lumineux & mesh */
.app-bg-glow {
    position: fixed;
    top: -20vh;
    left: 50%;
    transform: translateX(-50%);
    width: 90vw;
    max-width: 800px;
    height: 60vh;
    background: radial-gradient(circle, rgba(var(--brand-primary-rgb), 0.22) 0%, rgba(121, 40, 202, 0.15) 50%, transparent 75%);
    filter: blur(70px);
    pointer-events: none;
    z-index: 0;
}

.app-bg-mesh {
    position: fixed;
    inset: 0;
    background-image: 
        radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.8;
}

/* Conteneur principal */
.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    padding: 16px 16px 40px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

@media (min-width: 768px) {
    .app-container {
        max-width: 680px;
        padding: 24px 24px 60px 24px;
    }
}

/* En-tête Restaurant */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-subtle);
    margin-bottom: 20px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.brand-badge {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(var(--brand-primary-rgb), 0.4);
}

.brand-info h1 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.brand-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Actions d'en-tête (Son, Lots, Règles, Admin) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-icon:hover, .btn-icon:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
    border-color: var(--brand-primary);
}

.btn-icon.active {
    background: rgba(var(--brand-primary-rgb), 0.2);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

/* Bannière de campagne */
.campaign-banner {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
}

.campaign-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(var(--brand-primary-rgb), 0.15);
    border: 1px solid rgba(var(--brand-primary-rgb), 0.3);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--brand-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(var(--brand-primary-rgb), 0.15);
}

.campaign-tag .pulse-dot {
    width: 7px;
    height: 7px;
    background-color: #10B981;
    border-radius: 50%;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.campaign-banner h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #FFFFFF 30%, #E2E8F0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.campaign-banner p {
    font-size: 0.88rem;
    color: var(--text-muted);
    max-width: 440px;
    margin: 0 auto;
}

/* Carte de Jeu Principale (Game Glass Shell) */
.game-card-shell {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 24px 20px;
    box-shadow: var(--shadow-modal);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.game-card-shell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent), var(--brand-secondary));
}

/* Sélecteur de jeux (si multi-jeux activé) */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    width: 100%;
    margin-top: 10px;
}

.game-select-tile {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 20px 14px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-select-tile:hover, .game-select-tile:focus {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--brand-primary);
    box-shadow: 0 10px 24px rgba(var(--brand-primary-rgb), 0.25);
}

.game-select-tile .tile-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4));
}

.game-select-tile h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.game-select-tile p {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.tile-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.badge-hot {
    background: #EF4444;
    color: white;
}

.badge-pop {
    background: var(--brand-primary);
    color: white;
}

.badge-new {
    background: #10B981;
    color: white;
}

/* Boutons d'Action Principaux */
.btn-play-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    padding: 16px 28px;
    background: linear-gradient(135deg, var(--brand-primary), #E0531B);
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(var(--brand-primary-rgb), 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-play-action::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        60deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transform: rotate(25deg);
    animation: btnShimmer 3.5s infinite;
}

@keyframes btnShimmer {
    0% { transform: translateX(-100%) rotate(25deg); }
    30%, 100% { transform: translateX(100%) rotate(25deg); }
}

.btn-play-action:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 30px rgba(var(--brand-primary-rgb), 0.55);
}

.btn-play-action:active:not(:disabled) {
    transform: translateY(1px) scale(0.98);
}

.btn-play-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

/* Modals & Dialogues (Voucher, Lots, Règles, etc.) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 12, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-modal);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    padding: 28px 24px;
}

.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

/* Ticket Gagnant / Voucher Stylisé */
.voucher-ticket {
    background: linear-gradient(145deg, #18202F, #0E131E);
    border: 2px solid #F59E0B;
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    text-align: center;
    position: relative;
    margin: 18px 0;
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.25);
    overflow: hidden;
}

.voucher-ticket::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #F59E0B, #FFD166, #F59E0B);
}

.voucher-ribbon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #111827;
    font-weight: 800;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    margin-bottom: 12px;
}

.voucher-prize-icon {
    font-size: 3.2rem;
    margin: 8px 0;
    filter: drop-shadow(0 6px 16px rgba(245, 158, 11, 0.4));
    animation: prizeBounce 2s infinite ease-in-out;
}

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

.voucher-prize-title {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 6px;
}

.voucher-code-wrapper {
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed rgba(245, 158, 11, 0.5);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.voucher-code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.3rem;
    font-weight: 800;
    color: #FFD166;
    letter-spacing: 0.12em;
}

.btn-copy-code {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy-code:hover {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}

.voucher-qr-box {
    width: 140px;
    height: 140px;
    background: white;
    padding: 8px;
    border-radius: var(--radius-md);
    margin: 12px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.voucher-qr-box canvas, .voucher-qr-box img {
    max-width: 100%;
    max-height: 100%;
}

.voucher-timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #F87171;
    font-weight: 700;
    margin-top: 10px;
    background: rgba(239, 68, 68, 0.12);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.voucher-server-instruction {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Liste des Lots Disponibles */
.prizes-list-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0;
}

.prize-item-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    transition: transform 0.2s ease;
}

.prize-item-row:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.08);
}

.prize-item-icon {
    font-size: 1.8rem;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
}

.prize-item-details {
    flex: 1;
}

.prize-item-details h4 {
    font-size: 0.92rem;
    font-weight: 700;
}

.prize-item-details p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.prize-item-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(var(--brand-primary-rgb), 0.2);
    color: var(--brand-accent);
    border: 1px solid rgba(var(--brand-primary-rgb), 0.3);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-glass);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

/* Footer & Mentions */
.app-footer {
    text-align: center;
    margin-top: 30px;
    font-size: 0.76rem;
    color: var(--text-dim);
}

.app-footer a {
    color: var(--text-muted);
    text-decoration: underline;
}

.app-footer a:hover {
    color: var(--brand-primary);
}

.demo-switch-bar {
    margin-top: 20px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.78rem;
}

.btn-mini {
    padding: 4px 10px;
    font-size: 0.72rem;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-mini:hover {
    color: white;
    border-color: var(--brand-primary);
    background: rgba(var(--brand-primary-rgb), 0.2);
}
