/* BetTrack: styles.css
 * Design system, components, motion. Mobile-first, dark only.
 */

/* ============ Tokens ============ */
:root {
  --bg: #0d0d0d;
  --surface: #1a1a1a;
  --surface-2: #222222;
  --surface-3: #2a2a2a;
  --border: #2a2a2a;
  --border-strong: #3a3a3a;

  --accent: #f5a623;
  --accent-ink: #0d0d0d;
  --accent-soft: rgba(245, 166, 35, 0.14);

  --won: #00c851;
  --lost: #ff4444;
  --pending: #ffb300;
  --void: #2196f3;
  --won-soft: rgba(0, 200, 81, 0.12);
  --lost-soft: rgba(255, 68, 68, 0.12);
  --pending-soft: rgba(255, 179, 0, 0.12);
  --void-soft: rgba(33, 150, 243, 0.14);

  --text: #ffffff;
  --text-2: #8a8a8a; /* 5.0:1 on #1A1A1A, 5.6:1 on #0D0D0D */
  --text-2-raised: #a3a3a3; /* for text on #2A2A2A surfaces (5.6:1) */

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --fs-caption: 12px;
  --fs-body: 14px;
  --fs-subtitle: 16px;
  --fs-title: 20px;
  --fs-hero: 28px;

  --radius-card: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 6px 18px rgba(0, 0, 0, 0.35);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --nav-h: 64px;
  --appbar-h: 56px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --content-w: 560px;
}

/* ============ Base ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.4;
  font-feature-settings: 'tnum' 1, 'cv11' 1;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  font-weight: 700;
}

p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

img {
  max-width: 100%;
  display: block;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.skip-link {
  position: fixed;
  top: calc(var(--safe-top) + 8px);
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform 160ms var(--ease-out);
}

.skip-link:focus {
  transform: none;
}

.icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--sm {
  width: 16px;
  height: 16px;
}

.icon--xs {
  width: 13px;
  height: 13px;
  stroke-width: 2.6;
}

.icon--lg {
  width: 26px;
  height: 26px;
}

.muted {
  color: var(--text-2);
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.noscript {
  padding: 24px;
  text-align: center;
}

/* ============ App bar ============ */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: var(--safe-top);
  background: rgba(13, 13, 13, 0.86);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(42, 42, 42, 0.6);
}

.appbar__inner {
  max-width: var(--content-w);
  margin: 0 auto;
  height: var(--appbar-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand__mark {
  width: 28px;
  height: 28px;
}

.brand__name {
  font-size: var(--fs-title);
  letter-spacing: -0.02em;
}

.sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  color: var(--text-2);
  font-size: var(--fs-caption);
  font-weight: 600;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}

.sync-chip:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .sync-chip:hover {
    background: var(--surface);
  }
}

.sync-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-2);
  flex: none;
}

.sync-chip.is-live .sync-chip__dot {
  background: var(--won);
  animation: pulse-dot 1.6s ease-out infinite;
}

.sync-chip.is-ok .sync-chip__dot {
  background: var(--won);
}

.sync-chip.is-error {
  color: var(--pending);
}

.sync-chip.is-error .sync-chip__dot {
  background: var(--pending);
}

.sync-chip.is-syncing .sync-chip__dot {
  background: var(--accent);
  animation: pulse-dot 0.9s ease-out infinite;
}

/* ============ Pull to refresh ============ */
.ptr {
  position: fixed;
  top: calc(var(--safe-top) + var(--appbar-h));
  left: 0;
  right: 0;
  z-index: 15;
  display: flex;
  justify-content: center;
  pointer-events: none;
  transform: translateY(-64px);
}

.ptr__bubble {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--accent);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.ptr__icon {
  width: 20px;
  height: 20px;
  transition: transform 200ms var(--ease-out);
}

.ptr.is-armed .ptr__icon {
  transform: rotate(180deg);
}

.ptr__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(245, 166, 35, 0.25);
  border-top-color: var(--accent);
  animation: spin 0.6s linear infinite;
}

