.tourney-shell {
  max-width: 960px;
  margin: 0 auto;
}

.tourney-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.tourney-head h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.tourney-head p {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
}

.tourney-head-actions {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.tourney-head-actions .btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.tourney-import-form {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
}

.tourney-import-form input {
  height: 38px;
  padding: 0 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  min-width: 200px;
  box-sizing: border-box;
}

.tourney-import-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.digit-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.digit-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.digit-tab b {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 15px;
  color: var(--ink);
}

.digit-tab i {
  font-style: normal;
  font-size: 11px;
}

.digit-tab:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.digit-tab.is-active {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--ink);
}

.digit-count {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10.5px;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
}

.digit-1 b { color: oklch(0.68 0.2 25); }
.digit-2 b { color: oklch(0.72 0.17 55); }
.digit-3 b { color: oklch(0.8 0.14 85); }
.digit-4 b { color: oklch(0.78 0.14 150); }
.digit-5 b { color: oklch(0.75 0.13 200); }
.digit-6 b { color: oklch(0.72 0.12 250); }
.digit-7 b { color: oklch(0.75 0.13 320); }

.digit-chip {
  font-size: 10.5px;
  font-weight: 650;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.digit-1 { border-color: oklch(0.6 0.18 25 / 0.6); color: oklch(0.72 0.18 25); }
.digit-2 { border-color: oklch(0.6 0.15 55 / 0.6); color: oklch(0.75 0.15 55); }
.digit-3 { border-color: oklch(0.55 0.13 85 / 0.6); color: oklch(0.82 0.13 85); }
.digit-4 { border-color: oklch(0.55 0.12 150 / 0.6); color: oklch(0.8 0.13 150); }
.digit-5 { border-color: oklch(0.55 0.12 200 / 0.6); color: oklch(0.78 0.12 200); }
.digit-6 { border-color: oklch(0.55 0.12 250 / 0.6); color: oklch(0.75 0.12 250); }
.digit-7 { border-color: oklch(0.55 0.12 320 / 0.6); color: oklch(0.78 0.12 320); }

.tourney-filter {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.tourney-filter input[type='search'] {
  flex: 1 1 200px;
  min-width: 0;
  height: 38px;
  padding: 0 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  box-sizing: border-box;
}

.tourney-filter input:focus {
  outline: none;
  border-color: var(--accent);
}

.tourney-filter select {
  flex: 0 0 auto;
  height: 38px;
  max-width: 150px;
  padding: 0 1.7rem 0 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  appearance: none;
  -webkit-appearance: none;
  color: var(--ink);
  color-scheme: dark;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  box-sizing: border-box;
}

.tourney-filter select:focus {
  outline: none;
  border-color: var(--accent);
}

.tourney-create select {
  height: 38px;
  padding: 0 1.7rem 0 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: var(--surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  appearance: none;
  -webkit-appearance: none;
  color: var(--ink);
  color-scheme: dark;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  box-sizing: border-box;
}

.tourney-filter .btn {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 1.1rem;
  display: inline-flex;
  align-items: center;
}

.pack-building {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: 2.5rem 1rem 2rem;
  max-width: 520px;
  margin: 0 auto;
}

.pack-building h1 {
  margin: 0;
  font-size: 20px;
}

.pack-building p {
  margin: 0;
  line-height: 1.5;
}

.pack-note {
  font-size: 12.5px;
  color: var(--faint);
}

.pack-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid var(--surface-2);
  border-top-color: var(--accent);
  animation: pack-spin 0.9s linear infinite;
}

@keyframes pack-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .pack-spinner { animation: none; }
}

.pool-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.7rem;
}

.pool-grid > li {
  display: flex;
  min-width: 0;
}

.pool-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  color: inherit;
  background: var(--surface);
  transition: border-color var(--dur) ease, transform var(--dur) ease,
    box-shadow var(--dur) ease;
}

.pool-card:hover {
  border-color: var(--accent);
  color: inherit;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px oklch(0 0 0 / 0.4);
}

.pool-cover {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
}

.pool-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, oklch(from var(--surface) l c h / 0.85) 100%);
  pointer-events: none;
}

