/* RefTools — referee toolkit design system */
:root {
  --bg: #0a0f14;
  --bg-elevated: #111922;
  --surface: #151d28;
  --surface-hover: #1a2433;
  --border: #2a3544;
  --border-soft: #1e2836;
  --text: #eef2f6;
  --text-secondary: #8fa3b8;
  --text-muted: #5c7084;
  --accent: #1b8f4e;
  --accent-bright: #22a85c;
  --accent-glow: rgba(34, 168, 92, 0.22);
  --gold: #d4a853;
  --gold-dim: rgba(212, 168, 83, 0.15);
  --warn: #e5a23c;
  --danger: #e85d5d;
  --yellow-card: #e3b341;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --tap: 48px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(27, 143, 78, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(212, 168, 83, 0.06), transparent 50%);
}

.app-shell {
  max-width: 520px;
  margin: 0 auto;
}

/* Nav */
.nav-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  min-height: 44px;
}

.nav-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  margin-left: -8px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition), color var(--transition);
}

.nav-back:hover,
.nav-back:active {
  background: var(--surface);
  color: var(--text);
}

.nav-title {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Header */
.page-header {
  margin-bottom: 24px;
}

.page-header .brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--accent) 0%, #0d5c32 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 14px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
  line-height: 1.2;
}

.page-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 36ch;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.card-title {
  margin: 0 0 14px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* Home tool grid */
.tool-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 18px 18px 16px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition),
    background var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow);
}

.tool-card:active {
  transform: scale(0.985);
}

.tool-card:hover {
  border-color: var(--border);
  background: var(--surface-hover);
}

.tool-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.tool-icon--time {
  background: linear-gradient(145deg, rgba(34, 168, 92, 0.25), rgba(27, 143, 78, 0.08));
  border: 1px solid rgba(34, 168, 92, 0.35);
}

.tool-icon--fee {
  background: var(--gold-dim);
  border: 1px solid rgba(212, 168, 83, 0.35);
}

.tool-icon--docs {
  background: linear-gradient(145deg, rgba(88, 166, 255, 0.22), rgba(37, 99, 235, 0.08));
  border: 1px solid rgba(88, 166, 255, 0.35);
}

.tool-icon--bookmark {
  background: linear-gradient(145deg, rgba(167, 139, 250, 0.22), rgba(124, 58, 237, 0.08));
  border: 1px solid rgba(167, 139, 250, 0.35);
}

.tool-body {
  flex: 1;
  min-width: 0;
}

.tool-name {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tool-desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.tool-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 1.25rem;
  font-weight: 300;
}

/* Fields */
.field {
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.text-input,
.select-input {
  width: 100%;
  min-height: var(--tap);
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.select-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238fa3b8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--transition), background var(--transition),
    border-color var(--transition);
}

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

.btn-primary {
  width: 100%;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-ghost-sm {
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.85rem;
}

.btn-add {
  border-color: var(--accent-bright);
  background: var(--accent-glow);
  color: var(--accent-bright);
}

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

/* Chips & segments */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--transition), background var(--transition);
}

.chip[aria-pressed="true"],
.chip.active {
  border-color: var(--accent-bright);
  background: var(--accent-glow);
  color: var(--accent-bright);
}

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

.seg-btn {
  flex: 1;
  min-height: var(--tap);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.seg-btn[aria-selected="true"] {
  border-color: var(--accent-bright);
  background: var(--accent-glow);
  color: var(--accent-bright);
}

.summary-pill {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.summary-pill strong {
  color: var(--text);
}

/* Results */
.result-hero {
  text-align: center;
  padding: 20px 16px;
  background: linear-gradient(180deg, var(--bg-elevated), var(--surface));
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  margin-bottom: 12px;
}

.result-hero .amount {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--gold);
}

.result-hero .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.settlement-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  font-size: 0.95rem;
}

.settlement-item .arrow {
  color: var(--gold);
  font-weight: 700;
}

.person-totals {
  display: grid;
  gap: 10px;
}

.person-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
}

.person-row .name {
  font-weight: 600;
}

.person-row .meta {
  text-align: right;
  font-size: 0.85rem;
}

.person-row .meta .earn {
  color: var(--gold);
  font-weight: 700;
  font-size: 1rem;
}

.person-row .meta .sub {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.footer-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.55;
  padding: 8px 0 0;
}

