/*
Theme Name: TransferMoves Audience v6
Description: Tema minimale a tabellone arrivi/partenze per TransferMoves.com
Version: 6.0
*/

:root {
  --bg-void: #0B0E13;
  --bg-panel: #12161D;
  --bg-panel-hover: #171C24;
  --hairline: #232833;
  --flap-amber: #E8A33D;
  --flap-amber-dim: #8A6423;
  --live-green: #35D07F;
  --live-green-bg: #12261C;
  --confirmed-orange: #FF6B4A;
  --confirmed-orange-bg: #2A160F;
  --rumour-gray: #6B7280;
  --text-primary: #E9EBEF;
  --text-secondary: #8A8F98;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-sans: 'Inter', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
}

header.tm-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-void);
  border-bottom: 1px solid var(--hairline);
}

.tm-header-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px 20px 0;
}

.tm-wordmark-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.tm-wordmark {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.tm-wordmark span.moves { color: var(--flap-amber); }

.tm-home-tagline {
  max-width: 650px;
  margin: -7px 0 15px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}

.tm-live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--live-green);
  text-transform: uppercase;
}

.tm-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live-green);
  animation: tm-pulse 1.6s ease-in-out infinite;
}

@keyframes tm-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.tm-team-picker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding-bottom: 16px;
}

.tm-chip {
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: border-color 0.15s;
}

.tm-chip.active {
  color: var(--flap-amber);
  border-color: var(--flap-amber-dim);
  background: #1C1710;
}

.tm-chip-all {
  color: var(--flap-amber);
  border-color: var(--flap-amber-dim);
}

/* Larghezza fissa uguale per i due bottoni sopra le righe inline —
   "All teams →" e "Done Deals →" hanno testi di lunghezza diversa,
   senza questa regola le icone che li seguono partirebbero da punti
   diversi, disallineando le due righe */
.tm-inline-row .tm-chip-all,
.tm-inline-row .tm-chip-done {
  min-width: 140px;
  text-align: center;
  box-sizing: border-box;
}

.tm-page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 4px 16px;
}

.tm-count-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--flap-amber);
  border: 1px solid var(--flap-amber-dim);
  border-radius: 6px;
  padding: 6px 12px;
  background: #1C1710;
}

.tm-all-teams-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 4px 60px;
}

.tm-all-teams-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--flap-amber-dim);
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 15px;
  transition: border-color 0.15s, background 0.15s;
}
.tm-all-teams-item:hover {
  border-left-color: var(--flap-amber);
  background: var(--bg-panel-hover);
}

.tm-all-teams-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 20px;
}

.tm-all-teams-crest {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
  /* Sfondo chiaro sempre presente dietro ogni stemma — molti loghi
     (es. Juventus) sono prevalentemente neri/scuri e sparivano contro
     lo sfondo scuro del sito. */
  background: #E9EBEF;
  padding: 3px;
  flex-shrink: 0;
}
.tm-all-teams-crest-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  color: var(--flap-amber);
}

.tm-all-teams-name {
  flex: 1;
  font-weight: 500;
}

.tm-all-teams-arrow {
  color: var(--text-secondary);
  font-size: 18px;
}

main.tm-main {
  max-width: 780px;
  margin: 0 auto;
  padding: 8px 20px 60px;
}

.tm-feed-intro {
  max-width: 780px;
  margin: 0 auto;
  padding: 22px 20px 4px;
}
.tm-feed-title-row h1 {
  margin: 0;
  font: 700 17px var(--font-mono);
  letter-spacing: .03em;
  text-transform: uppercase;
}
.tm-feed-title-row p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 6px 0 14px;
  color: var(--text-secondary);
  font: 500 11px var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.tm-status-filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.tm-status-filters::-webkit-scrollbar { display: none; }
.tm-status-filters button { appearance: none; }