.pool-cover-empty {
  background:
    repeating-linear-gradient(
      135deg,
      oklch(0.16 0.01 280) 0 10px,
      oklch(0.19 0.012 280) 10px 20px
    );
}

.lazy-cover {
  background-color: var(--surface-2);
}

.lazy-cover.is-loaded {
  background-color: transparent;
}

.lazy-cover.is-failed {
  background:
    repeating-linear-gradient(
      135deg,
      oklch(0.16 0.01 280) 0 10px,
      oklch(0.19 0.012 280) 10px 20px
    );
}

.pool-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.65rem 0.8rem 0.8rem;
}

.pool-card-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.pool-elo {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.pool-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.pool-card-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.pool-card-sub .dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: var(--faint);
  flex: 0 0 auto;
}

.pool-card-sub .pool-sr {
  color: oklch(0.82 0.14 85);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.pool-card-sub .pool-count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.pool-hero {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
  min-height: 170px;
  display: grid;
}

.pool-hero-cover {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.4);
}

.pool-hero-body {
  position: relative;
  z-index: 1;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  justify-content: flex-end;
  background: linear-gradient(180deg, oklch(0 0 0 / 0.1), oklch(0.09 0 0 / 0.75));
}

.pool-hero-body h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.pool-hero-tags {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}

.pool-avg {
  font-size: 12px;
  color: var(--muted);
}

.pool-hero-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.crumbs {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 0.7rem;
}

.crumbs a {
  color: var(--muted);
}

.crumbs a:hover {
  color: var(--accent);
}

