/* ==========================================================================
   VOLLEYSCORE — Équipe-type de la semaine : demi-terrain vu de dessus, filet en haut
   ========================================================================== */
:root { --tw-court: #F4E7D7; --tw-line: rgba(255, 255, 255, .95); --tw-out: #E9EEF5; --tw-net: #1F2937; }
[data-theme="dark"] { --tw-court: #2A2320; --tw-line: rgba(255, 255, 255, .22); --tw-out: #161B22; --tw-net: #0B0E13; }

.tw { padding: 4px 12px 12px; }
.tw-week, .tw-nav { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 2px 0 10px; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.tw-nav button { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 50%; font-size: 18px; line-height: 1; color: var(--text-main); background: var(--bg-card); transition: border-color .12s ease; }
.tw-nav button:hover:not(:disabled) { border-color: var(--text-dim); }
.tw-nav button:disabled { opacity: .35; cursor: default; }

.tw-court { position: relative; padding: 16px 8px 10px; border-radius: 6px; background: var(--tw-out); }
.tw-court::before { /* surface de jeu, lignes blanches : ligne d'attaque au tiers */
  content: ''; position: absolute; inset: 8px 8px 6px; border: 2px solid var(--tw-line); border-top: 0; border-radius: 0 0 3px 3px;
  background: linear-gradient(to bottom, transparent calc(33% - 1px), var(--tw-line) calc(33% - 1px), var(--tw-line) calc(33% + 1px), transparent calc(33% + 1px)), var(--tw-court);
}
.tw-net { position: absolute; left: 4px; right: 4px; top: 4px; height: 6px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--tw-net) 0 3px, transparent 3px 6px), var(--tw-net); opacity: .85; }
.tw-row { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.tw-row + .tw-row { margin-top: 14px; }

.tw-p { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: 4px 2px; border-radius: 6px; text-align: center; transition: background .12s ease, transform .15s ease; }
.tw-p:not(:disabled):hover { background: rgba(255, 255, 255, .45); transform: translateY(-2px); }
[data-theme="dark"] .tw-p:not(:disabled):hover { background: rgba(255, 255, 255, .06); }
.tw-p.empty { visibility: hidden; }
.tw-av { width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--bg-card); box-shadow: 0 0 0 2px var(--bg-card), 0 2px 6px rgba(15, 17, 21, .18); }
.tw-av img { width: 100%; height: 100%; max-height: 100%; object-fit: cover; object-position: 50% 15%; }
.tw-av svg { width: 40px; height: 40px; }
.tw-nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 800; color: var(--text-main); }
.tw-meta { display: inline-flex; align-items: center; gap: 4px; }
.tw-meta .team-logo, .tw-meta img { width: 16px; height: 16px; object-fit: contain; }
.tw-meta .rt-pill { min-width: 34px; padding: 1px 5px; font-size: 11.5px; }
.tw-pos { font-size: 9.5px; line-height: 1.15; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .02em; max-width: 100%; overflow-wrap: anywhere; hyphens: auto; }
.tw-inf { margin-left: 3px; font-style: normal; font-weight: 800; color: var(--text-muted); }
.tw-court .tw-pos { color: color-mix(in srgb, var(--text-main) 55%, transparent); }

/* Libéro : sous le terrain, maillot de couleur différente comme en match */
.tw-lib { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; }
.tw-lib-l { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.tw-lib .tw-p { flex-direction: row; gap: 8px; padding: 4px 10px; border: 1px dashed var(--border); }
.tw-lib .tw-pos { display: none; }
.tw-lib .tw-av { width: 36px; height: 36px; }
.tw-note { margin-top: 8px; font-size: 11.5px; color: var(--text-dim); text-align: center; }

/* Carrousel de l'accueil */
.tw-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 12px 4px; scrollbar-width: none; }
.tw-tabs::-webkit-scrollbar { display: none; }
.tw-tabs button { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 6px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--text-muted); white-space: nowrap; transition: border-color .12s ease, background .12s ease; }
.tw-tabs button:hover { border-color: var(--text-dim); }
.tw-tabs button.on { background: var(--text-main); border-color: var(--text-main); color: var(--bg-card); }
.tw-box { min-width: 0; contain: inline-size; } /* onglets et diapositives n'imposent jamais leur largeur à la colonne */
.tw-car { position: relative; contain: inline-size; min-width: 0; } /* les 7 diapositives n'élargissent jamais la colonne */
.tw-track { width: 100%; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.tw-track::-webkit-scrollbar { display: none; }
.tw-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; }
.tw-arrow { position: absolute; top: 46%; z-index: 2; width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 50%; background: var(--bg-card); color: var(--text-main); font-size: 17px; line-height: 1; box-shadow: 0 2px 6px rgba(15, 17, 21, .15); opacity: .92; }
.tw-arrow:hover { opacity: 1; }
.tw-arrow.l { left: 2px; } .tw-arrow.r { right: 2px; }
@media (pointer: coarse) { .tw-arrow { display: none; } .tw-tabs button { min-height: 34px; } }

@media (max-width: 420px) {
  .tw-av { width: 38px; height: 38px; }
  .tw-nm { font-size: 11.5px; }
  .tw-pos { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tw-p, .tw-nav button { transition: none; } .tw-p:not(:disabled):hover { transform: none; } }