.tm-social-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 16px 0;
  padding: 16px 18px;
  border: 1px solid var(--flap-amber-dim);
  border-radius: 8px;
  background: #15140F;
}
.tm-social-cta strong {
  display: block;
  margin-bottom: 4px;
  font: 700 13px var(--font-mono);
  text-transform: uppercase;
}
.tm-social-cta span { color: var(--text-secondary); font-size: 12px; line-height: 1.45; }
.tm-social-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.tm-social-actions a {
  padding: 7px 11px;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.tm-social-actions a:hover { color: var(--flap-amber); border-color: var(--flap-amber-dim); }

.tm-row {
  display: grid;
  grid-template-columns: 56px 40px 1fr 28px;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  margin-bottom: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--flap-amber-dim);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.tm-row:hover {
  border-left-color: var(--flap-amber);
}

.tm-row-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-void);
}

/* Quando il banner è uno stemma squadra (fallback quando manca la
   foto giocatore) invece di una foto viso — contain non cover, per
   non tagliare il logo, e un piccolo padding per non farlo toccare
   il bordo del cerchio */
.tm-row-photo-crest {
  object-fit: contain;
  padding: 6px;
  border: 1px solid var(--hairline);
  background: #E9EBEF !important;
}

.tm-row-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--flap-amber);
  border: 1px solid var(--hairline);
}

.tm-row-sublabel {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.tm-row:hover { background: var(--bg-panel-hover); }

.tm-row-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.tm-row-main { min-width: 0; }

.tm-row-player {
  display: block;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tm-row-player-link,
.tm-row-headline-link,
.tm-row-photo-link,
.tm-row-link {
  text-decoration: none;
  color: inherit;
}
.tm-row-photo-link { display: block; line-height: 0; }
.tm-row-player-cta {
  display: inline-block;
  margin: -1px 0 5px;
  padding: 2px 6px;
  border: 1px solid var(--flap-amber-dim);
  border-radius: 3px;
  background: #1C1710;
  color: var(--flap-amber);
  font: 600 9px var(--font-mono);
  letter-spacing: .05em;
  text-decoration: none;
  text-transform: uppercase;
}
.tm-row-player-cta:hover { text-decoration: underline; }
.tm-row:focus-visible {
  outline: 2px solid var(--flap-amber);
  outline-offset: 2px;
}
.tm-row-headline-link { display: block; }
.tm-row-headline-link:hover { color: var(--text-primary); }

.tm-row-headline {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 6px;
  /* libero di andare su più righe, non tagliato con i puntini —
     a differenza del nome giocatore sopra, che resta su una riga */
}

.tm-row-source {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.tm-row-stay-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-style: italic;
  color: var(--text-secondary);
}

.tm-row-crest {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: contain;
  vertical-align: middle;
  background: #E9EBEF;
  padding: 2px;
}

.tm-status-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
  display: inline-block;
  margin-top: 4px;
}

.tm-status-rumour { color: #5B9BF5; background: #101C2E; }
.tm-status-advanced { color: var(--flap-amber); background: #241C0E; }
.tm-status-done { color: var(--live-green); background: var(--live-green-bg); }

.tm-row-link { color: var(--text-secondary); font-size: 15px; text-align: center; }

@keyframes tm-flip-in {
  0% { transform: rotateX(-90deg); opacity: 0; }
  100% { transform: rotateX(0deg); opacity: 1; }
}
.tm-row.tm-new { animation: tm-flip-in 0.4s ease-out; transform-origin: top; }

.tm-section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 20px 4px 8px;
}

.tm-loading, .tm-empty {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  padding: 40px 4px;
  text-align: center;
}

@media (max-width: 480px) {
  .tm-row-player { font-size: 13px; }
  .tm-row { grid-template-columns: 44px 32px 1fr 20px; gap: 8px; }
  .tm-row-photo { width: 32px; height: 32px; }
  .tm-social-cta { align-items: flex-start; flex-direction: column; }
}

/* ---------- PAGINA DI DETTAGLIO (single-news_mercato.php) ---------- */

.tm-back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 16px 4px 0;
}
.tm-back-link:hover { color: var(--flap-amber); }

.tm-article { padding: 20px 4px 60px; }

.tm-article-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin: 0 0 14px;
}

