/*
 * /tournaments/ list page. Same visual system as the tournament and match pages.
 * Every rule is scoped under .tlv.
 */

.tlv {
  --tlv-yellow: #FFDF00;
  --tlv-card: #171718;
  --tlv-inner: #111112;
  --tlv-text: #f4f4f6;
  --tlv-muted: #a8a8ad;
  --tlv-dim: #6e6e74;
  --tlv-line: rgba(255, 255, 255, .08);
  --tlv-red: #ff4655;
  --tlv-green: #59f18b;
  --tlv-ease: cubic-bezier(.16, 1, .3, 1);
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 0 56px;
  color: var(--tlv-text);
  container-type: inline-size;
  container-name: tlv;
}

.tlv *,
.tlv *::before,
.tlv *::after { box-sizing: border-box; }

.tlv-kicker { color: var(--tlv-yellow); font-size: .78rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }

.tlv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px; font: inherit; font-size: .92rem; font-weight: 800; text-decoration: none; white-space: nowrap; cursor: pointer; transition: transform .2s var(--tlv-ease), background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease; }
.tlv-btn--primary { background: var(--tlv-yellow); color: #111; }
.tlv-btn--primary:hover { color: #111; box-shadow: 0 10px 30px -8px rgba(255, 223, 0, .6); transform: translateY(-1px); }
.tlv-btn--soft { border-color: rgba(255, 223, 0, .5); background: rgba(255, 223, 0, .1); color: var(--tlv-yellow); }
.tlv-btn--soft:hover { background: rgba(255, 223, 0, .18); color: var(--tlv-yellow); }

.tlv-status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid var(--tlv-line); border-radius: 999px; background: rgba(0, 0, 0, .55); color: var(--tlv-muted); font-size: .68rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; backdrop-filter: blur(6px); }
.tlv-status--open { border-color: rgba(255, 223, 0, .55); color: var(--tlv-yellow); }
.tlv-status--check_in { border-style: dashed; border-color: rgba(255, 223, 0, .55); color: var(--tlv-yellow); }
.tlv-status--live { border-color: rgba(255, 70, 85, .55); color: #ff5a67; }
.tlv-status--live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tlv-red); box-shadow: 0 0 10px var(--tlv-red); animation: tlv-live 1.2s ease-in-out infinite; }
.tlv-status--completed { border-color: rgba(65, 218, 119, .5); color: var(--tlv-green); }
.tlv-status--cancelled { color: rgba(255, 255, 255, .4); text-decoration: line-through; }
.tlv-status--draft { border-style: dashed; }
@keyframes tlv-live { 50% { opacity: .2; } }