.slot-chip {
  flex: 0 0 auto;
  min-width: 52px;
  text-align: center;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 600;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.slot-NM { color: var(--ink); }
.slot-HD { color: oklch(0.8 0.14 85); border-color: oklch(0.5 0.12 85 / 0.5); }
.slot-HR { color: oklch(0.72 0.16 25); border-color: oklch(0.5 0.14 25 / 0.5); }
.slot-DT { color: oklch(0.75 0.13 320); border-color: oklch(0.5 0.12 320 / 0.5); }
.slot-FM { color: oklch(0.78 0.13 150); border-color: oklch(0.5 0.12 150 / 0.5); }
.slot-TB { color: var(--accent); border-color: var(--accent); }

.tier-ladder {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tier-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.tier-quantum { color: oklch(0.72 0.16 320); border-color: oklch(0.5 0.14 320 / 0.6); }
.tier-cosmic { color: oklch(0.72 0.14 250); border-color: oklch(0.5 0.12 250 / 0.6); }
.tier-atomos { color: oklch(0.75 0.13 200); border-color: oklch(0.5 0.12 200 / 0.6); }
.tier-diamond { color: oklch(0.78 0.13 150); border-color: oklch(0.5 0.12 150 / 0.6); }
.tier-platinum { color: oklch(0.8 0.12 85); border-color: oklch(0.5 0.12 85 / 0.6); }
.tier-gold { color: oklch(0.78 0.13 55); border-color: oklch(0.5 0.12 55 / 0.6); }
.tier-silver { color: oklch(0.75 0.1 120); border-color: oklch(0.5 0.1 120 / 0.6); }
.tier-candidate { color: var(--muted); }

.tops-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tops-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid transparent;
  color: inherit;
  transition: background var(--dur) ease, border-color var(--dur) ease;
}

.tops-row:hover {
  background: var(--surface-2);
  border-color: var(--border);
  color: inherit;
  text-decoration: none;
}

.tops-rank {
  flex: 0 0 30px;
  text-align: right;
  font-size: 13px;
  color: var(--faint);
}

.tops-top1 .tops-rank { color: oklch(0.82 0.15 85); font-weight: 700; }
.tops-top2 .tops-rank { color: oklch(0.8 0.05 250); font-weight: 700; }
.tops-top3 .tops-rank { color: oklch(0.72 0.14 55); font-weight: 700; }

.tops-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.tops-elo {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
  flex: 0 0 auto;
}

.tops-elo b {
  font-size: 15px;
  color: var(--accent);
}

.tops-elo i {
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
}

.tops-titles {
  font-size: 11px;
  margin-left: 0.3rem;
}

.tops-list > li {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.tops-list .tops-row {
  flex: 1 1 auto;
  min-width: 0;
}

.tops-duel {
  flex: 0 0 auto;
}

.tops-duel .btn {
  height: 34px;
  width: 38px;
  padding: 0;
  font-size: 15px;
}

.duel-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.duel-row .search-row-main {
  flex: 1 1 auto;
}

.duel-actions {
  display: flex;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.duel-list {
  margin-bottom: 1.2rem;
}

.tourney-rules {
  margin-top: 0.6rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
  max-width: 640px;
}

.tourney-rules-label {
  display: block;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.15rem;
}

.tourney-rules p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink);
}

.tourney-panel {
  padding: 14px 16px;
}

.tourney-panel .panel-label {
  text-align: center;
  margin-bottom: 0.5rem;
}

.tourney-panel .tourney-recent {
  margin-top: 0.85rem;
  gap: 0.3rem;
}

.tourney-panel .tourney-duel-form {
  margin-top: 0.95rem;
}

.tourney-panel .streak-record {
  text-align: center;
}

.tourney-record {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.tourney-record-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

.tourney-record-line i {
  font-size: 10px;
  line-height: 1;
  color: var(--faint);
}

.tourney-record-line .tier-glyph-gold {
  color: oklch(0.82 0.15 85);
}

.tourney-wl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tourney-wl .is-win {
  color: oklch(0.82 0.16 150);
  font-weight: 600;
}

.tourney-wl .is-loss {
  color: oklch(0.72 0.17 20);
  font-weight: 600;
}

.tourney-panel .tier-name {
  color: var(--tier, var(--ink));
  font-weight: 600;
}

.tourney-panel .tourney-empty + .tourney-duel-form {
  margin-top: 1.05rem;
}

.tourney-panel .stats-list {
  margin-bottom: 0.6rem;
}

:where(.streak-display) {
  --tier: oklch(0.82 0.15 85);
}

.streak-fire.streak-fire--tourney {
  background: radial-gradient(circle at 30% 30%,
    oklch(from var(--tier) calc(l * 0.38) c h),
    oklch(from var(--tier) calc(l * 0.27) calc(c * 0.8) h),
    oklch(from var(--tier) calc(l * 0.22) calc(c * 0.6) h)
  );
  border-color: oklch(from var(--tier) calc(l * 0.68) calc(c * 0.9) h);
  color: var(--tier);
  box-shadow:
    0 0 15px oklch(from var(--tier) l c h / 0.4),
    inset 0 -8px 20px oklch(from var(--tier) l c h / 0.22);
  animation: none;
}

.tier-glyph {
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(0 0 4px currentColor);
}

.tier-quantum { --tier: oklch(0.8 0.2 340); }
.tier-cosmic { --tier: oklch(0.72 0.21 305); }
.tier-atomos { --tier: oklch(0.75 0.18 50); }
.tier-diamond { --tier: oklch(0.85 0.11 215); }
.tier-platinum { --tier: oklch(0.84 0.07 195); }
.tier-gold { --tier: oklch(0.83 0.15 88); }
.tier-silver { --tier: oklch(0.79 0.02 260); }
.tier-candidate { --tier: oklch(0.72 0.11 150); }
.tier-unranked { --tier: oklch(0.65 0.01 280); }

.tourney-record .dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: var(--faint);
  flex: 0 0 auto;
}

.tourney-wl .dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: var(--faint);
  flex: 0 0 auto;
  display: block;
}

.tourney-panel .tier-name {
  color: var(--tier, var(--ink));
}

.tourney-panel .streak-info,
.tourney-panel .streak-label,
.tourney-panel .streak-progress-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tourney-panel .streak-label,
.tourney-panel .streak-progress-text {
  white-space: normal;
}

.tourney-panel .streak-progress-bar {
  flex: 1 1 auto;
}

.tourney-panel .streak-record {
  gap: 4px 14px;
  line-height: 1.4;
}

.tourney-record-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
}

.tourney-record-line i {
  font-size: 11px;
  line-height: 1;
  color: oklch(0.82 0.15 85);
  flex: 0 0 auto;
}

