:root {
    --neon: #00d4ff;
    --neon-dim: #006688;
    --neon-glow: rgba(0,212,255,0.15);
    --cyan-soft: #66e0ff;
    --danger: #ff2e5b;
    --danger-glow: rgba(255,46,91,0.15);
    --success: #00ff88;
    --success-glow: rgba(0,255,136,0.12);
    --amber: #ffaa00;
    --amber-glow: rgba(255,170,0,0.12);
    --glass: rgba(4,10,28,0.92);
    --card: rgba(2,6,18,0.85);
    --surface: rgba(8,18,40,0.7);
    --border: rgba(0,212,255,0.18);
    --border-bright: rgba(0,212,255,0.4);
    --text-dim: rgba(0,212,255,0.35);
    --text-mid: rgba(0,212,255,0.6);
}

* { box-sizing: border-box; outline: none; margin: 0; padding: 0; }

body {
    background: #010810;
    color: var(--neon);
    font-family: 'JetBrains Mono', monospace;
    display: flex; justify-content: center;
    overflow-x: hidden; min-height: 100vh;
}

#bgCanvas {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%; z-index: -2;
}

.vignette {
    position: fixed; inset: 0;
    background: radial-gradient(ellipse at 50% 30%, transparent 25%, rgba(0,0,0,0.8) 100%);
    pointer-events: none; z-index: -1;
}

.scan-line {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent 10%, rgba(0,212,255,0.06) 50%, transparent 90%);
    z-index: -1; pointer-events: none;
    animation: scanDown 8s linear infinite;
}

@keyframes scanDown {
    0% { top: -2px; }
    100% { top: 100%; }
}

.container {
    width: 100%; max-width: 500px;
    padding: 20px 16px 40px;
    display: flex; flex-direction: column; gap: 14px;
    z-index: 1;
}

/* ===== HEADER ===== */
.header {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 24px 20px;
    text-align: center;
    position: relative; overflow: hidden;
}

.header::before {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon), transparent);
    animation: headerScan 3.5s linear infinite;
}

.header::after {
    content: '';
    position: absolute; bottom: 0; left: 0;
    width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-bright), transparent);
}

@keyframes headerScan { to { left: 100%; } }

.header-badge {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(0,212,255,0.06); border: 1px solid rgba(0,212,255,0.12);
    padding: 3px 10px; border-radius: 20px;
    font-size: 8px; letter-spacing: 2px; color: var(--neon-dim);
    margin-bottom: 10px; font-weight: 700; text-transform: uppercase;
}

.header-badge .dot {
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse { 0%,100% { opacity:1; } 50% { opacity:0.3; } }

.header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px; font-weight: 800;
    color: #fff;
    letter-spacing: 4px;
    text-shadow: 0 0 30px rgba(0,212,255,0.4), 0 0 60px rgba(0,212,255,0.15);
    line-height: 1.3;
}

.header h1 span { color: var(--neon); }

.header .sub {
    font-size: 10px; color: var(--neon-dim);
    letter-spacing: 3px; margin-top: 8px; font-weight: 700;
}

.header .version {
    font-size: 8px; color: rgba(0,212,255,0.2);
    letter-spacing: 2px; margin-top: 4px;
}

/* ===== STATS ===== */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.stat-card {
    background: var(--card);
    border: 1px solid rgba(0,212,255,0.08);
    padding: 16px 12px; border-radius: 6px;
    text-align: center; position: relative;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    border-color: rgba(0,212,255,0.2);
    box-shadow: 0 0 20px rgba(0,212,255,0.05);
}

.stat-card::after {
    content: '';
    position: absolute; bottom: 0; left: 15%; right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,212,255,0.15), transparent);
}

.stat-card .stat-icon {
    width: 28px; height: 28px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; margin-bottom: 8px;
}

.stat-card:nth-child(1) .stat-icon { background: var(--neon-glow); color: var(--neon); }
.stat-card:nth-child(2) .stat-icon { background: var(--success-glow); color: var(--success); }