.ptr.is-loading .ptr__icon {
  display: none;
}

.ptr.is-loading .ptr__spinner {
  display: block;
}

/* ============ Layout ============ */
main {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 8px 16px calc(var(--nav-h) + var(--safe-bottom) + 104px);
  outline: none;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  margin-bottom: 8px;
}

.panel__title {
  font-size: var(--fs-hero);
  letter-spacing: -0.03em;
}

/* ============ Controls ============ */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--text);
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}

.icon-btn:active {
  transform: scale(0.94);
}

@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover {
    background: var(--surface-3);
  }
}

.icon-btn.is-spinning .icon {
  animation: spin 0.7s linear infinite;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: 1.2;
  text-decoration: none;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn--ghost {
  background: var(--surface-3);
  color: var(--text);
}

.btn--outline {
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn--danger {
  background: var(--lost);
  color: var(--accent-ink);
}

.btn--text {
  padding: 0 10px;
  color: var(--accent);
}

.btn--block {
  width: 100%;
}

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover {
    background: #ffb43c;
  }
  .btn--ghost:hover,
  .btn--outline:hover {
    background: #333;
  }
}

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.segmented__btn,
.tabs__btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  color: var(--text-2);
  font-weight: 600;
  font-size: 13px;
  transition: background-color 180ms ease, color 180ms ease;
  position: relative;
}

/* Expand hit area to 44px without changing visuals */
.segmented__btn::after,
.tabs__btn::after {
  content: '';
  position: absolute;
  inset: -3px 0;
}

.segmented__btn[aria-pressed='true'],
.tabs__btn[aria-selected='true'] {
  background: var(--surface-3);
  color: var(--text);
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.tabs__btn {
  flex: 1;
}

/* ============ Status badge ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-ink);
  white-space: nowrap;
  animation: badge-pop 150ms var(--ease-out);
}

.badge .icon {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}

.badge--won {
  background: var(--won);
}

.badge--lost {
  background: var(--lost);
}

.badge--pending {
  background: var(--pending);
}

.badge--void {
  background: var(--void);
}

.badge--demo {
  background: var(--surface-3);
  color: var(--text-2-raised);
  animation: none;
}

@keyframes badge-pop {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
}

/* ============ Onboarding / promo ============ */
.promo {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 14px;
  align-items: start;
  padding: 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.16), rgba(245, 166, 35, 0.04));
  border: 1px solid rgba(245, 166, 35, 0.35);
}

.promo__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
}

.promo__title {
  font-size: var(--fs-subtitle);
  font-weight: 600;
  margin-bottom: 4px;
}

.promo__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============ Empty state ============ */
.empty {
  text-align: center;
  padding: 40px 16px 24px;
}

.empty__art {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
}

.empty__art .icon {
  width: 40px;
  height: 40px;
  stroke-width: 1.6;
}

.empty__title {
  font-size: var(--fs-title);
  margin-bottom: 8px;
  text-wrap: balance;
}

.empty__text {
  color: var(--text-2);
  max-width: 320px;
  margin: 0 auto 20px;
  text-wrap: pretty;
}

.empty__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 300px;
  margin: 0 auto;
}

.empty__steps {
  list-style: none;
  padding: 0;
  margin: 28px auto 0;
  max-width: 340px;
  display: grid;
  gap: 10px;
  text-align: left;
}

.empty__steps li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.empty__step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  font-size: var(--fs-caption);
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent);
}

/* ============ Slip list ============ */
.day-group + .day-group {
  margin-top: 20px;
}

.day-group__title {
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 4px 8px;
}

.day-group__list {
  display: grid;
  gap: 12px;
}

/* Swipe container */
.swipe {
  position: relative;
  border-radius: var(--radius-card);
}

.swipe__bg {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  color: var(--text-2-raised);
  font-weight: 600;
  gap: 8px;
  opacity: 0;
  transition: background-color 160ms ease, color 160ms ease;
}

