/* ============================================================
   VARIABLES
============================================================ */
:root {
    --purple:      #9b00ff;
    --purple-dark: #6a00cc;
    --purple-dim:  #3d0066;
    --cyan:        #00ffe1;
    --bg:          #1a1a2e;
    --bg-card:     #16213e;
    --bg-panel:    #0f3460;
    --text:        #e0e0ff;
    --text-muted:  #8888aa;
    --radius:      12px;
    --danger:      #ff4444;
    --warn:        #ffaa00;
    --success:     #44ff88;
}

/* ============================================================
   RESET
============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ============================================================
   GLOBAL
============================================================ */
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   HEADER
============================================================ */
header {
    background: linear-gradient(135deg, var(--purple-dim), var(--bg-panel));
    padding: 0.8rem 2rem;
    text-align: center;
    border-bottom: 2px solid var(--purple);
    box-shadow: 0 4px 20px rgba(155,0,255,0.4);
    position: sticky;
    top: 0;
    z-index: 100;
}
header h1 { font-size: 1.8rem; text-shadow: 0 0 15px var(--purple); letter-spacing: 3px; }
header h2 { font-size: 0.8rem; color: var(--text-muted); font-weight: normal; letter-spacing: 2px; }
header { position: relative; }
.header-user {
    position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%);
    display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--text-muted);
}
.btn-header {
    background: rgba(155,0,255,0.2); border: 1px solid var(--purple-dim);
    color: var(--text); border-radius: 6px; padding: 0.3rem 0.7rem;
    cursor: pointer; font-size: 0.8rem; transition: background 0.2s;
}
.btn-header:hover { background: var(--purple-dim); }

/* ============================================================
   LAYOUT
============================================================ */
main { display: flex; flex: 1; overflow: hidden; height: calc(100vh - 78px); }

.left-panel {
    width: 340px; min-width: 300px;
    background: var(--bg-card); border-right: 2px solid var(--purple-dim);
    display: flex; flex-direction: column; gap: 0.8rem; padding: 1rem;
    overflow-y: auto; height: 100%;
}
.right-panel { flex: 1; padding: 0; overflow-y: auto; background: var(--bg); display: flex; flex-direction: column; }

/* ============================================================
   STATS
============================================================ */
.stat-card {
    background: var(--bg-panel); border: 1px solid var(--purple-dim);
    border-radius: var(--radius); padding: 0.8rem;
    display: flex; flex-direction: column; gap: 0.55rem;
}
.stat-row { display: flex; align-items: center; gap: 0.7rem; }
.stat-row.main-stat .stat-value { font-size: 1.7rem; }
.stat-icon { font-size: 1.2rem; width: 1.8rem; text-align: center; flex-shrink: 0; }
.stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.stat-value { font-size: 1.1rem; font-weight: bold; color: var(--purple); }
.stat-value.glow { text-shadow: 0 0 12px var(--purple), 0 0 24px var(--purple); }

/* ============================================================
   CLICKER
============================================================ */
.clicker-area { display: flex; justify-content: center; position: relative; overflow: visible; }
#click_button {
    width: 240px; height: auto; cursor: pointer; background: transparent; display: block;
    filter: drop-shadow(0 0 10px rgba(155,0,255,0.5)); transition: filter 0.1s;
}
#click_button:hover { filter: drop-shadow(0 0 20px var(--purple)) brightness(1.1); }
@keyframes click-bounce {
    0%{transform:scale(1)} 30%{transform:scale(0.92)} 70%{transform:scale(1.05)} 100%{transform:scale(1)}
}
#click_button.click-bounce { animation: click-bounce 0.18s ease-out; }