.stat-card small {
    font-size: 9px; letter-spacing: 2px;
    color: var(--neon-dim); text-transform: uppercase;
    font-weight: 700; display: block; margin-bottom: 4px;
}

.stat-card .val {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px; font-weight: 700; color: #fff;
}

.stat-card:nth-child(2) .val { color: var(--success); font-size: 16px; }

/* ===== PANEL ===== */
.panel {
    background: var(--glass);
    border: 1px solid var(--border);
    padding: 22px 20px; border-radius: 6px;
}

.panel-label {
    font-size: 10px; letter-spacing: 2px;
    color: var(--text-mid); margin-bottom: 8px;
    display: flex; align-items: center; gap: 6px; font-weight: 700;
}

.panel-label i { font-size: 9px; color: var(--neon); }
.panel-label .req { color: var(--danger); font-size: 8px; letter-spacing: 1px; }

input, select {
    width: 100%;
    background: rgba(0,3,15,0.9);
    border: 1px solid rgba(0,212,255,0.12);
    border-radius: 6px;
    padding: 14px 14px;
    color: #fff;
    font-family: inherit; font-size: 13px;
    margin-bottom: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-weight: 600;
}

input:focus, select:focus {
    border-color: var(--neon);
    box-shadow: 0 0 16px var(--neon-glow), inset 0 0 12px rgba(0,212,255,0.04);
}

input::placeholder { color: rgba(0,212,255,0.2); font-weight: 400; }

select {
    color: var(--cyan-soft); cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2300d4ff' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L2 5h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

select option { background: #010c1a; color: #ccc; }
select optgroup { color: var(--neon); font-style: normal; font-weight: 700; }

/* ===== PROGRESS BAR ===== */
.progress-wrap {
    width: 100%; height: 4px;
    background: rgba(0,212,255,0.06);
    border-radius: 2px; margin-bottom: 16px;
    overflow: hidden; display: none;
}

.progress-bar {
    height: 100%; width: 0;
    background: linear-gradient(90deg, var(--neon), var(--success));
    border-radius: 2px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--neon-glow);
}

/* ===== BUTTON ===== */
.btn-exe {
    width: 100%; padding: 18px;
    border: 1px solid var(--neon);
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(0,212,255,0.06), rgba(0,212,255,0.02));
    color: var(--neon);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700; font-size: 14px;
    letter-spacing: 4px; cursor: pointer;
    position: relative; overflow: hidden;
    transition: all 0.3s; text-transform: uppercase;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}

.btn-exe::before {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0,212,255,0.12), transparent);
    transition: left 0.6s;
}

.btn-exe:hover::before { left: 100%; }

.btn-exe:hover {
    background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(0,212,255,0.04));
    box-shadow: 0 0 40px var(--neon-glow), 0 0 80px rgba(0,212,255,0.06), inset 0 0 40px rgba(0,212,255,0.04);
    text-shadow: 0 0 12px var(--neon);
    transform: translateY(-1px);
}

.btn-exe:active { transform: scale(0.98) translateY(0); }

.btn-exe.processing {
    border-color: var(--amber);
    color: var(--amber);
    pointer-events: none;
}

.btn-exe .spinner {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-exe.processing .spinner { display: inline-block; }
.btn-exe.processing .btn-text { display: none; }
.btn-exe.processing .btn-loading { display: inline; }
.btn-exe .btn-loading { display: none; }

@keyframes spin { 100% { transform: rotate(360deg); } }

/* ===== TERMINAL ===== */
.terminal-wrap {
    background: var(--card);
    border: 1px solid rgba(0,212,255,0.08);
    border-radius: 6px; overflow: hidden;
}

.terminal-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 14px;
    background: rgba(0,212,255,0.03);
    border-bottom: 1px solid rgba(0,212,255,0.06);
}

.terminal-bar-left {
    display: flex; align-items: center; gap: 5px;
}

.terminal-bar-left .td {
    width: 8px; height: 8px; border-radius: 50%;
}

.terminal-bar-left .td:nth-child(1) { background: var(--danger); }
.terminal-bar-left .td:nth-child(2) { background: var(--amber); }
.terminal-bar-left .td:nth-child(3) { background: var(--success); }

