/* Mobile foundation primitives from design handoff T-60. */

.nd-card {
  background: var(--bg2);
  border: 2px solid var(--gray);
  border-radius: 4px;
  padding: 12px;
}

.nd-card--accent {
  border-color: var(--yellow);
  box-shadow: var(--glow-sm);
  background: linear-gradient(135deg, #1a1400 0%, var(--bg2) 60%);
}

.nd-eyebrow {
  font-family: var(--font-pixel);
  font-size: 6px;
  line-height: 1.6;
  letter-spacing: 0.12em;
  color: var(--yellow);
  text-shadow: var(--glow-sm);
}

.nd-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 7px;
  border: 1px solid var(--gray);
  border-radius: 999px;
  background: var(--bg2);
  color: var(--gray2);
  font-family: var(--font-pixel);
  font-size: 6px;
  line-height: 1.4;
}

.nd-chip--yellow {
  border-color: var(--yellow);
  background: rgba(255, 214, 0, 0.08);
  color: var(--yellow);
}

.nd-chip--green {
  border-color: var(--green);
  background: rgba(0, 255, 136, 0.08);
  color: var(--green);
}

.nd-chip--blue {
  border-color: var(--blue);
  background: rgba(68, 170, 255, 0.08);
  color: var(--blue);
}

.nd-chip--red {
  border-color: var(--red);
  background: rgba(255, 68, 85, 0.08);
  color: var(--red);
}

.nd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  border: 2px solid var(--yellow);
  border-radius: 4px;
  background: var(--bg2);
  color: var(--yellow);
  box-shadow: var(--glow-sm);
  font-family: var(--font-pixel);
  font-size: 7px;
  line-height: 1.4;
  text-decoration: none;
}

.nd-btn--primary {
  background: var(--yellow);
  color: #000;
}

.nd-btn--ghost {
  background: transparent;
  box-shadow: none;
}

.nd-btn--danger {
  border-color: var(--red);
  color: var(--red);
  box-shadow: var(--glow-red);
}

.nd-btn--green {
  border-color: var(--green);
  color: var(--green);
  box-shadow: var(--glow-green);
}

.nd-btn--sm {
  padding: 6px 8px;
  font-size: 6.5px;
}

.nd-segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  overflow: hidden;
  border: 2px solid var(--gray);
  border-radius: 4px;
}

.nd-segmented > * {
  border: none;
  border-right: 1px solid var(--gray);
  background: transparent;
  color: var(--gray2);
  padding: 9px 6px;
  font-family: var(--font-pixel);
  font-size: 7px;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

.nd-segmented > *:last-child {
  border-right: none;
}

.nd-segmented > *.is-active,
.nd-segmented > *[aria-pressed="true"] {
  background: var(--bg2);
  color: var(--yellow);
  box-shadow: inset 0 0 0 2px var(--yellow);
}

.nd-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 2px solid var(--gray);
  border-radius: 4px;
  background: var(--bg2);
}

.nd-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
}

.nd-page-header__copy {
  min-width: 0;
}

.nd-page-header__title {
  font-family: var(--font-pixel);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  color: var(--yellow);
  text-shadow: var(--glow-sm);
}

.nd-page-header__sub {
  margin-top: 2px;
  font-family: var(--font-pixel);
  font-size: 6px;
  line-height: 1.6;
  color: var(--gray2);
}

.nd-notif-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 45;
}

.nd-notif {
  position: relative;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: calc(100vh - 180px);
  background: var(--bg2);
  border: 2px solid var(--yellow);
  border-radius: 4px;
  box-shadow: var(--glow-md);
}

.nd-notif__head,
.nd-lk-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nd-notif__head {
  padding: 12px 14px;
  border-bottom: 2px solid var(--gray);
}

.nd-notif__title,
.nd-lk-section__title {
  font-family: var(--font-pixel);
  color: var(--yellow);
  text-shadow: var(--glow-sm);
}

.nd-notif__title {
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.08em;
}

.nd-notif__mark {
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  color: var(--gray2);
  font-family: var(--font-pixel);
  font-size: 6px;
}

.nd-notif__list,
.nd-lk-section__body {
  display: grid;
  gap: 8px;
}

.nd-notif__list {
  overflow-y: auto;
  padding: 8px;
}

