/* ==================== RESET & BASE ==================== */
* { box-sizing: border-box; touch-action: none; /* Bloque le zoom tactile */ }
body, html {
    margin: 0; padding: 0; width: 100%; height: 100%;
    overflow: hidden; background-color: #0b1120;
    font-family: 'Segoe UI', sans-serif;
    user-select: none; -webkit-user-select: none;
}

/* ==================== UI JEU ==================== */
#game-container {
    position: relative; width: 100%; height: 100%;
    background: linear-gradient(to bottom, #0f172a, #1e1b4b);
}

canvas { display: block; width: 100%; height: 100%; }

.ui-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(11, 17, 32, 0.85);
    backdrop-filter: blur(5px);
    z-index: 10;
    transition: opacity 0.3s;
}

.hidden { opacity: 0; pointer-events: none; }

h1 {
    color: #22d3ee; text-transform: uppercase; font-size: 3rem; margin: 0;
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.8);
    letter-spacing: 5px; font-weight: 900;
    text-align: center;
}

p.instructions {
    color: #e2e8f0; font-size: 1.1rem; margin-top: 10px; max-width: 80%; text-align: center;
}

.btn-neon {
    background: transparent; border: 2px solid #ec4899; color: #ec4899;
    padding: 15px 40px; font-size: 1.2rem; font-weight: bold; text-transform: uppercase;
    cursor: pointer; margin-top: 30px; border-radius: 5px;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
    transition: all 0.2s;
    animation: pulse 1.5s infinite;
}
.btn-neon:hover { background: #ec4899; color: white; box-shadow: 0 0 30px rgba(236, 72, 153, 0.8); }
.btn-neon:active { transform: scale(0.95); }

/* SCORE HUD */
#hud-score {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    color: white; font-size: 2rem; font-weight: bold; font-family: monospace;
    z-index: 5; text-shadow: 0 2px 5px black; pointer-events: none;
}

/* BOUTON ARCADE */
.arcade-btn-corner {
    position: absolute; top: 20px; right: 20px; z-index: 20;
}
.arcade-link {
    display: block; width: 50px; height: 50px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ff5555, #990000);
    border: 4px solid #444; box-shadow: 0 5px 15px rgba(0,0,0,0.5), inset 0 0 10px rgba(255,255,255,0.3);
    text-decoration: none; display: flex; align-items: center; justify-content: center;
    color: white; font-weight: bold; font-size: 10px; text-align: center;
    transition: transform 0.1s;
}
.arcade-link:active { transform: scale(0.9) translateY(2px); box-shadow: 0 2px 5px rgba(0,0,0,0.5); }

/* GAME OVER SCREEN */
.score-display { font-size: 4rem; color: #fff; margin: 10px 0; font-family: monospace; }
.share-btn {
    background: #1da1f2; border: none; color: white; padding: 10px 20px;
    border-radius: 20px; margin-top: 15px; cursor: pointer; display: flex; align-items: center; gap: 5px;
}

.coin-slot-btn {
    margin-top: 20px; background: #fbbf24; color: #000; border: 4px solid #b45309;
    font-weight: 900; padding: 10px 30px; text-transform: uppercase;
    box-shadow: 0 5px 0 #b45309; cursor: pointer; text-decoration: none; display: inline-block;
}
.coin-slot-btn:active { transform: translateY(5px); box-shadow: none; }

@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.7; } 100% { opacity: 1; } }

/* ==================== SIGNATURE ==================== */
#vs-signature {
    position: fixed; bottom: 10px; right: 15px;
    font-family: 'Segoe UI', sans-serif; font-size: 11px;
    color: rgba(255, 255, 255, 0.3); z-index: 9999;
    pointer-events: none; user-select: none;
    letter-spacing: 1px; text-shadow: 0 0 2px rgba(0,0,0,0.8);
}