.terminal-bar span {
    font-size: 8px; letter-spacing: 2px;
    color: var(--text-dim); font-weight: 700;
}

.terminal {
    height: 120px; padding: 12px 14px;
    font-size: 11px; color: var(--neon-dim);
    overflow-y: auto; line-height: 1.8; font-weight: 600;
}

.terminal::-webkit-scrollbar { width: 3px; }
.terminal::-webkit-scrollbar-track { background: transparent; }
.terminal::-webkit-scrollbar-thumb { background: var(--neon-dim); border-radius: 2px; }

.terminal .t-line { opacity: 0; animation: lineIn 0.3s ease forwards; }
@keyframes lineIn { to { opacity: 1; } }

.terminal .t-ok { color: var(--success); }
.terminal .t-err { color: var(--danger); }
.terminal .t-info { color: var(--neon); }
.terminal .t-warn { color: var(--amber); }
.terminal .t-dim { color: var(--text-dim); }

.cursor-blink {
    display: inline-block; width: 7px; height: 13px;
    background: var(--neon); vertical-align: middle;
    animation: cursorBlink 1s step-end infinite;
    margin-left: 2px;
}

@keyframes cursorBlink { 0%,100% { opacity:1; } 50% { opacity:0; } }

/* ===== RESULT ===== */
.result {
    display: none;
    border: 1px solid var(--danger);
    background: linear-gradient(135deg, rgba(255,46,91,0.04), rgba(255,46,91,0.01));
    border-radius: 6px;
    overflow: hidden;
    animation: resultIn 0.5s ease;
}

@keyframes resultIn {
    from { opacity:0; transform:translateY(10px); }
    to { opacity:1; transform:translateY(0); }
}

.result-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255,46,91,0.06);
    border-bottom: 1px solid rgba(255,46,91,0.12);
}

.result-header-left {
    display: flex; align-items: center; gap: 8px;
}

.result-header-left .rh-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
    animation: dotPulse 1.5s ease-in-out infinite;
}

.result-header span {
    font-size: 9px; letter-spacing: 3px;
    color: var(--danger); font-weight: 700;
}

.result-body {
    padding: 18px 16px;
    line-height: 2; font-size: 12px;
    color: #ccc; font-weight: 600;
}

.result-body .r-blue { color: var(--neon); }
.result-body .r-green { color: var(--success); }
.result-body .r-amber { color: var(--amber); }
.result-body .r-red { color: var(--danger); }

.result-divider {
    height: 1px; margin: 10px 0;
    background: linear-gradient(90deg, transparent, rgba(255,46,91,0.15), transparent);
}

/* ===== FOOTER LINK ===== */
.footer-link {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 20px;
    border: 1px solid var(--border-bright);
    border-radius: 6px;
    color: var(--neon); text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 13px; font-weight: 700;
    letter-spacing: 3px;
    background: linear-gradient(135deg, rgba(0,212,255,0.04), rgba(0,212,255,0.01));
    transition: all 0.3s;
    text-transform: uppercase;
}

.footer-link:hover {
    background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(0,212,255,0.04));
    box-shadow: 0 0 40px var(--neon-glow), 0 0 80px rgba(0,212,255,0.05);
    text-shadow: 0 0 12px var(--neon);
    transform: translateY(-1px);
}

.footer-link i { font-size: 11px; }

/* ===== TOAST ===== */
.toast-container {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    z-index: 9999; display: flex; flex-direction: column; gap: 8px;
    pointer-events: none; max-width: 90vw;
}

.toast-msg {
    background: var(--glass); backdrop-filter: blur(20px);
    border: 1px solid rgba(255,46,91,0.3);
    color: var(--danger); padding: 12px 20px;
    border-radius: 6px; font-size: 11px; font-weight: 700;
    letter-spacing: 1px; white-space: nowrap;
    animation: toastIn 0.4s ease, toastOut 0.4s ease 2.6s forwards;
    display: flex; align-items: center; gap: 8px;
}

