/*
 * The tournament card (templates/tournaments/components/tournament-card.html) and the grid of them (.bm-list): the
 * Tournaments page, the gallery, the maker page and the dashboards' carousels. Inside the tournaments pages
 * (.bm-page, css/tournaments.css) it takes their tokens; elsewhere the same values from here.
 */
.bm-list, .bm-item {
    --tc-surface: var(--surface, #ffffff);
    --tc-line: var(--line, #e1e6dc);
    --tc-ink: var(--ink, #17211a);
    --tc-stage: var(--stage, #e9f5db);
    --tc-accent: var(--accent, #54a300);
    --tc-accent-text: var(--accent-text, #3d7a00);
    --tc-muted: var(--muted, #6b746d);
    --tc-soft: var(--soft, #4d574f);
    --tc-shadow: var(--shadow, 0 1px 2px rgba(23, 33, 26, 0.05), 0 12px 32px -18px rgba(23, 33, 26, 0.25));
}
.bm-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.bm-item { height: 100%; font-family: 'Outfit', sans-serif; display: flex; align-items: stretch; border-radius: 18px; overflow: hidden; background: var(--tc-surface); border: 1px solid var(--tc-line); color: var(--tc-ink); text-decoration: none; transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
.bm-item:hover { transform: translateY(-2px); box-shadow: var(--tc-shadow); border-color: #d9edc2; color: var(--tc-ink); }
.bm-item:focus-visible { outline: 3px solid var(--tc-accent); outline-offset: 2px; }
/* The left column: the organiser's badge over the sport's picture, and a band saying where the tournament stands */
.bm-item__sport { width: 112px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--tc-stage); border-right: 1px solid var(--tc-line); color: var(--tc-accent-text); }
.bm-item__art { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px 10px; font-size: 34px; }
.bm-item__badge { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 11px; overflow: hidden; background: var(--tc-surface); box-shadow: 0 0 0 2px var(--tc-surface), 0 4px 10px -4px rgba(23, 33, 26, 0.35); color: var(--tc-accent-text); font-size: 17px; }
.bm-item__badge img { width: 100%; height: 100%; object-fit: cover; }
.bm-item__sport-img { width: 76px; height: 76px; object-fit: contain; transition: transform 200ms ease; }
.bm-item__badge + .bm-item__sport-img { width: 60px; height: 60px; }
.bm-item:hover .bm-item__sport-img { transform: scale(1.06); }
.bm-item__state { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 6px; font-size: 12px; font-weight: 700; line-height: 1.15; text-align: center; letter-spacing: 0.01em; }
.bm-item__state i { font-size: 11px; }
/* Sign-up open: the brand green (dark text on it), sign-up still to open: outlined, sign-up closed (no draw yet):
   neutral with a lock, drawn but nothing played: calm on the green column, in progress: ink with a live dot on a
   neutral column, finished: quiet */
.bm-item--signup { border-color: #c9e4a8; }
.bm-item--signup .bm-item__state { background: var(--tc-accent); color: var(--tc-ink); }
.bm-item--soon .bm-item__state { background: var(--tc-surface); color: var(--tc-accent-text); border-top: 1px dashed var(--tc-accent); }
.bm-item--closed .bm-item__sport { background: #f4f5f3; }
.bm-item--closed .bm-item__state { background: var(--tc-surface); color: var(--tc-soft); border-top: 1px solid var(--tc-line); }
.bm-item--ready .bm-item__state { background: var(--tc-surface); color: var(--tc-accent-text); border-top: 1px solid var(--tc-line); }
.bm-item--live .bm-item__sport { background: #f1f3ef; }
.bm-item--live .bm-item__state { background: var(--tc-ink); color: #ffffff; }
.bm-item__live-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: #ff6b5e; box-shadow: 0 0 0 0 rgba(255, 107, 94, 0.6); animation: bm-item-live 1.8s ease-out infinite; }
@keyframes bm-item-live { 0% { box-shadow: 0 0 0 0 rgba(255, 107, 94, 0.6); } 80%, 100% { box-shadow: 0 0 0 6px rgba(255, 107, 94, 0); } }
.bm-item--done .bm-item__sport { background: #f4f5f3; }
.bm-item--done .bm-item__state { background: var(--tc-line); color: var(--tc-soft); }
.bm-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; }
.bm-item__city { margin-top: -2px; font-size: 13px; font-weight: 600; color: var(--tc-muted); }
.bm-item h3 { font-size: 18px; line-height: 1.25; margin: 0; overflow-wrap: anywhere; font-weight: 650; letter-spacing: -0.02em; color: var(--tc-ink); }
.bm-item__meta { font-size: 14px; color: var(--tc-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.bm-item__format { display: inline-flex; align-items: center; padding: 3px 6px; border-radius: 8px; background: var(--tc-stage); color: var(--tc-accent-text); }
.bm-item__format svg { display: block; width: 50px; height: 20px; }
.bm-item__meta i { color: var(--tc-muted); }
.bm-item__champ { margin-top: 4px; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--tc-stage); font-size: 14px; font-weight: 700; color: var(--tc-accent-text); overflow-wrap: anywhere; }
.bm-item__progress { margin-top: 4px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--tc-muted); }
.bm-item__bar { display: block; height: 6px; border-radius: 999px; background: var(--tc-line); overflow: hidden; }
.bm-item__bar span { display: block; height: 100%; min-width: 6px; border-radius: inherit; background: var(--tc-accent); }
.bm-item__time { margin-top: auto; padding-top: 4px; font-size: 12.5px; color: var(--tc-muted); }
@media (max-width: 400px) {
    .bm-item__sport { width: 88px; }
    .bm-item__art { padding: 10px 8px; font-size: 26px; }
    .bm-item__sport-img { width: 56px; height: 56px; }
    .bm-item__badge + .bm-item__sport-img { width: 48px; height: 48px; }
    .bm-item__state { font-size: 11px; }
    .bm-item__body { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { .bm-item, .bm-item__sport-img { transition: none; } .bm-item:hover, .bm-item:hover .bm-item__sport-img { transform: none; } .bm-item__live-dot { animation: none; } }
.bm-item__org { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--tc-accent-text); margin: -2px 0 4px; }
.bm-item__signup { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--tc-accent-text); }
