:root{
  --bg:#0f1318;
  --panel:#171c22;
  --panel-2:#20262d;
  --panel-3:#2a3139;
  --line:#343c46;
  --text:#f5f7fa;
  --muted:#aab2bd;
  --yellow:#f5b800;
  --yellow-2:#ffd451;
  --green:#2eaf43;
  --danger:#db4d4d;
  --radius:10px;
}

*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
body{min-width:320px}
button,input{font:inherit}
button{cursor:pointer}
a{color:inherit;text-decoration:none}

.sport-app{min-height:100vh;background:linear-gradient(180deg,#11161b 0,#0f1318 100%)}

.sport-topbar{
  position:sticky;top:0;z-index:50;
  display:grid;grid-template-columns:auto 1fr auto;align-items:center;
  min-height:54px;padding:0 14px;
  background:#f6b600;color:#111;border-bottom:1px solid rgba(0,0,0,.25)
}
.brand{display:flex;align-items:center;gap:8px;font-weight:900;letter-spacing:.025em}
.brand img{width:32px;height:32px;object-fit:contain}
.brand span{white-space:nowrap}

.sport-main-nav{display:flex;align-items:stretch;justify-content:center;height:54px}
.sport-main-nav a,.sport-main-nav button{
  border:0;background:transparent;color:#111;font-weight:800;padding:0 14px;
  display:flex;align-items:center;justify-content:center;border-bottom:4px solid transparent
}
.sport-main-nav a:hover,.sport-main-nav button:hover,.sport-main-nav .active{background:rgba(0,0,0,.08);border-bottom-color:#111}
.nav-disabled{opacity:.6}

.account-area{display:flex;align-items:center;gap:10px}
.demo-badge{background:#111;color:#ffd451;padding:5px 8px;border-radius:999px;font-size:10px;font-weight:900;letter-spacing:.08em}
.account-link{background:#252b32;color:#fff;padding:8px 11px;border-radius:6px;font-size:11px;font-weight:800}

.sport-subnav{
  display:flex;gap:8px;overflow-x:auto;padding:10px 14px;background:#1d232a;border-bottom:1px solid var(--line);
  scrollbar-width:none
}
.sport-subnav::-webkit-scrollbar{display:none}
.subnav-item{flex:0 0 auto;border:1px solid var(--line);background:#272e36;color:#e8ebef;border-radius:7px;padding:8px 12px;font-weight:700}
.subnav-item.active{border-color:var(--yellow);background:var(--yellow);color:#151515}

.sport-layout{
  display:grid;grid-template-columns:220px minmax(0,1fr) 320px;gap:10px;
  max-width:1680px;margin:0 auto;padding:10px
}

.league-panel,.betslip-panel,.event-area{min-width:0}
.league-panel,.betslip-panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;height:max-content;position:sticky;top:75px}
.panel-heading,.betslip-head{display:flex;align-items:center;justify-content:space-between;padding:14px;border-bottom:1px solid var(--line);background:#20262d}
.panel-heading span{font-size:11px;color:var(--yellow);font-weight:800}

.search-box{display:flex;align-items:center;gap:8px;margin:12px;background:#11161b;border:1px solid var(--line);border-radius:7px;padding:9px 10px;color:var(--muted)}
.search-box input{width:100%;border:0;outline:0;background:transparent;color:#fff}
.quick-filters{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:0 12px 12px}
.quick-filter{border:1px solid var(--line);background:#252b32;color:#dfe3e8;padding:8px 5px;border-radius:6px;font-size:12px;font-weight:700}
.quick-filter.active{background:#343b44;color:#fff;border-color:#59636f}
.league-list{padding:0 8px 12px}
.league-button{
  width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px;
  border:0;border-bottom:1px solid #2b323a;background:transparent;color:#e8ebef;text-align:left;padding:11px 8px
}
.league-button:hover{background:#20262d}
.league-button small{color:var(--muted)}
.league-name{display:flex;align-items:center;gap:8px;font-weight:700;font-size:13px}

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

.hero-card{
  display:flex;align-items:center;justify-content:space-between;min-height:150px;
  padding:22px;border-radius:var(--radius);overflow:hidden;border:1px solid #3b434d;
  background:
    radial-gradient(circle at 80% 30%,rgba(245,184,0,.24),transparent 28%),
    linear-gradient(135deg,#272d35 0,#191f25 58%,#11161b 100%)
}
.eyebrow{display:block;font-size:11px;font-weight:900;letter-spacing:.1em;color:var(--yellow);text-transform:uppercase}
.hero-card h1{margin:6px 0 7px;font-size:clamp(22px,3vw,38px);line-height:1.05}
.hero-card p{margin:0;color:#c5cbd3;max-width:640px}
.hero-mark{font-size:110px;line-height:.7;color:rgba(245,184,0,.25);font-weight:900}

.featured,.matches-section{
  background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden
}
.section-title-row,.matches-head{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid var(--line)}
.section-title-row h2,.matches-head h2,.betslip-head h2{margin:3px 0 0;font-size:20px}
.view-tabs{display:flex;gap:6px}
.view-tab{border:1px solid var(--line);background:#242b32;color:#d8dde3;border-radius:6px;padding:8px 11px;font-weight:800;font-size:12px}
.view-tab.active{background:var(--yellow);border-color:var(--yellow);color:#111}

.featured-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:10px}
.featured-card{background:#242a31;border:1px solid #363e48;border-radius:8px;padding:12px}
.featured-card .league{color:#aeb6c0;font-size:11px;margin-bottom:8px}
.featured-card h3{margin:0 0 10px;font-size:15px}
.featured-card .boost{display:inline-flex;align-items:center;gap:6px;color:var(--yellow);font-weight:800;font-size:12px}
.featured-card .card-odds{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:12px}

.market-head{display:grid;grid-template-columns:repeat(3,68px);gap:6px;color:#aeb6c0;font-weight:800;font-size:12px;text-align:center}
.match-list{display:flex;flex-direction:column}
.match-row{
  display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;
  padding:12px 14px;border-bottom:1px solid #2c333b
}
.match-row:last-child{border-bottom:0}
.match-meta{display:flex;gap:8px;align-items:center;color:#aeb6c0;font-size:11px;margin-bottom:5px}
.live-dot{width:7px;height:7px;background:#ff4d4d;border-radius:50%;box-shadow:0 0 0 4px rgba(255,77,77,.12)}
.match-teams{font-weight:800;font-size:14px}
.match-odds{display:grid;grid-template-columns:repeat(3,68px);gap:6px}
.odd-button{
  border:1px solid #47515d;background:#2b323a;color:#fff;border-radius:6px;padding:9px 7px;
  font-weight:900;min-width:0
}
.odd-button small{display:block;color:#aab2bd;font-size:10px;font-weight:700;margin-bottom:2px}
.odd-button:hover{border-color:var(--yellow);background:#343c45}
.odd-button.selected{background:var(--yellow);border-color:var(--yellow);color:#111}
.odd-button.selected small{color:#333}

.betslip-head .selection-count{display:grid;place-items:center;min-width:26px;height:26px;padding:0 8px;border-radius:999px;background:var(--yellow);color:#111;font-weight:900;font-size:12px}
.betslip-tabs{display:grid;grid-template-columns:1fr 1fr;border-bottom:1px solid var(--line)}
.betslip-tab{border:0;background:#20262d;color:#dce1e6;padding:11px 8px;font-weight:800;font-size:12px}
.betslip-tab.active{box-shadow:inset 0 -3px 0 var(--yellow)}
.betslip-tab:disabled{opacity:.45}
.betslip-empty{display:flex;flex-direction:column;align-items:center;text-align:center;padding:28px 18px;color:#aeb6c0}
.betslip-empty strong{color:#fff;margin:6px 0}
.betslip-empty p{margin:0;font-size:12px}
.empty-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#252c33;color:var(--yellow);font-size:24px}

.betslip-selections{display:flex;flex-direction:column}
.selection-item{padding:12px;border-bottom:1px solid #2d343d;background:#1b2026}
.selection-item-head{display:flex;justify-content:space-between;gap:8px}
.selection-item h4{font-size:13px;margin:0 0 4px}
.selection-item p{margin:0;color:#aeb6c0;font-size:11px}
.selection-price{font-weight:900;color:var(--yellow)}
.remove-selection{border:0;background:transparent;color:#9fa8b3;font-size:18px;padding:0 2px}
.remove-selection:hover{color:#fff}

.stake-box{padding:12px;border-top:1px solid var(--line)}
.stake-box label{display:block;font-size:11px;color:#aeb6c0;margin-bottom:6px;font-weight:700}
.stake-input-wrap{display:flex;align-items:center;background:#fff;border-radius:6px;overflow:hidden}
.stake-input-wrap input{width:100%;border:0;outline:0;padding:10px;color:#111;font-weight:800}
.stake-input-wrap span{color:#111;padding:0 10px;font-weight:900}
.betslip-summary{padding:0 12px 12px}
.betslip-summary div{display:flex;justify-content:space-between;gap:10px;padding:6px 0;color:#aeb6c0;font-size:12px}
.betslip-summary strong{color:#fff}
.demo-submit{margin:0 12px 8px;width:calc(100% - 24px);border:0;border-radius:6px;padding:12px;background:#343b44;color:#8e98a4;font-weight:900}
.demo-note{padding:0 12px 14px;margin:0;color:#7f8995;font-size:10px;line-height:1.4}

.sport-footer{display:flex;justify-content:space-between;gap:12px;max-width:1680px;margin:0 auto;padding:10px 14px 22px;color:#7f8995;font-size:11px}
.sport-footer a{color:var(--yellow)}

@media (max-width:1180px){
  .sport-layout{grid-template-columns:190px minmax(0,1fr)}
  .betslip-panel{position:fixed;z-index:70;right:10px;bottom:10px;top:auto;width:min(360px,calc(100vw - 20px));max-height:72vh;overflow:auto;box-shadow:0 18px 60px rgba(0,0,0,.5)}
  .featured-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width:820px){
  .sport-topbar{grid-template-columns:1fr auto;min-height:auto;padding:8px 10px;gap:8px}
  .brand img{width:32px;height:32px}
  .brand span{font-size:13px}
  .account-area{justify-self:end}
  .account-link{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap}
  .sport-main-nav{
    grid-column:1/-1;order:3;width:100%;height:auto;overflow-x:auto;justify-content:flex-start;
    background:rgba(0,0,0,.09);border-radius:6px;scrollbar-width:none
  }
  .sport-main-nav::-webkit-scrollbar{display:none}
  .sport-main-nav a,.sport-main-nav button{flex:0 0 auto;padding:10px 13px;font-size:12px;border-bottom-width:3px}
  .sport-layout{grid-template-columns:1fr;padding:8px}
  .league-panel{position:static;order:2}
  .event-area{order:1}
  .league-panel{display:none}
  .featured-cards{grid-template-columns:1fr}
  .market-head{grid-template-columns:repeat(3,54px)}
  .match-row{grid-template-columns:1fr;gap:8px}
  .match-odds{grid-template-columns:repeat(3,1fr)}
  .odd-button{padding:10px 6px}
  .betslip-panel{right:8px;bottom:8px;width:calc(100vw - 16px);max-height:60vh}
  .hero-card{min-height:120px;padding:16px}
  .hero-card p{font-size:12px}
  .hero-mark{font-size:78px}
  .sport-footer{flex-direction:column}
}

@media (max-width:520px){
  .sport-subnav{padding:8px}
  .subnav-item{padding:8px 10px;font-size:11px}
  .hero-card h1{font-size:22px}
  .hero-mark{display:none}
  .section-title-row,.matches-head{padding:12px}
  .section-title-row h2,.matches-head h2,.betslip-head h2{font-size:17px}
  .featured-cards{padding:8px}
  .match-row{padding:10px}
  .match-teams{font-size:13px}
}

/* SPORT demo v2: controlli dedicati e comportamento mobile isolato */
.betslip-head-actions{display:flex;align-items:center;gap:8px}
.betslip-close{
  display:none;border:0;background:#303740;color:#fff;width:30px;height:30px;
  border-radius:6px;font-size:21px;line-height:1
}
.mobile-betslip-open{display:none}

@media (max-width:1180px) and (min-width:821px){
  .betslip-panel{display:block}
}

@media (max-width:820px){
  body{padding-bottom:64px}
  .betslip-panel{
    display:none;
    position:fixed;
    z-index:90;
    left:8px;
    right:8px;
    bottom:68px;
    top:auto;
    width:auto;
    max-height:min(68vh,620px);
    overflow:auto;
    box-shadow:0 20px 70px rgba(0,0,0,.68);
    border-color:#4a535e
  }
  body.sport-betslip-open .betslip-panel{display:block}
  .betslip-close{display:grid;place-items:center}
  .mobile-betslip-open{
    display:flex;
    position:fixed;
    z-index:85;
    left:50%;
    bottom:max(10px,env(safe-area-inset-bottom));
    transform:translateX(-50%);
    align-items:center;
    justify-content:center;
    gap:10px;
    min-width:170px;
    border:1px solid #f5b800;
    border-radius:999px;
    background:#f5b800;
    color:#111;
    padding:11px 18px;
    font-weight:900;
    box-shadow:0 8px 26px rgba(0,0,0,.4)
  }
  .mobile-betslip-open strong{
    display:grid;
    place-items:center;
    min-width:23px;
    height:23px;
    padding:0 6px;
    border-radius:999px;
    background:#111;
    color:#ffd451;
    font-size:11px
  }
  body.sport-betslip-open .mobile-betslip-open{background:#20262d;color:#fff}
  .sport-footer{padding-bottom:74px}
}

@media (max-width:520px){
  .sport-topbar{position:sticky;top:0}
  .sport-main-nav{scroll-snap-type:x proximity}
  .sport-main-nav a,.sport-main-nav button{scroll-snap-align:start}
  .hero-card{border-radius:8px}
  .featured,.matches-section{border-radius:8px}
  .match-meta{flex-wrap:wrap;row-gap:3px}
  .match-odds{gap:5px}
  .odd-button{font-size:13px}
}


/* SPORT demo v3: header piu compatto */
.brand span{font-size:14px}
@media (max-width:1024px) and (min-width:821px){
  .sport-topbar{padding:0 10px}
  .sport-main-nav a,.sport-main-nav button{padding:0 11px;font-size:13px}
  .brand span{font-size:13px}
}
@media (max-width:820px){
  .sport-topbar{padding:6px 8px;gap:6px}
  .brand img{width:30px;height:30px}
  .brand span{font-size:12px}
  .sport-main-nav a,.sport-main-nav button{padding:9px 12px}
}


/* SPORT login entry: always visible, including mobile */
.login-entry-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#111;
  color:#f5b800;
  padding:8px 11px;
  border-radius:6px;
  font-size:11px;
  font-weight:900;
  white-space:nowrap;
}
.login-entry-link:hover{background:#252525}
@media(max-width:820px){
  .login-entry-link{
    padding:7px 10px;
    font-size:11px;
  }
}
