:root { --bg-body:#0b0b12; --bg-card:#151520; --bg-input:#0a0a0f; --accent:#4E6CFF; --accent-hover:#3b55d9; --text-main:#ffffff; --text-muted:#8f90a6; --profit:#00E676; --loss:#FF1744; --border:1px solid rgba(255,255,255,0.08); --radius:14px; --font-title:'Space Grotesk', sans-serif; --font-body:'Inter', sans-serif; }
* { box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent; }

body { font-family:var(--font-body); background-color:var(--bg-body); color:var(--text-main); padding-bottom:80px; font-size:15px; overflow-x: hidden; }

/* HEADER INTEGRATO */
.portfolio-header-block {
    background: linear-gradient(145deg, #1a1a25, #0b0b12);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 20px; margin-bottom: 20px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    margin-top: -1rem; margin-left: -1rem; margin-right: -1rem;
}

.header-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:15px; }
.header-top h1 { font-family:var(--font-title); font-size:1.4rem; display:flex; align-items:center; gap:8px; margin:0; color:white; }
.live-dot { width:8px; height:8px; background:var(--profit); border-radius:50%; box-shadow:0 0 8px var(--profit); animation:pulse 2s infinite; }
@keyframes pulse { 0% {opacity:1;} 50% {opacity:0.5;} 100% {opacity:1;} }
.badge { background: var(--accent); color: white; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; }

.portfolio-summary { display:grid; grid-template-columns:1.2fr 1fr; gap:10px; }
.summary-box { background:rgba(255,255,255,0.05); border:var(--border); border-radius:var(--radius); padding:15px; text-align:center; }
.main-box h2 { font-family:var(--font-title); font-size:1.6rem; margin-top:5px; margin-bottom:0; color: white; }
.summary-grid { display:flex; flex-direction:column; gap:8px; }
.mini-box { display:flex; justify-content:space-between; align-items:center; background:rgba(255,255,255,0.05); padding:8px 12px; border-radius:8px; font-size:0.75rem; }

/* LAYOUT */
.container { padding:1rem; max-width:800px; margin:0 auto; }
.view { display:none; animation:fadeUp 0.3s ease; }
.view.active { display:block; }
@keyframes fadeUp { from {opacity:0; transform:translateY(10px);} to {opacity:1; transform:translateY(0);} }

.card { background:var(--bg-card); border-radius:var(--radius); border:var(--border); margin-bottom:1rem; overflow:hidden; }
.card-content { padding:15px; }
h2 { font-family:var(--font-title); margin-bottom:1rem; font-size:1.4rem; color: white; }

input, select, textarea { width:100%; background:var(--bg-input); border:1px solid #333; padding:12px; border-radius:10px; color:white; outline:none; font-family:inherit; font-size:1rem; margin-bottom:10px; }
input:focus { border-color:var(--accent); }
.input-group label { display:block; font-size:0.75rem; color:var(--text-muted); margin-bottom:5px; text-transform:uppercase; }
.row-2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }

.btn { width:100%; padding:12px; border:none; border-radius:10px; font-weight:700; cursor:pointer; background:var(--accent); color:white; transition:0.2s; }
.btn:hover { background:var(--accent-hover); }
.btn-outline { background:transparent; border:1px solid var(--accent); color:var(--accent); }
.btn-buy { background:linear-gradient(135deg, #00b09b, #96c93d); color:#000; }
.btn-sell { background:var(--loss); color:white; }
.btn-toggle-form { width:100%; padding:15px; background:rgba(255,255,255,0.05); border:1px dashed #555; color:var(--text-muted); margin-bottom:15px; cursor:pointer; border-radius:var(--radius); }
.btn-row { display:grid; grid-template-columns:1fr 1.5fr; gap:10px; }

.platforms-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:15px; }
.platform-card { padding:20px; text-align:center; display:flex; flex-direction:column; align-items:center; transition:transform 0.2s; background:linear-gradient(145deg, #1a1a25, #151520); position: relative; border: 1px solid rgba(255,255,255,0.05); }
.platform-card:hover { transform:translateY(-5px); border-color:var(--accent); }
.platform-logo { height:50px; width:auto; max-width:100%; object-fit:contain; margin-bottom:15px; background:white; padding:5px; border-radius:8px; }
.btn-aff { display:block; width:100%; padding:10px; background:rgba(78, 108, 255, 0.1); border:1px solid var(--accent); color:var(--accent); text-decoration:none; border-radius:8px; font-weight:bold; transition:0.2s; margin-top: auto; }

/* GLOSSARY & EDU */
details { background: rgba(255,255,255,0.03); margin-bottom: 10px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,0.05); }
summary { padding: 15px; cursor: pointer; font-weight: bold; color: var(--text-main); list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::after { content: '+'; font-size: 1.2rem; color: var(--accent); }
details[open] summary::after { content: '-'; }
details p { padding: 0 15px 15px 15px; color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; margin: 0; }

.topic-section { margin-bottom:30px; }
.topic-section h3 { font-size:1rem; text-transform:uppercase; color:var(--accent); border-bottom:1px solid rgba(255,255,255,0.1); padding-bottom:8px; margin-bottom:15px; }
.resource-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:15px; }
.res-card { background:var(--bg-card); padding:15px; border-radius:var(--radius); border:var(--border); display:flex; gap:15px; align-items:center; text-decoration:none; color:white; transition:0.2s; }
.res-card:hover { border-color:var(--accent); transform:translateY(-2px); }
.res-icon { width:45px; height:45px; display:flex; align-items:center; justify-content:center; font-size:1.4rem; border-radius:10px; background:rgba(255,255,255,0.05); flex-shrink:0; }

.bottom-nav { position:fixed; bottom:0; width:100%; background:rgba(10,10,15,0.98); backdrop-filter:blur(10px); border-top:1px solid rgba(255,255,255,0.1); display:flex; justify-content:space-around; padding:10px 0; padding-bottom:calc(10px + env(safe-area-inset-bottom)); z-index:200; }
.nav-link { color:#555; text-decoration:none; text-align:center; font-size:0.65rem; flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; transition: 0.2s; }
.nav-link.active { color:var(--accent); transform: translateY(-2px); }
.nav-link i { font-size: 1.2rem; margin-bottom: 2px; }

.modal-overlay { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.85); backdrop-filter:blur(5px); z-index:2000; display:flex; align-items:center; justify-content:center; }
.modal-content { background:var(--bg-card); padding:25px; border-radius:var(--radius); border:1px solid var(--accent); width:90%; max-width:350px; animation:fadeUp 0.3s; }
.text-profit { color:var(--profit); } .text-loss { color:var(--loss); } .text-main { color:white; }
.loader { text-align:center; padding:20px; color:var(--accent); }
.section-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; margin-top:20px; }
.section-header span { color:#888; font-size:0.85rem; font-weight:bold; text-transform:uppercase; }
.asset-item { display:flex; justify-content:space-between; align-items:center; padding:15px; background:var(--bg-card); border-radius:var(--radius); border:var(--border); margin-bottom:8px; }
.asset-left { display:flex; align-items:center; gap:12px; }
.coin-avatar { width:40px; height:40px; background:#2a2a35; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:bold; color:var(--text-muted); text-transform:uppercase; font-size: 0.8rem; }
.asset-actions { display:flex; gap:15px; justify-content:flex-end; margin-top:5px; }
.btn-action { background:none; border:none; cursor:pointer; font-size:0.9rem; color:#888; }
.table-container { max-height:250px; overflow-y:auto; border:1px solid rgba(255,255,255,0.1); border-radius:8px; margin-top:10px;}
.year-table { width:100%; border-collapse:collapse; font-size:0.85rem; }
.year-table td { padding:10px; border-bottom:1px solid #333; text-align:center; }