:root{
  --bg:#0b0f14;
  --header-top:#0f172a;
  --header-bottom:#020617;

  --accent-green:#00ff99;
  --accent-red:#ff4d4d;
  --accent-violet:#9b59b6;
  --accent-white:#eee;

  --text-main:#ffffff;
  --text-soft:#e5e7eb;
}

/* ================= GLOBAL ================= */
*{
  box-sizing:border-box;
  font-family:monospace;
}

body{
  margin:0;
  background:var(--bg);
  color:var(--text-main);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* ================= HEADER ================= */
.header{
  position:sticky;
  top:0;
  z-index:100;
  background:linear-gradient(180deg,var(--header-top),var(--header-bottom));
  padding:10px 12px;
  border-bottom:1px solid rgba(255,255,255,.08);
  display:flex;
  gap:10px;
}

/* LEFT */
.header-left{
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink:0;
}

/* LOGO */
.logo{
  font-size:18px;
  font-weight:800;
  display:flex;
  align-items:center;
  color:#ffffff;
}
.logo span{color:var(--accent-green);}

/* LIVE */
.live-wrap{
  display:inline-flex;
  align-items:center;
  gap:4px;
  margin-left:6px;
}
.live-dot{
  width:8px;
  height:8px;
  background:var(--accent-green);
  border-radius:50%;
  animation:pulse 1.2s infinite;
}
.live-text{
  font-size:11px;
  font-weight:900;
  color:var(--accent-green);
}

@keyframes pulse{
  0%{opacity:1}
  50%{opacity:.4}
  100%{opacity:1}
}

/* ================= INTERVAL SWITCH (CSS ONLY) ================= */
.intervals{
  display:flex;
  background:rgba(255,255,255,.1);
  padding:2px;
  border-radius:999px;
  position:relative;
  z-index:3;
}

.intervals input{
  display:none;
}

.intervals label{
  width:48px;
  text-align:center;
  font-size:12px;
  font-weight:800;
  padding:6px 0;
  border-radius:999px;
  color:#ffffff;
  opacity:.65;
  cursor:pointer;
  transition:.25s ease;
}

.intervals input:checked + label{
  background:var(--accent-green);
  color:#020617;
  opacity:1;
  font-weight:900;
  box-shadow:0 0 12px rgba(0,255,153,.45);
}

/* ================= PREVIOUS RESULTS ================= */
.header-history{
  display:flex;
  align-items:center;
  gap:8px;
  overflow-x:auto;
  overflow-y:hidden;
  white-space:nowrap;
  flex:1;
  position:relative;
  z-index:1;
}

.header-history::-webkit-scrollbar{
  display:none;
}

.ball{
  width:28px;
  height:28px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  font-weight:900;
  flex-shrink:0;
  color:#ffffff;
  text-shadow:0 1px 3px rgba(0,0,0,.75);
}

.green{background:var(--accent-green);color:#020617;}
.red{background:var(--accent-red);}
.violet{background:var(--accent-violet);}
.white{background:var(--accent-white);}

/* ================= RISK ================= */
.risk-wrap{
  padding:12px;
}

.risk-card{
  background:linear-gradient(180deg,#162041,#080f22);
  border-radius:14px;
  padding:14px;
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 10px 30px rgba(0,0,0,.5);
}

.risk-card *{
  color:#ffffff;
  text-shadow:0 1px 2px rgba(0,0,0,.6);
}

.risk-head{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
}

.risk-label{
  opacity:.85;
  font-weight:700;
}

.risk-value{
  font-weight:900;
}

.risk-suggestion{
  margin-left:auto;
  font-weight:900;
}

.risk-bar{
  height:12px;
  background:rgba(255,255,255,.2);
  border-radius:999px;
  overflow:hidden;
}

.risk-fill{
  height:100%;
  border-radius:999px;
}

.low{background:var(--accent-green)}
.medium{background:#ffcc00}
.high{background:var(--accent-red)}

/* ================= GRID ================= */
.prediction{
  padding:12px;
}

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(100px,1fr));
  gap:12px;
}

.card{
  background:linear-gradient(180deg,#162041,#080f22);
  border-radius:14px;
  padding:18px 12px;
  border:1px solid rgba(255,255,255,.1);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.05),
    0 14px 30px rgba(0,0,0,.6);
}

.card *{
  color:#ffffff !important;
  text-shadow:0 1px 2px rgba(0,0,0,.7);
}

.card.green{border-color:rgba(0,255,153,.5)}
.card.red{border-color:rgba(255,77,77,.5)}
.card.violet{border-color:rgba(155,89,182,.5)}

.card-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
}

/* MAIN NUMBER / LETTER */
.num{
  font-size:26px;
  font-weight:900;
  letter-spacing:1px;
}

/* PERCENT */
.percent{
  font-size:15px;
  font-weight:900;
  opacity:1;
}

/* PROGRESS BAR */
.bar{
  height:6px;
  background:rgba(255,255,255,.25);
  border-radius:10px;
  margin-top:10px;
}

.fill{
  height:100%;
  border-radius:10px;
}


.risk-fill {
  height: 100%;
  transition: width 0.4s ease;
}

/* ORDER MATTERS */
.risk-fill.very-low  { background:#22c55e; }
.risk-fill.low       { background:#84cc16; }
.risk-fill.medium    { background:#facc15; }
.risk-fill.high      { background:#f97316; }
.risk-fill.very-high { background:#ef4444; } /* RED */




.green-fill{background:var(--accent-green)}
.red-fill{background:var(--accent-red)}
.violet-fill{background:var(--accent-violet)}

/* ================= MOBILE ================= */
@media(max-width:767px){
  .header{
    flex-direction:column;
  }
}