/* Pool del Chiese — striscia "Partite di oggi" (home e Agenda).
   Sta subito sotto la fascia a sei colori della testata. Chiusa è soltanto una linguetta;
   aperta è una corsia scura in cui le partite di oggi scorrono in orizzontale.
   Il colore sul bordo di ogni partita è quello della società (--c). */

.tk { position: relative; z-index: 5; background: var(--ink-2); color: var(--on-ink); }

/* ---------- Linguetta: spunta da sotto la fascia colorata e apre/chiude la corsia ---------- */
.tk-tabwrap { position: absolute; top: 100%; left: 0; right: 0; height: 58px; display: flex; justify-content: center; align-items: flex-start; overflow: hidden; pointer-events: none; }
.tk-tab { pointer-events: auto; display: inline-flex; align-items: center; gap: .55rem; height: 34px; padding: 0 .85rem 0 .8rem; border: 1px solid rgba(255, 255, 255, .18); border-top: 0; border-radius: 0 0 14px 14px; background: var(--ink-2); color: #fff; font: 700 .95rem/1 var(--display); text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; cursor: pointer; box-shadow: 0 12px 18px -10px rgba(0, 0, 0, .75); transition: background-color .2s, border-color .2s; animation: tk-tab-in .7s .5s cubic-bezier(.2, 1.3, .4, 1) both; }
.tk-tab:hover, .tk.open .tk-tab { background: var(--ink-3); border-color: rgba(255, 255, 255, .3); }
.tk-tab:focus-visible { outline-offset: -3px; }
.tk-n { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 .35rem; border-radius: 999px; background: var(--yellow); color: var(--ink); font: 800 italic 1rem/1 var(--display); letter-spacing: 0; }
.tk-chev { width: 8px; height: 8px; margin: -4px 2px 0; border-right: 2.5px solid var(--yellow); border-bottom: 2.5px solid var(--yellow); transform: rotate(45deg); transition: transform .3s cubic-bezier(.2, .7, .2, 1), margin .3s; }
.tk.open .tk-chev { margin-top: 4px; transform: rotate(-135deg); }
.tk-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--on-ink-muted); }
.tk-dot.live { background: var(--green); animation: tk-pulse 1.8s ease-out infinite; } /* oggi si gioca */
@keyframes tk-pulse { from { box-shadow: 0 0 0 0 rgba(46, 189, 107, .75); } to { box-shadow: 0 0 0 9px rgba(46, 189, 107, 0); } }
@keyframes tk-tab-in { from { transform: translateY(-110%); } }