.tm-article-player-info {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.tm-article-player-info strong { color: var(--text-primary); }
.tm-player-profile-link {
  color: var(--flap-amber);
  text-decoration: none;
}
.tm-player-profile-link:hover { text-decoration: underline; }
.tm-player-profile-button {
  display: inline-block;
  margin: 10px 0 0;
  padding: 8px 12px;
  border: 1px solid var(--flap-amber-dim);
  border-radius: 5px;
  background: #1C1710;
  color: var(--flap-amber);
  font: 600 11px var(--font-mono);
  text-decoration: none;
  text-transform: uppercase;
}
.tm-player-profile-button:hover { border-color: var(--flap-amber); }

/* ---------- PAGINA CAMPIONATO ---------- */
.tm-league-intro {
  margin: 0 4px 18px;
  color: var(--text-secondary);
  font: 14px/1.5 var(--font-sans);
}
.tm-league-clubs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 4px 30px;
}
.tm-league-club {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  background: var(--bg-panel);
  color: var(--text-primary);
  font: 11px/1.3 var(--font-mono);
  text-decoration: none;
}
.tm-league-club:hover { border-color: var(--flap-amber-dim); }
.tm-league-club img,
.tm-league-club-placeholder {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: contain;
  padding: 4px;
  background: #E9EBEF;
}
.tm-league-club-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--flap-amber);
  background: var(--bg-void);
}
.tm-league-feed-title {
  margin: 0 4px 14px;
  color: var(--text-primary);
  font: 700 16px var(--font-mono);
  text-transform: uppercase;
}
@media (max-width: 720px) {
  .tm-league-clubs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .tm-league-club { font-size: 10px; padding: 7px; }
  .tm-league-club img,
  .tm-league-club-placeholder { width: 32px; height: 32px; flex-basis: 32px; }
}

.tm-article-clubs {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.tm-club-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  transition: border-color 0.15s, color 0.15s;
}
.tm-club-badge:hover {
  border-color: var(--flap-amber-dim);
  color: var(--flap-amber);
}
.tm-club-badge.to {
  color: var(--flap-amber);
  border-color: var(--flap-amber-dim);
  background: #1C1710;
}
.tm-club-badge img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: contain;
  background: #E9EBEF;
  padding: 2px;
}

/* ---------- PAGINA GIOCATORE / TIMELINE ---------- */
.tm-player-page { max-width: 860px; }

.tm-player-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 28px 4px 18px;
}

.tm-player-hero-photo {
  flex: 0 0 112px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--flap-amber-dim);
  background: var(--bg-panel);
}

.tm-player-hero-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 34px var(--font-mono);
  color: var(--flap-amber);
}

.tm-player-kicker {
  margin-bottom: 7px;
  color: var(--flap-amber);
  font: 600 11px var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.tm-player-hero h1 {
  margin: 0 0 8px;
  color: var(--text-primary);
  font: 700 26px/1.25 var(--font-mono);
  text-transform: uppercase;
}

.tm-player-meta,
.tm-player-intro {
  color: var(--text-secondary);
  font: 14px/1.6 var(--font-sans);
}

.tm-player-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--text-secondary);
  font: 12px var(--font-mono);
}

.tm-player-intro {
  padding: 0 4px 26px;
  border-bottom: 1px solid var(--hairline);
}

.tm-player-timeline {
  position: relative;
  padding: 26px 4px 12px 36px;
}

.tm-player-timeline::before {
  content: '';
  position: absolute;
  top: 72px;
  bottom: 35px;
  left: 13px;
  width: 1px;
  background: var(--hairline);
}

.tm-player-timeline > h2 {
  margin: 0 0 20px -32px;
  color: var(--text-primary);
  font: 700 18px var(--font-mono);
  text-transform: uppercase;
}

.tm-timeline-event {
  position: relative;
  margin-bottom: 14px;
  padding: 18px 18px 16px;
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--flap-amber-dim);
  border-radius: 8px;
  background: var(--bg-panel);
}

.tm-timeline-marker {
  position: absolute;
  top: 23px;
  left: -31px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--flap-amber);
  border-radius: 50%;
  background: var(--bg-void);
}