.nd-notif-item {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #171200, var(--bg2));
  border: 2px solid var(--gray);
  border-radius: 4px;
}

.nd-notif-item--unread {
  border-color: var(--yellow);
  box-shadow: var(--glow-sm);
}

.nd-notif-item__head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nd-notif-item__icon {
  font-size: 16px;
  line-height: 1;
}

.nd-notif-item__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 8px;
  line-height: 1.6;
  color: var(--text);
}

.nd-notif-item__time {
  font-family: var(--font-pixel);
  font-size: 6px;
  line-height: 1.4;
  color: var(--gray2);
  white-space: nowrap;
}

.nd-notif-item__body {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 7px;
  line-height: 1.8;
  color: var(--gray2);
}

.nd-notif-item__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nd-notif-btn {
  padding: 6px 10px;
  font-family: var(--font-pixel);
  font-size: 7px;
  line-height: 1.4;
}

.nd-notif-btn--ghost {
  background: transparent;
  color: var(--yellow);
}

.nd-notif__empty {
  padding: 20px 14px;
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 7px;
  line-height: 1.8;
  color: var(--gray2);
}

.nd-rating-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nd-rating-head__title {
  white-space: nowrap;
}

.nd-rating-head__tabs {
  margin-left: auto;
  display: flex;
  border: 2px solid var(--gray);
  border-radius: 4px;
  overflow: hidden;
}

.nd-rating-head__tabs button:last-child {
  border-right: none;
}