.toast-msg.toast-ok {
    border-color: rgba(0,255,136,0.3);
    color: var(--success);
}

@keyframes toastIn { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastOut { to { opacity:0; transform:translateY(-10px); } }

/* ===== HEX DECORATION ===== */
.hex-corner {
    position: absolute; width: 8px; height: 8px;
    border-color: var(--neon); border-style: solid; border-width: 0;
    opacity: 0.3;
}
.hex-tl { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.hex-tr { top: -1px; right: -1px; border-top-width: 1px; border-right-width: 1px; }
.hex-bl { bottom: -1px; left: -1px; border-bottom-width: 1px; border-left-width: 1px; }
.hex-br { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }

@media (prefers-reduced-motion: reduce) {
    .header::before, .scan-line, .cursor-blink, .dot { animation: none !important; }
}
/* ===== RESULT REDESIGN ===== */
.result {
    display: none;
    border: 1px solid var(--danger);
    background: var(--card);
    border-radius: 8px;
    overflow: hidden;
    animation: resultIn 0.5s ease;
}

@keyframes resultIn {
    from { opacity:0; transform:translateY(10px); }
    to { opacity:1; transform:translateY(0); }
}

.result-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(255,46,91,0.08), rgba(255,46,91,0.03));
    border-bottom: 1px solid rgba(255,46,91,0.12);
}

.result-header-left {
    display: flex; align-items: center; gap: 8px;
}

.result-header-left .rh-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
    animation: dotPulse 1.5s ease-in-out infinite;
}

.result-header span {
    font-size: 9px; letter-spacing: 3px;
    color: var(--danger); font-weight: 700;
}

/* Result body */
.result-body {
    padding: 0;
    line-height: 1; font-size: 12px;
    color: #ccc; font-weight: 600;
}

/* Info bar: Game + User */
.res-info-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 18px;
    background: rgba(0,212,255,0.03);
    border-bottom: 1px solid rgba(0,212,255,0.06);
    font-size: 10px; letter-spacing: 1px;
}

.res-info-bar .info-item {
    display: flex; align-items: center; gap: 6px;
}

.res-info-bar .info-label {
    color: var(--text-dim); font-weight: 700;
    text-transform: uppercase; font-size: 8px; letter-spacing: 1.5px;
}

.res-info-bar .info-val {
    color: var(--neon); font-weight: 700; font-size: 11px;
}

/* Grid pola */
.res-pola-grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    gap: 0; border-bottom: 1px solid rgba(0,212,255,0.06);
}

.res-pola-item {
    padding: 16px 14px;
    text-align: center;
    border-right: 1px solid rgba(0,212,255,0.06);
    position: relative;
}

.res-pola-item:last-child { border-right: none; }

.res-pola-item .pola-label {
    font-size: 8px; letter-spacing: 2px;
    color: var(--text-dim); text-transform: uppercase;
    font-weight: 700; margin-bottom: 8px;
}

.res-pola-item .pola-val {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px; font-weight: 800; color: #fff;
    line-height: 1;
}

.res-pola-item .pola-val.small {
    font-size: 18px;
}

.res-pola-item .pola-unit {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; font-weight: 700;
    margin-top: 4px; letter-spacing: 1px;
}

.res-pola-item .pola-unit.on { color: var(--success); }
.res-pola-item .pola-unit.off { color: var(--danger); }

/* Tag status di pojok */
.res-pola-item .pola-tag {
    position: absolute; top: 6px; right: 8px;
    font-size: 7px; letter-spacing: 1.5px;
    padding: 2px 6px; border-radius: 3px;
    font-weight: 800; text-transform: uppercase;
}

.res-pola-item .pola-tag.tag-on {
    background: rgba(0,255,136,0.1); color: var(--success);
    border: 1px solid rgba(0,255,136,0.2);
}

.res-pola-item .pola-tag.tag-off {
    background: rgba(255,46,91,0.1); color: var(--danger);
    border: 1px solid rgba(255,46,91,0.2);
}

/* Bet range */
.res-bet-section {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(0,212,255,0.06);
}