.swipe.is-dragging .swipe__bg,
.swipe.is-leaving .swipe__bg {
  opacity: 1;
}

.swipe.is-armed .swipe__bg {
  background: var(--accent);
  color: var(--accent-ink);
}

.swipe__bg .icon {
  transition: transform 200ms var(--ease-out);
}

.swipe.is-armed .swipe__bg .icon {
  transform: scale(1.15);
}

/* Slip card */
.slip {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  touch-action: pan-y;
  will-change: transform;
}

.slip--won {
  border-color: rgba(0, 200, 81, 0.35);
}

.slip--lost {
  border-color: rgba(255, 68, 68, 0.3);
}

.slip__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 10px;
}

.slip__legcount {
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--text-2);
}

.slip__time {
  margin-left: auto;
  font-size: var(--fs-caption);
  color: var(--text-2);
  white-space: nowrap;
}

.slip__legs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.leg {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 2px 10px;
  padding: 10px 16px;
}

/* Inset divider: starts 16px from the left edge of the text column */
.leg + .leg::before,
.slip__extra-legs .leg:first-child::before {
  content: '';
  position: absolute;
  top: 0;
  left: 54px;
  right: 0;
  height: 1px;
  background: var(--border);
}

.leg__icon {
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-top: 1px;
}

.leg__icon .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.8;
}

.leg__icon--won {
  background: var(--won-soft);
  color: var(--won);
}

.leg__icon--lost {
  background: var(--lost-soft);
  color: var(--lost);
}

.leg__icon--pending {
  background: var(--surface-3);
  color: var(--pending);
}

.leg__icon--void {
  background: var(--void-soft);
  color: var(--void);
}

.leg__match {
  font-weight: 600;
  font-size: var(--fs-body);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leg__score {
  justify-self: end;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0 6px;
  border-radius: 6px;
  white-space: nowrap;
}

.leg__score--live {
  color: var(--accent);
}

.leg__sub {
  grid-column: 2;
  color: var(--text-2);
  font-size: 13px;
  min-width: 0;
}

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

.leg__odds {
  grid-column: 3;
  justify-self: end;
  align-self: start;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.leg__state {
  grid-column: 2 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: var(--fs-caption);
  color: var(--text-2);
  flex-wrap: wrap;
}

.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--won);
  font-weight: 700;
  font-size: var(--fs-caption);
}

.live-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--won);
  flex: none;
}

.live-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--won);
  animation: pulse-ring 1.6s ease-out infinite;
}

.lean {
  font-weight: 600;
}

.builder-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-weight: 600;
}

.lean--winning {
  color: var(--won);
}

.lean--losing {
  color: var(--lost);
}

.slip__foot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 4px 16px 0;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.kv__label {
  display: block;
  font-size: var(--fs-caption);
  color: var(--text-2);
  margin-bottom: 2px;
}

.kv__value {
  font-weight: 700;
  font-size: var(--fs-subtitle);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.kv__value--won {
  color: var(--won);
}

.kv__value--lost {
  color: var(--lost);
}

.slip__toggle {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 13px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  transition: color 160ms ease, background-color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .slip__toggle:hover {
    color: var(--text);
    background: var(--surface-2);
  }
}

.slip__toggle .icon {
  width: 18px;
  height: 18px;
  transition: transform 260ms var(--ease-out);
}

.slip__toggle[aria-expanded='true'] .icon {
  transform: rotate(180deg);
}

.slip__extra {
  overflow: hidden;
}

.slip__details {
  padding: 4px 16px 14px;
  display: grid;
  gap: 12px;
}

.slip__detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-2);
  font-size: 13px;
}

.slip__thumb {
  width: 56px;
  height: 72px;
  object-fit: cover;
  object-position: top;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex: none;
}

.slip__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.slip__actions .btn {
  flex: 1;
  min-width: 96px;
  padding: 0 12px;
}

.form-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-caption);
}

.form-table caption {
  text-align: left;
  color: var(--text-2);
  padding-bottom: 6px;
  font-weight: 600;
}

