:root {
    --primary: #00d2ff;
    --primary-dim: rgba(0, 210, 255, 0.1);
    --secondary: #d8b4fe; /* Viola distintivo per Expedition */
    --bg-dark: #0b0e14;
    --panel-bg: rgba(22, 27, 34, 0.95);
    --text-main: #e6edf3;
    --text-muted: #8b949e;
    
    --success: #238636;
    --danger: #f85149;
    --warning: #d29922;
    
    --metal: #9ca3af;
    --crystal: #79c0ff;
    --deuterium: #56d364;
    --dm: #d8b4fe;

    --font-tech: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 0%, #1c2333 0%, #0b0e14 70%);
    color: var(--text-main);
    font-family: var(--font-body);
    margin: 0; padding: 20px; min-height: 100vh;
}

.background-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 80% 20%, rgba(216, 180, 254, 0.05) 0%, transparent 20%);
    z-index: -1; pointer-events: none;
}

.container { max-width: 1300px; margin: 0 auto; position: relative; z-index: 2; padding-bottom: 60px; }

/* HEADER */
.header-section { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.main-title { font-family: var(--font-tech); font-size: 2.2rem; font-weight: 700; letter-spacing: 2px; margin: 0; background: linear-gradient(to bottom, #ffffff, #a5b4fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.highlight { color: var(--secondary); -webkit-text-fill-color: var(--secondary); }
.v-tag { font-size: 0.4em; background: rgba(216,180,254,0.1); border: 1px solid var(--secondary); color: var(--secondary); -webkit-text-fill-color: var(--secondary); padding: 2px 6px; border-radius: 4px; vertical-align: middle; margin-left: 10px; font-weight: 600; }

/* HOME & LANG */
.home-btn { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: rgba(216, 180, 254, 0.1); border: 1px solid var(--secondary); color: var(--secondary); border-radius: 8px; font-size: 1.2rem; transition: 0.3s; box-shadow: 0 0 10px rgba(216, 180, 254, 0.2); text-decoration: none; }
.home-btn:hover { background: var(--secondary); color: #000; box-shadow: 0 0 20px var(--secondary); transform: translateY(-2px); }

.lang-bar { display: flex; align-items: center; }
.lang-select { 
    background: rgba(0, 0, 0, 0.5); border: 1px solid var(--secondary); color: var(--text-muted); 
    padding: 6px 12px; font-family: var(--font-tech); font-weight: 700; font-size: 0.9rem; 
    border-radius: 4px; outline: none; cursor: pointer; transition: 0.3s; 
}
.lang-select:hover, .lang-select:focus { border-color: var(--secondary); color: white; box-shadow: 0 0 10px rgba(216, 180, 254, 0.4); }
.lang-select option { background-color: #0a0b10; color: white; }

/* PANELS */
.glass-panel { background: var(--panel-bg); border: 1px solid rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); border-radius: 12px; padding: 20px; margin-bottom: 20px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); }
.panel-head h3 { margin: 0; font-family: var(--font-tech); font-size: 1.1rem; color: var(--secondary); text-transform: uppercase; letter-spacing: 1px; }

/* INPUTS */
.api-layout { display: flex; gap: 10px; align-items: flex-end; margin-top: 15px; }
.input-box { display: flex; flex-direction: column; flex: 1; }
.big-box { flex-grow: 2; }
.input-box label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; font-weight: bold; font-family: var(--font-body); }

.input-cyber {
    background: rgba(0, 0, 0, 0.5); border: 1px solid var(--secondary); color: var(--secondary);
    padding: 10px; font-family: var(--font-tech); font-size: 1rem; border-radius: 5px; width: 100%; transition: 0.3s;
}
.input-cyber:focus { box-shadow: 0 0 10px rgba(216,180,254,0.4); outline: none; }
select.input-cyber option { background-color: #0a0b10; color: white; font-family: var(--font-body); }

.settings-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-top: 15px; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr 1fr; } }

.advanced-settings { margin-top: 15px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.1); }
.adv-row { display: flex; gap: 10px; align-items: center; justify-content: space-around; flex-wrap: wrap; }
.input-mini { width: 60px; background: rgba(0,0,0,0.3); border: 1px solid #555; color: white; text-align: center; padding: 5px; border-radius: 3px; font-family: var(--font-tech); }

/* MAIN GRID */
.main-grid { display: grid; grid-template-columns: 350px 1fr; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .main-grid { grid-template-columns: 1fr; } }

/* FLEET LIST */
.fleet-header { display: flex; justify-content: space-between; margin-bottom: 10px; border-bottom: 1px solid #333; padding-bottom: 5px; }
.header-legend { font-size: 0.7rem; color: #777; }
.fleet-grid { display: grid; gap: 6px; max-height: 600px; overflow-y: auto; padding-right: 5px; margin-bottom: 15px; }

.ship-row { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.03); padding: 5px 8px; border-radius: 4px; border: 1px solid transparent; transition: 0.2s; }
.ship-row:hover { border-color: var(--secondary); background: rgba(255,255,255,0.06); }
.ship-row label { font-size: 0.85rem; color: #ddd; flex: 1; font-family: var(--font-body); }
.ship-inputs { display: flex; gap: 5px; }
.in-lf { width: 50px; text-align: center; border: 1px solid var(--secondary); color: var(--secondary); background: rgba(216,180,254,0.1); padding: 4px; border-radius: 3px; font-weight: bold; font-family: var(--font-tech); }
.in-cnt { width: 80px; text-align: right; background: rgba(0,0,0,0.4); border: 1px solid #444; color: white; padding: 4px; border-radius: 3px; font-family: var(--font-tech); font-size: 1rem; }
.in-cnt:focus { border-color: var(--primary); outline: none; }

/* RESULTS */
.res-card { background: rgba(255,255,255,0.03); padding: 12px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; border-left: 3px solid var(--secondary); }
.highlight-card { border-left-color: var(--primary); background: var(--primary-dim); flex-direction: column; align-items: flex-start; }
.res-label { color: var(--text-muted); font-size: 0.85rem; font-family: var(--font-body); }
.res-value { font-family: var(--font-tech); font-size: 1.2rem; color: white; }
.res-sub { font-size: 0.7rem; color: var(--primary); margin-top: 5px; }

.resources-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.res-box { padding: 10px; border-radius: 6px; text-align: center; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); }
.res-box strong { display: block; font-size: 1.1rem; margin-top: 5px; font-family: var(--font-tech); color: white; }
.met { border-color: var(--metal); color: var(--metal); }
.cry { border-color: var(--crystal); color: var(--crystal); }
.deu { border-color: var(--deuterium); color: var(--deuterium); }
.dm { border-color: var(--dm); color: var(--dm); }

.warning-section { margin-top: 20px; padding: 15px; background: rgba(248, 81, 73, 0.1); border: 1px solid var(--danger); border-radius: 8px; }
.warning-section h4 { color: var(--danger); margin: 0 0 10px 0; font-size: 0.9rem; font-family: var(--font-tech); }
.worst-row { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 0.9rem; color: #ffadad; }

.fleet-findings { margin-top: 20px; }
.fleet-findings h4 { color: var(--secondary); margin-bottom: 10px; font-family: var(--font-tech); }
.found-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 0.8rem; }
.found-item { background: rgba(255,255,255,0.05); padding: 5px; border-radius: 3px; color: #bbb; text-align: center; border: 1px solid transparent; }
.found-item.ok { color: var(--success); border-color: var(--success); background: rgba(35, 134, 54, 0.1); font-weight: bold; }

.btn-main { width: 100%; padding: 12px; background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 100%); border: none; border-radius: 6px; color: #000; font-family: var(--font-tech); font-weight: 900; cursor: pointer; text-transform: uppercase; transition: 0.3s; font-size: 1rem; }
.btn-main:hover { transform: translateY(-2px); box-shadow: 0 0 20px rgba(216, 180, 254, 0.5); }
.small-btn { width: auto; padding: 10px 20px; height: 45px; margin: 0; }
.btn-reset { width: 100%; padding: 10px; background: transparent; border: 1px solid var(--danger); color: var(--danger); border-radius: 4px; cursor: pointer; font-weight: bold; transition: 0.3s; margin-top: 10px; font-family: var(--font-tech); }
.btn-reset:hover { background: var(--danger); color: white; }

/* COOKIE BANNER */
.cookie-banner {
    position: fixed; bottom: -150px; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 600px; background: rgba(10, 11, 16, 0.95);
    backdrop-filter: blur(10px); border: 1px solid var(--secondary);
    border-radius: 10px; padding: 20px; display: flex; align-items: center;
    justify-content: space-between; gap: 20px; box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
    z-index: 9999; transition: bottom 0.5s ease-in-out;
}
.cookie-banner.show { bottom: 20px; }
.cookie-text { font-size: 0.9rem; color: #e0e0e0; line-height: 1.4; font-family: var(--font-body); }
.cookie-btn {
    background: var(--secondary); color: #000; border: none; padding: 10px 20px;
    font-family: var(--font-tech); font-weight: 700; border-radius: 5px;
    cursor: pointer; transition: 0.3s; white-space: nowrap; font-size: 0.9rem;
}
.cookie-btn:hover { background: white; box-shadow: 0 0 15px var(--secondary); }

@media (max-width: 768px) {
    .cookie-banner { flex-direction: column; text-align: center; }
    .cookie-btn { width: 100%; }
}