.tm-timeline-event time {
  display: block;
  margin-bottom: 7px;
  color: var(--text-secondary);
  font: 11px var(--font-mono);
}

.tm-timeline-event h3 { margin: 0 0 9px; }
.tm-timeline-event h3 a {
  color: var(--text-primary);
  font: 600 16px/1.4 var(--font-mono);
  text-decoration: none;
}
.tm-timeline-event h3 a:hover { color: var(--flap-amber); }

.tm-timeline-event p {
  margin: 10px 0;
  color: var(--text-secondary);
  font: 13px/1.55 var(--font-sans);
}

.tm-timeline-clubs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--text-secondary);
  font: 12px var(--font-mono);
}
.tm-timeline-clubs img {
  border-radius: 50%;
  object-fit: contain;
  padding: 2px;
  background: #E9EBEF;
}

.tm-timeline-read {
  color: var(--flap-amber);
  font: 11px var(--font-mono);
  text-decoration: none;
  margin-right: 10px;
}

.tm-pagination { padding: 10px 4px 45px; }
.tm-pagination .page-numbers {
  display: inline-block;
  margin-right: 5px;
  padding: 6px 10px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--text-secondary);
  text-decoration: none;
  font: 12px var(--font-mono);
}
.tm-pagination .current { color: var(--flap-amber); border-color: var(--flap-amber-dim); }

@media (max-width: 600px) {
  .tm-player-hero { align-items: flex-start; gap: 14px; }
  .tm-player-hero-photo { width: 76px; height: 76px; flex-basis: 76px; }
  .tm-player-hero h1 { font-size: 19px; }
  .tm-player-meta { font-size: 12px; }
  .tm-player-timeline { padding-left: 27px; }
  .tm-player-timeline::before { left: 9px; }
  .tm-timeline-marker { left: -24px; }
}

.tm-article-body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}

/* Qualsiasi immagine nel corpo articolo (WP le può aggiungere via
   editor, o embed) non deve mai superare la larghezza del contenitore
   — senza questa regola, su schermi grandi le immagini restano alla
   loro dimensione nativa e "sforano" il layout. */
.tm-article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 12px 0;
}

.tm-article-source {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}
.tm-article-source a { color: var(--text-secondary); }
.tm-article-source a:hover { color: var(--flap-amber); }

.tm-share-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}

.tm-share-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-right: 4px;
}

.tm-share-btn {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 6px 12px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.tm-share-btn:hover {
  color: var(--flap-amber);
  border-color: var(--flap-amber-dim);
}

/* ---------- PAGINA ARCHIVIO SQUADRA (taxonomy-squadra.php) ---------- */

.tm-team-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 4px 10px;
}

.tm-team-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: contain;
  background: #E9EBEF;
  padding: 5px;
}

.tm-team-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  margin: 0;
}

.tm-team-intro {
  max-width: 720px;
  margin: 0 4px 18px;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* ---------- GRIGLIA SQUADRE IN HOME (front-page.php) ---------- */

.tm-teams-section {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px 20px 60px;
  border-top: 1px solid var(--hairline);
}

.tm-teams-title {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

.tm-teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 10px;
}

.tm-team-crest {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  transition: border-color 0.15s;
  overflow: hidden;
  text-decoration: none;
  /* Se un'immagine dello stemma non si carica (link Wikidata rotto),
     il browser mostra il testo alt con lo stile di link blu di
     default — questo lo nasconde, lasciando solo il cerchio vuoto
     invece di un artefatto testuale brutto */
  color: transparent;
  font-size: 0;
}
.tm-team-crest:hover { border-color: var(--flap-amber-dim); }

.tm-team-crest img {
  width: 60%;
  height: 60%;
  object-fit: contain;
}

.tm-team-crest-placeholder {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--flap-amber);
}

/* ---------- COUNTDOWN DEADLINE DAY ---------- */

.tm-deadline-countdown {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--bg-panel);
  border: 1px solid var(--flap-amber-dim);
  border-radius: 8px;
}

