/* EFLCASH tournament cards */
.t-grid,
.live-grid,
.tournament-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  background: transparent;
}

.tc-card {
  --tc-surface: rgba(9, 14, 24, 0.96);
  position: relative;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(180deg, rgba(18, 25, 39, 0.98), rgba(5, 8, 15, 0.98));
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
  isolation: isolate;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tc-card:hover {
  transform: translateY(-2px);
  border-color: rgba(204, 255, 0, 0.28);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.34);
}

.tc-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.tc-hero {
  position: relative;
  overflow: hidden;
  min-height: 230px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--tc-surface);
}

/* ===== Unified cover image layer (real <img>, not a CSS background) =====
   Rendered by assets/js/cover-image.js. Sits behind the readability scrim
   and the card content, which are explicitly z-index'd above it. Because
   it's a real <img>, a failed load is visible/catchable via onerror,
   instead of a CSS background-image silently disappearing. */
.tc-cover-img {
  display: block;
  object-fit: cover;
  object-position: center;
}

.tc-cover-img.tc-cover-fallback {
  object-fit: contain;
}

.tc-hero > .tc-cover-img,
.tc-card-banner .tc-banner-cover > .tc-cover-img,
.tc-row-thumb > .tc-cover-img,
.t-detail-hero > .tc-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.tc-hero > .tc-cover-img.tc-cover-fallback,
.tc-card-banner .tc-banner-cover > .tc-cover-img.tc-cover-fallback,
.t-detail-hero > .tc-cover-img.tc-cover-fallback {
  padding: 12%;
  background: var(--tc-surface);
}

.tc-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(180deg, rgba(4, 10, 19, 0.12) 0%, rgba(4, 10, 19, 0.18) 30%, rgba(4, 10, 19, 0.72) 72%, var(--tc-surface) 100%),
    linear-gradient(90deg, rgba(4, 10, 19, 0.72) 0%, rgba(4, 10, 19, 0.12) 55%, rgba(4, 10, 19, 0.05) 100%);
  pointer-events: none;
}

.tc-rails::before,
.tc-rails::after {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 999px;
  z-index: 0;
}

.tc-rails::before {
  left: 0;
  background: var(--danger);
  box-shadow: 0 0 22px rgba(255, 77, 77, 0.55);
}

.tc-rails::after {
  right: 0;
  background: var(--secondary);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.55);
}

.tc-badge-row,
.tc-title-wrap,
.tc-mark,
.tc-content,
.tc-action,
.tc-rails {
  position: relative;
  z-index: 2;
}

.tc-badge-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.tc-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 27px;
  max-width: 62%;
  padding: 0.26rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(2, 5, 11, 0.62);
  color: var(--text-soft);
  font-family: var(--font-ui);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(10px);
}

.tc-badge-row .tc-pill:last-child {
  max-width: 48%;
  justify-content: flex-end;
}

.tc-format-1v1 {
  color: var(--secondary);
  border-color: rgba(0, 229, 255, 0.46);
  background: rgba(0, 229, 255, 0.09);
}

.tc-format-ko {
  color: #ffb4c2;
  border-color: rgba(255, 77, 122, 0.5);
  background: rgba(255, 77, 122, 0.1);
}

.tc-format-group {
  color: #d8c8ff;
  border-color: rgba(167, 139, 250, 0.48);
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.12), rgba(0, 229, 255, 0.08));
}

.tc-status-live,
.tc-status-open {
  color: var(--primary);
  border-color: rgba(204, 255, 0, 0.45);
  background: rgba(204, 255, 0, 0.08);
}

.tc-status-upcoming {
  color: var(--secondary);
  border-color: rgba(0, 229, 255, 0.42);
  background: rgba(0, 229, 255, 0.08);
}

.tc-status-full,
.tc-status-paused {
  color: var(--warning);
  border-color: rgba(255, 176, 32, 0.45);
  background: rgba(255, 176, 32, 0.08);
}

.tc-status-completed {
  color: var(--text-soft);
  border-color: rgba(148, 163, 184, 0.32);
  background: rgba(148, 163, 184, 0.08);
}

.tc-status-cancelled {
  color: #ffb4b4;
  border-color: rgba(255, 77, 77, 0.48);
  background: rgba(255, 77, 77, 0.09);
}