.footer-note em {
  font-style: normal;
  font-weight: 600;
  color: var(--text-secondary);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Fee tool — compact single-screen layout */
.fees-page {
  padding-top: max(6px, env(safe-area-inset-top));
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  font-size: 15px;
}

.fees-page .nav-title {
  font-size: 1.1rem;
}

.fees-shell {
  max-width: 520px;
}

.fees-nav {
  margin-bottom: 8px;
  min-height: 36px;
}

.fees-nav .nav-back {
  width: 40px;
  height: 40px;
}

.fees-add-match {
  min-height: 36px;
  min-width: 36px;
  padding: 0 10px;
  margin-right: -4px;
}

.fees-panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
}

.names-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.names-row .name-input {
  min-height: 42px;
  padding: 0 10px;
  font-size: 0.94rem;
}

.matches-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.match-row {
  display: grid;
  grid-template-columns: 38px 1fr 1fr 1fr;
  gap: 6px;
  align-items: stretch;
}

.match-row--head {
  margin-bottom: 2px;
}

.match-row--head .match-slot-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
  padding: 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-slot-label--corner {
  visibility: hidden;
}

.match-index {
  position: relative;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.1;
}

.match-index .match-total {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--gold);
  margin-top: 1px;
}

.match-del {
  position: absolute;
  top: -4px;
  right: -2px;
  width: 14px;
  height: 14px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.65rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.match-del:active {
  color: var(--danger);
}

.role-slot {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.role-slot:focus-within {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.role-slot .role-select {
  width: 100%;
  min-height: 40px;
  padding: 8px 24px 6px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  border: none;
  border-radius: 0;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238fa3b8' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px 6px;
}

.role-slot .role-select:focus {
  outline: none;
  box-shadow: none;
  background-color: var(--surface-hover);
}

.fees-page .role-slot .role-select option {
  background-color: #1a2433;
  color: #eef2f6;
}

.role-fee-line {
  padding: 4px 6px 6px;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  color: #f0c96a;
  background: linear-gradient(180deg, rgba(212, 168, 83, 0.18), rgba(212, 168, 83, 0.08));
  border-top: 1px solid rgba(212, 168, 83, 0.28);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.role-fee-line.is-empty {
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.15);
  border-top-color: var(--border-soft);
}

.fees-results {
  border-top: 1px solid var(--border-soft);
  padding-top: 8px;
}

.fees-scope-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 6px;
  padding: 6px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--warn);
  background: rgba(229, 162, 60, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(229, 162, 60, 0.25);
  line-height: 1.35;
}

.fee-emoji {
  display: inline-block;
  font-size: 0.95em;
  line-height: 1;
  flex-shrink: 0;
}

.fees-scope-hint .fee-emoji {
  font-size: 0.9em;
}

.fees-results-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.fees-person-card {
  padding: 8px 10px;
  background: var(--bg-elevated);
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  line-height: 1.35;
}

.fees-person-card--idle .fp-row--hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.fees-person-card--idle .fp-row--hint .fee-emoji {
  font-size: 0.85em;
}

.fees-person-card .fp-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.fees-person-card .fp-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fees-person-card .fp-name .fee-emoji {
  font-size: 1.15em;
}

.fees-person-card .fp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  margin-top: 4px;
}

.fees-person-card .fp-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
  min-width: 0;
}

.fees-person-card .fp-label .fee-emoji {
  font-size: 0.95em;
}

.fees-person-card .fp-label .fee-emoji + span {
  white-space: nowrap;
}

