:root {
    --primary: #00d2ff;
    --primary-dim: rgba(0, 210, 255, 0.1);
    --secondary: #3a7bd5;
    --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;

    /* FONT STANDARD V3 */
    --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;
}

.container { max-width: 1200px; margin: 0 auto; position: relative; z-index: 2; }

/* 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(--primary); -webkit-text-fill-color: var(--primary); }
.v-tag { font-size: 0.4em; background: var(--primary-dim); border: 1px solid var(--primary); color: var(--primary); -webkit-text-fill-color: var(--primary); padding: 2px 6px; border-radius: 4px; vertical-align: middle; margin-left: 10px; font-weight: 600; }

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

/* LANGUAGE SELECTOR */
.lang-bar { display: flex; align-items: center; }
.lang-select { 
    background: rgba(0, 0, 0, 0.5); border: 1px solid var(--primary); 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(--primary); color: white; box-shadow: 0 0 10px var(--primary-dim); }
.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); position: relative; }
.step-badge { position: absolute; top: -10px; left: 20px; background: var(--bg-dark); border: 1px solid var(--primary); color: var(--primary); width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-tech); font-weight: bold; box-shadow: 0 0 10px var(--primary-dim); }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-left: 10px; }
.panel-head h3 { margin: 0; font-family: var(--font-tech); font-size: 1.1rem; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; }
.head-flex { display: flex; align-items: center; gap: 10px; }

/* CONFIG */
.config-bar { padding: 15px 20px; }
.config-content { display: flex; align-items: center; width: 100%; justify-content: center; gap: 40px; }
.config-group { display: flex; align-items: center; gap: 15px; }
.c-label { font-weight: bold; color: var(--text-muted); font-size: 0.9rem; text-transform: uppercase; }
.v-sep { width: 1px; height: 25px; background: rgba(255,255,255,0.1); }
.toggle-switch { display: flex; background: rgba(0,0,0,0.3); border-radius: 4px; padding: 2px; border: 1px solid rgba(255,255,255,0.1); }
.toggle-switch input { display: none; }
.toggle-switch label { padding: 6px 15px; cursor: pointer; font-size: 0.85rem; border-radius: 3px; transition: 0.3s; color: var(--text-muted); }
.toggle-switch input:checked + label { background: var(--primary-dim); color: var(--primary); font-weight: bold; border: 1px solid var(--primary); margin: -1px; }

/* INPUT */
.unified-input-container { position: relative; margin-bottom: 20px; }
textarea { width: 100%; height: 100px; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; color: var(--primary); padding: 15px; font-family: monospace; font-size: 0.85rem; resize: none; transition: 0.3s; }
textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 15px var(--primary-dim); }
.memory-indicators { display: flex; gap: 10px; align-items: center; }
.mem-badge { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: var(--text-muted); padding: 4px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; font-family: var(--font-tech); transition: 0.3s; display: flex; align-items: center; gap: 5px; }
.mem-badge.active { background: rgba(35, 134, 54, 0.2); border-color: var(--success); color: var(--success); box-shadow: 0 0 10px rgba(35, 134, 54, 0.2); }
.btn-icon-small { background: transparent; border: none; color: var(--danger); cursor: pointer; font-size: 0.9rem; margin-left: 5px; opacity: 0.7; transition: 0.2s; }
.btn-icon-small:hover { opacity: 1; transform: scale(1.1); }

/* FEEDBACK MSG */
.input-feedback { 
    position: absolute; top: 50%; right: 25px; transform: translateY(-50%); 
    font-size: 1.1rem; font-weight: 900; text-transform: uppercase; letter-spacing: 1px; font-family: var(--font-tech);
    opacity: 0; transition: opacity 0.5s; pointer-events: none; text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}
.feedback-success { color: var(--success); opacity: 1; }
.feedback-error { color: var(--danger); opacity: 1; }

