:root{
  --panel: rgba(255,255,255,.58);
  --panel2: rgba(255,255,255,.74);
  --stroke: rgba(0,0,0,.10);
  --shadow: 0 10px 30px rgba(0,0,0,.18);
  --shadow2: 0 6px 18px rgba(0,0,0,.14);
  --radius: 22px;
  --radius2: 18px;
  --red: #cf4637;
  --red2:#b8392d;
  --text:#2b2b2b;
  --muted:#6b6b6b;
  --tap: rgba(0,0,0,.06);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:#0b0b0d;
  overflow-x:hidden; /* NO scroll orizzontale */
}

/* Sfondo: immagine arena (bg-arena.jpg) + overlay “glass” */
.court-bg{
  position:fixed; inset:0;
  background:
    radial-gradient(1200px 700px at 50% 35%, rgba(255,255,255,.30), rgba(255,255,255,0) 62%),
    linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,.25) 38%, rgba(0,0,0,.35)),
    url("bg-arena.jpg") center / cover no-repeat fixed;
  transform: translateZ(0);
}

/* Linee campo leggere (opzionali, sopra l'arena) */
.court-lines{
  position:fixed; inset:0;
  pointer-events:none;
  opacity:.16;
  transform: translateZ(0);
  background:
    radial-gradient(circle at 50% 50%, transparent 0 120px, rgba(255,255,255,.85) 121px 124px, transparent 125px),
    linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) 50% 50% / 92% 4px no-repeat,
    linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) 50% 6% / 92% 4px no-repeat,
    linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) 50% 94% / 92% 4px no-repeat,
    linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) 4% 50% / 4px 92% no-repeat,
    linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) 96% 50% / 4px 92% no-repeat;
}

/* Wrapper: smartphone centrato, tablet full width */
.wrap{
  position:relative;
  min-height:100%;
  display:flex;
  justify-content:center;
  padding: 24px 12px 40px;
}
.shell{
  width:min(520px, 100%);
  max-width:520px;
  padding: 14px 14px 18px;
  border-radius: 28px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@media (min-width: 760px){
  .wrap{ padding: 24px 24px 40px; }
  .shell{
    width:min(1100px, 100%);
    max-width:1100px;
    padding: 18px 18px 22px;
  }
}

/* Top header */
.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 6px 8px 12px;
}
.brand{
  font-size: clamp(34px, 6vw, 46px);
  font-weight: 850;
  letter-spacing: .2px;
  color:#dfeaff;
  text-shadow: 0 2px 0 rgba(0,0,0,.25), 0 10px 30px rgba(0,0,0,.35);
  margin:0;
}
.ball{
  font-size: 36px;
  transform: translateY(2px);
  filter: drop-shadow(0 10px 16px rgba(0,0,0,.35));
  user-select:none;
}