.fees-person-card .fp-val {
  font-weight: 700;
  color: var(--text-secondary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.fees-person-card .fp-val--earn {
  color: var(--gold);
  font-size: 0.9rem;
}

.fp-balance--ok {
  color: var(--accent-bright);
}

.fp-balance--over {
  color: var(--warn);
}

.fp-balance--under {
  color: #7eb8ff;
}

.settlement-inline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.settlement-inline .settlement-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 100%;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
}

.settlement-inline .settlement-chip .fee-emoji {
  font-size: 0.95em;
}

.settlement-inline .settlement-chip--head {
  background: transparent;
  border: none;
  padding: 2px 0 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  justify-content: flex-start;
}

.settlement-inline .settlement-chip--head .fee-emoji {
  font-size: 0.9em;
}

.settlement-inline .settlement-chip strong {
  color: var(--text);
}

.settlement-inline .settlement-chip .amt {
  color: var(--gold);
}

.settlement-inline .settlement-chip--hint {
  color: var(--text-muted);
  font-weight: 500;
}

.settlement-inline .settlement-chip--warn {
  color: var(--warn);
  border-color: rgba(229, 162, 60, 0.35);
}

.fees-page .card,
.fees-page .page-header {
  display: none;
}

/* Fee rate reference (bottom of fees page) */
.fee-schedule {
  margin-top: 10px;
  padding: 10px 12px 8px;
  background: rgba(21, 29, 40, 0.65);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}

.fee-schedule-title {
  margin: 0 0 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.fee-schedule-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fee-schedule-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 8px;
  align-items: baseline;
  font-size: 0.76rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.fee-tier {
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.fee-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--text-muted);
}

.fee-role em {
  font-style: normal;
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 2px;
}

.fee-role .fee-amt {
  color: var(--text-secondary);
  font-weight: 600;
}

.fee-match-total {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  text-align: right;
}

.fee-match-total::before {
  content: "Σ ";
  font-weight: 600;
  opacity: 0.75;
}

/* Time tool — compact single-screen layout */
.time-page {
  padding-top: max(6px, env(safe-area-inset-top));
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  font-size: 15px;
}

.time-shell {
  max-width: 520px;
}

.time-nav {
  margin-bottom: 8px;
  min-height: 36px;
}

.time-nav .nav-back {
  width: 40px;
  height: 40px;
}

.time-add-entry {
  min-height: 36px;
  min-width: 36px;
  padding: 0 10px;
  margin-right: -4px;
}

.time-panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.time-setup {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}

.time-setup-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.time-setup-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 28px;
}

.time-chips {
  flex: 1;
  min-width: 0;
}