.btn-main { width: 100%; padding: 15px; 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; font-size: 1.1rem; cursor: pointer; text-transform: uppercase; transition: 0.3s; }
.btn-main:hover { transform: translateY(-2px); box-shadow: 0 0 20px rgba(0, 210, 255, 0.5); }

/* SUMMARY */
.summary-strip { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.sum-item { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.05); padding: 8px; border-radius: 6px; text-align: center; }
.sum-label { display: block; font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
.sum-val { font-family: var(--font-tech); font-size: 1.1rem; font-weight: bold; color: white; }

/* CARDS */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 25px; }

.player-card { 
    background: linear-gradient(160deg, rgba(22,27,34,1) 0%, rgba(30,35,45,1) 100%); 
    border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; transition: 0.3s;
    overflow: visible; position: relative; z-index: 1;
}
.player-card:hover { transform: translateY(-3px); border-color: var(--primary); z-index: 10; }

.card-header { background: rgba(0,0,0,0.3); padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05); border-radius: 7px 7px 0 0; }
.card-footer { padding: 10px; text-align: center; background: rgba(0,0,0,0.2); border-top: 1px solid rgba(255,255,255,0.05); border-radius: 0 0 7px 7px; }

.p-name { font-family: var(--font-tech); color: white; font-size: 1rem; font-weight: bold; }
.status-badge { font-size: 0.7rem; font-weight: bold; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; }
.status-rec { background: rgba(35, 134, 54, 0.2); color: #7ee787; border: 1px solid #238636; }
.status-pay { background: rgba(218, 54, 51, 0.2); color: #ff7b72; border: 1px solid #da3633; }
.status-even { color: var(--text-muted); border: 1px solid var(--text-muted); }
.card-body { padding: 12px 15px; font-size: 0.85rem; }

/* DATA ROWS & TOOLTIP */
.data-row { display: flex; justify-content: space-between; margin-bottom: 6px; border-bottom: 1px dashed rgba(255,255,255,0.1); padding-bottom: 2px; }
.data-row:last-child { border: none; }
.d-label { color: #8b949e; }
.d-val { font-weight: bold; font-family: monospace; }

.tooltip-container { position: relative; display: inline-flex; align-items: center; cursor: help; }
.tooltip-container:hover .custom-tooltip { display: block; opacity: 1; pointer-events: none; }
.custom-tooltip {
    display: none; opacity: 0; transition: opacity 0.2s;
    position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%);
    background: #0d1117; border: 1px solid var(--primary); color: white;
    padding: 8px 10px; border-radius: 6px; font-size: 0.75rem;
    z-index: 100; box-shadow: 0 5px 15px rgba(0,0,0,0.5); width: max-content; min-width: 140px;
}
.custom-tooltip::after {
    content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px;
    border-width: 5px; border-style: solid; border-color: var(--primary) transparent transparent transparent;
}
.tt-row { display: grid; grid-template-columns: 40px 1fr; gap: 10px; margin-bottom: 2px; align-items: center; }
.tt-val { font-weight: bold; font-family: monospace; text-align: right; }
.info-icon { font-size: 0.65em; color: var(--secondary); margin-right: 4px; opacity: 0.7; }

.res-breakdown { background: rgba(0,0,0,0.3); padding: 8px; border-radius: 6px; margin-top: 8px; }
.res-breakdown-title { text-align: center; margin-bottom: 3px; font-size: 0.75rem; font-weight: bold; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 2px;}
.res-row { display: flex; justify-content: space-between; margin-bottom: 2px; font-family: monospace; font-size: 0.85rem;}
.c-met { color: var(--metal); } .c-crys { color: var(--crystal); } .c-deut { color: var(--deuterium); }

.bal-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; }
.bal-val { font-family: var(--font-tech); font-size: 1.2rem; font-weight: bold; }
.text-ok { color: var(--success); text-shadow: 0 0 10px rgba(35, 134, 54, 0.4); }
.text-err { color: var(--danger); text-shadow: 0 0 10px rgba(218, 54, 51, 0.4); }

/* LAYOUT */
.split-layout { display: flex; gap: 20px; }
.split-col { flex: 1; min-width: 0; }
.transport-grid { display: flex; flex-direction: column; gap: 12px; }
.transport-block { background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 10px; }

/* TRANSPORT TITLES COLOR */
.block-met .trans-title { color: var(--metal); border-bottom-color: rgba(156, 163, 175, 0.3); }
.block-crys .trans-title { color: var(--crystal); border-bottom-color: rgba(121, 192, 255, 0.3); }
.block-deut .trans-title { color: var(--deuterium); border-bottom-color: rgba(86, 211, 100, 0.3); }

.trans-title {
    font-family: var(--font-tech); color: var(--text-main); font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 6px; margin-bottom: 8px;
    display: flex; align-items: center; gap: 10px;
}

/* TRANSPORT ROUTES - SLEEK FLEX */
.trade-route {
    display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.03); 
    padding: 6px 10px; margin-bottom: 4px; border-radius: 3px; font-family: monospace; font-size: 0.85rem; border-left: 3px solid #555; transition: 0.2s;
}
.trade-route:hover { background: rgba(255,255,255,0.06); }
.r-name { color: white; font-weight: bold; min-width: 30%; }
.r-name:last-child { text-align: right; }
.r-amt { font-weight: bold; color: var(--primary); text-align: center; flex: 1; }
.r-arr { color: var(--text-muted); font-size: 0.7em; margin: 0 5px; }
.route-met { border-left-color: var(--metal); } .route-crys { border-left-color: var(--crystal); } .route-deut { border-left-color: var(--deuterium); }