.tm-deadline-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.tm-deadline-value {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--flap-amber);
  letter-spacing: 0.02em;
}
.tm-window-closed {
  border-color: #245E43;
  background: var(--live-green-bg);
}
.tm-window-closed .tm-deadline-value { color: var(--live-green); }

/* ---------- BARRA DI RICERCA ---------- */

.tm-search-row {
  padding-bottom: 14px;
}

.tm-search-input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 10px 16px;
}
.tm-search-input:focus {
  outline: none;
  border-color: var(--flap-amber-dim);
}
.tm-search-input::placeholder {
  color: var(--text-secondary);
}

/* ---------- CHIP CAMPIONATO / DONE DEALS (varianti colore) ---------- */

.tm-chip-league {
  color: #5B9BF5;
  border-color: #1E3A5F;
}

.tm-chip-done {
  color: var(--live-green);
  border-color: #1E4A32;
}

.tm-count-badge-done {
  color: var(--live-green);
  border-color: #1E4A32;
  background: var(--live-green-bg);
}

/* ---------- NEWS CORRELATE (fondo pagina articolo) ---------- */

.tm-related {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}

.tm-related-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 12px;
}

.tm-related-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
}

.tm-related-item-title {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
}
.tm-related-item:hover .tm-related-item-title {
  color: var(--flap-amber);
}

/* ---------- ANTEPRIMA DONE DEALS (home, sotto i chip) ---------- */

.tm-done-preview {
  display: flex;
  gap: 14px;
  padding: 4px 0 16px;
  overflow-x: auto;
}

.tm-done-preview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  flex-shrink: 0;
  width: 60px;
}

.tm-done-preview-item img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--live-green);
}

.tm-done-preview-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--live-green);
  background: var(--bg-panel);
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--live-green);
}

.tm-done-preview-name {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}

/* ---------- ANTEPRIMA SQUADRE (home, stemmi) ---------- */

.tm-team-preview {
  display: flex;
  gap: 14px;
  padding: 4px 0 16px;
  overflow-x: auto;
}

.tm-team-preview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  flex-shrink: 0;
  width: 60px;
}

.tm-team-preview-item img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: contain;
  background: #E9EBEF;
  padding: 5px;
  border: 2px solid var(--flap-amber-dim);
}

.tm-team-preview-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--flap-amber-dim);
  background: var(--bg-panel);
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--flap-amber);
}

.tm-team-preview-name {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}

/* ---------- RIGHE INLINE: bottone + icone sulla stessa riga ---------- */

.tm-inline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tm-inline-row::-webkit-scrollbar { display: none; }

/* Il bottone "All teams →"/"Done Deals →" resta sempre visibile e
   fermo mentre scorri le icone — non scompare mai scorrendo */
.tm-inline-row .tm-chip {
  position: sticky;
  left: 0;
  z-index: 1;
  /* stesso sfondo della pagina, altrimenti le icone che scorrono
     sotto si vedrebbero attraverso il bottone durante lo scroll */
  background: var(--bg-void);
}

.tm-inline-crest {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tm-inline-crest img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #E9EBEF;
  display: block;
}

.tm-inline-crest-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--flap-amber);
  box-sizing: border-box;
}

/* ---------- FOOTER ---------- */

.tm-footer {
  max-width: 780px;
  margin: 40px auto 0;
  padding: 20px 20px 40px;
  border-top: 1px solid var(--hairline);
  text-align: center;
}

.tm-footer-links {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.tm-footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}
.tm-footer-links a:hover {
  color: var(--flap-amber);
}
.tm-footer-sep {
  margin: 0 8px;
  color: var(--hairline);
}

.tm-footer-copy {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* ---------- PAGINE DI CONTENUTO SEMPLICE (page.php: Terms, Privacy, About) ---------- */

.tm-simple-page {
  padding: 20px 4px 60px;
}

.tm-simple-page-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  margin: 0 0 20px;
}

.tm-simple-page-content {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
}

.tm-simple-page-content p {
  margin-bottom: 16px;
}

.tm-simple-page-content strong {
  color: var(--text-primary);
}

.tm-simple-page-content a {
  color: var(--flap-amber);
}