.time-chips .chip {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.time-min-input {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
}

.time-min-input input {
  width: 40px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 4px 0;
  text-align: center;
}

.time-min-input input:focus {
  outline: none;
}

.time-min-input .suffix {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.time-segment .seg-btn {
  min-height: 34px;
  min-width: 36px;
  flex: 0 0 auto;
  padding: 0 12px;
  font-size: 0.88rem;
}

.time-summary-inline {
  margin-left: auto;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-bright);
  white-space: nowrap;
}

.time-entries {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.time-entry {
  display: grid;
  grid-template-columns: 18px auto 50px minmax(96px, 1.6fr) 94px 22px;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: visible;
  min-width: 280px;
}

.time-entry-index {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-align: center;
}

.time-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 76px;
  flex-shrink: 1;
  min-width: 0;
}

.period-chip--sm {
  min-width: 32px;
  min-height: 34px;
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.period-chip--sm[aria-pressed="true"] {
  border-color: var(--accent-bright);
  background: var(--accent-glow);
  color: var(--accent-bright);
}

.time-countdown-input {
  width: 100%;
  min-height: 36px;
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

.time-countdown-input:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.time-countdown-input::placeholder {
  color: var(--text-muted);
  font-weight: 600;
}

.time-result {
  text-align: center;
  min-width: 92px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid rgba(34, 168, 92, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  overflow: visible;
  flex-shrink: 0;
  justify-self: stretch;
  z-index: 1;
}

.time-result-main {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent-bright);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.time-result-main .sep {
  color: var(--text-muted);
  font-weight: 600;
  margin: 0 2px;
}

.time-result-unit {
  font-size: 0.75em;
  color: var(--text-muted);
}

.time-result.warn .time-result-main {
  color: var(--warn);
}

.time-events {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
  justify-self: end;
}

.event-btn--sm {
  width: 28px;
  min-height: 34px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.event-btn--sm[aria-pressed="true"] {
  border-color: var(--accent-bright);
  background: var(--accent-glow);
}

.event-btn--sm[data-kind="goal"][aria-pressed="true"] {
  border-color: #58a6ff;
  background: rgba(88, 166, 255, 0.15);
}

.event-btn--sm[data-kind="yellow"][aria-pressed="true"] {
  border-color: var(--yellow-card);
  background: rgba(227, 179, 65, 0.15);
}

.event-btn--sm[data-kind="red"][aria-pressed="true"] {
  border-color: var(--danger);
  background: rgba(232, 93, 93, 0.15);
}

.time-entry-del {
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.time-entry-del:active {
  color: var(--danger);
}

.time-formula-hint {
  margin: 8px 0 0;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.4;
  text-align: center;
}

.time-formula-hint strong {
  color: var(--text-secondary);
  font-weight: 700;
}

/* shared period-chip fallback */
.period-chip[aria-pressed="true"] {
  border-color: var(--accent-bright);
  background: var(--accent-glow);
  color: var(--accent-bright);
}

.manual-input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  min-height: var(--tap);
}

.manual-input input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 8px 0;
}

.manual-input input:focus {
  outline: none;
}

.manual-input .suffix {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Docs hub — league handbooks & rules */
.docs-page {
  padding-top: max(6px, env(safe-area-inset-top));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.docs-shell {
  max-width: 560px;
}

.docs-nav {
  margin-bottom: 6px;
}

.docs-intro {
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.docs-league-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin: 0 -4px 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.docs-league-tab {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 88px;
  max-width: 108px;
  padding: 12px 10px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition),
    transform var(--transition), background var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.docs-league-tab[aria-selected="true"] {
  border-color: var(--league-accent, var(--accent-bright));
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--league-accent, var(--accent)) 18%, var(--surface)),
    var(--surface)
  );
  box-shadow: 0 6px 24px color-mix(in srgb, var(--league-accent, var(--accent)) 25%, transparent);
}

.docs-league-tab:active {
  transform: scale(0.97);
}

.docs-tab-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
}

.docs-tab-logos img {
  max-height: 40px;
  max-width: 72px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.docs-tab-name {
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.docs-league-tab[aria-selected="true"] .docs-tab-name {
  color: var(--text);
}

.docs-league-panel {
  --league-accent: var(--accent-bright);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}

.docs-panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}

.docs-panel-logos {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 12px;
  background: #f4f6f8;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.docs-panel-logos img {
  max-height: 48px;
  max-width: 64px;
  object-fit: contain;
}

.docs-panel-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.docs-panel-count {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.docs-file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.docs-file-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition),
    transform var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.docs-file-btn:hover,
.docs-file-btn.is-active {
  border-color: color-mix(in srgb, var(--league-accent) 55%, var(--border));
  background: color-mix(in srgb, var(--league-accent) 8%, var(--bg-elevated));
}

.docs-file-btn:active {
  transform: scale(0.99);
}

.docs-file-icon {
  flex-shrink: 0;
  font-size: 1.35rem;
  line-height: 1;
}

.docs-file-text {
  flex: 1;
  min-width: 0;
}

.docs-file-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.docs-file-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-file-go {
  flex-shrink: 0;
  font-size: 1.2rem;
  color: var(--text-muted);
  font-weight: 300;
}

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

/* Fullscreen document viewer */
.doc-viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: #0c1018;
}

.doc-viewer[hidden] {
  display: none !important;
}

body.docs-viewer-open {
  overflow: hidden;
}

.doc-viewer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(8px, env(safe-area-inset-top)) 12px 10px;
  background: rgba(17, 25, 34, 0.96);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(12px);
}

.doc-viewer-titles {
  flex: 1;
  min-width: 0;
}

.doc-viewer-league {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.doc-viewer-title {
  margin: 2px 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-viewer-meta {
  display: block;
  margin-top: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.35;
}

.doc-viewer-icon-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.doc-viewer-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #525659;
  overflow: hidden;
}

.doc-viewer-status {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 15, 20, 0.72);
  pointer-events: none;
}

.doc-viewer-status.is-active {
  display: flex;
}

.doc-status-loading {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
}

.doc-status-err {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.45;
}

/* PDF.js continuous reader */
.pdf-viewport {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.pdf-viewport[hidden] {
  display: none !important;
}

.pdf-scroller {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.pdf-pages {
  margin: 0 auto;
  padding: 12px 0 24px;
}

.pdf-page {
  position: relative;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.pdf-page.is-rendering::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(255, 255, 255, 0) 70%
  );
  animation: pdf-shimmer 1.2s ease-in-out infinite;
}

@keyframes pdf-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.pdf-page-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.pdf-page-label {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(17, 25, 34, 0.08);
}

.doc-embed-wrap {
  position: absolute;
  inset: 0;
  background: #fff;
}

.doc-embed-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.doc-image-wrap {
  position: absolute;
  inset: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #1a1a1a;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
}

.doc-image-wrap[hidden] {
  display: none !important;
}

.doc-image-view {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.docs-panel-venue {
  margin: 6px 0 0;
  font-size: 0.76rem;
  line-height: 1.4;
}

.docs-panel-venue a {
  color: var(--accent-bright);
  text-decoration: none;
  font-weight: 600;
}

.docs-panel-venue a:active {
  text-decoration: underline;
}

.doc-viewer-fallback {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  margin: 0;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text);
  background: rgba(17, 25, 34, 0.92);
  border-radius: var(--radius-sm);
  z-index: 2;
}

.doc-viewer-fallback a {
  color: var(--accent-bright);
  font-weight: 600;
}

.doc-viewer-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 12px max(12px, env(safe-area-inset-bottom));
  background: rgba(17, 25, 34, 0.96);
  border-top: 1px solid var(--border-soft);
}

.doc-viewer-footer .doc-nav-btn:first-child {
  justify-self: start;
}

.doc-viewer-footer .doc-nav-btn:last-child {
  justify-self: end;
}

.doc-zoom-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-self: center;
}

.doc-zoom-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.doc-zoom-btn:active {
  background: var(--surface-hover);
}

.doc-zoom-level {
  min-width: 56px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent-bright);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.doc-zoom-level:disabled {
  opacity: 0.55;
  cursor: default;
}

.doc-nav-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

body.docs-viewer-native-fs .doc-viewer-bar,
body.docs-viewer-native-fs .doc-viewer-footer {
  opacity: 0.92;
}

body.docs-viewer-native-fs .doc-viewer-stage {
  background: #525659;
}

/* Bookmarks — quick links from BookmarkList.txt */
.bookmarks-page {
  padding-top: max(6px, env(safe-area-inset-top));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.bookmarks-shell {
  max-width: 560px;
}

.bookmarks-nav {
  margin-bottom: 6px;
}

.match-report-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--transition), background var(--transition);
  overflow: hidden;
}

