:root {
  --bg: #0c0f0e;
  --surface: #171a19;
  --surface-raised: #1f2423;
  --text: #fafaf9;
  --text-secondary: #a8a29e;
  --brand-accent: #34d399;
  --brand-accent-secondary: #6ee7b7;
  --brand-accent-soft: rgba(52, 211, 153, 0.14);
  --brand-accent-shadow: rgba(52, 211, 153, 0.25);
  --accent: var(--brand-accent);
  --accent-secondary: var(--brand-accent-secondary);
  --accent-soft: var(--brand-accent-soft);
  --accent-shadow: var(--brand-accent-shadow);
  --border: rgba(250, 250, 249, 0.1);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --radius-md: 0.75rem;
  --radius-lg: 1.125rem;
  --radius-pill: 999px;
  --text-muted: #78716c;
  --perf-win: #34d399;
  --perf-win-soft: rgba(52, 211, 153, 0.18);
  --perf-loss: #f87171;
  --perf-loss-soft: rgba(248, 113, 113, 0.16);
  --perf-draw: #a8a29e;
  --perf-draw-soft: rgba(168, 162, 158, 0.16);
  --perf-excluded: #57534e;
  --perf-excluded-soft: rgba(87, 83, 78, 0.22);
  --tab-bar-height: 3.75rem;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-chrome: calc(var(--tab-bar-height) + var(--safe-area-bottom));
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.shell {
  max-width: 28rem;
  width: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: calc(1.5rem + var(--safe-area-top)) 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.shell-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-player-header {
  margin-bottom: 0.65rem;
  flex-shrink: 0;
}

.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.scroll-region {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.dashboard-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.dashboard-header__title {
  margin: 0;
  min-width: 0;
  flex: 1;
  font-size: clamp(1.375rem, 5.5vw, 1.625rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-header__menu-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(250, 250, 249, 0.04);
  color: var(--text);
  cursor: pointer;
}

.dashboard-header__menu-btn:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.dashboard-header__menu-icon {
  display: block;
  width: 1.125rem;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.dashboard-header-menu__backdrop {
  position: fixed;
  inset: 0;
  z-index: 24;
  background: rgba(0, 0, 0, 0.32);
}

.dashboard-header-menu {
  position: fixed;
  top: calc(1.5rem + var(--safe-area-top) + 2.75rem);
  right: max(1.25rem, calc(50% - 14rem + 1.25rem));
  z-index: 26;
  min-width: 10rem;
  padding: 0.35rem;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.dashboard-header-menu__item {
  display: block;
  padding: 0.75rem 0.9rem;
  border-radius: calc(var(--radius-md) - 0.125rem);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  min-height: 2.75rem;
}

.dashboard-header-menu__item:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.dashboard-match-menu__backdrop {
  position: fixed;
  inset: 0;
  z-index: 28;
  background: rgba(0, 0, 0, 0.42);
}

.dashboard-match-menu {
  padding: 0.45rem;
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.dashboard-match-menu--anchored {
  position: fixed;
  right: max(1rem, calc(50% - 14rem + 1rem));
  bottom: calc(var(--bottom-chrome) + 0.55rem);
  z-index: 32;
  min-width: min(calc(100vw - 2rem), 14rem);
}

.dashboard-match-menu__item {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  min-height: 3rem;
}

.dashboard-match-menu__item + .dashboard-match-menu__item {
  margin-top: 0.25rem;
}

.dashboard-match-menu__item:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.dashboard-match-menu__item--new {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.28);
}

.dashboard-match-menu__item--join {
  background: rgba(250, 250, 249, 0.04);
  border: 1px solid var(--border);
}

.dashboard-match-menu__item:active {
  transform: translateY(1px);
}

.dashboard-match-menu__label {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.dashboard-match-menu__hint {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.dashboard-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  margin-top: 1.25rem;
}

.dashboard-performance {
  padding-bottom: 0.75rem;
}

.dashboard-performance__title {
  margin: 0 0 0.85rem;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.dashboard-performance__status {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.perf-overall-hero {
  margin-bottom: 1rem;
  padding: 1.1rem 1rem 0.85rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, rgba(52, 211, 153, 0.14) 0%, rgba(0, 0, 0, 0.2) 68%);
  border: 1px solid rgba(52, 211, 153, 0.28);
}

.perf-overall-hero--unrated {
  background: rgba(250, 250, 249, 0.03);
  border-color: var(--border);
}

.perf-overall-hero__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.perf-overall-hero__copy {
  flex: 1;
  min-width: 0;
}

.perf-overall-hero__eyebrow {
  margin: 0 0 0.4rem;
  color: var(--brand-accent-secondary);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.perf-overall-hero--unrated .perf-overall-hero__eyebrow {
  color: var(--text-muted);
}

.perf-overall-hero__meta {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.perf-overall-hero--unrated .perf-overall-hero__meta {
  color: var(--text-secondary);
}

.perf-overall-hero__ring-wrap {
  position: relative;
  flex: 0 0 auto;
  width: clamp(5.5rem, 22vw, 6.75rem);
  height: clamp(5.5rem, 22vw, 6.75rem);
}

.perf-overall-hero__ring {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(-90deg);
}

.perf-ring__track {
  fill: none;
  stroke: rgba(250, 250, 249, 0.1);
  stroke-width: 6;
}

.perf-ring__accent {
  fill: none;
  stroke: var(--brand-accent);
  stroke-width: 6;
  stroke-linecap: round;
}

.perf-overall-hero--unrated .perf-ring__accent {
  stroke: var(--text-muted);
  opacity: 0.45;
}

.perf-overall-hero__value {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(1.5rem, 6vw, 1.875rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--brand-accent);
}

.perf-overall-hero--unrated .perf-overall-hero__value {
  color: var(--text-secondary);
}

.perf-overall-hero__details {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.perf-overall-hero__summary {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.perf-overall-hero__summary::-webkit-details-marker {
  display: none;
}

.perf-overall-hero__detail {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.perf-ratings {
  margin-bottom: 1rem;
}

.perf-ratings__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.perf-ratings__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.perf-ratings__note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.6875rem;
  line-height: 1.3;
  text-align: right;
}

.perf-ratings__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.75rem, 1fr));
  gap: 0.65rem;
}

.perf-rating-tile {
  position: relative;
  padding: 0.85rem 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  background: linear-gradient(
    160deg,
    var(--card-accent-soft, var(--brand-accent-soft)) 0%,
    rgba(0, 0, 0, 0.24) 100%
  );
  border: 1px solid var(--card-accent-soft, var(--brand-accent-soft));
  text-align: center;
}

.perf-rating-tile--unrated {
  background: rgba(250, 250, 249, 0.04);
  border-color: var(--border);
}

.perf-rating-tile__badge {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  line-height: 1;
  opacity: 0.85;
}

.perf-rating-tile__value {
  display: block;
  font-size: clamp(1.25rem, 5vw, 1.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--card-accent, var(--brand-accent));
}

.perf-rating-tile--unrated .perf-rating-tile__value {
  color: var(--text-secondary);
}

.perf-rating-tile__discipline {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
}

.perf-rating-tile__meta {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.625rem;
  line-height: 1.3;
}

.perf-panel {
  padding: 1.1rem 1rem 1.15rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, var(--surface-raised) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: perf-fade-in 0.4s ease-out both;
}

.perf-panel--cl187 {
  display: grid;
  gap: 0.15rem;
}

.perf-callout {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--brand-accent-soft);
  border: 1px solid rgba(52, 211, 153, 0.22);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.perf-callout--muted {
  background: rgba(250, 250, 249, 0.04);
  border-color: var(--border);
}

.perf-grid {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.perf-grid__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.perf-grid__charts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: end;
}

.perf-stat {
  padding: 0.85rem 0.5rem;
  border-radius: var(--radius-md);
  background: rgba(250, 250, 249, 0.03);
  border: 1px solid var(--border);
  text-align: center;
}

.perf-stat__value {
  display: block;
  font-size: clamp(1.125rem, 4.5vw, 1.375rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.perf-stat__label {
  display: block;
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
}

.perf-stat--accent .perf-stat__value {
  color: var(--brand-accent);
}

.perf-chart-card {
  padding: 0.85rem 0.75rem 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(250, 250, 249, 0.03);
  border: 1px solid var(--border);
}

.perf-chart-card__title {
  margin: 0 0 0.55rem;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.perf-donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.perf-donut {
  --donut-size: 5.5rem;
  width: var(--donut-size);
  height: var(--donut-size);
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
}

.perf-donut::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 1px solid var(--border);
}

.perf-donut__center {
  position: relative;
  z-index: 1;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.perf-donut__center small {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.perf-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.55rem;
  width: 100%;
}

.perf-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-secondary);
  font-size: 0.6875rem;
  line-height: 1.2;
}

.perf-legend__swatch {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.perf-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.perf-gauge__svg {
  width: 100%;
  max-width: 7.5rem;
  height: auto;
  display: block;
}

.perf-gauge__track {
  fill: none;
  stroke: rgba(250, 250, 249, 0.08);
  stroke-width: 8;
  stroke-linecap: round;
}

.perf-gauge__fill {
  fill: none;
  stroke: var(--brand-accent);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease-out;
}

.perf-gauge__value {
  margin-top: -0.35rem;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.perf-gauge__caption {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.6875rem;
  line-height: 1.35;
  text-align: center;
}

.perf-gauge--limited .perf-gauge__fill {
  stroke: var(--text-muted);
  opacity: 0.45;
}

.perf-gauge--limited .perf-gauge__value {
  color: var(--text-muted);
  font-size: 1.0625rem;
}

.perf-winrate-caption {
  margin: 0 0 0.85rem;
  padding-top: 0.15rem;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.perf-winrate-caption__detail {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.perf-section {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.perf-section__title {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.perf-discipline {
  display: grid;
  gap: 0.75rem;
}

.perf-discipline__row {
  display: grid;
  gap: 0.4rem;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(250, 250, 249, 0.02);
  border: 1px solid var(--border);
  border-left: 3px solid var(--item-accent, var(--brand-accent));
}

.perf-discipline__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.3;
}

.perf-discipline__name {
  font-weight: 700;
  color: var(--item-accent-secondary, var(--text));
}

.perf-discipline__meta {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-align: right;
}

.perf-discipline__bar {
  display: flex;
  height: 0.5rem;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: rgba(250, 250, 249, 0.06);
}

.perf-discipline__segment {
  min-width: 0;
  transition: flex-grow 0.5s ease-out;
}

.perf-discipline__segment--win {
  background: var(--perf-win);
}

.perf-discipline__segment--loss {
  background: var(--perf-loss);
}

.perf-discipline__segment--draw {
  background: var(--perf-draw);
}

.perf-discipline__segment--excluded {
  background: var(--perf-excluded);
}

.perf-form-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.35rem 0 0.15rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.perf-form-timeline::-webkit-scrollbar {
  display: none;
}

.perf-form-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  min-width: 2.75rem;
  position: relative;
}

.perf-form-node__dot {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  border: 2px solid transparent;
  background: var(--surface);
}

.perf-form-node__dot--win {
  color: #052e1f;
  background: var(--perf-win);
  border-color: var(--item-accent, rgba(52, 211, 153, 0.5));
}

.perf-form-node__dot--loss {
  color: #450a0a;
  background: var(--perf-loss);
  border-color: var(--item-accent, rgba(248, 113, 113, 0.45));
}

.perf-form-node__dot--draw {
  color: var(--text);
  background: var(--perf-draw-soft);
  border-color: var(--item-accent, var(--perf-draw));
}

.perf-form-node__dot--unsupported,
.perf-form-node__dot--unknown {
  color: var(--text-muted);
  background: var(--perf-excluded-soft);
  border-color: var(--perf-excluded);
}

.perf-form-node__label {
  margin-top: 0.35rem;
  max-width: 3.25rem;
  color: var(--text-muted);
  font-size: 0.625rem;
  line-height: 1.2;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perf-form-node__connector {
  flex: 0 0 0.75rem;
  height: 2px;
  margin-bottom: 1.35rem;
  background: linear-gradient(90deg, var(--border), rgba(250, 250, 249, 0.04));
}

.perf-empty {
  padding: 1.35rem 1rem 1.25rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.08) 0%, var(--surface) 55%);
  border: 1px dashed rgba(52, 211, 153, 0.28);
  text-align: center;
}

.perf-empty__icon {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-accent);
  background: var(--brand-accent-soft);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.perf-empty__message {
  margin: 0 0 0.45rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}

.perf-empty__hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.perf-loading {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  border: 1px solid var(--border);
}

.perf-loading__bar {
  display: block;
  height: 0.65rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    90deg,
    rgba(250, 250, 249, 0.06) 0%,
    rgba(250, 250, 249, 0.12) 50%,
    rgba(250, 250, 249, 0.06) 100%
  );
  background-size: 200% 100%;
  animation: perf-shimmer 1.2s ease-in-out infinite;
}

.perf-loading__bar--short {
  width: 55%;
}

.perf-loading__bar--medium {
  width: 78%;
}

@keyframes perf-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes perf-shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

@media (max-width: 360px) {
  .perf-grid__charts {
    grid-template-columns: 1fr;
  }

  .perf-grid__stats {
    gap: 0.45rem;
  }

  .perf-stat {
    padding: 0.7rem 0.35rem;
  }

  .perf-overall-hero__body {
    flex-direction: column-reverse;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .perf-panel,
  .perf-loading__bar,
  .perf-discipline__segment,
  .perf-gauge__fill,
  .perf-ring__accent,
  .tab-bar__action,
  .tab-bar__action-icon,
  .dashboard-header__menu-btn {
    animation: none !important;
    transition: none !important;
  }
}

.new-match-picker-scroll {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.new-match-picker__empty {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
  text-align: center;
}

.view--scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.view > .view-nav,
.view > header,
.view > .dashboard-body,
.view > .new-match-picker-scroll,
.view > .context-actions,
.view > .field--search,
.view > .match-form,
.view > .home-history,
.view > .install-section {
  flex-shrink: 0;
}

.view.hidden {
  display: none;
}

.eyebrow {
  margin: 0 0 0.625rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

#view-select .eyebrow,
#view-add-discipline .eyebrow {
  color: var(--brand-accent);
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 7vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.45;
  max-width: 22rem;
}

.hidden {
  display: none !important;
}

.install-section {
  margin-top: 1.25rem;
}

.install-button {
  width: 100%;
  min-height: 3rem;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.95rem 1.25rem;
  background: var(--accent);
  color: #052e1f;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px var(--accent-shadow);
}

.install-button:active {
  transform: translateY(1px);
}

.install-fallback,
.install-guide {
  margin-top: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.install-fallback {
  margin-top: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.install-guide-title {
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.install-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.625rem;
}

.install-steps li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.view-nav {
  margin-bottom: 1rem;
}

.view-nav--split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.view-nav__spacer {
  flex: 1;
}

.view-nav__profile-link {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
}

.profile-name-form {
  display: grid;
  gap: 1rem;
  max-width: 28rem;
}

.profile-name-form__hint {
  margin: 0;
  color: var(--muted, #a8a29e);
  font-size: 0.9375rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.25rem;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.home-history {
  margin: 1.25rem 0 0;
  text-align: center;
}

.history-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.history-link--inline {
  display: inline-block;
  margin-top: 0.75rem;
}

.history-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-bottom: 0.5rem;
  align-content: start;
}

.history-list__status {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.history-item {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
}

.history-item:active {
  transform: translateY(1px);
}

.history-item__status {
  display: inline-block;
  width: fit-content;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.history-item__status--active {
  background: var(--item-accent-soft, var(--brand-accent-soft));
  color: var(--item-accent, var(--brand-accent));
}

.history-item__status--waiting {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
}

.history-item__status--completed {
  background: rgba(251, 191, 36, 0.14);
  color: #fbbf24;
}

.history-item__status--submitted {
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
}

.history-item__discipline {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--item-accent, var(--brand-accent));
}

.history-item__matchup {
  font-size: 1.0625rem;
  font-weight: 700;
}

.history-item__result {
  color: var(--text);
  font-weight: 600;
}

.history-item__when {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.discipline-grid {
  display: grid;
  gap: 0.875rem;
  margin-top: auto;
  padding-top: 1.25rem;
}

.discipline-card-shell {
  position: relative;
}

.discipline-card__unpin {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  z-index: 2;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid rgba(250, 250, 249, 0.14);
  border-radius: var(--radius-pill);
  background: rgba(12, 15, 14, 0.78);
  color: rgba(250, 250, 249, 0.9);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.discipline-card__unpin:active {
  transform: translateY(1px);
}

.discipline-card__unpin:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.discipline-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.875rem;
  min-height: 4.75rem;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.discipline-card--hero {
  position: relative;
  overflow: hidden;
  border-color: rgba(250, 250, 249, 0.14);
}

.discipline-card--hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
}

.discipline-card--hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(12, 15, 14, 0.94) 0%,
    rgba(12, 15, 14, 0.78) 52%,
    rgba(12, 15, 14, 0.42) 100%
  );
}

.discipline-card--hero > * {
  position: relative;
  z-index: 1;
}

.discipline-card:active {
  transform: translateY(1px);
}

.discipline-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.875rem;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--card-accent-soft, var(--brand-accent-soft));
  color: var(--card-accent, var(--brand-accent));
  box-shadow: inset 0 0 0 1px var(--card-accent-secondary-soft, transparent);
}

.discipline-card--add .discipline-card__badge {
  background: rgba(148, 163, 184, 0.12);
  color: var(--brand-accent);
  box-shadow: none;
}

.discipline-card__badge--add {
  font-size: 1.375rem;
  line-height: 1;
}

.discipline-card--add {
  border-style: dashed;
}

.discipline-card--pick {
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.discipline-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.discipline-card__label {
  font-size: 1.125rem;
  font-weight: 700;
}

.discipline-card__hint {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.discipline-card--hero .discipline-card__hint {
  color: rgba(250, 250, 249, 0.82);
}

.discipline-card__action {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--card-accent, var(--brand-accent));
}

.discipline-context--hero > header {
  position: relative;
  overflow: hidden;
  margin: 0 0 0.25rem;
  padding: 1.25rem 1rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(250, 250, 249, 0.08);
}

.discipline-context--hero > header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
}

.discipline-context--hero > header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(12, 15, 14, 0.45) 0%,
    rgba(12, 15, 14, 0.9) 100%
  );
}

.discipline-context--hero > header > * {
  position: relative;
  z-index: 1;
}

.discipline-context--hero > header .lede {
  color: rgba(250, 250, 249, 0.86);
}

.context-actions {
  margin-top: 1.25rem;
  padding-top: 0;
}

.context-actions--dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  align-items: stretch;
}

.context-actions--dual .context-actions__host,
.context-actions--dual .context-actions__join {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 3rem;
  margin-top: 0;
  padding: 0.95rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.context-actions--dual .context-actions__host {
  border: 0;
  background: var(--accent);
  color: #052e1f;
  box-shadow: 0 10px 24px var(--accent-shadow);
}

.context-actions--dual .context-actions__join {
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: none;
}

.context-actions--dual .context-actions__host:active,
.context-actions--dual .context-actions__join:active {
  transform: translateY(1px);
}

.discipline-join {
  margin-top: 1.25rem;
}

.join-inline-scanner {
  margin-bottom: 1rem;
}

.join-inline-scanner__viewport {
  position: relative;
  min-height: 12rem;
  max-height: min(42vh, 16rem);
  overflow: hidden;
  border-radius: 1rem;
  background: #000;
}

.join-inline-scanner__video {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 12rem;
  object-fit: cover;
}

.join-inline-scanner--scanning .join-inline-scanner__video {
  display: block;
}

.join-inline-scanner__frame {
  display: none;
  position: absolute;
  inset: 12%;
  border: 2px solid rgba(52, 211, 153, 0.85);
  border-radius: 0.75rem;
  box-shadow: 0 0 0 9999px rgba(12, 15, 14, 0.35);
  pointer-events: none;
}

.join-inline-scanner--scanning .join-inline-scanner__frame {
  display: block;
}

.join-inline-scanner__enable {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 2;
  min-height: 3rem;
}

.join-inline-scanner--scanning .join-inline-scanner__enable {
  display: none;
}

.join-inline-scanner__enable.hidden {
  display: none;
}

.join-inline-scanner__resume {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(12, 15, 14, 0.78);
  color: #34d399;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.join-inline-scanner__resume.hidden {
  display: none;
}

.join-inline-scanner--scanning .join-inline-scanner__resume {
  display: none;
}

.join-inline-scanner__resume-icon {
  display: block;
}

.join-inline-scanner__status {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
  text-align: center;
}

.join-inline-scanner__error {
  margin-top: 0.5rem;
}

.join-inline-scanner__manual-label {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.discipline-history-list {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  padding: 0.95rem 1.25rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #052e1f;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 24px var(--accent-shadow);
}

.primary-button:active {
  transform: translateY(1px);
}

.match-form,
.field--search {
  margin-top: 1.25rem;
}

.match-form {
  display: grid;
  gap: 1rem;
  padding: 1.125rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.match-host-shell {
  margin-top: 1.25rem;
  padding: 1.125rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.875rem;
}

.match-host-shell__hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.match-manual-fallback {
  margin-top: 1rem;
}

.match-manual-fallback summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 0.75rem;
}

.match-manual-fallback__hint {
  margin: 0 0 0.875rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.45;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.compose-waiting {
  display: grid;
  gap: 0.875rem;
}

.compose-waiting__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.compose-waiting__progress {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent, var(--text));
  letter-spacing: 0.01em;
}

.compose-waiting__hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.compose-waiting__slots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.625rem;
}

.compose-waiting__slot {
  display: grid;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  background: var(--surface-elevated, var(--surface));
}

.compose-waiting__slot-main {
  display: grid;
  gap: 0.35rem;
}

.compose-waiting__slot--provisional {
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent, #6ee7a0) 35%, var(--border));
}

.compose-waiting__slot--ratified,
.compose-waiting__slot--committed {
  border-style: solid;
  border-color: var(--border);
}

.compose-waiting__slot--open {
  border-style: dashed;
  opacity: 0.95;
}

.compose-waiting__badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.compose-waiting__badge--open {
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--text-secondary) 12%, transparent);
}

.compose-waiting__badge--provisional {
  color: #f5d565;
  background: color-mix(in srgb, #f5d565 18%, transparent);
}

.compose-waiting__badge--ratified,
.compose-waiting__badge--committed {
  color: var(--accent, #6ee7a0);
  background: color-mix(in srgb, var(--accent, #6ee7a0) 16%, transparent);
}

.compose-waiting__name {
  font-size: 1rem;
  font-weight: 500;
}

.compose-waiting__name--muted {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 0.9375rem;
}

.compose-waiting__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: stretch;
}

.compose-waiting__action {
  flex: 1 1 calc(50% - 0.25rem);
  min-height: 2.75rem;
  font-size: 0.875rem;
  padding: 0.55rem 0.75rem;
}

.compose-waiting__action--remove {
  flex-basis: 100%;
}

.compose-waiting__host-join {
  display: grid;
  gap: 0.625rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.compose-waiting__host-join-action {
  min-height: 2.75rem;
}

.compose-waiting__start {
  min-height: 2.875rem;
}

.compose-waiting__start:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.compose-waiting__start-gate {
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, #f5d565 35%, var(--border));
  background: color-mix(in srgb, #f5d565 10%, transparent);
}

.compose-waiting__start-hint {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.compose-waiting__start-hint--ready {
  color: var(--brand-accent, #6ee7a0);
}

.compose-waiting__start-blockers {
  margin: 0.375rem 0 0;
  padding-left: 1.125rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.compose-waiting__label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.compose-share {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-elevated, var(--surface));
}

.compose-share--simplified {
  gap: 0.625rem;
}

.compose-share__copy-button {
  width: 100%;
}

.compose-share__copy-feedback {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--accent);
}

.compose-share__match-code {
  margin: 0;
  text-align: center;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
}

.compose-share__match-code-value {
  font-size: 1.25rem;
  letter-spacing: 0.12em;
}

.compose-u2__public-meta {
  display: grid;
  gap: 0.25rem;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.compose-u2__joiner-status {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  text-align: center;
}

.compose-u2__tile--readonly {
  cursor: default;
  pointer-events: none;
}

.compose-share__advanced-entry summary,
.compose-waiting__host-join summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
}

.compose-share__advanced-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-top: 0.25rem;
}

.compose-share__advanced-panel {
  display: grid;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.compose-entity-manual-fallback {
  margin-top: 0.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}

.compose-entity-manual-fallback summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
}

.compose-entity-manual-fallback__action {
  width: 100%;
}

.compose-waiting--ux02 .compose-waiting__start {
  margin-top: 0.25rem;
}

/* Phase U2 — QR Match waiting room */
.compose-waiting--u2 {
  gap: 1rem;
}

.compose-u2__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.compose-u2__discipline {
  margin: 0;
}

.compose-u2__gear {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-elevated, var(--surface));
  color: var(--text-secondary);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}

.compose-u2__gear[aria-expanded="true"] {
  color: var(--accent, #6ee7a0);
  border-color: color-mix(in srgb, var(--accent, #6ee7a0) 40%, var(--border));
}

.compose-share--u2 {
  border: none;
  padding: 0;
  background: transparent;
  gap: 0.625rem;
}

.compose-share__qr-wrap--u2 {
  width: min(200px, 72vw);
}

.compose-u2__gear-panel {
  display: grid;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-elevated, var(--surface));
}

.compose-u2__tiles-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.25rem;
  padding: 0.25rem;
}

.compose-u2__tiles {
  display: flex;
  gap: 0.75rem;
  min-width: min-content;
  justify-content: center;
}

.compose-u2__tile {
  flex: 0 0 auto;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: var(--radius-md);
  border: 2px dashed color-mix(in srgb, var(--text-secondary) 35%, var(--border));
  background: var(--surface-elevated, var(--surface));
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.compose-u2__tile--ratified,
.compose-u2__tile--provisional,
.compose-u2__tile--committed {
  border-style: solid;
}

.compose-u2__tile-mark {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.compose-u2__tile--open .compose-u2__tile-mark {
  color: var(--text-secondary);
  font-weight: 500;
}

.compose-u2__slot-dialog {
  display: grid;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-elevated, var(--surface));
}

.compose-u2__slot-dialog-action,
.compose-u2__slot-dialog-cancel {
  width: 100%;
}

.compose-u2__start {
  margin-top: 0.25rem;
}

.compose-waiting--u2 .compose-waiting__start-gate,
.compose-waiting--u2 .compose-waiting__start-blockers {
  display: none;
}

.compose-share__label {
  margin: 0;
  font-weight: 600;
  font-size: 0.9375rem;
}

.compose-share__hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.45;
}

.compose-share__qr-wrap {
  width: min(240px, 100%);
  max-width: 100%;
  margin-inline: auto;
  aspect-ratio: 1;
}

.compose-share__qr {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  min-height: 8rem;
  border-radius: var(--radius-md);
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
  background: #fff;
}

.compose-share__qr[data-fta2c-qr-rendered="true"] {
  min-height: 0;
}

.compose-share__qr[data-fta2c-qr-rendered="error"] {
  min-height: 4rem;
}

.compose-share .share-row {
  grid-template-columns: minmax(0, 1fr) auto;
  max-width: 100%;
  min-width: 0;
}

.compose-share .share-row__input {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .compose-share .share-row {
    grid-template-columns: 1fr;
  }

  .compose-share .share-row__button {
    width: 100%;
  }
}

.compose-share__durable-ref {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.compose-share__copy-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.compose-share__pin,
.compose-share__wrapper {
  border-top: 1px solid var(--border);
  padding-top: 0.625rem;
}

.compose-share__pin summary,
.compose-share__wrapper summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
}

.compose-share__pin-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.compose-share__pin-display {
  margin: 0;
  font-size: 0.9375rem;
}

.compose-share__pin-actions,
.compose-share__wrapper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.compose-share__pin-actions .secondary-button,
.compose-share__wrapper-actions .secondary-button {
  min-height: 2.75rem;
  flex: 1 1 auto;
}

.compose-share__wrapper-status {
  margin: 0;
  font-size: 0.875rem;
}

.compose-share__wrapper-status--active {
  color: var(--accent, #6ee7a0);
}

.compose-share__wrapper-status--idle {
  color: var(--text-secondary);
}

.compose-share__wrapper-status--expired {
  color: #f5d565;
}

.compose-recovery {
  display: grid;
  gap: 0.625rem;
  margin-top: 0.75rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--text-secondary) 8%, transparent);
}

.compose-recovery__hint {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.compose-recovery__action {
  width: 100%;
  min-height: 2.75rem;
}

.compose-check-in__banner--recovery {
  background: color-mix(in srgb, #f5d565 14%, transparent);
  color: #f5d565;
}

.compose-check-in__banner {
  margin: 0;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  background: color-mix(in srgb, var(--accent, #6ee7a0) 12%, transparent);
}

.compose-check-in__banner--muted {
  background: color-mix(in srgb, var(--text-secondary) 10%, transparent);
  color: var(--text-secondary);
}

.compose-check-in--mobile {
  gap: 1rem;
}

.compose-check-in--reduced,
.compose-waiting--reduced {
  gap: 0.75rem;
}

.compose-waiting--reduced .compose-waiting__start-blockers {
  margin: 0;
  padding-left: 1.125rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.compose-check-in__control,
.join-paste__input {
  min-height: 2.75rem;
  font-size: 1rem;
}

.compose-check-in__submit {
  min-height: 3rem;
  font-size: 1.0625rem;
}

.compose-check-in__error-panel {
  margin: 0;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, #fca5a5 45%, var(--border));
  background: color-mix(in srgb, #fca5a5 12%, var(--surface));
  color: #fecaca;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.compose-check-in__error-panel--blocker {
  border-color: color-mix(in srgb, #f5d565 40%, var(--border));
  background: color-mix(in srgb, #f5d565 14%, var(--surface));
  color: #fde68a;
}

.compose-check-in__paste-hint {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.join-paste {
  margin-top: 1.25rem;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  display: grid;
  gap: 0.75rem;
}

.join-paste__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.join-paste__hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.join-game__code-input {
  font-size: 1.125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.join-paste__action {
  min-height: 2.75rem;
  margin-top: 0;
}

#view-engagement.view--scroll {
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

@media (max-width: 480px) {
  .engagement-card {
    padding: 1rem;
  }

  .compose-check-in__field select,
  .compose-check-in__field input,
  .join-paste__input {
    font-size: 16px;
  }
}

.compose-check-in {
  display: grid;
  gap: 0.75rem;
}

.compose-check-in__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.compose-check-in__hint {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.compose-check-in__field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.875rem;
}

.compose-check-in__field select,
.compose-check-in__field input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
}

.compose-waiting__status {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

@media (min-width: 480px) {
  .compose-waiting__slot {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .compose-waiting__actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .compose-waiting__action {
    flex: 0 1 auto;
    min-width: 6.5rem;
  }

  .compose-waiting__action--remove {
    flex-basis: auto;
  }
}

.field--checkbox {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.field--checkbox input {
  width: 1.125rem;
  height: 1.125rem;
}

.match-side-slot {
  display: grid;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  border: 1px solid var(--border);
}

.match-side-slot__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-accent-secondary);
}

.match-side-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.match-side-picker__chip {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.375rem 0.75rem;
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
}

.match-side-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.match-side-selected__name {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
}

.text-button,
.secondary-button {
  border: 0;
  background: transparent;
  color: var(--brand-accent);
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.25rem 0;
}

.secondary-button {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 0.875rem;
}

.compose-enrich {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.compose-enrich__title {
  font-weight: 700;
  margin: 0 0 0.375rem;
}

.compose-enrich__hint {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.compose-enrich__grid {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.compose-enrich__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.compose-enrich__skip {
  margin-left: auto;
}

.compose-enrich__error {
  margin: 0.75rem 0 0;
  color: var(--danger, #c0392b);
  font-size: 0.875rem;
}

.compose-enrich__success,
.compose-enrich__saved {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.match-side-identify summary {
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.match-side-identify__grid {
  display: grid;
  gap: 0.5rem;
}

.field {
  display: grid;
  gap: 0.375rem;
}

.field__label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.field__input {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  color: var(--text);
  caret-color: var(--text);
  font-size: 1rem;
}

.field__input::placeholder {
  color: var(--text-secondary);
  opacity: 0.85;
}

.field__input:focus {
  outline: 2px solid var(--accent-soft);
  outline-offset: 0;
  border-color: var(--accent);
}

.form-error {
  margin: 0;
  color: #fca5a5;
  font-size: 0.9375rem;
}

.engagement-card {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--text);
}

.engagement-card__discipline {
  margin: 0 0 0.375rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.engagement-card__matchup {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.engagement-card__status {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.match-load-diag__line {
  margin: 0.5rem 0 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.45;
}

.match-load-diag__copy {
  margin-top: 0.75rem;
}

.engagement-card__hint {
  margin: 0.75rem 0 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.engagement-card__action {
  margin-top: 1rem;
}

.secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  margin-top: 1rem;
  padding: 0.95rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button:active {
  transform: translateY(1px);
}

.scoreboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.scoreboard__side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.75rem;
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  border: 1px solid var(--border);
}

.scoreboard__name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
}

.scoreboard__score {
  margin: 0;
  font-size: clamp(2.5rem, 12vw, 3.5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.scoreboard__score--editable {
  display: block;
  width: 100%;
  padding: 0.25rem;
  border: 2px dashed transparent;
  border-radius: var(--radius-lg);
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.scoreboard__score--editable:hover,
.scoreboard__score--editable:focus-visible {
  border-color: var(--accent-soft);
  outline: none;
}

.scoreboard__score-edit {
  display: grid;
  gap: 0.5rem;
}

.scoreboard__score-input {
  width: 100%;
  min-height: 3.5rem;
  padding: 0.375rem 0.5rem;
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  color: var(--text);
  font-size: clamp(2rem, 10vw, 3rem);
  font-weight: 800;
  text-align: center;
  touch-action: manipulation;
}

.scoreboard__score-edit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.score-button--compact {
  min-height: 2.75rem;
  font-size: 1rem;
}

.scoreboard__controls {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.score-button {
  flex: 1;
  min-height: 3.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.score-button--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #052e1f;
}

.score-button:active {
  transform: translateY(1px);
}

.result-card__headline {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.result-card__scores {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.share-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.share-section__label {
  margin: 0 0 0.5rem;
  font-weight: 700;
  color: var(--text);
}

.share-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.share-row__input {
  min-height: 2.75rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 1rem;
}

.share-row__button {
  margin-top: 0;
  width: auto;
  min-width: 6.5rem;
  min-height: 2.75rem;
  padding: 0.625rem 1rem;
}

.form-success {
  margin: 0.75rem 0 0;
  color: var(--accent);
  font-size: 0.9375rem;
}

.snooker-breaks {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.snooker-breaks__label {
  margin: 0 0 0.375rem;
  font-weight: 700;
  color: var(--accent);
}

.snooker-breaks__hint {
  margin: 0 0 0.875rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.snooker-breaks__grid {
  display: grid;
  gap: 0.75rem;
}

.break-panel {
  padding: 0.875rem;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  border: 1px solid var(--accent-secondary-soft, rgba(250, 250, 249, 0.12));
}

.break-panel__name {
  margin: 0 0 0.375rem;
  font-weight: 700;
  color: var(--accent);
}

.break-panel__stat {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.break-panel__controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.break-panel__controls .score-button {
  min-height: 2.75rem;
  font-size: 1rem;
  padding: 0.5rem;
}


.result-card__breaks {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent-secondary);
}

.history-item__extra {
  font-size: 0.875rem;
  color: var(--item-accent-secondary, var(--accent-secondary));
  font-weight: 600;
}

.catalog-results {
  display: grid;
  gap: 0.875rem;
  margin-top: 1rem;
  padding-bottom: 0.5rem;
  align-content: start;
}

.catalog-results__status {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.tab-bar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: flex !important;
  visibility: visible;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--tab-bar-height);
  padding: 0.5rem 0.85rem calc(0.5rem + var(--safe-area-bottom));
  background: rgba(12, 15, 14, 0.94);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.tab-bar--with-action .tab-bar__item {
  flex: 1;
  max-width: none;
}

.tab-bar__item {
  flex: 1;
  max-width: 10rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  text-align: center;
}

.tab-bar__item--selected {
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
}

.tab-bar__action {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #052e1f;
  box-shadow: 0 8px 20px var(--accent-shadow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tab-bar__action:focus-visible {
  outline: 2px solid var(--brand-accent-secondary);
  outline-offset: 2px;
}

.tab-bar__action:active {
  transform: translateY(1px);
}

.tab-bar__action--open {
  box-shadow: 0 4px 12px var(--accent-shadow);
}

.tab-bar__action-icon {
  display: block;
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1;
  transition: transform 0.15s ease;
}

.tab-bar__action--open .tab-bar__action-icon {
  transform: rotate(45deg);
}

.update-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: calc(var(--bottom-chrome) + 0.75rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #052e1f;
  box-shadow: 0 12px 30px var(--accent-shadow);
  z-index: 30;
}

.update-banner.hidden {
  display: none;
}

.update-banner button {
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.5rem 0.875rem;
  background: #052e1f;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}