/* Hero */
.tlv-hero { --mx: 50%; --my: 50%; position: relative; isolation: isolate; overflow: hidden; padding: 32px; border: 1px solid var(--tlv-line); border-radius: 18px; background: var(--tlv-inner); }
.tlv-hero__art { position: absolute; inset: -30px; z-index: -4; display: grid; grid-template-columns: repeat(5, 1fr); filter: blur(5px) saturate(.85); opacity: .26; transform: scale(1.05); }
.tlv-hero__art span { background: var(--art) center / cover no-repeat; }
.tlv-hero__wash { position: absolute; inset: 0; z-index: -3; background: radial-gradient(60% 130% at 0% 30%, rgba(255, 223, 0, .2), transparent 60%), linear-gradient(180deg, rgba(17, 17, 18, .3), rgba(17, 17, 18, .94)); }
.tlv-hero__spot { position: absolute; inset: 0; z-index: -2; background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 223, 0, .08), transparent 60%); pointer-events: none; }
.tlv-hero__ghost { position: absolute; left: -10px; bottom: -8px; z-index: -1; color: transparent; font-size: clamp(70px, 12vw, 160px); font-weight: 900; line-height: .9; letter-spacing: -.03em; text-transform: uppercase; white-space: nowrap; -webkit-text-stroke: 1px rgba(255, 255, 255, .06); pointer-events: none; user-select: none; animation: tlv-ghost 34s linear infinite; }
@keyframes tlv-ghost { to { transform: translateX(-15%); } }
.tlv-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; }
.tlv-hero h1 { margin: 8px 0 10px; color: #fff; font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 900; line-height: 1; letter-spacing: -.02em; }
.tlv-hero p { margin: 0; max-width: 520px; color: var(--tlv-muted); font-size: 1.02rem; font-weight: 500; }

/* Filters */
.tlv-filters { position: sticky; top: 84px; z-index: 30; display: grid; gap: 10px; margin: 14px 0 0; padding: 10px; border: 1px solid var(--tlv-line); border-radius: 16px; background: rgba(23, 23, 24, .9); backdrop-filter: blur(12px); box-shadow: 0 12px 30px -18px rgba(0, 0, 0, .8); }
.tlv-filters__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.tlv-filters__spacer { flex: 1; }
.tlv-seg { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.tlv-seg a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border: 1px solid transparent; border-radius: 10px; color: var(--tlv-muted); font-size: .86rem; font-weight: 800; text-decoration: none; white-space: nowrap; transition: color .2s ease, background .2s ease, border-color .2s ease; }
.tlv-seg a:hover { background: rgba(255, 255, 255, .04); color: var(--tlv-text); }
.tlv-seg a.is-on { border-color: rgba(255, 223, 0, .5); background: rgba(255, 223, 0, .1); color: var(--tlv-yellow); }
.tlv-seg__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tlv-red); box-shadow: 0 0 8px var(--tlv-red); }

.tlv-game { position: relative; }
.tlv-game__toggle { display: inline-flex; align-items: center; gap: 8px; min-width: 190px; min-height: 42px; padding: 0 36px 0 12px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 10px; background: #09090a; color: var(--tlv-text); font: inherit; font-size: .9rem; font-weight: 700; text-align: left; }
.tlv-game__toggle > i { color: var(--tlv-yellow); }
.tlv-game__toggle::after { position: absolute; right: 14px; border-top-color: var(--tlv-yellow); }
.tlv-game__toggle:focus-visible { border-color: rgba(255, 223, 0, .6); outline: none; box-shadow: 0 0 0 3px rgba(255, 223, 0, .12); }
.tlv-game__menu { min-width: 100%; padding: 6px; border: 1px solid rgba(255, 223, 0, .3); border-radius: 12px; background: #141415; box-shadow: 0 18px 40px rgba(0, 0, 0, .55); }
.tlv-game__option { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--tlv-text); font-size: .88rem; font-weight: 700; }
.tlv-game__option:hover, .tlv-game__option:focus { background: rgba(255, 223, 0, .08); color: var(--tlv-text); }
.tlv-game__option.active, .tlv-game__option:active { background: rgba(255, 223, 0, .1); color: var(--tlv-yellow); }
.tlv-game__icon { display: grid; place-items: center; width: 20px; height: 20px; color: var(--tlv-yellow); }
.tlv-game__icon img { width: 20px; height: 20px; object-fit: contain; }

.tlv-region { position: relative; margin: 0; }
.tlv-region i { position: absolute; top: 50%; left: 12px; color: var(--tlv-yellow); transform: translateY(-50%); }
.tlv-region input { width: 150px; min-height: 42px; padding: 0 12px 0 34px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 10px; background: #09090a; color: var(--tlv-text); font: inherit; font-size: .9rem; font-weight: 600; }
.tlv-region input::placeholder { color: var(--tlv-dim); }
.tlv-region input:focus { border-color: rgba(255, 223, 0, .6); outline: none; box-shadow: 0 0 0 3px rgba(255, 223, 0, .12); }

.tlv-ad { margin-top: 14px; margin-bottom: 0; border-radius: 14px; }

.tlv-results { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 2px 12px; }
.tlv-results strong { color: #fff; font-size: 1.15rem; font-weight: 900; }
.tlv-results__clear { color: var(--tlv-muted); font-size: .82rem; font-weight: 800; text-decoration: none; }
.tlv-results__clear:hover { color: var(--tlv-yellow); }

/* Cards */
.tlv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.tlv-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--tlv-line); border-radius: 18px; background: var(--tlv-card); color: inherit; text-decoration: none; transition: border-color .25s ease, transform .35s var(--tlv-ease), box-shadow .35s ease; }
.tlv-card:hover { border-color: rgba(255, 223, 0, .4); color: inherit; transform: translateY(-4px); box-shadow: 0 30px 60px -40px rgba(255, 223, 0, .5); }
.tlv-card--live { border-color: rgba(255, 70, 85, .4); }
.tlv-card--live:hover { border-color: rgba(255, 70, 85, .7); box-shadow: 0 30px 60px -40px rgba(255, 70, 85, .7); }
.tlv-card--completed, .tlv-card--cancelled { opacity: .85; }

.tlv-card__art { position: relative; isolation: isolate; height: 118px; overflow: hidden; }
.tlv-card__art::before { content: ""; position: absolute; inset: -10px; z-index: -2; background: var(--art) center / cover no-repeat; filter: blur(1.5px) saturate(.9); transition: transform .6s var(--tlv-ease); }
.tlv-card__art.is-logo::before { background: var(--art) right -10px center / auto 150% no-repeat, radial-gradient(circle at 80% 40%, rgba(255, 223, 0, .1), transparent 65%), #141416; filter: grayscale(.35); opacity: .22; }
.tlv-card__art::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(23, 23, 24, .15), rgba(23, 23, 24, .95)); }
.tlv-card:hover .tlv-card__art::before { transform: scale(1.06); }
.tlv-card__art .tlv-status { position: absolute; top: 12px; left: 12px; }
.tlv-card__game { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--tlv-line); border-radius: 8px; background: rgba(0, 0, 0, .55); color: var(--tlv-text); font-size: .72rem; font-weight: 800; backdrop-filter: blur(6px); }
.tlv-card__game img { width: 16px; height: 16px; object-fit: contain; }