.box-label { font-size: 0.8rem; font-weight: bold; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; }
.result-box { background: #05070a; border: 1px solid rgba(255,255,255,0.1); color: var(--text-muted); font-family: monospace; padding: 10px; border-radius: 6px; font-size: 0.75rem; height: 180px; overflow-y: auto; margin-bottom: 10px; }

/* ACTION BUTTONS GRID */
.action-buttons-grid { display: flex; gap: 10px; margin-bottom: 10px; }
.btn-copy { flex: 2; padding: 12px; background: var(--success); border: none; border-radius: 6px; color: white; font-weight: bold; cursor: pointer; font-family: var(--font-tech); transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-copy:hover { filter: brightness(1.1); box-shadow: 0 0 10px rgba(35, 134, 54, 0.4); }

/* SOCIAL BUTTONS */
.btn-share { flex: 1; border: none; border-radius: 6px; color: white; font-size: 1.2rem; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; }
.btn-wa { background: #25D366; }
.btn-wa:hover { box-shadow: 0 0 10px #25D366; }
.btn-tg { background: #0088cc; }
.btn-tg:hover { box-shadow: 0 0 10px #0088cc; }

/* TICKET BUTTON - HIGH VISIBILITY ORANGE */
.btn-ticket { 
    width: 100%; 
    padding: 12px; 
    background: linear-gradient(90deg, #ff8c00, #ff4500); 
    border: none; 
    border-radius: 6px; 
    color: white; 
    font-weight: 800; 
    cursor: pointer; 
    font-family: var(--font-tech); 
    transition: 0.3s; 
    font-size: 0.9rem; 
    display: flex; align-items: center; justify-content: center; gap: 8px; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.btn-ticket:hover { 
    filter: brightness(1.2); 
    box-shadow: 0 0 15px rgba(255, 69, 0, 0.4); 
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .config-content { flex-direction: column; gap: 15px; }
    .v-sep { width: 100%; height: 1px; }
    .split-layout { flex-direction: column; }
    .trade-route { flex-wrap: wrap; text-align: center; justify-content: center; gap: 5px; }
    .r-name { width: 100%; text-align: center !important; }
    .r-arr { display: none; }
}