/* Glass helpers */
.glass{
  background: rgba(255,255,255,.30);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: var(--shadow2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.glass2{
  background: rgba(255,255,255,.46);
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: var(--shadow2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.panel{
  border-radius: var(--radius);
  overflow:hidden;
}
.panel-inner{ padding: 14px; }

/* Red bar */
.bar-red{
  width:100%;
  margin-top: 6px;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--red), var(--red2));
  color: #fff;
  padding: 14px 14px;
  display:flex;
  align-items:center;
  gap:12px;
  font-weight: 900;
  box-shadow: 0 14px 26px rgba(168,37,24,.28);
  border: 1px solid rgba(255,255,255,.18);
  user-select:none;
  cursor:pointer;
}
.bar-red:active{ transform: translateY(1px); }
.bar-icon{ font-size:22px; filter: drop-shadow(0 6px 12px rgba(0,0,0,.28)); }
.bar-title{ font-size: 22px; }
.bar-sub{ margin-left:auto; font-weight:800; opacity:.92; }

/* Menu list */
.menu{
  margin-top: 14px;
  border-radius: var(--radius);
  overflow:hidden;
}
.row{
  width:100%;
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 16px 16px;
  cursor:pointer;
  user-select:none;
  background: transparent;
  border: 0;
  text-decoration:none;
  color: inherit;
}
.row + .row{ border-top: 1px solid rgba(0,0,0,.10); }
.row:active{ background: var(--tap); }
.ico{ font-size:28px; width:34px; text-align:center; }
.label{
  font-size: 26px;
  font-weight: 750;
  letter-spacing:.2px;
  color:#1e1e1e;
}
.chev{
  margin-left:auto;
  color:#5c5c5c;
  font-size: 26px;
  font-weight: 900;
}

/* Viewbar */
.viewbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top: 10px;
  border-radius: 18px;
  padding: 12px 14px;
}
.viewtitle{ font-size: 22px; font-weight: 950; }

/* Cards */
.card{
  margin-top: 12px;
  border-radius: var(--radius);
  overflow:hidden;
}
.card-h{
  padding: 14px 14px;
  font-size: 22px;
  font-weight: 950;
  border-bottom: 1px solid rgba(0,0,0,.10);
}
.card-b{ padding: 14px; }

.muted{ color: rgba(0,0,0,.55); }
.smalltxt{ font-size:12px; }

label{
  display:block;
  font-weight: 950;
  margin: 10px 0 6px;
  color:#262626;
}
input, select{
  width:100%;
  border-radius: 16px;
  padding: 12px 12px;
  border: 1px solid rgba(0,0,0,.16);
  background: rgba(255,255,255,.82);
  font-size: 16px;
  outline: none;
}
input:focus, select:focus{
  box-shadow: 0 0 0 3px rgba(46,106,214,.20);
  border-color: rgba(46,106,214,.48);
}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media (max-width: 380px){ .grid2{ grid-template-columns: 1fr; } }

.btn{
  border: 0;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 950;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(0,0,0,.10);
  cursor:pointer;
  box-shadow: 0 12px 18px rgba(0,0,0,.14);
}
.btn:active{ transform: translateY(1px); }
.btn.primary{
  background: linear-gradient(180deg, #2e6ad6, #2657b2);
  color:#fff;
  border-color: rgba(255,255,255,.18);
}
.btn.danger{
  background: linear-gradient(180deg, #d24b3c, #b8392d);
  color:#fff;
  border-color: rgba(255,255,255,.18);
}
.btn.small{
  padding: 10px 12px;
  border-radius: 14px;
}

.list{ display:flex; flex-direction:column; gap:10px; }

.pill{
  border-radius: 18px;
  padding: 12px 12px;
  border: 1px solid rgba(0,0,0,.10);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background: rgba(255,255,255,.70);
}
.pill strong{ font-weight: 950; }

.check{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight: 900;
}
.check input{
  width: 22px;
  height: 22px;
  accent-color: #2e6ad6;
}

/* Calendar */
.cal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
}
.month{ font-weight: 950; font-size: 20px; color:#1b1b1b; }
.cal{
  width:100%;
  border-collapse: separate;
  border-spacing: 6px;
  table-layout: fixed;
}
.cal th{
  font-size: 12px;
  color:#3e3e3e;
  text-transform: uppercase;
  letter-spacing:.08em;
  font-weight: 950;
  text-align:center;
  padding: 0 0 6px;
}
.cal td{ text-align:center; padding:0; }
.day{
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.76);
  height: 44px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 950;
  cursor:pointer;
  user-select:none;
}
.day:active{ background: var(--tap); }
.day.dim{ opacity:.45; }
.day.sel{ outline: 3px solid rgba(46,106,214,.35); }
.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  color:#fff;
  background: rgba(46,106,214,.88);
  margin-left: 6px;
  padding: 0 6px;
}

/* Stats table */
table.stats{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.78);
  table-layout: fixed;
}
table.stats th, table.stats td{
  padding: 9px 8px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  font-size: 12px;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}
table.stats th{
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color:#333;
  font-weight: 950;
  background: rgba(255,255,255,.86);
}
table.stats tr:last-child td{ border-bottom:0; }
.right{ text-align:right; }
.center{ text-align:center; }

.spacer-10{ height:10px; }
.spacer-12{ height:12px; }
.spacer-14{ height:14px; }

/* Toast */
.toast{
  position:fixed;
  left:50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(20,20,20,.92);
  color:#fff;
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
  opacity:0;
  pointer-events:none;
  transition: opacity .18s ease;
  max-width: min(540px, 92vw);
}
.toast.show{ opacity:1; }

/* Views */
.view{ display:none; }
.view.active{ display:block; }

/* Safety: no horizontal scroll from media */
img, svg, canvas{ max-width:100%; height:auto; }