.streak-progress-fill.streak-progress-fill--tourney {
  background: linear-gradient(90deg,
    oklch(from var(--tier) calc(l * 0.72) c h),
    oklch(from var(--tier) calc(l * 0.88) c h),
    var(--tier)
  );
  box-shadow:
    0 0 12px oklch(from var(--tier) l c h / 0.45),
    inset 0 1px 0 oklch(1 0 0 / 0.2);
}

.tourney-panel .empty {
  margin: 0.1rem 0 0.2rem;
}

.tourney-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.55rem 0 0.35rem;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.tourney-empty i {
  font-size: 19px;
  line-height: 1;
  color: var(--faint);
  flex: 0 0 auto;
  margin: 0;
}

.tourney-empty p {
  margin: 0;
  padding: 0;
}

.tourney-recent {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tourney-recent li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12.5px;
  min-width: 0;
}

.tourney-recent .matchup {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  min-width: 0;
}

.tourney-recent .matchup > .recent-pair {
  flex: 1 1 auto;
  min-width: 0;
}

.tourney-recent .tourney-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 11px;
  color: var(--faint);
  min-width: 0;
}

.tourney-recent li b {
  font-weight: 600;
}

.tourney-recent .mono.win { color: oklch(0.78 0.16 150); }
.tourney-recent .mono.loss { color: var(--faint); }