.form-table th,
.form-table td {
  padding: 4px 6px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.form-table th:first-child,
.form-table td:first-child {
  text-align: left;
}

.form-table thead th {
  color: var(--text-2);
  font-weight: 600;
}

/* Score update flash */
.flash {
  animation: flash 400ms ease-out;
}

@keyframes flash {
  from {
    background-color: rgba(245, 166, 35, 0.55);
  }
  to {
    background-color: transparent;
  }
}

/* ============ Live panel ============ */
.live-meta {
  color: var(--text-2);
  font-size: var(--fs-caption);
  margin: -4px 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.live-meta--stale {
  color: var(--pending);
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--border);
}

.notice .icon {
  color: var(--accent);
  margin-top: 1px;
}

.notice__title {
  font-weight: 600;
  margin-bottom: 2px;
}

.notice__body {
  color: var(--text-2);
  font-size: 13px;
}

.live-group + .live-group {
  margin-top: 20px;
}

.live-group__list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.match-row {
  position: relative;
  padding: 12px 16px 12px 19px;
}

.match-row::after {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--border-strong);
}

.match-row--good::after {
  background: var(--won);
}

.match-row--bad::after {
  background: var(--lost);
}

.match-row + .match-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 1px;
  background: var(--border);
}

.match-row__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--fs-caption);
  color: var(--text-2);
  margin-bottom: 8px;
}

.match-row__teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.match-row__team {
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.match-row__team--home {
  text-align: right;
}

.match-row__score {
  min-width: 64px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--surface-3);
  font-size: var(--fs-title);
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.match-row__score--live {
  color: var(--accent);
}

.match-row__score--pre {
  font-size: var(--fs-body);
  color: var(--text-2-raised);
}

.match-row__legs {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.leg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-caption);
  font-weight: 600;
  background: var(--surface-3);
  color: var(--text-2-raised);
  max-width: 100%;
}

.leg-chip__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leg-chip .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.8;
}

.leg-chip--good {
  background: var(--won-soft);
  color: var(--won);
}

.leg-chip--bad {
  background: var(--lost-soft);
  color: #ff6b6b;
}

.leg-chip--void {
  background: var(--void-soft);
  color: #5cb3f7;
}

/* ============ Stats ============ */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.metric {
  padding: 14px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 0;
}

.metric--wide {
  grid-column: 1 / -1;
}

.metric__label {
  font-size: var(--fs-caption);
  color: var(--text-2);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric__value {
  font-size: var(--fs-hero);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.metric__value--sm {
  font-size: var(--fs-title);
}

.metric__hint {
  margin-top: 4px;
  font-size: var(--fs-caption);
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos {
  color: var(--won);
}

.neg {
  color: var(--lost);
}

.card {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--border);
}

.card__title {
  font-size: var(--fs-subtitle);
  font-weight: 600;
  margin-bottom: 4px;
}

.card__sub {
  font-size: var(--fs-caption);
  color: var(--text-2);
  margin-bottom: 14px;
}

/* CSS-only P&L bar chart */
.chart {
  --chart-h: 140px;
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: var(--chart-h);
  list-style: none;
  margin: 0;
  padding: 0;
}

.chart::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border-strong);
}

.chart__col {
  flex: 1;
  position: relative;
  min-width: 0;
}

.chart__bar {
  position: absolute;
  left: 12%;
  right: 12%;
  border-radius: 4px;
  transform-origin: bottom;
  animation: bar-grow 420ms var(--ease-out) backwards;
}

.chart__bar--pos {
  bottom: 50%;
  height: calc(var(--v) * 50%);
  background: var(--won);
  border-radius: 4px 4px 1px 1px;
}

.chart__bar--neg {
  top: 50%;
  height: calc(var(--v) * 50%);
  background: repeating-linear-gradient(135deg, var(--lost) 0 4px, #d93636 4px 7px);
  border-radius: 1px 1px 4px 4px;
  transform-origin: top;
}

.chart__col.is-today .chart__bar {
  box-shadow: 0 0 0 2px var(--accent);
}

@keyframes bar-grow {
  from {
    transform: scaleY(0.001);
  }
}

.chart-axis {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  font-size: 10px;
  color: var(--text-2);
}

.chart-axis span {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
  white-space: nowrap;
}

/* Heatmap */
.heatmap-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
}

