
:root{
  --bg:#0a0a0a;
  --bg2:#0e0e0e;
  --text:#ede7ff;
  --muted:#a88dd9;

  --card: rgba(255,255,255,.04);
  --stroke: rgba(255,255,255,.12);
  --shadow: 0 18px 40px rgba(0,0,0,.55);

  --accent:#9146ff;
  --accent2:#6b2fff;

  --radius: 22px;
  --blur: 16px;

  --g-card: linear-gradient(180deg, rgba(145,70,255,.08), rgba(145,70,255,.02));
  --g-icon: linear-gradient(145deg, rgba(145,70,255,.30), rgba(43,10,89,.35));
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x:hidden;
}

.muted{ color: var(--muted); }
code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .95em;
  color: #f0eaff;
  background: rgba(145,70,255,.12);
  border: 1px solid rgba(145,70,255,.20);
  padding: 2px 6px;
  border-radius: 8px;
}

/* ===== BG FX ===== */
.bg{
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("../img/nature.gif") center / cover no-repeat;
}
.bg::after{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(0, 0, 0, 0.765); /* patina scura */
}

/* ===== LAYOUT ===== */
.page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 22px 14px;
}
.card{
  width:min(840px, 100%);
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  padding: 22px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* contenuto sopra il LED */
.card > *{
  position: relative;
  z-index: 2;
}

/* LED che corre sul bordo */
.card::before{
  content:"";
  position:absolute;
  inset: -3px;                 /* esce leggermente fuori */
  border-radius: inherit;
  padding: 3px;                /* spessore led */
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(145,70,255,0) 20deg,
    rgba(145,70,255,1) 55deg,
    rgba(107,47,255,1) 80deg,
    rgba(255,255,255,1) 88deg,
    rgba(107,47,255,1) 96deg,
    rgba(145,70,255,0) 130deg,
    transparent 360deg
  );

  /* “taglia” il centro: resta solo il bordo */
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;

  filter: blur(1.5px);
  opacity: .95;
  z-index: 1;
  pointer-events: none;
  animation: ledRun 2.4s linear infinite;
}

@keyframes ledRun{
  to { transform: rotate(1turn); }
}




@keyframes breathe {
  0%   { opacity: .2; filter: blur(1px); }
  50%  { opacity: .7; filter: blur(4px); }
  100% { opacity: .3; filter: blur(2px); }
}


.card__head{
  display:flex;
  flex-direction: column;
  gap: 14px;
}
.brand{
  display:flex;
  align-items:center;
  gap: 12px;
}
.brand__dot{
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(145,70,255,.12);
}
.brand__meta h1{
  margin:0;
  font-size: 22px;
  letter-spacing: .2px;
}
.brand__meta p{
  margin: 4px 0 0;
  font-size: 13px;
}

.filters{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
}
.chip{
  display:inline-flex;
  align-items:center;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--g-card);
  text-decoration:none;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.chip:hover{
  transform: translateY(-1px);
  border-color: rgba(145,70,255,.45);
  box-shadow: 0 10px 24px rgba(145,70,255,.10);
}
.chip.is-active{
  border-color: rgba(145,70,255,.65);
  box-shadow: 0 10px 24px rgba(145,70,255,.14);
}

/* ===== SUMMARY ===== */
.summary{
  margin-top: 14px;
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.stat{
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: rgba(145,70,255,.06);
  padding: 12px 14px;
}
.stat__k{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.stat__v{
  font-size: 18px;
  font-weight: 800;
}

/* ===== TABLE ===== */
.table{
  margin-top: 16px;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  overflow:hidden;
  background: rgba(0,0,0,.18);
}
.row{
  display:grid;
  grid-template-columns: 52px 1fr 140px;
  gap: 0px;
  align-items:center;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.row:first-child{ border-top: none; }
.row--head{
  background: rgba(145,70,255,.10);
  border-top: none;
  font-weight: 800;
  font-size: 13px;
}
.row--foot{
  background: rgba(0,0,0,.10);
}
.cell--rank{ display:flex; align-items:center; justify-content:flex-start; }
.cell--bits{ display:flex; align-items:center; justify-content:flex-end; }

.rank{
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  font-weight: 900;
}
.rank--1{
  background: rgba(145,70,255,.20);
  border-color: rgba(145,70,255,.45);
}
.rank--2{
  background: rgba(145,70,255,.16);
  border-color: rgba(145,70,255,.35);
}
.rank--3{
  background: rgba(145,70,255,.12);
  border-color: rgba(145,70,255,.28);
}

.user{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width:0;
}
.avatar{
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  background: var(--g-icon);
  border: 1px solid rgba(255,255,255,.12);
  font-weight: 900;
  flex: 0 0 auto;
}
.user__meta{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.user__name{
  font-weight: 900;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user__tag{
  font-size: 12px;
  margin-top: 2px;
}

.bits{
  font-weight: 900;
  letter-spacing: .2px;
}
.foot{
  padding: 6px 0;
  font-size: 12px;
}

.card__foot{
  margin-top: 14px;
  display:flex;
  justify-content:flex-end;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 720px){
  .summary{ grid-template-columns: 1fr; }
  .row{ grid-template-columns: 44px 1fr 110px; }
  .card{ padding: 18px; }
}

@media (max-width: 520px){
  .brand__meta h1{ font-size: 20px; }
  .row{ padding: 10px 12px; grid-template-columns: 42px 1fr 96px; }
  .bits{ font-size: 14px; }
  .rank{ width: 30px; height: 30px; border-radius: 12px; }
  .avatar{ width: 34px; height: 34px; border-radius: 12px; }
}

/* header modern */
.brand{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 14px;
}
.brand__left{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 0;
}
.brand__logo{
  width: 44px;
  height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
}
.brand__right{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* switch pills */
.pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(145,70,255,.10);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .2px;
  color: var(--text);
}

.pill--tab{
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.pill--tab:hover{
  transform: translateY(-1px);
  border-color: rgba(145,70,255,.45);
  box-shadow: 0 10px 24px rgba(145,70,255,.12);
}
.pill--tab.is-active{
  background: rgba(145,70,255,.18);
  border-color: rgba(145,70,255,.55);
  box-shadow: 0 12px 26px rgba(145,70,255,.16);
}

/* bits box + progress */
.bitsBox{
  display:flex;
  flex-direction: column;
  align-items:flex-end;
  gap: 6px;
}
.bar{
  width: 120px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.10);
}
.bar span{
  display:block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 18px rgba(145,70,255,.25);
}

@media (max-width: 520px){
  .bar{ width: 92px; height: 5px; }
  .brand__logo{ width: 40px; height: 40px; border-radius: 14px; }
}

/* AGGIUNGI QUESTO IN FONDO AL TUO style.css */

.hint{
  margin: 10px 0 0;
  font-size: 12px;
  opacity: .85;
}

/* (se già le hai, non duplicare) */
.bitsBox{
  display:flex;
  flex-direction: column;
  align-items:flex-end;
  gap: 6px;
}
.bar{
  width: 120px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.10);
}
.bar span{
  display:block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 18px rgba(145,70,255,.25);
}
@media (max-width: 520px){
  .bar{ width: 92px; height: 5px; }
}