.nd-month-bar {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.nd-month-bar__nav {
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
}

.nd-month-bar__nav:disabled {
  opacity: 0.3;
  box-shadow: none;
}

.nd-month-bar__label {
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 9px;
  line-height: 1.5;
  color: var(--yellow);
  text-shadow: var(--glow-sm);
}

.nd-month-bar__sub {
  margin-top: 2px;
  text-align: center;
}

.nd-ldr {
  display: grid;
  gap: 6px;
}

.nd-row__meta {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.nd-row__score {
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1.2;
  color: var(--yellow);
  text-shadow: var(--glow-sm);
}

.nd-row__streak {
  font-family: var(--font-pixel);
  font-size: 6px;
  line-height: 1.2;
  color: #ff6600;
}

.nd-tour-list,
.nd-h2h-pick-wrap,
.nd-h2h-list,
.nd-about-copy,
.nd-tab-panel {
  display: grid;
  gap: 10px;
}

.nd-tour-card--active {
  border-color: var(--yellow);
  box-shadow: var(--glow-sm);
  background: linear-gradient(135deg, #1a1400, var(--bg2));
}

.nd-tour-card__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.nd-tour-card__actions form,
.nd-tour-card__actions .nd-btn,
.nd-tour-card__actions button {
  width: 100%;
}

.nd-tour-card__actions--single {
  grid-template-columns: 1fr;
}

.nd-h2h-pick {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 6px;
  align-items: center;
  padding: 6px;
  background: var(--bg2);
  border: 2px solid var(--gray);
  border-radius: 4px;
}

.nd-h2h-pick select {
  width: 100%;
  padding: 6px 4px;
  border: 1px solid var(--gray);
  border-radius: 4px;
  background: var(--bg3);
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 7px;
}

.nd-h2h-pick .vs {
  font-family: var(--font-pixel);
  font-size: 10px;
  line-height: 1;
  color: var(--yellow);
  text-shadow: var(--glow-sm);
}

.nd-h2h-submit {
  width: 100%;
}

.nd-h2h-hero {
  display: grid;
  grid-template-columns: 1fr 56px 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: var(--bg2);
  border: 2px solid var(--gray);
  border-radius: 4px;
}

.nd-h2h-hero__side {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.nd-h2h-hero__avatar {
  width: 48px;
  height: 48px;
  border: 2px solid var(--yellow);
  border-radius: 4px;
  background: linear-gradient(135deg, #2a2000, #4a3800);
  box-shadow: var(--glow-sm);
  object-fit: cover;
}

.nd-h2h-hero__avatar--blue {
  border-color: var(--blue);
  background: linear-gradient(135deg, #003a66, #0a5099);
  box-shadow: 0 0 10px rgba(68, 170, 255, 0.22);
}

.nd-h2h-hero__name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-pixel);
  font-size: 8px;
  line-height: 1.5;
  color: var(--text);
}

.nd-h2h-hero__side:first-child .nd-h2h-hero__name {
  color: var(--yellow);
  text-shadow: var(--glow-sm);
}

.nd-h2h-hero__side:last-child .nd-h2h-hero__name {
  color: var(--blue);
  text-shadow: 0 0 6px rgba(68, 170, 255, 0.4);
}

.nd-h2h-hero__score {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.nd-h2h-hero__score-val {
  font-family: var(--font-pixel);
  font-size: 14px;
  line-height: 1;
  color: var(--yellow);
  text-shadow: var(--glow-md);
}

.nd-h2h-hero__score-lbl {
  font-family: var(--font-pixel);
  font-size: 5px;
  line-height: 1.4;
  color: var(--gray2);
  letter-spacing: 0.08em;
}

.nd-cmp {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg2);
  border: 2px solid var(--gray);
  border-radius: 4px;
}

.nd-cmp__head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.nd-cmp__label {
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 6px;
  line-height: 1.4;
  color: var(--gray2);
  letter-spacing: 0.08em;
}

.nd-cmp__val {
  font-family: var(--font-pixel);
  font-size: 9px;
  line-height: 1.4;
}

.nd-cmp__val--a {
  color: var(--yellow);
  text-align: left;
  text-shadow: var(--glow-sm);
}

.nd-cmp__val--b {
  color: var(--blue);
  text-align: right;
  text-shadow: 0 0 6px rgba(68, 170, 255, 0.4);
}

.nd-cmp__bar {
  display: flex;
  position: relative;
  height: 16px;
  overflow: hidden;
  background: var(--bg3);
  border: 2px solid var(--gray);
  border-radius: 999px;
}

.nd-cmp__bar--hero {
  width: 100%;
}

.nd-cmp__bar-a,
.nd-cmp__bar-b {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.nd-cmp__bar-a {
  background: linear-gradient(90deg, var(--yellow), #ffe867);
  box-shadow: 0 0 6px rgba(255, 214, 0, 0.4);
}

.nd-cmp__bar-b {
  justify-content: flex-end;
  background: linear-gradient(90deg, #86c7ff, var(--blue));
  box-shadow: 0 0 6px rgba(68, 170, 255, 0.4);
}

.nd-cmp__bar-inpct {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  white-space: nowrap;
  font-family: var(--font-pixel);
  font-size: 7px;
  line-height: 1;
}

.nd-cmp__bar-inpct--a {
  padding-left: 6px;
  color: #000;
}

.nd-cmp__bar-inpct--b {
  padding-right: 6px;
  color: #fff;
}

.nd-cmp__pct-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.nd-cmp__pct-row--hero {
  width: 100%;
}

.nd-cmp__bar-pct {
  min-width: 1px;
  font-family: var(--font-pixel);
  font-size: 7px;
  line-height: 1.4;
}

.nd-cmp__bar-pct--a {
  color: var(--yellow);
}

.nd-cmp__bar-pct--b {
  color: var(--blue);
}

.nd-cmp__dominance {
  font-family: var(--font-pixel);
  font-size: 7px;
  line-height: 1.4;
  color: var(--text);
  text-align: center;
  letter-spacing: 0.08em;
}

.nd-cmp__dominance--yellow {
  color: var(--yellow);
}

.nd-cmp__dominance--blue {
  color: var(--blue);
}

.nd-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.nd-group {
  min-width: 0;
}

.nd-group-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.nd-group-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
  font-size: 11px;
}

.nd-group-table th,
.nd-group-table td {
  padding: 7px 6px;
  text-align: left;
}

.nd-group-table th {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: var(--gray2);
}

.nd-group-table tbody tr {
  background: var(--bg2);
  outline: 1px solid var(--gray);
}

.nd-group-table tbody tr.nd-group-table__qualifier {
  outline: 2px solid var(--green);
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.2);
}

.nd-group-matches {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.nd-group-match {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 7px;
  background: var(--bg2);
  border: 1px solid var(--gray);
  border-radius: 4px;
}

.nd-group-match--played {
  border-color: color-mix(in srgb, var(--green) 45%, var(--gray));
}

.nd-group-match__number {
  color: var(--gray2);
  font-size: 9px;
}

.nd-group-match__player {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  font: inherit;
}

button.nd-group-match__player {
  color: var(--yellow);
  cursor: pointer;
  text-decoration: underline;
}

.nd-group-match__player--right {
  text-align: right;
}

.nd-group-match__score {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--yellow);
}

.nd-group-result-types {
  display: grid;
  gap: 8px;
}

.nd-group-result-types .pixel-btn {
  width: 100%;
}

@media (max-width: 760px) {
  .nd-groups {
    grid-template-columns: minmax(0, 1fr);
  }

  .nd-group-match {
    grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .nd-group-match form,
  .nd-group-match .bracket-match__game-link {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

.nd-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.nd-stat {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  background: var(--bg2);
  border: 2px solid var(--gray);
  border-radius: 4px;
}

.nd-stat__val {
  font-family: var(--font-pixel);
  font-size: 14px;
  line-height: 1;
  color: var(--yellow);
  text-shadow: var(--glow-sm);
}

.nd-stat__val--green {
  color: var(--green);
  text-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
}

.nd-stat__val--blue {
  color: var(--blue);
  text-shadow: 0 0 6px rgba(68, 170, 255, 0.4);
}

.nd-stat__val--red {
  color: var(--red);
  text-shadow: var(--glow-red);
}

.nd-stat__lbl {
  font-family: var(--font-pixel);
  font-size: 6px;
  line-height: 1.4;
  color: var(--gray2);
  letter-spacing: 0.06em;
}

.nd-stat__sub {
  font-family: var(--font-pixel);
  font-size: 5px;
  line-height: 1.6;
  color: var(--gray2);
}

.nd-lk-hero {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg2);
  border: 2px solid var(--gray);
  border-radius: 4px;
}

.nd-lk-hero__avatar {
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 2px solid var(--yellow);
  border-radius: 4px;
  box-shadow: var(--glow-sm);
}

.nd-lk-hero__main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.nd-lk-hero__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-pixel);
  font-size: 11px;
  line-height: 1.3;
  color: var(--yellow);
  text-shadow: var(--glow-sm);
}

.nd-lk-hero__row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nd-lk-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 6px;
  border: 2px solid transparent;
  border-radius: 4px;
  font-family: var(--font-pixel);
  font-size: 6px;
  line-height: 1.4;
}

.nd-lk-badge--admin {
  background: #2a0006;
  border-color: var(--red);
  color: var(--red);
}

.nd-lk-badge--stuff {
  background: #1f1700;
  border-color: var(--yellow);
  color: var(--yellow);
}

.nd-lk-badge--gamer {
  background: var(--bg3);
  border-color: var(--gray);
  color: var(--text);
}

.nd-lk-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.nd-lk-action {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 4px;
  background: var(--bg2);
  border: 2px solid var(--gray);
  border-radius: 4px;
  color: var(--text);
  text-decoration: none;
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 5px;
  line-height: 1.4;
}

.nd-lk-action__icon {
  font-size: 16px;
  line-height: 1;
}

.nd-lk-action:hover,
.nd-notif__mark:hover {
  color: var(--yellow);
  border-color: var(--yellow);
  box-shadow: var(--glow-sm);
}

.tournament-trophies--profile {
  margin-bottom: 8px;
  padding: 10px;
}

.tournament-trophies__head {
  flex-wrap: wrap;
}

.tournament-trophies__grid {
  grid-template-columns: 1fr;
}

.tournament-trophy {
  grid-template-columns: 32px minmax(0, 1fr);
  padding: 8px;
}

.tournament-trophy__icon {
  width: 32px;
  height: 32px;
  font-size: 18px;
}

.tournament-trophy__name {
  font-size: 7px;
}

.nd-ach {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--bg3);
  border: 1px solid var(--gray);
  border-radius: 4px;
}

.nd-ach--unlocked {
  border-color: var(--yellow);
  background: rgba(255, 214, 0, 0.04);
}

.nd-ach__icon {
  font-size: 18px;
  line-height: 1;
  text-align: center;
}

.nd-ach__name {
  margin-bottom: 2px;
  font-family: var(--font-pixel);
  font-size: 7px;
  line-height: 1.5;
  color: var(--text);
}

.nd-ach__cond {
  font-family: var(--font-pixel);
  font-size: 5px;
  line-height: 1.6;
  color: var(--gray2);
}

.nd-ach__progress {
  font-family: var(--font-pixel);
  font-size: 6px;
  line-height: 1.4;
  color: var(--yellow);
}

/* ===== Tournament bracket canvas ===== */
.nd-bracket-wrap {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg2);
  border: 2px solid var(--gray);
  border-radius: 4px;
}

.nd-bracket-toolbar {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  display: flex;
  gap: 4px;
  align-items: center;
}

.nd-bracket-toolbar button {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 2px solid var(--yellow);
  border-radius: 4px;
  background: var(--bg3);
  color: var(--yellow);
  box-shadow: var(--glow-sm);
  font-family: var(--font-pixel);
  font-size: 11px;
  line-height: 1;
}

.nd-bracket-toolbar .zoom-val {
  min-width: 38px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  border: 2px solid var(--gray);
  border-radius: 4px;
  background: var(--bg3);
  color: var(--yellow);
  font-family: var(--font-pixel);
  font-size: 7px;
  line-height: 1.4;
}

.nd-bracket-scroll {
  overflow: auto;
  padding: 32px 8px 8px;
  max-height: min(78vh, 560px);
  min-height: 260px;
  scrollbar-width: thin;
  scrollbar-color: var(--yellow) transparent;
}

.nd-bracket-scroll::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.nd-bracket-scroll::-webkit-scrollbar-thumb {
  background: var(--yellow);
}

.nd-bracket {
  position: relative;
  transform-origin: 0 0;
  transition: transform 0.15s ease;
}

.nd-bracket svg.connectors {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.nd-bracket__connector {
  fill: none;
  stroke: var(--yellow);
  stroke-width: 1.5;
  opacity: 0.55;
}

.nd-bracket__connector--third_place {
  stroke: var(--blue);
  opacity: 0.45;
}

.nd-match {
  position: absolute;
  width: 130px;
  display: grid;
  gap: 3px;
  padding: 5px;
  border: 2px solid var(--gray);
  border-radius: 4px;
  background: var(--bg3);
  z-index: 1;
}

.nd-match--final {
  border-color: var(--yellow);
  box-shadow: var(--glow-sm);
  background: linear-gradient(135deg, #1a1400, var(--bg2));
}

.nd-match--third-place {
  border-color: var(--blue);
  box-shadow: 0 0 10px rgba(68, 170, 255, 0.22);
}

.nd-match__head,
.nd-match__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-family: var(--font-pixel);
  font-size: 5px;
  line-height: 1.4;
  color: var(--gray2);
}

.nd-match__head span:first-child,
.nd-match__foot span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nd-match__head {
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nd-match__slot {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 4px 5px;
  border: 1px solid var(--gray);
  border-radius: 3px;
  background: var(--bg2);
  color: var(--text);
  text-align: left;
}

.nd-match__slot--action {
  cursor: pointer;
}

.nd-match__slot--action:hover,
.nd-match__slot--action:focus-visible {
  border-color: var(--yellow);
  box-shadow: var(--glow-sm);
  outline: none;
}

.nd-match__slot--win {
  border-color: var(--green);
  background: rgba(0, 255, 136, 0.06);
}

.nd-match__slot--lose {
  border-color: rgba(255, 68, 85, 0.4);
  background: rgba(255, 68, 85, 0.04);
  opacity: 0.82;
}

.nd-match__slot--empty {
  opacity: 0.5;
}

.nd-match__player {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-family: var(--font-pixel);
  font-size: 6px;
  line-height: 1.3;
  color: var(--text);
}

.nd-match__player .seed {
  flex: 0 0 auto;
  font-size: 5px;
  color: var(--gray2);
}

.nd-match__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.nd-match__name:hover {
  color: var(--yellow);
}

.nd-match__name--win {
  color: var(--green);
}

.nd-match__guest {
  flex: 0 0 auto;
  padding: 1px 3px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  background: rgba(68, 170, 255, 0.08);
  color: var(--blue);
  font-family: var(--font-pixel);
  font-size: 4px;
  line-height: 1.4;
}

.nd-match__score {
  flex: 0 0 auto;
  color: var(--yellow);
  font-family: var(--font-pixel);
  font-size: 7px;
  line-height: 1;
}

.nd-match__foot {
  padding-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nd-match__link {
  color: var(--blue);
}

.nd-match__link:hover {
  color: var(--yellow);
  text-shadow: var(--glow-sm);
}

.nd-tournament-detail-page {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.nd-tournament-detail-page,
.nd-tournament-detail-page .nd-page-header,
.nd-tournament-detail-page .tournament-hero,
.nd-tournament-detail-page .tournament-hero__copy,
.nd-tournament-detail-page .tournament-hero__stats,
.nd-tournament-detail-page .tournament-podium,
.nd-tournament-detail-page .nd-tournament-tabs,
.nd-tournament-detail-page .nd-tab-panel,
.nd-tournament-detail-page #tournament-bracket-shell,
.nd-tournament-detail-page .tournament-participants,
.nd-tournament-detail-page .nd-about-copy {
  min-width: 0;
  max-width: 100%;
}

.nd-tournament-detail-page .page-header__actions,
.nd-tournament-detail-page .tournament-manage__actions,
.nd-tournament-detail-page .tournament-podium__person {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
}

.nd-tournament-detail-page .page-header__actions {
  gap: 8px;
}

.nd-tournament-detail-page .pixel-btn,
.nd-tournament-detail-page .nd-btn {
  max-width: 100%;
  white-space: normal;
}

.nd-tournament-detail-page .hero-copy,
.nd-tournament-detail-page .section-sub,
.nd-tournament-detail-page .tournament-podium__series,
.nd-tournament-detail-page .tournament-participants__identity {
  overflow-wrap: anywhere;
}

.nd-tournament-detail-page #tournament-bracket-shell {
  overflow: hidden;
}

.nd-tournament-detail-page .nd-bracket-wrap {
  width: 100%;
  max-width: 100%;
}

.nd-tournament-detail-page .nd-bracket-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  place-items: start;
}

.nd-match--editable {
  padding-top: 20px;
}

.nd-match__tools {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 3;
  display: flex;
  gap: 3px;
}

.nd-match__tool {
  width: 18px;
  height: 18px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--yellow);
  border-radius: 3px;
  background: rgba(17, 17, 17, 0.92);
  color: var(--yellow);
  font-size: 10px;
  line-height: 1;
}

.nd-match__tool:hover,
.nd-match__tool:focus-visible {
  box-shadow: var(--glow-sm);
  outline: none;
}

.tournament-lifecycle {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.tournament-lifecycle__title {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 7px;
  line-height: 1.8;
  color: var(--yellow);
}

.nd-manage-dialog {
  width: min(92vw, 420px);
  max-height: min(82vh, 620px);
  overflow: auto;
  border: 2px solid var(--yellow);
  border-radius: 4px;
  background: var(--bg2);
  color: var(--text);
  box-shadow: var(--glow-md);
  padding: 12px;
}

.nd-manage-dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.nd-manage-dialog--sheet {
  margin: auto auto 0;
  border-radius: 4px 4px 0 0;
}

.nd-manage-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray);
}

.nd-manage-dialog__title,
.nd-manage-dialog__sub {
  margin: 0;
  font-family: var(--font-pixel);
}

.nd-manage-dialog__title {
  color: var(--yellow);
  font-size: 9px;
  line-height: 1.5;
  text-shadow: var(--glow-sm);
}

.nd-manage-dialog__sub {
  margin-top: 4px;
  color: var(--gray2);
  font-size: 6px;
  line-height: 1.6;
}

.nd-manage-dialog__close {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 2px solid var(--gray);
  border-radius: 4px;
  background: var(--bg3);
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 12px;
}

.nd-result-grid,
.nd-dialog-form,
.nd-series-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.nd-result-choice {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 2px solid var(--gray);
  border-radius: 4px;
  background: var(--bg3);
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 7px;
  line-height: 1.5;
  text-align: left;
}

.nd-result-choice:hover,
.nd-result-choice:focus-visible {
  border-color: var(--yellow);
  box-shadow: var(--glow-sm);
  outline: none;
}

.nd-result-choice__icon {
  font-size: 16px;
  line-height: 1;
  text-align: center;
}

.nd-dialog-form--danger {
  padding-top: 10px;
  border-top: 1px solid var(--gray);
}

.nd-series-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--gray);
  border-radius: 4px;
  background: var(--bg3);
}