.heatmap-days {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
  font-size: 10px;
  color: var(--text-2);
}

.heatmap-days span {
  display: flex;
  align-items: center;
  line-height: 1;
}

.heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
}

.heatmap__cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--surface-3);
  min-width: 0;
}

.heatmap__cell--future {
  background: transparent;
}

.heatmap__cell--even {
  background: #555;
}

.heatmap__cell--win.l1 {
  background: rgba(0, 200, 81, 0.4);
}
.heatmap__cell--win.l2 {
  background: rgba(0, 200, 81, 0.7);
}
.heatmap__cell--win.l3 {
  background: var(--won);
}

/* Losses get a diagonal hatch so the heatmap never relies on colour alone */
.heatmap__cell--loss {
  background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.45) 0 2px, transparent 2px 4px);
}
.heatmap__cell--loss.l1 {
  background-color: rgba(255, 68, 68, 0.45);
}
.heatmap__cell--loss.l2 {
  background-color: rgba(255, 68, 68, 0.72);
}
.heatmap__cell--loss.l3 {
  background-color: var(--lost);
}

.heatmap__cell.is-today {
  outline: 1.5px solid var(--accent);
  outline-offset: 1px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  font-size: var(--fs-caption);
  color: var(--text-2);
}

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

.legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* ============ Settings ============ */
.settings-group {
  margin-bottom: 24px;
}

.settings-group__title {
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 4px 8px;
}

.settings-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  list-style: none;
  margin: 0;
  padding: 0;
}

.settings-item {
  position: relative;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}

.settings-item + .settings-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 0;
  height: 1px;
  background: var(--border);
}

.settings-item--stack {
  flex-direction: column;
  align-items: stretch;
}

.settings-item__text {
  flex: 1;
  min-width: 0;
}

.settings-item__label {
  font-weight: 600;
  display: block;
}

.settings-item__desc {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

/* Switch built on a native checkbox */
.switch {
  position: relative;
  flex: none;
  width: 52px;
  height: 44px;
  display: inline-flex;
  align-items: center;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.switch__track {
  width: 52px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  position: relative;
  transition: background-color 200ms ease, border-color 200ms ease;
}

.switch__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #cfcfcf;
  transition: transform 240ms var(--ease-out), background-color 200ms ease;
}

.switch input:checked + .switch__track {
  background: var(--accent);
  border-color: var(--accent);
}

.switch input:checked + .switch__track::after {
  transform: translateX(20px);
  background: var(--accent-ink);
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Form fields */
.field {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2-raised);
}

.field__hint {
  font-size: var(--fs-caption);
  color: var(--text-2);
}

.input,
.select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 16px; /* prevents iOS zoom */
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input::placeholder {
  color: #7a7a7a;
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input[aria-invalid='true'] {
  border-color: var(--lost);
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

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

.form-grid .field--full {
  grid-column: 1 / -1;
}

.leg-fieldset {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px 14px;
  margin: 0 0 12px;
  background: var(--surface);
  min-width: 0;
}

.leg-fieldset legend {
  padding: 0 6px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-2-raised);
}

.leg-fieldset__head {
  display: flex;
  justify-content: flex-end;
  margin: -6px -8px 4px 0;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: var(--fs-body);
  color: var(--text-2-raised);
  cursor: pointer;
}

.check input {
  width: 20px;
  height: 20px;
  flex: none;
  margin: 0;
  accent-color: var(--accent);
}

.score-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-inputs .input {
  text-align: center;
}

.form-section-title {
  font-size: var(--fs-subtitle);
  font-weight: 600;
  margin: 20px 0 10px;
}

.warnings {
  list-style: none;
  padding: 12px 14px;
  margin: 0 0 16px;
  border-radius: 12px;
  background: var(--pending-soft);
  border: 1px solid rgba(255, 179, 0, 0.35);
  display: grid;
  gap: 4px;
  font-size: 13px;
}

.warnings li {
  display: flex;
  gap: 8px;
}

.warnings .icon {
  color: var(--pending);
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.raw-text {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-2);
}

.raw-text summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
}

.raw-text pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  max-height: 240px;
  overflow: auto;
  font-size: 12px;
}