/* ============================================================
   BARRE RÉVISION
============================================================ */
.revision-card {
    background: var(--bg-panel); border: 1px solid var(--purple-dim);
    border-radius: var(--radius); padding: 0.7rem 0.9rem;
}
.revision-header { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.revision-bar-bg { background: #333; border-radius: 8px; height: 10px; overflow: hidden; }
.revision-fill {
    height: 100%; background: linear-gradient(90deg,#44ff88,#00ffe1);
    border-radius: 8px; transition: width 0.3s ease, background 0.5s; width: 0%;
}
.revision-fill.rev-warn   { background: linear-gradient(90deg,#ffaa00,#ff7700); }
.revision-fill.rev-alert  { background: linear-gradient(90deg,#ff7700,#ff4444); }
.revision-fill.rev-danger { background: linear-gradient(90deg,#ff4444,#ff0000); animation: pulse-danger 0.6s infinite alternate; }
@keyframes pulse-danger { from{box-shadow:0 0 6px #ff4444} to{box-shadow:0 0 16px #ff0000} }
.revision-rate { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.3rem; text-align: right; }

/* ============================================================
   BOUTONS GAUCHE
============================================================ */
.save-buttons { display: flex; gap: 0.5rem; margin-top: auto; }
.save-buttons button { flex:1; padding:0.6rem; border:none; border-radius:var(--radius); font-size:0.85rem; cursor:pointer; font-weight:bold; transition:filter 0.2s, transform 0.1s; }
.btn-secondary { background: var(--purple-dim); color: var(--text); border: 1px solid var(--purple); }
.btn-danger    { background: #330000; color: #ff8888; border: 1px solid var(--danger); }
.save-buttons button:hover { filter: brightness(1.3); transform: scale(1.03); }

/* ============================================================
   ONGLETS
============================================================ */
.panel-tabs {
    display: flex; background: var(--bg-card); border-bottom: 2px solid var(--purple-dim);
    position: sticky; top: 0; z-index: 10; flex-shrink: 0;
}
.ptab {
    flex: 1; padding: 0.75rem 0.5rem; background: transparent; border: none;
    color: var(--text-muted); cursor: pointer; font-size: 0.82rem; font-weight: bold;
    border-bottom: 3px solid transparent; transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.ptab:hover { color: var(--text); }
.ptab.active { color: var(--purple); border-bottom-color: var(--purple); }

.tab-content { padding: 1.2rem; }
.tab-header { margin-bottom: 1rem; }
.tab-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.3rem; }
.upgrades-title { font-size: 1.2rem; color: var(--purple); text-shadow: 0 0 8px var(--purple); letter-spacing: 1px; }

/* ============================================================
   UPGRADES
============================================================ */
.upgrades-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 0.9rem; margin-bottom: 1.5rem; }
.upg-card {
    background: var(--bg-card); border: 2px solid var(--purple-dim); border-radius: var(--radius);
    padding: 0.9rem; display: flex; align-items: center; gap: 0.7rem;
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
}
.upg-card:has(button:not(:disabled)) { border-color: var(--purple); box-shadow: 0 0 10px rgba(155,0,255,0.3); }
.upg-card:has(button:not(:disabled)):hover { box-shadow: 0 0 20px rgba(155,0,255,0.6); transform: translateY(-2px); }
.upg-icon  { font-size: 1.8rem; flex-shrink: 0; width: 2.2rem; text-align: center; }
.upg-body  { flex: 1; display: flex; flex-direction: column; gap: 0.12rem; }
.upg-body strong { font-size: 0.9rem; }
.upg-body small  { font-size: 0.72rem; color: var(--text-muted); }
.upg-cost  { font-size: 0.75rem; color: var(--cyan); margin-top: 0.2rem; }
.upg-card button {
    background: var(--purple); color: var(--text); border: none; border-radius: 8px;
    padding: 0.45rem 0.8rem; cursor: pointer; font-size: 0.8rem; font-weight: bold;
    white-space: nowrap; flex-shrink: 0; transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}
.upg-card button:hover:not(:disabled) { background: var(--purple-dark); transform: scale(1.05); box-shadow: 0 0 10px var(--purple); }
.upg-card button:disabled { background: #2a2a3a; color: #555577; cursor: not-allowed; }

/* ============================================================
   AMÉLIORATIONS SECRÈTES
============================================================ */
#secret_upgrades {
    margin-top: 1.5rem; padding: 1.2rem;
    border: 2px dashed var(--cyan); border-radius: var(--radius);
    background: linear-gradient(135deg,#050510,#0d0d1a);
    animation: secret-glow 2.5s ease-in-out infinite alternate;
}
@keyframes secret-glow {
    from{box-shadow:0 0 15px rgba(0,255,225,0.2),inset 0 0 30px rgba(155,0,255,0.1)}
    to  {box-shadow:0 0 35px rgba(0,255,225,0.4),inset 0 0 50px rgba(155,0,255,0.2)}
}
#secret_upgrades h3 { font-size:1.2rem; color:var(--cyan); text-shadow:0 0 10px var(--cyan); text-align:center; margin-bottom:1rem; }
.upg-card.secret { background:#050512; border-color:rgba(0,255,225,0.3); }
.upg-card.secret:has(button:not(:disabled)) { border-color:var(--cyan); box-shadow:0 0 15px rgba(0,255,225,0.4); }
.upg-card.secret button:not(:disabled) { background:radial-gradient(circle,var(--cyan),var(--purple)); color:#000; }

/* ============================================================
   BÂTIMENTS
============================================================ */
.buildings-grid { display: flex; flex-direction: column; gap: 0.7rem; }
.bld-card {
    background: var(--bg-card); border: 2px solid var(--purple-dim); border-radius: var(--radius);
    padding: 0.9rem; display: flex; align-items: center; gap: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    opacity: 0.6;
}
.bld-card.can-buy { border-color: var(--purple); box-shadow: 0 0 8px rgba(155,0,255,0.3); opacity: 1; }
.bld-card.owned   { opacity: 1; }
.bld-card.can-buy:hover { box-shadow: 0 0 18px rgba(155,0,255,0.5); transform: translateX(3px); }
.bld-icon  { font-size: 2rem; flex-shrink: 0; width: 52px; height: 52px; text-align: center; display: flex; align-items: center; justify-content: center; }
.bld-icon img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
.bld-info  { flex: 1; min-width: 0; }
.bld-name  { font-size: 0.92rem; font-weight: bold; display: flex; align-items: center; gap: 0.4rem; }
.bld-mult  { background: gold; color: #000; font-size: 0.7rem; padding: 0.1rem 0.35rem; border-radius: 4px; font-weight: bold; }
.bld-desc  { font-size: 0.72rem; color: var(--text-muted); margin: 0.15rem 0; }
.bld-stats { display: flex; gap: 1rem; font-size: 0.72rem; color: var(--cyan); margin-top: 0.2rem; }
.bld-next  { color: var(--text-muted); }
.bld-right { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; flex-shrink: 0; min-width: 80px; }
.bld-count { font-size: 1.6rem; font-weight: bold; color: var(--purple); line-height: 1; }
.bld-cost  { font-size: 0.72rem; color: var(--cyan); text-align: center; }
.bld-card button {
    background: var(--purple); color: var(--text); border: none; border-radius: 8px;
    padding: 0.4rem 0.7rem; cursor: pointer; font-size: 0.78rem; font-weight: bold;
    width: 100%; transition: background 0.2s;
}
.bld-card button:hover:not(:disabled) { background: var(--purple-dark); }
.bld-card button:disabled { background: #2a2a3a; color: #555577; cursor: not-allowed; }

/* ============================================================
   MINI-JEUX
============================================================ */
.mj-card {
    background: var(--bg-card); border: 2px solid var(--purple-dim); border-radius: var(--radius);
    padding: 1.2rem; margin-bottom: 1rem; overflow: hidden;
}
.mj-banner {
    width: calc(100% + 2.4rem); height: 90px; object-fit: cover; display: block;
    margin: -1.2rem -1.2rem 1rem;
    border-bottom: 1px solid rgba(123,68,242,0.4);
}
.mj-card.mj-info { border-color: rgba(0,255,225,0.2); background: #050512; }
.mj-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 0.8rem; }
.mj-icon   { font-size: 2.2rem; flex-shrink: 0; }
.mj-name   { font-size: 1rem; font-weight: bold; color: var(--text); }
.mj-desc   { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }
.mj-tip    { font-size: 0.78rem; color: var(--cyan); margin-top: 0.5rem; padding: 0.5rem; background: rgba(0,255,225,0.05); border-radius: 6px; }
.mj-btn {
    background: var(--purple); color: var(--text); border: none; border-radius: 8px;
    padding: 0.7rem 1.2rem; cursor: pointer; font-size: 0.9rem; font-weight: bold;
    transition: background 0.2s, box-shadow 0.2s; margin-top: 0.5rem;
}
.mj-btn:hover:not(:disabled) { background: var(--purple-dark); box-shadow: 0 0 12px var(--purple); }
.mj-btn:disabled { background: #2a2a3a; color: #555577; cursor: not-allowed; }
.mj-btn-accent { background: #005500; border: 1px solid #00aa00; }
.mj-btn-accent:hover:not(:disabled) { background: #007700; }

/* Probabilités Loto */
.mj-odds { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.odd-row { display: flex; align-items: center; gap: 0.3rem; background: #1a1a2e; border-radius: 6px; padding: 0.3rem 0.6rem; font-size: 0.78rem; }
.odd-label { color: var(--text); }
.odd-val   { color: var(--text-muted); }

/* Jackpot Mécanique */
.jackpot-reels { display: flex; justify-content: center; gap: 0.6rem; margin: 0.8rem 0 0.5rem; }
.jackpot-reel  { font-size: 2.8rem; background: #1a1a2e; border: 2px solid var(--purple-dim); border-radius: 10px; padding: 0.3rem 0.6rem; min-width: 3.5rem; text-align: center; transition: transform 0.1s; }
.jackpot-result { font-size: 0.85rem; color: var(--cyan); text-align: center; margin: 0.4rem 0 0.6rem; min-height: 1.2rem; }
.pari-btns { display: flex; gap: 0.7rem; flex-wrap: wrap; }

/* Course Chrono */
.course-btns      { display: flex; gap: 0.7rem; }
.course-status-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.course-bar-bg    { background: #333; border-radius: 8px; height: 8px; overflow: hidden; margin-bottom: 0.7rem; }
.course-bar-fill  { height: 100%; background: linear-gradient(90deg, var(--purple), var(--cyan)); border-radius: 8px; width: 0%; transition: width 0.1s linear; }

/* ============================================================
   DRIFT EVENT OVERLAY
============================================================ */
.drift-overlay {
    position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
    z-index: 500; pointer-events: all;
    background: rgba(0,0,0,0.3); backdrop-filter: blur(2px);
}
.drift-card {
    background: linear-gradient(135deg, #1a0020, #0d0030);
    border: 3px solid var(--purple); border-radius: 20px;
    padding: 2rem 2.5rem; text-align: center; min-width: 300px;
    box-shadow: 0 0 60px rgba(155,0,255,0.8), 0 0 120px rgba(155,0,255,0.3);
    animation: drift-appear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}
.drift-card .drift-banner {
    width: calc(100% + 5rem); height: 80px; object-fit: cover; display: block;
    margin: -2rem -2.5rem 1.2rem;
}
@keyframes drift-appear { from{transform:scale(0.5);opacity:0} to{transform:scale(1);opacity:1} }
.drift-title  { font-size: 2.5rem; font-weight: 900; color: #ff6600; text-shadow: 0 0 20px #ff6600, 0 0 40px #ff3300; margin-bottom: 0.5rem; animation: flicker 0.5s infinite alternate; }
@keyframes flicker { from{opacity:1} to{opacity:0.85} }
.drift-reward { font-size: 1.4rem; color: gold; font-weight: bold; text-shadow: 0 0 10px gold; margin-bottom: 1rem; }
.drift-btn {
    background: linear-gradient(135deg, #ff6600, #ff0000); color: #fff;
    border: none; border-radius: 12px; padding: 0.9rem 2rem;
    font-size: 1.2rem; font-weight: 900; cursor: pointer; letter-spacing: 2px;
    transition: transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 0 20px rgba(255,100,0,0.6);
    animation: drift-pulse 0.8s ease-in-out infinite alternate;
}
@keyframes drift-pulse { from{transform:scale(1)} to{transform:scale(1.05)} }
.drift-btn:hover { transform: scale(1.1) !important; box-shadow: 0 0 35px rgba(255,100,0,0.9); }
.drift-bar-bg  { background: #333; border-radius: 8px; height: 6px; margin-top: 1rem; overflow: hidden; }
.drift-bar-fill { height: 100%; background: linear-gradient(90deg, var(--purple), #ff6600); border-radius: 8px; width: 100%; }
.drift-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.5rem; }

/* ============================================================
   HISTORIQUE
============================================================ */
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.history-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: 70vh; overflow-y: auto; }
.history-empty { text-align: center; color: var(--text-muted); font-size: 0.9rem; padding: 2rem; }
.history-item {
    display: flex; align-items: center; gap: 0.8rem;
    background: var(--bg-card); border-left: 3px solid var(--purple-dim);
    border-radius: 0 8px 8px 0; padding: 0.5rem 0.8rem; font-size: 0.82rem;
    animation: slideIn 0.2s ease-out;
}
@keyframes slideIn { from{transform:translateX(-10px);opacity:0} to{transform:translateX(0);opacity:1} }
.history-item.type-upgrade  { border-left-color: var(--purple); }
.history-item.type-building { border-left-color: var(--cyan); }
.history-item.type-minigame { border-left-color: gold; }
.history-item.type-event    { border-left-color: #ff6600; }
.hist-icon  { font-size: 1.1rem; flex-shrink: 0; }
.hist-name  { flex: 1; font-weight: bold; }
.hist-cost  { color: var(--cyan); font-size: 0.75rem; white-space: nowrap; }
.hist-time  { color: var(--text-muted); font-size: 0.7rem; white-space: nowrap; }

/* ============================================================
   TEXTES FLOTTANTS
============================================================ */
.point {
    position: absolute; color: #ffcc00; font-size: 1rem; font-weight: bold;
    text-shadow: 0 0 8px #ff8800; pointer-events: none; z-index: 50;
    animation: floatUp 0.9s ease-out forwards; white-space: nowrap; transform: translateX(-50%);
}
@keyframes floatUp {
    from{transform:translateX(-50%) translateY(0);opacity:1}
    to  {transform:translateX(-50%) translateY(-55px);opacity:0}
}

/* ============================================================
   TOAST
============================================================ */
.toast {
    position: fixed; top: 90px; right: -400px; max-width: 320px;
    padding: 0.8rem 1.2rem; border-radius: var(--radius); font-size: 0.88rem; font-weight: bold;
    z-index: 999; transition: right 0.35s cubic-bezier(0.68,-0.55,0.27,1.55);
    border-left: 4px solid var(--purple); background: var(--bg-card);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.toast.show  { right: 1.2rem; }
.toast.info    { border-color: var(--purple); }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.warn    { border-color: var(--warn);    color: var(--warn); }
.toast.danger  { border-color: var(--danger);  color: var(--danger); }

/* ============================================================
   AUTH / MODALS
============================================================ */
.auth-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.8); display: flex;
    align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(4px);
}
.auth-card {
    background: var(--bg-card); border: 2px solid var(--purple); border-radius: 16px;
    padding: 2rem; width: 380px; max-width: 95vw; box-shadow: 0 0 40px rgba(155,0,255,0.4);
    display: flex; flex-direction: column; gap: 1rem;
}
.auth-logo { font-size: 1.5rem; font-weight: bold; text-align: center; color: var(--purple); text-shadow: 0 0 15px var(--purple); letter-spacing: 2px; }
.auth-tabs { display: flex; border-radius: 8px; overflow: hidden; border: 1px solid var(--purple-dim); }
.auth-tab { flex:1; padding:0.6rem; background:transparent; border:none; color:var(--text-muted); cursor:pointer; font-size:0.9rem; font-weight:bold; transition:background 0.2s,color 0.2s; }
.auth-tab.active { background: var(--purple-dim); color: var(--text); }
.auth-error { background:rgba(255,68,68,0.15); border:1px solid var(--danger); color:#ff9999; border-radius:8px; padding:0.5rem 0.8rem; font-size:0.82rem; }
#form-login, #form-register { display:flex; flex-direction:column; gap:0.7rem; }
.auth-card input[type="text"], .auth-card input[type="password"] {
    background:#111122; border:1px solid var(--purple-dim); border-radius:8px;
    color:var(--text); padding:0.65rem 0.9rem; font-size:0.93rem; outline:none; transition:border-color 0.2s;
}
.auth-card input:focus { border-color: var(--purple); }
.auth-submit { background:var(--purple); color:var(--text); border:none; border-radius:8px; padding:0.75rem; font-size:0.95rem; font-weight:bold; cursor:pointer; transition:background 0.2s,box-shadow 0.2s; }
.auth-submit:hover { background:var(--purple-dark); box-shadow:0 0 15px var(--purple); }
.auth-guest { background:transparent; border:1px solid var(--text-muted); color:var(--text-muted); border-radius:8px; padding:0.55rem; font-size:0.82rem; cursor:pointer; transition:border-color 0.2s,color 0.2s; }
.auth-guest:hover { border-color:var(--text); color:var(--text); }

/* Leaderboard */
.lb-card { width: 460px; }
.lb-table { width:100%; border-collapse:collapse; font-size:0.88rem; }
.lb-table th { color:var(--text-muted); font-size:0.72rem; text-transform:uppercase; letter-spacing:1px; padding:0.45rem 0.7rem; border-bottom:1px solid var(--purple-dim); text-align:left; }
.lb-table td { padding:0.5rem 0.7rem; border-bottom:1px solid #1a1a2e; }
.lb-table tr.lb-top td:first-child { color:gold; font-weight:bold; }
.lb-table tr:nth-child(2) td:first-child { color:silver; }
.lb-table tr:nth-child(3) td:first-child { color:#cd7f32; }
.lb-table td:last-child { color:var(--cyan); font-weight:bold; }

/* ============================================================
   REBIRTH / PRESTIGE
============================================================ */
.rb-stats { display:flex; gap:0.7rem; margin-bottom:1rem; flex-wrap:wrap; }
.rb-stat  { background:var(--bg-panel); border:1px solid var(--purple-dim); border-radius:var(--radius); padding:0.7rem 1rem; display:flex; align-items:center; gap:0.6rem; flex:1; min-width:80px; }
.rb-stat-icon  { font-size:1.5rem; }
.rb-stat-label { font-size:0.7rem; color:var(--text-muted); text-transform:uppercase; }
.rb-stat-val   { font-size:1.2rem; font-weight:bold; color:var(--purple); }

.rb-threshold-card { background:var(--bg-card); border:2px solid var(--purple-dim); border-radius:var(--radius); padding:1rem; margin-bottom:1.2rem; }
.rb-threshold-header { display:flex; justify-content:space-between; font-size:0.82rem; color:var(--text-muted); margin-bottom:0.4rem; }
.rb-btn {
    width:100%; margin-top:0.7rem; padding:0.8rem; border:none; border-radius:var(--radius);
    background:#2a2a3a; color:#555577; cursor:not-allowed; font-size:0.92rem; font-weight:bold;
}
.rb-btn.rb-ready {
    background:linear-gradient(135deg,var(--purple),#ff6600);
    color:#fff; cursor:pointer;
    box-shadow:0 0 20px rgba(155,0,255,0.5);
    animation:rb-pulse 1.2s ease-in-out infinite alternate;
}
@keyframes rb-pulse { from{box-shadow:0 0 15px rgba(155,0,255,0.5)} to{box-shadow:0 0 30px rgba(255,100,0,0.7)} }
.rb-upgrades-title { font-size:1rem; color:var(--cyan); margin-bottom:0.8rem; }

/* ============================================================
   FOOTER
============================================================ */
footer { text-align:center; padding:0.5rem; background:#0a0a14; color:var(--text-muted); font-size:0.72rem; border-top:1px solid var(--purple-dim); }

/* ============================================================
   SCROLLBAR
============================================================ */
::-webkit-scrollbar { width:5px; }
::-webkit-scrollbar-track { background:var(--bg); }
::-webkit-scrollbar-thumb { background:var(--purple-dim); border-radius:3px; }
::-webkit-scrollbar-thumb:hover { background:var(--purple); }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 720px) {
    main { flex-direction:column; height:auto; overflow:visible; }
    .left-panel { width:100%; height:auto; }
    .right-panel { min-height: 60vh; }
    .upgrades-grid { grid-template-columns:1fr; }
    .ptab { font-size:0.72rem; padding:0.6rem 0.3rem; }
}