/* ==================== WIDGET 1: RUBAN GAUCHE ==================== */
.support-ribbon-container {
    position: fixed; left: 0.25rem; bottom: 4rem; z-index: 9998;
    font-family: system-ui,-apple-system,sans-serif;
}
.support-ribbon-toggle {
    position: absolute; left: 0; bottom: 0;
}
.support-ribbon-toggle button {
    background: linear-gradient(135deg,#f97316,#ec4899); border-radius: 999px;
    border: none; padding: 0.45rem 0.7rem; color: #0b1120;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.12em; cursor: pointer; box-shadow: 0 10px 25px rgba(15,23,42,0.9);
    display: inline-flex; align-items: center; gap: 0.3rem;
}
.support-ribbon-panel {
    position: relative; transform: translateX(-110%); opacity: 0;
    pointer-events: none; transition: transform 0.2s ease-out, opacity 0.2s ease-out;
    max-width: 280px;
}
.support-ribbon-panel.active {
    transform: translateX(0); opacity: 1; pointer-events: auto;
}
.support-ribbon-card {
    background: rgba(15,23,42,0.96); border-radius: 1rem;
    border: 1px dashed rgba(148,163,184,0.7); padding: 0.8rem 0.9rem;
    margin-bottom: 0.5rem; box-shadow: 0 12px 30px rgba(15,23,42,0.95);
    font-size: 0.75rem; color: #d1d5db;
}
.support-ribbon-title { font-weight: 600; font-size: 0.78rem; margin-bottom: 0.25rem; color: #f9fafb; }
.support-ribbon-body { margin-bottom: 0.55rem; }
.support-ribbon-body span { color: #fbbf24; font-weight: 500; }
.support-ribbon-cta {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; padding: 0.35rem 0.8rem;
    background: linear-gradient(135deg,#22d3ee,#6366f1);
    color: #0b1120; font-size: 0.75rem; font-weight: 600;
    text-decoration: none; box-shadow: 0 0 18px rgba(59,130,246,0.7);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.support-ribbon-cta:hover { transform: translateY(-1px) scale(1.02); box-shadow: 0 0 22px rgba(59,130,246,0.9); }

/* ==================== WIDGET 2: CARTE FLOTTANTE + PIP ==================== */
.support-widget {
    position: fixed; right: 1rem; bottom: 1rem; z-index: 9999;
    max-width: 260px; font-family: system-ui,-apple-system,sans-serif; color: #e5e7eb;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.support-card {
    background: radial-gradient(circle at top left, rgba(34,211,238,0.25), rgba(15,23,42,0.96));
    border-radius: 1rem; padding: 0.75rem 0.85rem;
    border: 1px solid rgba(34,211,238,0.4); box-shadow: 0 12px 30px rgba(15,23,42,0.9);
    font-size: 0.78rem; line-height: 1.4; position: relative;
}
.support-card-title { font-weight: 600; font-size: 0.8rem; margin-bottom: 0.25rem; color: #f9fafb; }
.support-card-text { color: #cbd5f5; margin-bottom: 0.5rem; }
.support-card-text span { color: #22d3ee; }
.support-card-button {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.35rem 0.8rem; border-radius: 999px;
    background: linear-gradient(135deg,#22d3ee,#4ade80);
    color: #0b1120; font-weight: 600; font-size: 0.75rem; text-decoration: none;
    box-shadow: 0 0 20px rgba(34,197,94,0.55);
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease; white-space: nowrap;
}
.support-card-button:hover { transform: translateY(-1px) scale(1.02); box-shadow: 0 0 24px rgba(34,197,94,0.75); opacity: 0.95; }
.support-card-close {
    position: absolute; top: -0.35rem; right: -0.35rem; width: 20px; height: 20px;
    border-radius: 999px; background: rgba(15,23,42,0.9);
    border: 1px solid rgba(148,163,184,0.7); color: #9ca3af; font-size: 0.7rem;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pip-btn {
    position: absolute; top: -0.35rem; right: 20px;
    width: 20px; height: 20px; cursor: pointer; border-radius: 50%;
    background: #334155; color: white; border: 1px solid #94a3b8;
    display: flex; align-items: center; justify-content: center; font-size: 10px;
}
.pip-btn:hover { background: #22d3ee; border-color: #22d3ee; color: black; }

/* MEDIA QUERIES */
@media (max-width: 640px) {
    .support-ribbon-container { left: 0.4rem; bottom: 3.4rem; }
    .support-ribbon-card { max-width: 260px; }
    .support-widget { right: 0.75rem; left: 0.75rem; bottom: 0.75rem; max-width: none; }
    .support-card { text-align: center; }
}