/* ============ Import progress ============ */
.import-progress {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 8px 0 16px;
  text-align: center;
}

.import-progress__thumb {
  width: 132px;
  max-height: 220px;
  object-fit: cover;
  object-position: top;
  border-radius: 12px;
  border: 1px solid var(--border);
  position: relative;
}

.scan {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.scan::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 40px;
  top: -40px;
  background: linear-gradient(180deg, transparent, rgba(245, 166, 35, 0.45), transparent);
  animation: scan 1.6s var(--ease-in-out) infinite;
}

@keyframes scan {
  to {
    transform: translateY(260px);
  }
}

.progress {
  width: 100%;
  max-width: 280px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 100%;
  background: var(--accent);
  border-radius: inherit;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 300ms var(--ease-out);
}

/* ============ FAB ============ */
.fab {
  position: fixed;
  z-index: 30;
  right: max(24px, calc((100vw - var(--content-w)) / 2 + 24px));
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 24px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(245, 166, 35, 0.28), 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: transform 160ms var(--ease-out), box-shadow 200ms ease;
}

.fab .icon {
  stroke-width: 2.2;
}

.fab:active {
  transform: scale(0.94);
}

.fab:focus-visible {
  outline-offset: 4px;
  border-radius: 50%;
}

.fab.is-hidden {
  transform: scale(0.6);
  opacity: 0;
  pointer-events: none;
  transition: transform 200ms var(--ease-out), opacity 150ms ease;
}

/* ============ Bottom navigation ============ */
.bottomnav {
  position: fixed;
  z-index: 25;
  left: 0;
  right: 0;
  bottom: 0;
  padding-bottom: var(--safe-bottom);
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-top: 1px solid var(--border);
}

.bottomnav__list {
  max-width: var(--content-w);
  margin: 0 auto;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.bottomnav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 44px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  transition: color 160ms ease;
  position: relative;
}

.bottomnav__item .icon {
  transition: transform 200ms var(--ease-out);
}

.bottomnav__item:active .icon {
  transform: scale(0.9);
}

.bottomnav__item[aria-selected='true'] {
  color: var(--accent);
}

.bottomnav__item[aria-selected='true']::before {
  content: '';
  position: absolute;
  top: 0;
  left: 30%;
  right: 30%;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--accent);
}

.bottomnav__icon-wrap {
  position: relative;
  display: inline-flex;
}

.bottomnav__badge {
  position: absolute;
  top: -4px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--won);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* ============ Sheet (dialog) ============ */
dialog {
  color: var(--text);
}

.sheet {
  position: fixed;
  inset: auto 0 0 0;
  margin: 0 auto;
  padding: 0;
  width: 100%;
  max-width: var(--content-w);
  max-height: 94dvh;
  border: 0;
  background: transparent;
  overflow: visible;
}

.sheet::backdrop,
.modal::backdrop {
  background: rgba(0, 0, 0, 0.62);
  animation: fade-in 200ms ease;
}

.sheet.is-closing::backdrop,
.modal.is-closing::backdrop {
  opacity: 0;
  transition: opacity 180ms ease;
}

.sheet__panel {
  display: flex;
  flex-direction: column;
  max-height: 94dvh;
  background: #161616;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  animation: sheet-in 420ms var(--ease-drawer);
  will-change: transform;
}

.sheet__grabber {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--border-strong);
  margin: 8px auto 0;
  flex: none;
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px 6px 20px;
  flex: none;
}

.sheet__title {
  font-size: var(--fs-title);
}

.sheet__body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 20px 20px;
}