.tc-mark {
  width: 44px;
  height: 44px;
  margin-left: auto;
  display: grid;
  place-items: center;
  color: var(--primary);
  border: 1px solid rgba(204, 255, 0, 0.28);
  border-radius: 8px;
  background: rgba(2, 5, 11, 0.48);
  box-shadow: var(--glow-primary);
  backdrop-filter: blur(10px);
}

.tc-title {
  display: -webkit-box;
  margin: 0 0 0.34rem;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.76);
}

.tc-host {
  margin: 0;
  color: rgba(229, 236, 248, 0.8);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
}

.tc-host strong {
  color: var(--secondary);
}

.tc-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  padding: 1rem;
  background:
    linear-gradient(180deg, var(--tc-surface), rgba(4, 8, 15, 0.98));
}

.tc-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(148, 163, 184, 0.12);
}

.tc-meta-item {
  min-width: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 0.48rem;
  padding: 0.68rem 0.55rem;
  background: rgba(255, 255, 255, 0.035);
}

.tc-meta-item i {
  width: 17px;
  flex: 0 0 auto;
  color: var(--primary);
  text-align: center;
}

.tc-meta-item strong,
.tc-meta-item span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tc-meta-item strong {
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 800;
}

.tc-meta-item span {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tc-finance {
  display: grid;
  grid-template-columns: 1fr 0.75fr;
  gap: 1px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(148, 163, 184, 0.1);
}

.tc-finance > div {
  min-width: 0;
  padding: 0.72rem 0;
  background: var(--tc-surface);
}

.tc-finance span,
.tc-funding {
  display: block;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tc-finance strong {
  display: block;
  margin-top: 0.18rem;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.tc-funding {
  margin-top: -0.55rem;
  color: var(--secondary);
}

.tc-capacity {
  margin-top: auto;
}

.tc-capacity-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.38rem;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tc-capacity-top strong {
  color: var(--primary);
}

.tc-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.tc-progress > div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--danger), var(--primary), var(--secondary));
  box-shadow: var(--glow-primary);
  transition: width 0.25s ease;
}

.tc-action {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: 4px;
  border: 1px solid rgba(204, 255, 0, 0.66);
  background: linear-gradient(90deg, rgba(204, 255, 0, 0.96), rgba(0, 229, 255, 0.86));
  color: #061006;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(204, 255, 0, 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.tc-action:hover {
  transform: translateY(-1px);
  box-shadow: var(--glow-primary), var(--glow-secondary);
}

.tc-action:disabled {
  color: var(--muted);
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: none;
  cursor: not-allowed;
}

.tc-action-pay {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.95), rgba(204, 255, 0, 0.88));
}

/* ===== Banner strip variant — standard browse grids (tournaments.html, my_tournaments.html) ===== */
.tc-card-banner {
  min-height: auto;
}

.tc-card-banner .tc-banner-cover {
  position: relative;
  overflow: hidden;
  height: 130px;
  background: var(--tc-surface);
}

.tc-card-banner .tc-banner-cover > .tc-cover-img {
  z-index: 0;
}

.tc-card-banner .tc-banner-cover > .tc-hero-scrim {
  z-index: 1;
  background-image: linear-gradient(180deg, rgba(4, 10, 19, 0) 55%, var(--tc-surface) 100%);
}

.tc-banner-status {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 2;
}

.tc-banner-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem 1.1rem 1.1rem;
  background: linear-gradient(180deg, var(--tc-surface), rgba(4, 8, 15, 0.98));
}

.tc-banner-format {
  color: var(--secondary);
  font-family: var(--font-ui);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tc-banner-title {
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.tc-banner-host {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.78rem;
}

.tc-banner-divider {
  height: 1px;
  background: rgba(148, 163, 184, 0.14);
}

.tc-banner-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-soft);
  font-family: var(--font-ui);
  font-size: 0.74rem;
}

.tc-banner-meta strong { color: #fff; }

.tc-banner-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.tc-banner-prize {
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 900;
}

.tc-banner-action {
  width: auto;
  min-height: 38px;
  flex: 0 0 auto;
  padding: 0 1rem;
  border-radius: 4px;
  border: 1px solid rgba(204, 255, 0, 0.66);
  background: linear-gradient(90deg, rgba(204, 255, 0, 0.96), rgba(0, 229, 255, 0.86));
  color: #061006;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tc-banner-action:disabled {
  color: var(--muted);
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.035);
  cursor: not-allowed;
}