.nd-series-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  font-family: var(--font-pixel);
  font-size: 6px;
  line-height: 1.7;
  color: var(--gray2);
}

.nd-series-row__meta strong {
  color: var(--yellow);
  font-weight: normal;
}

.nd-tab-panel[hidden] {
  display: none;
}

.nd-topbar__mobile-actions {
  display: none;
}

@media (max-width: 768px) {
  html,
  body.nd-app {
    height: 100%;
  }

  body.nd-app {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    overflow: hidden;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  body.nd-app .app-layout {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 72px;
  }

  body.nd-app .app-main.nd-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
    padding: 10px;
  }

  body.nd-app .nd-page-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
  }

  body.nd-app .nd-page-scroll::-webkit-scrollbar {
    width: 4px;
  }

  body.nd-app .nd-page-scroll::-webkit-scrollbar-thumb {
    background: var(--yellow);
  }

  .topbar.nd-topbar {
    height: 48px;
    padding: 0 12px;
  }

  .topbar.nd-topbar .topbar__nav {
    display: none;
  }

  .topbar.nd-topbar .topbar__logo {
    gap: 6px;
  }

  .topbar.nd-topbar .topbar__logo-icon {
    font-size: 18px;
    line-height: 1;
  }

  .topbar.nd-topbar .topbar__logo-text {
    font-size: 10px;
  }

  .topbar.nd-topbar .nd-topbar__mobile-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .topbar.nd-topbar .notifications-shell--mobile {
    display: flex;
  }

  .topbar.nd-topbar .mobile-avatar,
  .topbar.nd-topbar .nd-topbar__avatar-link,
  .topbar.nd-topbar .nd-topbar__auth-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .topbar.nd-topbar .nd-bell {
    position: relative;
    width: 36px;
    height: 36px;
    min-width: 36px;
    padding: 0;
    border: 2px solid var(--gray);
    border-radius: 4px;
    background: var(--bg2);
    color: var(--text);
    box-shadow: none;
  }

  .topbar.nd-topbar .nd-bell:hover,
  .topbar.nd-topbar .nd-bell[aria-expanded="true"] {
    border-color: var(--yellow);
    color: var(--yellow);
    box-shadow: var(--glow-sm);
  }

  .topbar.nd-topbar .nd-bell__badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border: 2px solid var(--yellow);
    border-radius: 999px;
    background: #2a0000;
    color: var(--yellow);
    box-shadow: var(--glow-red);
    font-family: var(--font-pixel);
    font-size: 7px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .topbar.nd-topbar .nd-topbar__avatar-link .avatar--sm,
  .topbar.nd-topbar .nd-topbar__auth-link {
    width: 32px;
    height: 32px;
  }

  .topbar.nd-topbar .nd-topbar__auth-link {
    min-width: auto;
    padding: 6px 8px;
    font-size: 7px;
  }

  .topbar.nd-topbar .notifications-dropdown {
    position: fixed;
    top: 60px;
    left: 8px;
    right: 8px;
    width: auto;
  }

  .nd-rating-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .nd-rating-head__tabs {
    width: 100%;
    margin-left: 0;
  }

  .nd-row__streak {
    display: none;
  }

  .nd-tour-card__actions,
  .nd-tour-card__actions--single {
    grid-template-columns: 1fr;
  }

  .nd-h2h-pick {
    grid-template-columns: 1fr;
  }

  .nd-h2h-pick .vs {
    justify-self: center;
  }

  .nd-h2h-hero {
    grid-template-columns: 1fr;
  }

  .tournament-hero,
  .tournament-podium,
  .tournament-participants,
  .tournament-roster-forms,
  .tournament-hero__stats {
    grid-template-columns: 1fr;
  }

  .tournament-history__head,
  .tournament-section__head,
  .notifications-page__head,
  .notifications-page__pagination,
  .nd-lk-section__head {
    flex-direction: column;
    align-items: flex-start;
  }
}
