/* Matches list screen esports polish */
.sm-match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sm-match-panel {
  padding: 0;
  background: transparent;
  border: none;
}

.sm-match-segmented-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.sm-match-tabs {
  display: inline-flex;
  background: var(--surface-container-low, #1d1a10);
  border: 1px solid var(--outline-variant, #332b18);
  border-radius: var(--radius-md, 12px);
  padding: 3px;
  gap: 4px;
}

.sm-match-tabs button {
  padding: 6px 14px;
  border-radius: var(--radius-sm, 8px);
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface-variant, #a69c84);
  background: transparent;
  border: none;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.15s ease;
}

.sm-match-tabs button.on,
.sm-match-tabs button.active {
  background: var(--primary, #f6c445);
  color: var(--on-primary);
  font-weight: 700;
}

.sm-inbox-crosslink {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary, #f6c445);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
}

.sm-inbox-crosslink:hover {
  text-decoration: underline;
}

.sm-match-list {
  display: grid;
  gap: 14px;
}

.sm-match-card {
  display: block;
  width: 100%;
  text-align: left;
  padding: 18px;
  background: var(--surface-container-low, #1d1a10);
  border: 1px solid var(--outline-variant, #332b18);
  border-radius: var(--sm-radius-card, 14px);
  color: inherit;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.sm-match-card:hover {
  border-color: rgba(246, 196, 69, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.sm-match-card__main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.sm-match-card__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sm-match-card__title b {
  font-size: 16px;
  font-weight: 700;
  color: var(--on-surface, #fff);
  line-height: 1.3;
}

.sm-match-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--on-surface-variant, #a69c84);
}

.sm-match-card__result {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.sm-match-result-link {
  font-size: 12px;
  color: var(--primary, #f6c445);
  text-decoration: none;
  margin-left: auto;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.sm-match-result-link:hover {
  text-decoration: underline;
}

.sm-match-pagination {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

/* 1. Mobile Breakpoint (< 768px) */
@media (max-width: 767px) {
  .sm-match-card {
    padding: 14px;
  }
}

/* 2. Tablet Breakpoint (768px – 1049px) */
@media (min-width: 768px) and (max-width: 1049px) {
  .sm-match-card {
    padding: 18px;
  }
}

/* 3. Desktop Breakpoint (>= 1050px) */
@media (min-width: 1050px) {
  .sm-match-card {
    padding: 20px;
  }
}

/* ==========================================================================
   MODERN LAYER (v0.16) - Matches: date block, status accent, live countdown,
   press feedback and staggered entrance. Additive only.
   ========================================================================== */
.sm-match-card {
  position: relative; display: flex; align-items: center; gap: 14px; overflow: hidden;
  padding: 14px 16px 14px 14px; border-radius: 20px; -webkit-tap-highlight-color: transparent;
  background: var(--surface-container-low, #1d1a10);
  transition: transform .14s ease, border-color .16s ease, box-shadow .16s ease;
  animation: sm-match-rise .38s cubic-bezier(.2, .8, .2, 1) both;
}
.sm-match-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--primary, #f6c445); opacity: .85; }
.sm-match-card--live::before { background: var(--ok, #70e0ad); opacity: 1; }
.sm-match-card--completed::before { background: var(--on-surface-variant, #a69c84); opacity: .4; }
.sm-match-card--cancelled::before { background: var(--error, #ffb4ab); opacity: .6; }
.sm-match-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, .25); }
.sm-match-card:active { transform: scale(.985); }
.sm-match-card:focus-visible { outline: 3px solid var(--primary, #f6c445); outline-offset: 2px; }
.sm-match-card[data-i="1"] { animation-delay: 40ms; }
.sm-match-card[data-i="2"] { animation-delay: 80ms; }
.sm-match-card[data-i="3"] { animation-delay: 120ms; }
.sm-match-card[data-i="4"] { animation-delay: 160ms; }
.sm-match-card[data-i="5"] { animation-delay: 200ms; }
.sm-match-card[data-i="6"] { animation-delay: 240ms; }
.sm-match-card[data-i="7"] { animation-delay: 280ms; }
@keyframes sm-match-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.sm-match-date {
  flex: 0 0 auto; display: grid; place-items: center; align-content: center; gap: 0; width: 54px; height: 60px;
  border-radius: 14px; margin-left: 4px; text-align: center;
  background: color-mix(in srgb, var(--primary, #f6c445) 14%, var(--surface-container-high, #252216));
  border: 1px solid color-mix(in srgb, var(--primary, #f6c445) 30%, transparent);
}
.sm-match-date b { font-size: 1.35rem; line-height: 1.05; font-weight: 800; color: var(--primary, #f6c445); font-variant-numeric: tabular-nums; }
.sm-match-date span { font-size: .62rem; font-weight: 800; letter-spacing: .08em; color: var(--on-surface-variant, #a69c84); }
.sm-match-card__main { flex: 1 1 auto; min-width: 0; width: auto; }
.sm-match-card__title b { overflow-wrap: anywhere; }
.sm-match-chevron { flex: 0 0 auto; font-size: 1.5rem; color: var(--on-surface-variant); opacity: .5; transition: transform .18s ease, opacity .18s ease; }
.sm-match-card:hover .sm-match-chevron { transform: translateX(3px); opacity: .9; }

.sm-match-countdown {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 3px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--primary, #f6c445); background: color-mix(in srgb, var(--primary, #f6c445) 14%, transparent);
}
.sm-match-countdown.is-live { color: var(--ok, #70e0ad); background: color-mix(in srgb, var(--ok, #70e0ad) 16%, transparent); }

/* Tabs: sliding pill feel */
.sm-match-tabs { border-radius: 999px; padding: 4px; }
.sm-match-tabs button { border-radius: 999px; padding: 6px 16px; transition: background .2s ease, color .2s ease, transform .12s ease; }
.sm-match-tabs button:active { transform: scale(.94); }
.sm-match-tabs button.on, .sm-match-tabs button.active { box-shadow: 0 4px 14px color-mix(in srgb, var(--primary, #f6c445) 30%, transparent); }
.sm-match-segmented-row { position: sticky; top: -1px; z-index: 4; padding: 6px 0; background: color-mix(in srgb, var(--surface, #12110a) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

@media (min-width: 720px) { .sm-match-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 360px) { .sm-match-date { width: 46px; height: 54px; } .sm-match-card { gap: 10px; } }
@media (prefers-reduced-motion: reduce) {
  .sm-match-card { animation: none !important; transition: none !important; }
  .sm-live-dot { animation: none !important; }
}

/* Fixes found in browser review: keep the heading readable on phones */
@media (max-width: 767px) {
  .sm-screen__heading > .sm-match-actions { flex: 1 1 100%; }
  .sm-match-actions .btn { flex: 1 1 auto; }
}

/* ── v0.17 Match history ──────────────────────────────────────── */
.sm-history-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 12px; }
.sm-history-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px; border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--outline-variant, #414957) 55%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--primary, #f6c445) 10%, var(--surface-container, #171b23)), var(--surface-container, #171b23));
}
.sm-history-stat b { font-size: 1.2rem; font-variant-numeric: tabular-nums; color: var(--on-surface, #fff); }
.sm-history-stat small { font-size: .68rem; letter-spacing: .05em; text-transform: uppercase; color: var(--on-surface-variant, #aeb8c7); }
.sm-history-source { margin-bottom: 12px; }

.sm-history-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px;
  border-radius: 18px; cursor: pointer; border: 1px solid color-mix(in srgb, var(--outline-variant, #414957) 50%, transparent);
  background: color-mix(in srgb, var(--surface-container, #171b23) 88%, transparent);
  transition: transform .15s ease, border-color .2s ease, background .2s ease;
}
.sm-history-card + .sm-history-card { margin-top: 10px; }
.sm-history-card:hover { border-color: color-mix(in srgb, var(--primary, #f6c445) 45%, transparent); }
.sm-history-card:active { transform: scale(.985); }
.sm-history-card:focus-visible { outline: 2px solid var(--primary, #f6c445); outline-offset: 2px; }
.sm-history-rank {
  display: flex; flex-direction: column; align-items: center; justify-content: center; width: 56px; height: 56px;
  border-radius: 14px; background: color-mix(in srgb, var(--on-surface, #fff) 7%, transparent); color: var(--on-surface, #fff);
}
.sm-history-rank small { font-size: .56rem; letter-spacing: .08em; color: var(--on-surface-variant, #aeb8c7); }
.sm-history-rank b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.sm-history-rank.gold { background: linear-gradient(135deg, var(--primary, #f6c445), #ff9d2e); color: #1b1400; }
.sm-history-rank.gold small { color: rgba(27, 20, 0, .7); }
.sm-history-rank.top { background: color-mix(in srgb, var(--primary, #f6c445) 20%, transparent); color: var(--primary, #f6c445); }
.sm-history-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sm-history-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sm-history-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-history-main > small { color: var(--on-surface-variant, #aeb8c7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-history-kind { flex: none; font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.sm-history-kind--public { color: var(--primary, #f6c445); background: color-mix(in srgb, var(--primary, #f6c445) 14%, transparent); }
.sm-history-kind--practice { color: #7fd6ff; background: rgba(127, 214, 255, .14); }
:root[data-theme="light"] .sm-history-kind--practice { color: #0b5f8a; background: rgba(11, 95, 138, .12); }
.sm-history-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--on-surface-variant, #aeb8c7); }
.sm-history-stats b { color: var(--on-surface, #fff); font-variant-numeric: tabular-nums; }
.sm-history-stats time { margin-left: auto; }
@media (max-width: 360px) { .sm-history-summary { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { .sm-history-card { transition: none; } }