/* ---------- Corsia ---------- */
.tk-lane { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .45s cubic-bezier(.2, .7, .2, 1), visibility 0s .45s; }
.tk.open .tk-lane { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s; }
.tk-inner { min-height: 0; overflow: hidden; }
.tk-row { display: flex; align-items: center; gap: .5rem; padding: .5rem clamp(.6rem, 2vw, 1.25rem); box-shadow: inset 0 -1px 0 var(--ink-3), inset 0 12px 14px -14px rgba(0, 0, 0, .9); }
.tk-b { flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .09); color: #fff; cursor: pointer; transition: background-color .2s, color .2s; }
.tk-b:hover { background: var(--yellow); color: var(--ink); }
.tk-b svg { width: 16px; height: 16px; }
.tk-i-play, .tk-b[aria-pressed="true"] .tk-i-pause { display: none; }
.tk-b[aria-pressed="true"] .tk-i-play { display: block; }
.tk-b[aria-pressed="true"] { background: var(--yellow); color: var(--ink); }
.tk.calm .tk-b[data-tk="pausa"] { display: none; } /* senza scorrimento automatico non c'è nulla da fermare */
.tk-all { flex: none; padding: .55rem .2rem .55rem .5rem; color: var(--yellow); font: 700 .92rem/1 var(--display); text-transform: uppercase; letter-spacing: .08em; text-decoration: none; white-space: nowrap; }
.tk-all::after { content: " →"; }
.tk-all:hover { color: #fff; }
@media (max-width: 1080px) { .tk-all { display: none; } }

.tk-view { flex: 1; min-width: 0; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  -webkit-mask: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%);
  mask: linear-gradient(90deg, transparent 0, #000 26px, #000 calc(100% - 26px), transparent 100%); }
.tk-view.dragging a { pointer-events: none; }
.tk-track { position: relative; display: flex; width: max-content; will-change: transform; }
.tk-list { display: flex; align-items: center; gap: .5rem; margin: 0; padding: 4px .25rem; list-style: none; }
.tk.open .tk-list:first-child > li { animation: tk-in .45s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms + .12s); }
@keyframes tk-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
/* poche partite: ci stanno tutte, niente scorrimento né comandi */
.tk.static .tk-view { cursor: default; -webkit-mask: none; mask: none; }
.tk.static .tk-track { margin-inline: auto; }
.tk.static .tk-list + .tk-list, .tk.static .tk-b, .tk.static .tk-end { display: none; }

.tk-end { flex: none; display: grid; place-items: center; width: 76px; }
.tk-end img { width: 44px; height: 36px; opacity: .9; }

/* una partita, in tre riquadri: giorno e ora · squadra e categoria · i due stemmi con "VS" e, sotto, il luogo */
.tk-m { --c: var(--on-ink-muted); display: flex; align-items: center; height: 52px; padding-right: .9rem; overflow: hidden; border-radius: 12px; background: var(--ink-3); color: #fff; text-decoration: none; white-space: nowrap; box-shadow: inset 4px 0 0 var(--c); transition: background-color .2s, box-shadow .25s, transform .2s cubic-bezier(.2, .7, .2, 1); }
.tk-m:hover { background: #2f3760; color: #fff; transform: translateY(-2px); box-shadow: inset 4px 0 0 var(--c), 0 10px 16px -10px var(--c); }
.tk-m:focus-visible { outline-offset: -3px; }
/* i primi due riquadri sono uguali: un'etichetta piccola sopra, il dato grande sotto */
.tk-when { flex: none; align-self: stretch; display: grid; justify-items: center; align-content: center; gap: 3px; width: 56px; margin-left: 4px; background: rgba(255, 255, 255, .07); }
.tk-when + .tk-when { margin-left: 2px; }
.tk-when i { font: 700 .7rem/1 var(--display); font-style: normal; text-transform: uppercase; letter-spacing: .12em; color: var(--on-ink-muted); }
.tk-when b { font: 800 italic 1.15rem/1 var(--display); }
.tk-m.past { opacity: .5; }
/* terzo riquadro: gli stemmi (prima chi gioca in casa) e, sotto al centro, il luogo */
.tk-body { display: grid; justify-items: center; gap: 4px; margin-left: .8rem; }
.tk-teams { display: flex; align-items: center; justify-content: center; gap: .5rem; }
.tk-teams img { flex: none; width: 28px; height: 28px; object-fit: contain; }
.tk-opp { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; font: 700 .95rem/1 var(--display); text-transform: uppercase; letter-spacing: .03em; } /* chi non ha uno stemma: il nome */
.tk-vs { font: 800 italic .8rem/1 var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--yellow); }
.tk-meta { display: flex; justify-content: center; font-size: .8rem; line-height: 1; color: var(--on-ink-muted); }
.tk-place { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 760px) {
  .tk-row { gap: .35rem; padding: .45rem .5rem; }
  .tk-b { width: 34px; height: 34px; }
  .tk-all { display: none; }
  .tk-view { -webkit-mask: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); mask: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); }
  .tk-list { gap: .4rem; }
  .tk-m { height: 50px; padding-right: .7rem; }
  .tk-when { width: 48px; }
  .tk-when i { font-size: .64rem; letter-spacing: .08em; }
  .tk-when b { font-size: 1.05rem; }
  .tk-body { margin-left: .6rem; }
  .tk-teams { gap: .4rem; }
  .tk-teams img { width: 26px; height: 26px; }
  .tk-place { max-width: 8.5rem; }
  .tk-tab { height: 32px; font-size: .88rem; letter-spacing: .07em; }
}