.res-bet-section .bet-title {
    font-size: 8px; letter-spacing: 2px;
    color: var(--text-dim); text-transform: uppercase;
    font-weight: 700; margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}

.res-bet-section .bet-title i { color: var(--amber); font-size: 9px; }

.res-bet-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0;
}

.res-bet-row + .res-bet-row {
    border-top: 1px solid rgba(0,212,255,0.04);
}

.res-bet-row .bet-label {
    font-size: 10px; color: var(--text-dim);
    font-weight: 700; letter-spacing: 1px;
}

.res-bet-row .bet-val {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px; font-weight: 700; color: var(--amber);
}

/* Volatility bar */
.res-vol-section {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(0,212,255,0.06);
}

.res-vol-section .vol-title {
    font-size: 8px; letter-spacing: 2px;
    color: var(--text-dim); text-transform: uppercase;
    font-weight: 700; margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
}

.res-vol-section .vol-title i { color: var(--neon); font-size: 9px; }

.vol-bar-wrap {
    display: flex; align-items: center; gap: 10px;
}

.vol-bar {
    flex: 1; height: 6px;
    background: rgba(0,212,255,0.06);
    border-radius: 3px; overflow: hidden;
    position: relative;
}

.vol-bar-fill {
    height: 100%; border-radius: 3px;
    transition: width 0.8s ease;
}

.vol-bar-fill.vol-low {
    width: 30%;
    background: linear-gradient(90deg, var(--success), rgba(0,255,136,0.6));
    box-shadow: 0 0 8px rgba(0,255,136,0.3);
}

.vol-bar-fill.vol-med {
    width: 60%;
    background: linear-gradient(90deg, var(--amber), rgba(255,170,0,0.6));
    box-shadow: 0 0 8px rgba(255,170,0,0.3);
}

.vol-bar-fill.vol-high {
    width: 90%;
    background: linear-gradient(90deg, var(--danger), rgba(255,46,91,0.6));
    box-shadow: 0 0 8px rgba(255,46,91,0.3);
}

.vol-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px; font-weight: 800;
    letter-spacing: 1px; min-width: 40px; text-align: right;
}

.vol-label.vl-low { color: var(--success); }
.vol-label.vl-med { color: var(--amber); }
.vol-label.vl-high { color: var(--danger); }

/* Status footer */
.res-status-section {
    padding: 14px 18px;
}

.res-status-item {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 0;
    font-size: 11px; font-weight: 700;
    letter-spacing: 0.5px;
}

.res-status-item + .res-status-item {
    border-top: 1px solid rgba(0,212,255,0.04);
}

.res-status-item .status-dot {
    width: 6px; height: 6px; border-radius: 50%;
    flex-shrink: 0;
}

.res-status-item .status-dot.dot-green {
    background: var(--success);
    box-shadow: 0 0 6px rgba(0,255,136,0.5);
}

.res-status-item .status-dot.dot-amber {
    background: var(--amber);
    box-shadow: 0 0 6px rgba(255,170,0,0.5);
}

.res-status-item .status-tag {
    font-size: 8px; letter-spacing: 1.5px;
    padding: 2px 8px; border-radius: 3px;
    font-weight: 800; text-transform: uppercase;
    flex-shrink: 0;
}

.res-status-item .status-tag.tag-synced {
    background: rgba(0,255,136,0.08); color: var(--success);
    border: 1px solid rgba(0,255,136,0.15);
}

.res-status-item .status-tag.tag-locked {
    background: rgba(0,212,255,0.08); color: var(--neon);
    border: 1px solid rgba(0,212,255,0.15);
}

.res-status-item .status-tag.tag-notice {
    background: rgba(255,170,0,0.08); color: var(--amber);
    border: 1px solid rgba(255,170,0,0.15);
}

.res-status-item .status-text {
    color: #aaa; font-size: 10px;
}

.res-status-item .status-text .hl-green { color: var(--success); }
.res-status-item .status-text .hl-amber { color: var(--amber); }
.res-status-item .status-text .hl-blue { color: var(--neon); }