.match-report-copy:active,
.match-report-copy.is-copied {
  border-color: var(--accent-bright);
  background: var(--accent-glow);
}

.match-report-copy-badge {
  flex-shrink: 0;
  padding: 3px 7px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-dim);
  border-radius: 6px;
  border: 1px solid rgba(212, 168, 83, 0.35);
}

.match-report-copy-preview {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-report-copy-action {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.match-report-copy.is-copied .match-report-copy-action {
  color: var(--accent-bright);
}

.bookmarks-intro {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.bookmarks-intro code {
  font-size: 0.78rem;
  color: var(--accent-bright);
  background: var(--bg-elevated);
  padding: 1px 6px;
  border-radius: 4px;
}

.bookmarks-updated {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

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

.bookmark-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 16px 16px 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.bookmark-link:active {
  transform: scale(0.985);
  background: var(--surface-hover);
  border-color: rgba(167, 139, 250, 0.45);
}

.bookmark-icon {
  flex-shrink: 0;
  font-size: 1.35rem;
  line-height: 1;
}

.bookmark-text {
  flex: 1;
  min-width: 0;
}

.bookmark-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.bookmark-host {
  display: block;
  margin-top: 3px;
  font-size: 0.74rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmark-go {
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--accent-bright);
  font-weight: 600;
}

.bookmarks-empty {
  margin: 20px 0 0;
  padding: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.bookmarks-empty code {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Bookmark shell (pages/bookmark-view.html) */
.bookmark-view-page {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

.bookmark-float-back {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 10px 14px 10px 11px;
  min-height: 44px;
  border-radius: 999px;
  background: rgba(10, 15, 20, 0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
}

.bookmark-float-back:active {
  background: rgba(10, 15, 20, 0.85);
}

.bookmark-float-back-icon {
  font-size: 1.35rem;
  line-height: 1;
  margin-top: -2px;
}

.bookmark-view-frame {
  display: block;
  width: 100%;
  height: 100dvh;
  border: none;
  background: #fff;
}

.bookmark-view-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100dvh;
  padding: 24px 20px;
  padding-top: max(72px, calc(env(safe-area-inset-top) + 56px));
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  box-sizing: border-box;
}

.bookmark-view-fallback-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

.bookmark-view-host {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: #5ec8e8;
  word-break: break-all;
}

.bookmark-view-reason {
  margin: 0 0 8px;
  max-width: 28rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.bookmark-view-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(100%, 280px);
}

.bookmark-view-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  min-height: 48px;
}

.bookmark-view-open--secondary {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
}

/* Cary Cup rules page (pages/cary-cup-rules.html) */
.rules-page {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  padding-bottom: 32px;
}

.rules-hero {
  text-align: center;
  padding: 24px 20px 20px;
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.18), transparent);
  border-bottom: 1px solid var(--border-soft);
}

.rules-logo {
  max-height: 56px;
  max-width: 140px;
  object-fit: contain;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.rules-hero h1 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.rules-hero-sub {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.rules-abbr {
  margin: 0;
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-bright);
  background: var(--accent-glow);
  border-radius: 999px;
  border: 1px solid rgba(34, 168, 92, 0.35);
}

.rules-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(10, 15, 20, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.rules-toc a {
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.rules-toc a:active {
  color: var(--accent-bright);
  border-color: rgba(34, 168, 92, 0.45);
}

.rules-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

/* Pre-game speech — high contrast, compact for field reading */
.pregame-speech {
  margin-bottom: 20px;
  padding: 14px 14px 12px;
  border-radius: var(--radius);
  border: 3px solid #ffd54f;
  background: #0d1117;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.45);
}

.pregame-lead {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.pregame-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 14px;
}

.pregame-list li {
  position: relative;
  padding-left: 14px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.32;
  color: #f5f5f5;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

.pregame-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #69f0ae;
  box-shadow: 0 0 6px rgba(105, 240, 174, 0.7);
}

.pregame-list li:nth-child(3),
.pregame-list li:nth-child(6) {
  grid-column: 1 / -1;
}

.pregame-close {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 2px solid rgba(255, 213, 79, 0.45);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.35;
  color: #ffd54f;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

@media (max-width: 420px) {
  .pregame-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .pregame-list li:nth-child(3),
  .pregame-list li:nth-child(6) {
    grid-column: auto;
  }

  .pregame-list li {
    font-size: 0.9rem;
  }
}

@media (min-width: 421px) and (max-height: 740px) {
  .pregame-speech {
    padding: 12px 12px 10px;
  }

  .pregame-lead {
    font-size: 1rem;
    margin-bottom: 8px;
  }

  .pregame-list li {
    font-size: 0.86rem;
    line-height: 1.28;
  }

  .pregame-close {
    font-size: 0.92rem;
    margin-top: 8px;
    padding-top: 8px;
  }
}

.rules-section {
  margin-bottom: 28px;
}

.rules-section-title {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.rules-section-desc {
  margin: 0 0 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.rules-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  background: var(--surface);
}

.rules-table-wrap--scroll {
  max-width: 100%;
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.rules-table th,
.rules-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}

.rules-table th {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.rules-table td a {
  color: var(--accent-bright);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.rules-table--compact th,
.rules-table--compact td {
  padding: 8px 10px;
  font-size: 0.76rem;
}

.rule-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.rule-card--highlight {
  border-color: rgba(14, 116, 144, 0.45);
  background: linear-gradient(165deg, rgba(14, 116, 144, 0.12), var(--surface));
}

.rule-card h3 {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #5ec8e8;
  letter-spacing: -0.01em;
}

.rule-en {
  margin: 0 0 6px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.rule-zh {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.55;
  padding-left: 10px;
  border-left: 3px solid var(--accent-bright);
}

.rule-en:last-child,
.rule-zh:last-child {
  margin-bottom: 0;
}

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

.rule-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rule-list .rule-en {
  margin: 0;
  font-size: 0.82rem;
}

.rule-list .rule-zh {
  margin: 0;
  font-size: 0.86rem;
}

.rules-details {
  margin-bottom: 8px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.rules-details summary {
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  background: var(--bg-elevated);
}

.rules-details summary::-webkit-details-marker {
  display: none;
}

.rules-details[open] summary {
  border-bottom: 1px solid var(--border-soft);
  color: #5ec8e8;
}

.rules-details-body {
  padding: 12px 14px 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.rules-details-body h4 {
  margin: 14px 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rules-details-body h4:first-child {
  margin-top: 0;
}

.rules-details-body p {
  margin: 0 0 8px;
}

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

.rules-note {
  margin: 10px 0 0;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-style: italic;
}

.rules-footer {
  text-align: center;
  padding: 20px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Tournament info (pages/tournament-info.html) ── */
.t-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit;
  vertical-align: middle;
  line-height: 0;
}

.t-icon svg {
  display: block;
}

.t-icon--sm svg {
  width: 14px;
  height: 14px;
}

.t-icon--hero svg {
  width: 22px;
  height: 22px;
}

.t-icon--now svg {
  width: 28px;
  height: 28px;
  color: #b8ff3c;
}

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

.t-icon--accent {
  color: #5ec8e8;
}

.t-icon--lime {
  color: #b8ff3c;
}

.t-icon--fee {
  color: #7ee787;
}

.t-icon--tag svg {
  width: 12px;
  height: 12px;
}

.t-icon--badge svg {
  width: 11px;
  height: 11px;
}

.t-icon--chevron svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.t-icon--back svg {
  width: 16px;
  height: 16px;
}

.t-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.t-row--time {
  flex-wrap: wrap;
}

.tournament-page {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
}

.tournament-hero {
  padding: max(12px, env(safe-area-inset-top)) 16px 16px;
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg));
  border-bottom: 1px solid var(--border-soft);
}

.tournament-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-bright);
  text-decoration: none;
}

.tournament-hero h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tournament-sub {
  margin: 0 0 8px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.tournament-venue {
  margin: 0 0 12px;
  font-size: 0.8rem;
}

.tournament-venue a {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  color: #5ec8e8;
  text-decoration: none;
}

.tournament-assignor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  font-size: 0.78rem;
}

.tournament-assignor-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.tournament-assignor a {
  color: #5ec8e8;
  text-decoration: none;
}

.tournament-assignor-phone {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  font-size: 1rem !important;
  font-weight: 800 !important;
  padding: 6px 10px;
  border-radius: 8px;
  border: 2px solid #5ec8e8;
  background: rgba(94, 200, 232, 0.1);
}

.tournament-assignor-contact {
  display: inline-flex;
  align-items: stretch;
  gap: 8px;
}

.tournament-assignor-sms {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  font-size: 1rem !important;
  font-weight: 800 !important;
  padding: 6px 10px;
  border-radius: 8px;
  border: 2px solid #5ec8e8;
  background: rgba(94, 200, 232, 0.1);
  color: #5ec8e8 !important;
  text-decoration: none;
}

.tournament-contact-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.tournament-contact-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tournament-call-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 10px;
  border: 2px solid #5ec8e8;
  background: rgba(94, 200, 232, 0.12);
  color: #5ec8e8;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.tournament-call-btn--sm {
  width: 36px;
  min-height: 36px;
  border-radius: 8px;
}

.tournament-call-btn .t-icon--call svg {
  width: 20px;
  height: 20px;
}

.tournament-call-btn--sm .t-icon--call svg {
  width: 16px;
  height: 16px;
}

.tournament-phone-btn {
  flex: 1;
  min-width: 0;
}

.tournament-total {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-bright);
}

/* Sticky “now” card — high contrast for bright sunlight */
.tournament-now {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0;
  padding: 16px 14px;
  padding-right: 5.5rem;
  background: #0d1f0d;
  border-bottom: 3px solid #b8ff3c;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.tournament-now-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b8ff3c;
}

.tournament-now-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tournament-now-time {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.tournament-now-role {
  font-size: 1.2rem;
  color: #b8ff3c;
}

.tournament-now-field {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 800;
}

.tournament-now-field a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #5ec8e8;
  text-decoration: none;
}

.tournament-now-teams {
  margin: 0 0 12px;
}

.tournament-now-teams p {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
}

.tournament-now-crew-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b8ff3c;
}

.tournament-now-vs {
  margin: 4px 0 !important;
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  color: #b8ff3c !important;
  letter-spacing: 0.1em;
}

.tournament-phones {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tournament-phone-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #1a2e1a;
  border: 2px solid #b8ff3c;
  color: #fff;
  text-decoration: none;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

.tournament-phone-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tournament-phones--lg .tournament-phone-btn {
  padding: 14px 16px;
}

.tournament-phone-role {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #b8ff3c;
  letter-spacing: 0.06em;
}

.tournament-phone-name {
  font-size: 1rem;
  font-weight: 800;
}

.tournament-phone-num {
  font-size: 1.2rem;
  font-weight: 800;
  color: #5ec8e8;
  letter-spacing: 0.02em;
}

.tournament-main {
  padding: 12px 12px max(24px, env(safe-area-inset-bottom));
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tournament-day {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.tournament-day--today {
  border-color: rgba(184, 255, 60, 0.45);
}

.tournament-day--past {
  opacity: 0.72;
}

.tournament-day-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  background: var(--bg-elevated);
  -webkit-tap-highlight-color: transparent;
}

.tournament-day-summary::-webkit-details-marker {
  display: none;
}

.tournament-day[open] .tournament-day-summary {
  border-bottom: 1px solid var(--border-soft);
  color: #5ec8e8;
}

.tournament-day--today .tournament-day-summary {
  background: rgba(184, 255, 60, 0.1);
}

.tournament-day-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tournament-day-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.tournament-day[open] .t-icon--chevron svg {
  transform: rotate(90deg);
}

.tournament-day-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tournament-game-compact-time {
  font-weight: 800;
  color: var(--text-secondary);
}

.tournament-game-compact-role {
  font-weight: 700;
  color: var(--text-muted);
}

.tournament-game-compact-field {
  color: var(--text-muted);
}

.tournament-day-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tournament-game {
  position: relative;
  background: var(--surface);
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--radius);
  padding: 14px;
  padding-right: 4.75rem;
  box-shadow: var(--shadow);
}

.tournament-game-fee-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.92rem;
  font-weight: 800;
  color: #f5d565;
  line-height: 1;
  white-space: nowrap;
}

.tournament-game-fee-badge--compact {
  top: 8px;
  right: 8px;
  font-size: 0.78rem;
}

.tournament-game-fee-badge--now {
  top: 14px;
  right: 14px;
  font-size: 1.05rem;
  color: #ffe566;
}

.t-icon--coin {
  color: #f5d565;
}

.t-icon--coin svg {
  width: 17px;
  height: 17px;
}

.tournament-game-fee-badge--compact .t-icon--coin svg {
  width: 14px;
  height: 14px;
}

.tournament-game-fee-badge--now .t-icon--coin svg {
  width: 20px;
  height: 20px;
  color: #ffe566;
}

.tournament-game-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 16px;
  margin-bottom: 10px;
}

.tournament-game-top--now {
  margin-bottom: 8px;
}

.tournament-game-time-block,
.tournament-game-role-block {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tournament-game-time-block {
  flex: 1 1 8rem;
}

.tournament-game-role-block {
  flex: 1 1 7rem;
}

.tournament-game-myrole,
.tournament-now-role {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #b8ff3c;
  line-height: 1.2;
}

.tournament-game-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tournament-game-facts--now {
  margin-bottom: 8px;
}

.tournament-fact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

.tournament-crew {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}

.tournament-crew--now {
  border-top-color: rgba(184, 255, 60, 0.25);
}

.tournament-crew-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  min-height: 36px;
}

.tournament-crew-row.is-me {
  opacity: 0.55;
}

.tournament-crew-row--assignor {
  width: 100%;
  padding: 4px 0 0;
}

.tournament-crew-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  min-width: 3.2rem;
}

.tournament-crew-name {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tournament-crew-icons {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.tournament-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: var(--bg-elevated);
  color: #5ec8e8;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.tournament-icon-link--call {
  color: #7ee787;
}

.t-icon--action svg {
  width: 16px;
  height: 16px;
}

.t-icon--vs svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

.tournament-game-compact-match {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.tournament-game-compact-level,
.tournament-game-compact-half {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--text-muted);
}

.tournament-game--focus,
.tournament-game--live {
  border-width: 2px;
  border-color: #b8ff3c;
  background: linear-gradient(165deg, rgba(184, 255, 60, 0.12), var(--surface));
  order: -1;
}

.tournament-game--live {
  border-color: #ff6b6b;
  background: linear-gradient(165deg, rgba(255, 107, 107, 0.15), var(--surface));
}

.tournament-game--done {
  opacity: 0.55;
  padding: 8px 12px;
}

.tournament-game--compact .tournament-game-compact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 0.78rem;
}

.tournament-game-compact-time,
.tournament-game-compact-role,
.tournament-game-compact-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tournament-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #ff6b6b;
  color: #fff;
  vertical-align: middle;
}

.tournament-game-fee {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #7ee787;
}

.tournament-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.tournament-team {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
}

.tournament-field a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #5ec8e8;
  text-decoration: none;
}

.tournament-crew h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.tournament-live-badge--next {
  background: #b8ff3c;
  color: #0a0f14;
}

.tournament-game-time {
  font-size: 1.25rem;
  font-weight: 800;
}

.tournament-game-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.tournament-game-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(14, 116, 144, 0.2);
  color: #5ec8e8;
  font-size: 0.72rem;
  font-weight: 800;
}

.tournament-game-when {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.88rem;
}

.tournament-game-when strong {
  font-weight: 800;
}

.tournament-game-when span:not(.t-icon):not(.tournament-live-badge) {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.tournament-game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tournament-tag--role {
  color: #5ec8e8;
  border-color: rgba(14, 116, 144, 0.45);
  background: rgba(14, 116, 144, 0.12);
}

.tournament-matchup {
  margin-bottom: 10px;
}

.tournament-vs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tournament-field {
  margin: 0 0 12px;
  font-size: 0.8rem;
}

.tournament-official {
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
}

.tournament-official.is-me {
  border-color: rgba(126, 231, 135, 0.45);
  background: rgba(126, 231, 135, 0.08);
}

.tournament-official-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.tournament-official-role {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 2.5rem;
}

.tournament-official-name {
  font-size: 0.84rem;
  font-weight: 700;
}

.tournament-official-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 3.2rem;
}

.tournament-official-actions a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: #5ec8e8;
  text-decoration: none;
  word-break: break-all;
}

.tournament-error {
  text-align: center;
  padding: 24px;
  color: #f85149;
  font-size: 0.88rem;
}