/* ===== Compact row variant — dense lists (dashboard "My Tournaments" panel) ===== */
.tc-card-row {
  min-height: auto;
  flex-direction: row;
  align-items: center;
  gap: 0.9rem;
  padding: 0.6rem;
  border-radius: 8px;
}

.tc-row-thumb {
  position: relative;
  overflow: hidden;
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: var(--tc-surface);
}

.tc-row-thumb > .tc-cover-img {
  border-radius: 6px;
}

.tc-row-live-dot {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: var(--glow-primary);
}

.tc-row-mid {
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 0;
}

.tc-row-title {
  overflow: hidden;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tc-row-sub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  margin-top: 0.15rem;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tc-row-sub .dot {
  width: 3px;
  height: 3px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
}

.tc-row-right {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex: 0 0 auto;
}

.tc-row-prize { text-align: right; }

.tc-row-prize strong {
  display: block;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 900;
}

.tc-row-prize span {
  display: block;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tc-row-btn {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  cursor: pointer;
}

.tc-row-btn:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.t-detail-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: var(--tc-surface, #0b0f16);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.3);
}

.t-detail-hero > .tc-cover-img {
  position: absolute;
  z-index: 0;
}

.t-detail-hero > .tc-hero-scrim {
  position: absolute;
  z-index: 1;
  background-image:
    linear-gradient(180deg, rgba(4, 10, 19, 0.08) 0%, rgba(4, 10, 19, 0.24) 34%, rgba(4, 10, 19, 0.86) 100%),
    linear-gradient(90deg, rgba(4, 10, 19, 0.76), rgba(4, 10, 19, 0.08));
}

.t-detail-hero::before,
.t-detail-hero::after {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 999px;
}

.t-detail-hero::before {
  left: 0;
  background: var(--danger);
  box-shadow: 0 0 24px rgba(255, 77, 77, 0.55);
}

.t-detail-hero::after {
  right: 0;
  background: var(--secondary);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.55);
}

.t-detail-hero > * {
  position: relative;
  z-index: 1;
}

.t-detail-title {
  max-width: 820px;
  margin: 0.65rem 0 0.45rem;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.78);
  overflow-wrap: anywhere;
}

.t-detail-host {
  margin: 0 0 1.2rem;
  color: rgba(229, 236, 248, 0.82);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 700;
}

.t-detail-host strong {
  color: var(--secondary);
}

.t-detail-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.t-detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  margin-top: 1.2rem;
  border: 1px solid rgba(148, 163, 184, 0.13);
  background: rgba(148, 163, 184, 0.13);
}

.t-detail-meta .thm {
  min-height: 74px;
  display: grid;
  align-content: center;
  background: rgba(5, 8, 15, 0.62);
  backdrop-filter: blur(8px);
}

html[data-theme="light"] .tc-card,
html[data-theme="light"] .tc-content,
html[data-theme="light"] .tc-finance > div {
  --tc-surface: rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] .tc-title,
html[data-theme="light"] .t-detail-title {
  color: #fff;
}

html[data-theme="light"] .tc-meta-item {
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .tc-host,
html[data-theme="light"] .t-detail-host {
  color: rgba(235, 241, 250, 0.86);
}

@media (max-width: 760px) {
  .t-grid,
  .live-grid,
  .tournament-card-grid {
    grid-template-columns: 1fr;
  }

  .tc-card {
    min-height: 0;
  }

  .tc-hero {
    min-height: 210px;
  }

  .tc-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tc-finance {
    grid-template-columns: 1fr;
  }

  .tc-badge-row {
    align-items: stretch;
  }

  .tc-pill,
  .tc-badge-row .tc-pill:last-child {
    max-width: 50%;
  }

  .t-detail-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 390px) {
  .tc-hero {
    min-height: 198px;
    padding: 0.8rem;
  }

  .tc-content {
    padding: 0.85rem;
  }

  .tc-pill {
    font-size: 0.58rem;
    padding-inline: 0.5rem;
  }

  .tc-meta-item {
    min-height: 68px;
    padding-inline: 0.45rem;
  }

  .tc-title {
    font-size: 1rem;
  }
}