.sheet__footer {
  position: sticky;
  bottom: -20px;
  margin: 16px -20px -20px;
  padding: 12px 20px calc(12px + 0px);
  background: linear-gradient(180deg, rgba(22, 22, 22, 0), #161616 30%);
  display: flex;
  gap: 8px;
}

.sheet__footer .btn {
  flex: 1;
}

@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
}

/* Modal */
.modal {
  padding: 0;
  border: 0;
  background: transparent;
  width: calc(100% - 32px);
  max-width: 380px;
}

.modal__panel {
  background: #1c1c1c;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 20px 16px;
  animation: modal-in 220ms var(--ease-out);
}

.modal__title {
  font-size: var(--fs-title);
  margin-bottom: 8px;
}

.modal__message {
  color: var(--text-2-raised);
  margin-bottom: 20px;
}

.modal__actions {
  display: flex;
  gap: 8px;
}

.modal__actions .btn {
  flex: 1;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* ============ Toasts ============ */
.toasts {
  position: fixed;
  z-index: 60;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 92px);
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 0 16px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  width: 100%;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  min-height: 52px;
  border-radius: 14px;
  background: #262626;
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 240ms ease, transform 320ms var(--ease-out);
}

@starting-style {
  .toast {
    opacity: 0;
    transform: translateY(16px);
  }
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition-duration: 160ms;
}

.toast__text {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-weight: 600;
}

.toast__body {
  font-size: 13px;
  color: var(--text-2-raised);
}

/* ============ Animations ============ */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* ============ Responsive ============ */
@media (min-width: 420px) {
  .metric-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .metric--half {
    grid-column: span 1;
  }
}

@media (max-width: 359px) {
  .panel__title {
    font-size: 24px;
  }
  .slip__foot {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 720px) {
  main {
    padding-top: 16px;
  }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .badge,
  .chart__bar,
  .sheet__panel,
  .modal__panel {
    animation: fade-in 200ms ease !important;
  }

  .live-dot::after,
  .scan::after {
    display: none;
  }

  .sync-chip.is-live .sync-chip__dot,
  .sync-chip.is-syncing .sync-chip__dot {
    animation: none !important;
  }

  .ptr__spinner {
    animation: spin 1.2s linear infinite !important;
    animation-iteration-count: infinite !important;
    animation-duration: 1.2s !important;
  }

  .toast,
  .switch__track::after,
  .slip__toggle .icon,
  .fab,
  .skip-link {
    transition-property: opacity, background-color, color !important;
  }

  @starting-style {
    .toast {
      transform: none;
    }
  }

  .flash {
    animation: flash 400ms ease-out !important;
  }
}

/* ============ Slip editor (v2) ============ */
.leg-edit {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 8px 14px 14px;
  margin: 0 0 12px;
  min-width: 0;
  display: grid;
  gap: 12px;
}

.leg-edit:has([aria-invalid='true']) {
  border-color: rgba(255, 68, 68, 0.6);
}

.leg-edit__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: -8px;
}

.leg-edit__num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}

.leg-edit__summary {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leg-edit .link-field {
  margin-top: -6px;
}

/* Market chips + selection choices: native radios styled as buttons */
.chips,
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-radio,
.choice {
  position: relative;
  display: inline-flex;
}

.chip-radio input,
.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.chip-radio span,
.choice span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text-2-raised);
  font-weight: 600;
  font-size: 13px;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms var(--ease-out);
}

.choice {
  flex: 1 1 0;
  min-width: 96px;
}

.choice span {
  width: 100%;
  justify-content: center;
  text-align: center;
  min-height: 48px;
  border-radius: 12px;
  font-size: var(--fs-body);
  line-height: 1.2;
  padding: 6px 10px;
}

.chip-radio input:checked + span,
.choice input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.chip-radio input:focus-visible + span,
.choice input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.chip-radio:active span,
.choice:active span {
  transform: scale(0.97);
}

.selbox {
  display: grid;
  gap: 10px;
}