/* ---------- Sul telefono (.pager, lo decide settimana.js): una partita alla volta, con due frecce ---------- */
.tk-pos { display: none; }
.tk.pager .tk-b[data-tk="pausa"], .tk.pager .tk-list + .tk-list, .tk.pager .tk-end { display: none; }
.tk.pager .tk-b { background: var(--yellow); color: var(--ink); transition: opacity .25s, transform .15s; }
.tk.pager .tk-b:active { transform: scale(.9); }
.tk.pager .tk-b:disabled { opacity: .25; cursor: default; }
.tk.pager .tk-view { position: relative; padding-bottom: 14px; }
.tk.pager .tk-track { transition: transform .55s cubic-bezier(.22, 1, .36, 1); }
.tk.pager .tk-list { gap: .9rem; }
/* la partita al centro è piena; le vicine, che si intravedono ai lati, sono piccole e spente */
.tk.pager .tk-list > li { animation: none; }
.tk.pager .tk-m { opacity: .28; transform: scale(.86); transition: opacity .45s, transform .55s cubic-bezier(.22, 1, .36, 1), box-shadow .3s; }
.tk.pager .tk-m.on { opacity: 1; transform: none; box-shadow: inset 4px 0 0 var(--c), 0 10px 18px -10px var(--c); }
.tk.pager .tk-m.past.on { opacity: .6; }
.tk.pager .tk-pos { display: block; position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font: 700 .68rem/1 var(--display); letter-spacing: .14em; color: var(--on-ink-muted); }

/* ---------- Finestra con i dettagli di una partita: come quella dell'Agenda (pcm-* in agenda.css) ---------- */
.tkd { width: min(430px, calc(100vw - 28px)); max-height: 82vh; padding: 16px 16px 14px; overflow: auto; border: 1px solid rgba(255, 255, 255, .18); border-radius: 16px; background: #161a28; color: #edf0fa; font-family: var(--body); line-height: 1.35; box-shadow: 0 18px 60px rgba(0, 0, 0, .5); }
.tkd[open] { animation: tkd-in .22s cubic-bezier(.2, .7, .2, 1); }
.tkd::backdrop { background: rgba(5, 8, 16, .66); backdrop-filter: blur(2px); }
@keyframes tkd-in { from { opacity: 0; transform: translateY(14px); } }
.tkd-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tkd-head h2 { margin: 0; color: #edf0fa; font: 700 16.5px/1.2 var(--body); font-style: normal; text-transform: capitalize; letter-spacing: 0; }
.tkd-x { flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid rgba(255, 255, 255, .18); border-radius: 8px; background: #1e2235; color: #a8b0ce; font: 800 15px/1 var(--body); cursor: pointer; }
.tkd-x:hover { color: #edf0fa; border-color: #8089a8; }
.tkd-ev { padding: 10px 12px; border: 1px solid rgba(255, 255, 255, .18); border-left-width: 5px; border-radius: 11px; background: #1e2235; }
.tkd-r1 { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.tkd-r1 img { flex: none; width: 34px; height: 34px; object-fit: contain; }
.tkd-vs { flex: none; font-size: 21px; line-height: 1; }
.tkd-t1 { font-size: 16px; font-weight: 700; line-height: 1.2; }
.tkd-t2 { margin-top: 2px; font-size: 12.5px; font-weight: 500; color: #8089a8; }
.tkd-rows { display: grid; gap: 4px; font-size: 13.5px; color: #a8b0ce; }
.tkd-row { display: flex; align-items: flex-start; gap: 7px; line-height: 1.45; }
.tkd-row > :first-child { flex: none; min-width: 1.2em; text-align: center; }
.tkd-row a { color: #a8b0ce; text-decoration: underline; }
.tkd-row a:hover { color: #edf0fa; }
.tkd-dot { display: inline-block; width: 11px; height: 11px; margin-top: .35em; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .35); }
.tkd-note { font-style: italic; }
.tkd-all { display: block; margin-top: 12px; color: var(--yellow); font: 700 .92rem/1.2 var(--display); text-transform: uppercase; letter-spacing: .07em; text-decoration: none; }
.tkd-all::after { content: " →"; }
.tkd-all:hover { color: #fff; }

/* ---------- Movimento ridotto (vedi site.css): la corsia si apre senza animazioni e non scorre da sola ---------- */
@media (prefers-reduced-motion: reduce) {
  html:not(.motion) .tk-m:hover { transform: none; }
}