.tourney-versus {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.tourney-versus > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.tourney-versus > span.is-me {
  color: var(--ink);
  font-weight: 600;
}

.tourney-versus-sep {
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 11px;
}

.tourney-result {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.tourney-result i {
  font-size: 11px;
  line-height: 1;
}

.tourney-result--win {
  color: oklch(0.82 0.16 150);
  background: oklch(0.82 0.16 150 / 0.12);
  box-shadow: inset 0 0 0 1px oklch(0.82 0.16 150 / 0.28);
}

.tourney-result--loss {
  color: oklch(0.72 0.17 20);
  background: oklch(0.72 0.17 20 / 0.12);
  box-shadow: inset 0 0 0 1px oklch(0.72 0.17 20 / 0.28);
}

.tourney-result-score {
  font-variant-numeric: tabular-nums;
}

.tourney-recent-full {
  margin-top: 0;
}

.search-heading + .search-list,
.search-heading + .tourney-recent-full,
.duel-list + .search-heading,
.search-list + .search-heading {
  margin-top: 0;
}

.search-list + .search-heading,
.duel-list + .search-heading,
.notif-empty + .search-heading {
  margin-top: 1.5rem;
}

.search-heading + .search-list,
.search-heading + .tourney-recent-full {
  margin-top: 0;
}

.tourney-winner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: oklch(0.82 0.15 85);
  font-weight: 600;
}

.tourney-winner i {
  font-size: 10px;
  line-height: 1;
  flex: 0 0 auto;
}

.search-row-sub .tourney-winner {
  font-weight: 500;
}

.tourney-duel-form {
  display: flex;
  justify-content: center;
  margin-top: 0.95rem;
}

.tourney-duel-form .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

.tourney-duel-form .btn i {
  font-size: 13px;
}

.tourney-create {
  display: grid;
  grid-template-columns: 1.1fr 1.6fr 1.2fr auto auto;
  gap: 0.5rem;
  align-items: stretch;
  margin-bottom: 1rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.tourney-create input,
.tourney-create select {
  height: 38px;
  min-width: 0;
  padding: 0 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  box-sizing: border-box;
}

.tourney-create input:focus,
.tourney-create select:focus {
  outline: none;
  border-color: var(--accent);
}

.tourney-create .btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .tourney-create {
    grid-template-columns: 1fr 1fr;
  }

  .tourney-create input[name='description'] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .tourney-create {
    grid-template-columns: 1fr;
  }
}

.tourney-status {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.tourney-status-registration { color: oklch(0.8 0.13 150); border-color: oklch(0.5 0.12 150 / 0.5); }
.tourney-status-ongoing { color: oklch(0.82 0.14 85); border-color: oklch(0.5 0.12 85 / 0.5); }
.tourney-status-finished { color: var(--faint); }

.entry-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.entry-chip {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--ink);
}

.entry-chip:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.bracket {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  align-items: stretch;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.bracket-matches {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 0.5rem;
  min-width: 0;
}

.bracket-round .search-heading {
  margin: 0;
  min-height: 1em;
}

.match-card.is-bye {
  border-style: dashed;
  opacity: 0.75;
}

.match-bye {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem;
  font-size: 13px;
}

.match-bye .muted {
  font-size: 11.5px;
}

.match-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.match-card.is-decided {
  border-color: oklch(0.82 0.16 150 / 0.28);
}

.match-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  font-size: 13px;
}

.match-player + .match-player {
  border-top: 1px solid var(--border);
}

.match-player.is-winner {
  color: oklch(0.82 0.16 150);
  background: oklch(0.82 0.16 150 / 0.08);
  font-weight: 600;
}

.match-player:not(.is-winner) a {
  color: var(--muted);
}

.match-card.is-decided .match-player:not(.is-winner) {
  color: var(--faint);
}

.match-player .mono {
  font-size: 12px;
  color: var(--muted);
}

.match-report-box {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.match-report-box summary {
  padding: 0.4rem 0.65rem;
  font-size: 11.5px;
  color: var(--faint);
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.match-report-box summary::-webkit-details-marker {
  display: none;
}

.match-report-box summary::before {
  content: '› ';
  color: var(--faint);
}

.match-report-box[open] summary::before {
  content: '⌄ ';
}

.match-report-box summary:hover {
  color: var(--muted);
}

.match-report-box summary .mono {
  font-size: 11px;
}

.match-report {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0 0.5rem 0.55rem;
}

.match-report-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.match-report-scores label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-report-scores input[type='number'] {
  height: 32px;
  padding: 0 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  box-sizing: border-box;
}

.match-report-winners {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
}

.match-report button {
  min-width: 0;
  height: 34px;
  padding: 0 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-report button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.match-report button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 640px) {
  .tourney-create {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .tourney-head {
    flex-direction: column;
  }

  .tourney-import-form input {
    min-width: 0;
    flex: 1 1 auto;
  }

  .pool-grid {
    grid-template-columns: 1fr;
  }
}

.tourney-recent button.matchup {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
  cursor: default;
}

.tourney-recent .recent-match.has-maps > button.matchup {
  cursor: pointer;
}

.tourney-recent .recent-match.has-maps > button.matchup:hover .recent-name {
  color: var(--accent);
}

.recent-pair {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.recent-side {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
}

.recent-side:first-child {
  justify-content: flex-end;
}

.recent-side:last-child {
  justify-content: flex-start;
}

.recent-side.won {
  color: var(--ink);
  font-weight: 650;
}

.recent-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-crown {
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 1;
  color: oklch(0.82 0.15 85);
}

.recent-set {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  font-size: 11.5px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.recent-set .set-win {
  color: oklch(0.82 0.16 150);
  font-weight: 650;
}

.recent-set .set-lose {
  color: var(--faint);
}

.recent-set .dash,
.recent-map-score .dash {
  color: var(--faint);
}

.recent-caret {
  flex: 0 0 auto;
  opacity: 0.5;
  transition: transform 0.15s ease;
}

.recent-match.has-maps > .matchup[aria-expanded="true"] .recent-caret {
  transform: rotate(180deg);
}

.tourney-recent .tourney-name > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-maps {
  list-style: none;
  margin: 7px 0 1px;
  padding: 8px 0 0;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 2px;
}

.recent-maps[hidden] {
  display: none;
}

.tourney-recent .recent-maps > .recent-map {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
  min-width: 0;
  border-radius: 0;
  background: none;
  font-size: 11.5px;
}

.recent-map-mod {
  flex: 0 0 auto;
  width: 36px;
  padding: 1px 0;
  border-radius: 5px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.04em;
  text-align: center;
}

.recent-map-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--faint);
  font-size: 11.5px;
}

.recent-map-score {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}

.recent-map-score .side.win {
  color: oklch(0.82 0.16 150);
  font-weight: 650;
}

@media (prefers-reduced-motion: reduce) {
  .recent-caret {
    transition: none;
  }
}
