/* direttagol.it - Magellano Tech S.r.l. - UI v3 (light, sport-portal) */
:root {
  --navy: #101f3d;
  --navy-2: #17294d;
  --navy-3: #1d3057;
  --page: #eceef3;
  --card: #ffffff;
  --ink: #12233f;
  --ink-2: #3d4d66;
  --muted: #7a8698;
  --dim: #9aa4b4;
  --line: #e6eaf1;
  --line-2: #dde3ec;
  --orange: #f5892f;
  --orange-d: #d76f18;
  --red: #e6203f;
  --gold: #f6c500;
  --green: #16a34a;
  --radius: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --cond: "Barlow Condensed", "Manrope", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { background: var(--page); color: var(--ink); font-family: var(--sans); font-weight: 600; -webkit-font-smoothing: antialiased; padding-bottom: calc(76px + var(--safe-b)); }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* ---------------- Header ---------------- */
.topbar { background: var(--navy); position: sticky; top: 0; z-index: 40; box-shadow: 0 2px 14px rgba(16, 31, 61, .25); }
.topbar-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: calc(12px + var(--safe-t)) 18px 12px; }
.brand { display: flex; align-items: center; gap: 11px; }
.logo { width: 46px; height: 42px; flex: 0 0 auto; }
.brand-word { display: flex; flex-direction: column; line-height: .82; }
.bw-1 { color: #fff; font-weight: 800; font-size: 15px; letter-spacing: .12em; }
.bw-2 { font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 34px; color: var(--orange); letter-spacing: .01em; text-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.mainnav { display: none; gap: 4px; margin-left: 12px; }
.mainnav a { color: #c7d0e0; font-weight: 700; font-size: 14px; padding: 9px 15px; border-radius: 9px; letter-spacing: .02em; text-transform: uppercase; }
.mainnav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.mainnav a.active { color: #fff; background: rgba(255, 255, 255, .12); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pill { border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: #b9c3d6; font-size: 10px; font-weight: 800; padding: 6px 11px; border-radius: 999px; letter-spacing: .1em; text-transform: uppercase; }
.hamb { display: flex; flex-direction: column; gap: 4px; width: 34px; height: 34px; border: 0; background: transparent; cursor: pointer; align-items: center; justify-content: center; }
.hamb span { width: 20px; height: 2px; background: #fff; border-radius: 2px; }

/* ---------------- Date strip ---------------- */
.datestrip { background: var(--navy-2); border-top: 1px solid rgba(255, 255, 255, .06); }
.datestrip { display: flex; gap: 0; overflow-x: auto; max-width: 1100px; margin: 0 auto; padding: 0 8px; scrollbar-width: none; }
.datestrip::-webkit-scrollbar { display: none; }
.day { flex: 0 0 auto; min-width: 62px; text-align: center; padding: 9px 6px 8px; color: #9fb0cc; cursor: pointer; border-bottom: 3px solid transparent; }
.day b { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.day span { display: block; font-size: 13px; font-weight: 700; margin-top: 2px; }
.day:hover { color: #dfe6f2; }
.day.active { color: #fff; border-bottom-color: var(--orange); }
.day.today b { color: var(--orange); }

/* ---------------- Sport tabs ---------------- */
.sport-tabs { background: var(--navy); display: flex; gap: 7px; overflow-x: auto; max-width: 1100px; margin: 0 auto; padding: 8px 14px 12px; scrollbar-width: none; }
.sport-tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; padding: 8px 15px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 0; color: #cdd6e6; font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: #fff; }
.tab.active { color: #fff; background: var(--orange); box-shadow: 0 4px 12px rgba(245, 137, 47, .4); }

/* ---------------- Layout ---------------- */
.layout { max-width: 1100px; margin: 0 auto; padding: 16px 14px 0; display: grid; grid-template-columns: 1fr; gap: 20px; }
.container { min-width: 0; }
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.ad-slot { text-align: center; color: var(--dim); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 26px 16px; background: #fff; }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.side-title { margin: 0 0 4px; font-size: 16px; font-weight: 800; color: var(--ink); border-bottom: 2px solid var(--orange); display: inline-block; padding-bottom: 6px; }
.side-empty { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

/* ---------------- Filters ---------------- */
.filters { display: flex; gap: 9px; margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 1.5px solid var(--line-2); background: #fff; color: var(--ink-2); font-weight: 800; font-size: 14px; padding: 11px 20px; border-radius: 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: .15s; }
.chip:hover { border-color: var(--dim); }
.chip-all.active { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: 0 5px 14px rgba(245, 137, 47, .35); }
.chip-live.active { background: #fff; border-color: var(--red); color: var(--red); }
.chip:not(.chip-all):not(.chip-live).active { background: var(--navy); border-color: var(--navy); color: #fff; }
.dotlive { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 7px var(--red); animation: pulse 1.3s infinite; }

/* ---------------- Match list ---------------- */
.league-group { margin-bottom: 16px; border-radius: var(--radius); overflow: hidden; box-shadow: 0 3px 14px rgba(16, 31, 61, .08); }
.league-head { display: flex; align-items: center; gap: 10px; padding: 12px 15px; background: linear-gradient(180deg, var(--navy-3), var(--navy-2)); color: #fff; }
.league-head img { width: 20px; height: 20px; border-radius: 4px; background: #fff; }
.league-head .lg-name { font-weight: 800; font-size: 15px; }
.league-head .lg-country { margin-left: auto; color: #9fb0cc; font-weight: 700; font-size: 12px; }
.card-list { background: #fff; }
.match-row { display: grid; grid-template-columns: 52px 1fr auto 34px; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--line); transition: background .12s; }
.match-row:last-child { border-bottom: 0; }
.match-row:hover { background: #f6f8fb; }
.mr-time { text-align: center; }
.mr-min { color: var(--red); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.mr-min .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 7px var(--red); animation: pulse 1.3s infinite; }
.mr-clock { color: var(--muted); font-weight: 800; font-size: 13px; }
.mr-ft { color: var(--dim); font-weight: 800; font-size: 11px; text-transform: uppercase; }
.mr-teams { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.mr-team { display: flex; align-items: center; gap: 9px; min-width: 0; }
.mr-team img { width: 22px; height: 22px; border-radius: 5px; flex: 0 0 auto; object-fit: contain; }
.mr-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 15px; color: var(--ink); }
.mr-team.dim span { color: var(--muted); }
.mr-team.win span { color: var(--ink); font-weight: 800; }
.mr-score { display: flex; flex-direction: column; gap: 7px; text-align: right; font-variant-numeric: tabular-nums; }
.mr-score b { font-size: 16px; font-weight: 800; color: var(--ink); }
.mr-score .live-val { color: var(--red); }
.mr-bell { display: flex; align-items: center; justify-content: center; color: var(--dim); }
.mr-bell svg { width: 19px; height: 19px; }
.mr-bell.on { color: var(--orange); }

.skel { background: linear-gradient(90deg, #eef1f6 25%, #e2e7ef 37%, #eef1f6 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
.skel-row { height: 60px; margin: 1px 0; }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-weight: 700; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }

/* ---------------- Bottom bar ---------------- */
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; justify-content: space-around; padding: 8px 12px calc(8px + var(--safe-b)); background: #fff; border-top: 1px solid var(--line-2); box-shadow: 0 -4px 18px rgba(16, 31, 61, .08); }
.bb-btn { flex: 1; max-width: 130px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: transparent; border: 0; color: var(--muted); font-family: var(--sans); font-weight: 800; font-size: 11px; cursor: pointer; padding: 3px; }
.bb-btn .bb-ico { font-size: 17px; line-height: 1; }
.bb-btn.active { color: var(--orange); }

/* ---------------- Match live view ---------------- */
.matchview { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.mv-backdrop { position: absolute; inset: 0; background: rgba(16, 31, 61, .55); backdrop-filter: blur(3px); }
.mv-panel { position: relative; width: 100%; max-width: 640px; max-height: 94vh; overflow-y: auto; background: #fff; border-radius: 20px 20px 0 0; padding: 20px 18px calc(26px + var(--safe-b)); box-shadow: 0 -20px 60px rgba(0, 0, 0, .35); animation: slideup .28s cubic-bezier(.2, .9, .3, 1); }
.mv-close { position: absolute; top: 12px; right: 14px; background: #eef1f6; border: 0; color: var(--ink); width: 34px; height: 34px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; z-index: 2; }
.mv-scoreboard { text-align: center; padding: 6px 0 12px; }
.mv-league { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.mv-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.mv-team { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mv-logo { width: 56px; height: 56px; border-radius: 14px; object-fit: contain; background: #f2f5f9; }
.mv-name { font-weight: 800; font-size: 15px; text-align: center; color: var(--ink); }
.mv-score-val { font-size: 42px; font-weight: 800; font-variant-numeric: tabular-nums; display: block; color: var(--ink); }
.mv-status { display: inline-block; margin-top: 6px; color: var(--red); font-weight: 800; font-size: 13px; }
.mv-status.scheduled { color: var(--muted); }
.mv-status.finished { color: var(--dim); }
.mv-pitch { position: relative; height: 130px; margin: 10px 4px 0; background: linear-gradient(180deg, #1a8f52, #147a45); border-radius: 12px; overflow: hidden; }
.mv-pitch::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0, transparent 34px, rgba(255, 255, 255, .05) 34px, rgba(255, 255, 255, .05) 68px); }
.pitch-line-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, .3); }
.pitch-circle { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; border: 2px solid rgba(255, 255, 255, .3); border-radius: 50%; transform: translate(-50%, -50%); }
.pitch-ball { position: absolute; top: 50%; left: 50%; width: 13px; height: 13px; background: #fff; border-radius: 50%; box-shadow: 0 0 12px rgba(255, 255, 255, .9); transform: translate(-50%, -50%); transition: left 1.2s cubic-bezier(.4, .1, .3, 1), top 1.2s ease; z-index: 2; }
.pitch-flash { position: absolute; inset: 0; background: radial-gradient(circle, rgba(245, 137, 47, .7), transparent 60%); opacity: 0; }
.pitch-flash.go { animation: goalflash .9s ease; }
.momentum { height: 8px; border-radius: 999px; margin: 12px 4px 4px; background: linear-gradient(90deg, var(--navy-3), var(--red)); position: relative; overflow: hidden; }
.momentum-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 50%; background: #fff; transition: width .8s ease; }
.momentum-legend { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; padding: 2px 4px 0; font-weight: 800; }
.mv-commentary { margin: 16px 2px 6px; background: #f6f8fb; border: 1px solid var(--line); border-radius: 14px; padding: 13px; }
.mv-commentary-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ai-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; color: var(--navy-3); text-transform: uppercase; letter-spacing: .05em; }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 9px var(--orange); animation: pulse 1.5s infinite; }
.mv-head-right { display: flex; align-items: center; gap: 10px; }
.narr-mode { color: var(--muted); font-weight: 700; text-transform: none; letter-spacing: 0; font-size: 11px; }
.mv-min { color: var(--muted); font-weight: 800; font-size: 13px; }
.narr-toggle { background: #fff; border: 1px solid var(--line-2); color: var(--muted); font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.mv-commentary.collapsed .commentary-feed { display: none; }
.commentary-feed { display: flex; flex-direction: column; gap: 9px; max-height: 230px; overflow-y: auto; }
.cm-line { display: flex; gap: 10px; align-items: flex-start; animation: fadein .35s ease; }
.cm-min { flex: 0 0 auto; min-width: 30px; color: var(--dim); font-weight: 800; font-size: 12px; padding-top: 2px; }
.cm-text { font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.cm-line.event .cm-text { color: var(--ink); font-weight: 700; }
.cm-line.goal .cm-text { color: var(--orange-d); font-weight: 800; }
.mv-timeline { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 2px 0; }
.tl-chip { display: inline-flex; align-items: center; gap: 7px; background: #f2f5f9; border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 700; color: var(--ink); }
.tl-chip .tl-min { color: var(--muted); font-weight: 800; }
.tl-badge { width: 15px; height: 15px; border-radius: 4px; }
.tl-badge.goal { background: var(--green); border-radius: 50%; }
.tl-badge.yellow { background: var(--gold); }
.tl-badge.red { background: var(--red); }
.tl-badge.sub { background: var(--navy-3); }
.tl-badge.var { background: #9aa4b4; }

/* ---------------- Footer ---------------- */
.footer { background: var(--navy); color: #c3cdde; margin-top: 26px; }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 24px 18px 8px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.fb-word { display: inline-flex; align-items: baseline; gap: 6px; }
.fb-1 { color: #fff; font-weight: 800; letter-spacing: .1em; font-size: 15px; }
.fb-2 { font-family: var(--cond); font-style: italic; font-weight: 800; font-size: 26px; color: var(--orange); }
.footer-tag { margin: 4px 0 0; font-size: 12px; color: #8ea0bd; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { color: #c3cdde; font-size: 13px; font-weight: 700; }
.footer-links a:hover { color: #fff; }
.footer-pub { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.footer-pub span { color: #8ea0bd; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.footer-logo { height: 40px; width: auto; background: #fff; border-radius: 9px; padding: 7px 12px; }
.footer-legal { max-width: 1100px; margin: 0 auto; padding: 14px 18px 26px; }
.footer-legal p { margin: 3px 0; font-size: 11.5px; line-height: 1.55; color: #93a1bd; }
.footer-legal strong { color: #dfe6f2; }
.footer-note { color: #6f7f9c !important; font-size: 10.5px !important; margin-top: 8px !important; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes slideup { from { transform: translateY(40px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadein { from { transform: translateY(6px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes goalflash { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }

@media (min-width: 760px) {
  .mainnav { display: flex; }
  .hamb { display: none; }
  .layout { grid-template-columns: 1fr 300px; }
  .matchview { align-items: center; }
  .mv-panel { border-radius: 20px; max-height: 90vh; }
  .bottombar { display: none; }
  body { padding-bottom: 0; }
}
@media (max-width: 759px) {
  .sidebar { display: none; }
}
