/* style.css — EmpireMoney v15 */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Fix global : l'attribut hidden doit TOUJOURS gagner sur les display CSS */
[hidden] { display: none !important; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(160deg, #0d1421 0%, #1a2332 100%);
    color: #e8ecf1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ---------- Cartes auth (login/register) ---------- */
.auth-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 36px 28px;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(12px);
}

.auth-card h1 { font-size: 1.6rem; margin-bottom: 6px; text-align: center; }
.subtitle { color: #8a94a6; text-align: center; margin-bottom: 24px; font-size: 0.95rem; }

label { display: block; margin: 14px 0 6px; font-size: 0.9rem; color: #b8c1d0; }

input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #e8ecf1;
    font-size: 1rem;
}
input:focus { outline: none; border-color: #4ade80; }

.auth-card button {
    width: 100%;
    margin-top: 22px;
    padding: 13px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, filter 0.2s;
}
.auth-card button:hover { filter: brightness(1.1); }
.auth-card button:active { transform: scale(0.98); }

.alert {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.switch { text-align: center; margin-top: 18px; font-size: 0.9rem; color: #8a94a6; }
.switch a { color: #4ade80; text-decoration: none; }

/* ---------- Layout jeu ---------- */
.game-body {
    display: block;
    padding: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}
.brand { font-weight: 700; font-size: 1.05rem; }
.user { color: #8a94a6; font-size: 0.95rem; }
.user a { color: #ef4444; text-decoration: none; margin-left: 10px; font-size: 1.1rem; }
.user strong { color: #4ade80; font-variant-numeric: tabular-nums; }

.game-main {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px 90px;
}

.page-title { font-size: 1.3rem; margin-bottom: 16px; }

/* ---------- Bannière offline ---------- */
.offline-banner {
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.35);
    color: #bbf7d0;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 0.92rem;
    text-align: center;
    transition: opacity 0.8s;
}
.offline-banner.fade-out { opacity: 0; }

/* ---------- Stats ---------- */
.stats { text-align: center; margin-bottom: 28px; }

.stat-label {
    display: block;
    color: #8a94a6;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.stat-main .stat-value {
    font-size: 2.4rem;
    font-weight: 800;
    color: #4ade80;
    font-variant-numeric: tabular-nums;
}

.stat-row {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.stat-mini {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 12px;
}

.stat-value-sm {
    font-size: 1.05rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ---------- Clicker ---------- */
.clicker-zone {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.click-btn {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    border: 3px solid rgba(74, 222, 128, 0.5);
    background: radial-gradient(circle at 35% 30%, #1f3a2b, #10241a);
    color: #e8ecf1;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 0 40px rgba(74, 222, 128, 0.15);
    transition: box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
}
.click-btn:hover { box-shadow: 0 0 60px rgba(74, 222, 128, 0.3); }
.click-btn.pop { animation: pop 0.15s ease; }

@keyframes pop {
    50% { transform: scale(0.93); }
}

.click-icon { font-size: 3rem; }
.click-label { font-size: 0.95rem; color: #86efac; font-weight: 600; }

/* ---------- Navigation basse ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    background: rgba(13, 20, 33, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 10px 0 14px;
    backdrop-filter: blur(10px);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 1.25rem;
    color: #8a94a6;
    cursor: pointer;
    text-decoration: none;
}
.nav-item small { font-size: 0.65rem; }
.nav-item.active { color: #4ade80; }
.nav-item.disabled { opacity: 0.35; cursor: default; }

/* ---------- Onglets catégories ---------- */
.cat-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 14px;
    scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
    flex-shrink: 0;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    color: #b8c1d0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.cat-tab.active {
    background: rgba(74, 222, 128, 0.15);
    border-color: rgba(74, 222, 128, 0.5);
    color: #86efac;
}

/* ---------- Cartes entreprises ---------- */
.biz-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.biz-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 14px 16px;
    transition: border-color 0.3s;
}
.biz-card.locked { opacity: 0.55; }
.biz-card.flash { animation: flash-green 0.5s ease; }

@keyframes flash-green {
    30% { border-color: rgba(74, 222, 128, 0.8); background: rgba(74, 222, 128, 0.08); }
}

.biz-info { display: flex; flex-direction: column; gap: 3px; }
.biz-name { font-weight: 700; font-size: 0.98rem; }
.biz-income { color: #8a94a6; font-size: 0.8rem; }
.biz-level { color: #4ade80; font-size: 0.8rem; font-weight: 600; }

.biz-action { flex-shrink: 0; text-align: right; }

.buy-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: none;
    border-radius: 10px;
    color: #fff;
    padding: 9px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.5;
    transition: filter 0.2s;
}
.buy-btn:hover { filter: brightness(1.12); }
.buy-btn:disabled { opacity: 0.6; cursor: wait; }
.buy-btn.shake { animation: shake 0.35s ease; }

@keyframes shake {
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.lock-info { color: #8a94a6; font-size: 0.75rem; line-height: 1.5; }

/* ---------- Marché (Bourse & Crypto) ---------- */
.market-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.asset-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 14px 14px;
}

.asset-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.asset-symbol { font-weight: 800; font-size: 0.95rem; letter-spacing: 0.03em; }
.asset-change { font-size: 0.7rem; margin-left: 5px; }
.asset-name { color: #8a94a6; font-size: 0.78rem; }
.asset-holding { color: #b8c1d0; font-size: 0.78rem; margin-top: 3px; }

.asset-mid { flex-shrink: 0; display: flex; align-items: center; }

.pnl-up { color: #4ade80; font-weight: 700; }
.pnl-down { color: #f87171; font-weight: 700; }

.asset-price-zone {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.asset-price { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.92rem; }

.trade-btn {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.5);
    border-radius: 8px;
    color: #86efac;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.trade-btn:hover { background: rgba(74, 222, 128, 0.25); }

/* ---------- Panneau de trade ---------- */
.trade-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(3px);
}

.trade-panel {
    background: #16202f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px 18px 0 0;
    padding: 20px 18px 28px;
    width: 100%;
    max-width: 480px;
}

.trade-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 1.05rem;
}

.trade-close {
    background: none;
    border: none;
    color: #8a94a6;
    font-size: 1.2rem;
    cursor: pointer;
}

.trade-chart {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    line-height: 0;
}
.trade-chart svg { width: 100%; height: 110px; display: block; }

.trade-price { color: #b8c1d0; font-size: 0.92rem; margin-bottom: 4px; }
.trade-price strong { color: #e8ecf1; font-variant-numeric: tabular-nums; }
.trade-position { color: #8a94a6; font-size: 0.82rem; margin-bottom: 14px; }

.trade-row { display: flex; gap: 10px; margin-bottom: 10px; }
.trade-row input { flex: 1; }
.trade-row .buy-btn { padding: 12px 18px; font-size: 0.9rem; }

.trade-quick { display: flex; gap: 8px; margin-bottom: 14px; }
.trade-quick button {
    flex: 1;
    padding: 7px 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #b8c1d0;
    font-size: 0.8rem;
    cursor: pointer;
}
.trade-quick button:hover { background: rgba(255, 255, 255, 0.12); }

.trade-sell-row { margin-top: 4px; }

.sell-btn {
    flex: 1;
    padding: 11px 0;
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.45);
    border-radius: 10px;
    color: #fca5a5;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.sell-btn:hover { background: rgba(248, 113, 113, 0.22); }
.sell-btn.sell-all { background: rgba(248, 113, 113, 0.2); }

.trade-msg { min-height: 20px; font-size: 0.85rem; text-align: center; }
.msg-ok { color: #4ade80; }
.msg-err { color: #f87171; }
/* ================= v15 ================= */

/* Tuile d'icône des cartes business */
.biz-tile {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.biz-details-link {
    color: #86efac;
    font-size: 0.78rem;
    text-decoration: none;
    margin-top: 2px;
}
.biz-details-link:hover { text-decoration: underline; }

/* Nav compacte pour 6 entrées */
.bottom-nav { padding: 8px 0 12px; }
.nav-item { font-size: 1.1rem; }
.nav-item small { font-size: 0.58rem; }

/* Ligne USSRAF sous les stats */
.ussraf-line {
    margin-top: 12px;
    color: #fca5a5;
    font-size: 0.8rem;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.3);
    border-radius: 10px;
    padding: 8px 12px;
    display: inline-block;
}

/* Bouton Discord */
.discord-btn {
    display: block;
    text-align: center;
    margin: 4px auto 0;
    max-width: 320px;
    padding: 12px 18px;
    background: rgba(88, 101, 242, 0.18);
    border: 1px solid rgba(88, 101, 242, 0.55);
    border-radius: 12px;
    color: #c7d2fe;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: background 0.2s;
}
.discord-btn:hover { background: rgba(88, 101, 242, 0.3); }

/* Courbes agrandies sur mobile */
@media (max-width: 600px) {
    .big-chart svg { height: 220px !important; }
    .asset-mid svg { width: 74px; }
}
.kofi-btn {
    display: block;
    text-align: center;
    margin: 10px auto 0;
    max-width: 320px;
    padding: 12px 18px;
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.55);
    border-radius: 12px;
    color: #ffd75e;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: background 0.2s;
}
.kofi-btn:hover { background: rgba(255, 193, 7, 0.28); }