.selbox:has([aria-invalid='true']) .choices span {
  border-color: rgba(255, 68, 68, 0.6);
}

/* Match search combobox */
.combo {
  position: relative;
}

.suggest {
  list-style: none;
  margin: 6px 0 0;
  padding: 4px;
  max-height: 280px;
  overflow-y: auto;
  border-radius: 12px;
  background: #202020;
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.suggest__item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
}

.suggest__item[aria-selected='true'],
.suggest__item:hover {
  background: var(--surface-3);
}

.suggest__teams {
  font-weight: 600;
}

.suggest__meta {
  font-size: var(--fs-caption);
  color: var(--text-2-raised);
}

.suggest__info {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-2-raised);
}

/* Collapsible extra fields */
.more summary,
.shot summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-2-raised);
  list-style: none;
}

.more summary::-webkit-details-marker,
.shot summary::-webkit-details-marker {
  display: none;
}

.more summary::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  margin-left: 4px;
  transition: transform 200ms var(--ease-out);
}

.more[open] summary::after {
  transform: rotate(225deg) translateY(-2px);
}

.more > .form-grid {
  padding: 4px 0 4px;
}

.shot {
  margin-bottom: 8px;
}

.shot img {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  object-position: top;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
}

/* Stake */
.stake-row {
  display: grid;
  gap: 8px;
}

.input-affix {
  position: relative;
}

.input-affix .input {
  padding-right: 48px;
  font-size: var(--fs-title);
  font-weight: 700;
}

.input-affix span {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2-raised);
  font-weight: 600;
}

.stake-chips {
  display: flex;
  gap: 6px;
}

.chip-btn {
  flex: 1;
  min-height: 40px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  transition: transform 150ms var(--ease-out), background-color 150ms ease;
}

.chip-btn:active {
  transform: scale(0.96);
}

.form-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 14px 0 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(245, 166, 35, 0.3);
  font-size: 13px;
  color: var(--text-2-raised);
}

.form-summary strong {
  color: var(--text);
  font-size: var(--fs-subtitle);
  margin-left: 4px;
}

.form-error {
  color: #ff6b6b;
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  min-height: 1em;
}

/* In-play neutral hint ("Döntetlen az állás") */
.lean--neutral {
  color: var(--text-2-raised);
}

/* Leg status icon is a button on cards */
button.leg__icon {
  position: relative;
  cursor: pointer;
  transition: transform 150ms var(--ease-out);
}

button.leg__icon::after {
  content: '';
  position: absolute;
  inset: -8px;
}

button.leg__icon:active {
  transform: scale(0.9);
}

/* Quick status picker */
.status-picker__leg {
  margin-bottom: 14px;
}

.status-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.status-picker__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-weight: 700;
  transition: transform 150ms var(--ease-out), background-color 150ms ease;
}

.status-picker__btn:active {
  transform: scale(0.97);
}

.status-picker__btn--won .icon {
  color: var(--won);
}
.status-picker__btn--lost .icon {
  color: var(--lost);
}
.status-picker__btn--void .icon {
  color: var(--void);
}
.status-picker__btn--pending .icon {
  color: var(--pending);
}

.status-picker__btn[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ============ Account (Firebase) ============ */
.appbar__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.account-btn[hidden] {
  display: none;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--surface-3);
}

.avatar--initial {
  display: inline-grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: var(--fs-body);
}

.avatar--lg {
  width: 44px;
  height: 44px;
  font-size: var(--fs-subtitle);
}

.account-btn.is-signed-in .avatar {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--border-strong);
}

.account__email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account__domain {
  color: var(--text);
  font-weight: 600;
  word-break: break-all;
}

.btn--google {
  background: #ffffff;
  color: #1f1f1f;
  gap: 10px;
}

@media (hover: hover) and (pointer: fine) {
  .btn--google:not(:disabled):hover {
    background: #f1f1f1;
  }
}

.google-logo {
  width: 18px;
  height: 18px;
  flex: none;
}

.account__domain-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  text-align: center;
}