.tlv-card__body { position: relative; z-index: 1; display: grid; gap: 12px; margin-top: -38px; padding: 0 18px 16px; }
.tlv-card__identity { display: flex; align-items: flex-end; gap: 14px; }
.tlv-card__logo { display: grid; flex: 0 0 auto; place-items: center; width: 72px; height: 72px; border: 1px solid rgba(255, 223, 0, .35); border-radius: 16px; background: linear-gradient(145deg, #1d1d20, #0e0e10); box-shadow: 0 0 0 5px var(--tlv-card), 0 14px 30px -12px rgba(0, 0, 0, .8); }
.tlv-card__logo img { width: 78%; height: 78%; object-fit: contain; }
.tlv-card h2 { margin: 0 0 4px; color: #fff; font-size: 1.18rem; font-weight: 900; line-height: 1.1; overflow-wrap: anywhere; }
.tlv-card__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tlv-card__chips span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid var(--tlv-line); border-radius: 7px; background: var(--tlv-inner); color: var(--tlv-muted); font-size: .72rem; font-weight: 700; }
.tlv-card__chips i { color: var(--tlv-yellow); }

.tlv-card__facts { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 8px; }
.tlv-card__fact { display: grid; align-content: start; gap: 3px; min-width: 0; padding: 10px; border: 1px solid var(--tlv-line); border-radius: 10px; background: var(--tlv-inner); }
.tlv-card__fact small { color: var(--tlv-dim); font-size: .6rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.tlv-card__fact strong { overflow: hidden; color: #fff; font-size: .88rem; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.tlv-card__fact strong span { color: inherit; }
.tlv-card__fact em { color: var(--tlv-yellow); font-size: .7rem; font-style: normal; font-weight: 800; }
.tlv-card__fact em:empty { display: none; }
.tlv-card__fact em.is-dim { color: var(--tlv-dim); }
.tlv-card__fact--live em { color: #ff5a67; }
.tlv-fill { height: 5px; margin-top: 3px; overflow: hidden; border-radius: 99px; background: #222; }
.tlv-fill i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, rgba(255, 223, 0, .5), var(--tlv-yellow)); }
.tlv-fill.is-full i { background: linear-gradient(90deg, rgba(255, 70, 85, .5), var(--tlv-red)); }

.tlv-card__notice { display: -webkit-box; min-height: 2.3em; margin: 0; overflow: hidden; color: var(--tlv-dim); font-size: .8rem; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.tlv-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding: 12px 18px; border-top: 1px solid var(--tlv-line); background: #141415; }
.tlv-card__reg { display: inline-flex; align-items: center; gap: 7px; color: var(--tlv-muted); font-size: .82rem; font-weight: 800; }
.tlv-card__reg.is-open { color: var(--tlv-yellow); }
.tlv-card__open { display: inline-flex; align-items: center; gap: 6px; color: var(--tlv-text); font-size: .85rem; font-weight: 900; transition: gap .25s var(--tlv-ease), color .2s ease; }
.tlv-card:hover .tlv-card__open { gap: 10px; color: var(--tlv-yellow); }

/* Empty */
.tlv-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 10px; padding: 56px 20px; border: 1px dashed rgba(255, 255, 255, .12); border-radius: 18px; background: var(--tlv-card); text-align: center; }
.tlv-empty > i { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid rgba(255, 223, 0, .3); border-radius: 18px; background: rgba(255, 223, 0, .06); color: var(--tlv-yellow); font-size: 1.8rem; }
.tlv-empty h2 { margin: 6px 0 0; color: #fff; font-size: 1.4rem; font-weight: 900; }
.tlv-empty p { margin: 0; color: var(--tlv-muted); }
.tlv-empty .tlv-btn { margin-top: 8px; }

/* Pagination */
.tlv-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 26px; }
.tlv-pager a, .tlv-pager span { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 42px; height: 42px; padding: 0 14px; border: 1px solid var(--tlv-line); border-radius: 10px; background: var(--tlv-card); color: var(--tlv-muted); font-weight: 800; text-decoration: none; }
.tlv-pager a:hover { border-color: rgba(255, 223, 0, .4); color: var(--tlv-text); }
.tlv-pager .is-on { border-color: rgba(255, 223, 0, .5); background: rgba(255, 223, 0, .1); color: var(--tlv-yellow); }
.tlv-pager .is-disabled { opacity: .4; }

/* Entrance */
.tlv.is-animated .tlv-hero h1, .tlv.is-animated .tlv-hero p { animation: tlv-in-left .8s var(--tlv-ease) both; }
.tlv.is-animated .tlv-card { animation: tlv-rise .6s var(--tlv-ease) both; animation-delay: calc(.1s + var(--i, 0) * 70ms); }
@keyframes tlv-in-left { from { opacity: 0; transform: translateX(-40px); } }
@keyframes tlv-rise { from { opacity: 0; transform: translateY(16px); } }
@media (prefers-reduced-motion: reduce) { .tlv *, .tlv *::before, .tlv *::after { animation: none !important; transition: none !important; } }

@media (max-width: 960px) {
  .tlv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  .tlv { padding-top: 16px; }
  .tlv-hero { padding: 22px 16px; }
  .tlv-hero__grid { grid-template-columns: 1fr; }
  .tlv-filters { top: 8px; }
  .tlv-filters__row { display: grid; grid-template-columns: 1fr; }
  .tlv-seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tlv-seg a { flex: 0 0 auto; }
  .tlv-game, .tlv-game__toggle, .tlv-region, .tlv-region input { width: 100%; min-width: 0; }
  .tlv-region { display: block; }
  .tlv-filters__spacer { display: none; }
  .tlv-grid { grid-template-columns: 1fr; }
}

@container tlv (max-width: 900px) {
  .tlv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container tlv (max-width: 580px) {
  .tlv-grid { grid-template-columns: 1fr; }
}
