:root {
  --green: #44d62c;
  --green-dark: #17a900;
  --ink: #eefcea;
  --muted: #8ab685;
  --bg: #030603;
  --card: rgba(8, 17, 9, 0.92);
  --line: rgba(68, 214, 44, 0.26);
  --accent: #00e5ff;
  --danger: #ff385c;
  --radius: 10px;
  --shadow: 0 0 0 1px rgba(68, 214, 44, 0.08), 0 18px 42px rgba(0, 0, 0, 0.55),
    0 0 28px rgba(68, 214, 44, 0.12);
  --panel: rgba(4, 10, 5, 0.78);
  --glow: 0 0 18px rgba(68, 214, 44, 0.52), 0 0 44px rgba(68, 214, 44, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(68, 214, 44, 0.2), transparent 28rem),
    radial-gradient(circle at 90% 10%, rgba(0, 229, 255, 0.12), transparent 24rem),
    linear-gradient(180deg, #061006 0%, var(--bg) 48%, #010201 100%);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  background-image:
    linear-gradient(rgba(68, 214, 44, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68, 214, 44, 0.09) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.88), transparent 78%);
  animation: grid-drift 18s linear infinite;
}

body::after {
  z-index: 300;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.025) 0,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 5px
  );
  mix-blend-mode: overlay;
  opacity: 0.2;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px calc(40px + env(safe-area-inset-bottom));
  position: relative;
  z-index: 1;
}

/* ---- Top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  background: rgba(3, 6, 3, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.brand {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.brand .dot {
  color: var(--green);
  text-shadow: var(--glow);
  animation: pulse-dot 1.6s ease-in-out infinite;
}
.topbar .spacer {
  flex: 1;
}

/* ---- Buttons ---- */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 41, 23, 0.92), rgba(6, 13, 7, 0.92));
  color: var(--ink);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 0 0 rgba(68, 214, 44, 0);
  text-transform: uppercase;
  letter-spacing: 0;
}
.btn:hover {
  border-color: rgba(68, 214, 44, 0.72);
  box-shadow: 0 0 18px rgba(68, 214, 44, 0.2);
}
.btn:active {
  transform: translateY(1px) scale(0.98);
}
.btn-primary {
  background: linear-gradient(180deg, var(--green), var(--green-dark));
  border-color: var(--green);
  color: #031003;
  box-shadow: var(--glow);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #61ff45, var(--green));
}
.btn-accent {
  background: linear-gradient(180deg, var(--accent), #008fa3);
  border-color: var(--accent);
  color: #001014;
}
.btn-danger {
  background: rgba(50, 9, 18, 0.85);
  border-color: rgba(255, 56, 92, 0.55);
  color: var(--danger);
}
.btn-danger-solid {
  background: linear-gradient(180deg, #ff5775, var(--danger));
  border-color: var(--danger);
  color: #fff;
}
.btn-ghost {
  background: transparent;
}
.btn.full {
  width: 100%;
  justify-content: center;
}
.btn-icon {
  padding: 9px 11px;
  font-size: 1.05rem;
}
.btn-install {
  padding: 9px 12px;
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
/* keep the button being acted on at full opacity so its spinner stays visible */
.btn.loading {
  min-width: 110px;
}
.btn.loading[disabled] {
  opacity: 1;
}
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- Cards / layout ---- */
.card {
  background:
    linear-gradient(135deg, rgba(68, 214, 44, 0.08), transparent 38%),
    var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.card::before,
.match::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(68, 214, 44, 0.16), transparent);
  transform: translateX(-120%);
  animation: panel-sweep 5.8s ease-in-out infinite;
}

.section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted);
  font-weight: 700;
  margin: 20px 4px 10px;
  text-shadow: 0 0 12px rgba(68, 214, 44, 0.22);
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---- Admin toolbar ---- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.toolbar .grow {
  flex: 1 1 auto;
}

.viewswitch {
  display: inline-flex;
  background: rgba(2, 7, 3, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.viewswitch button {
  border: none;
  background: transparent;
  padding: 9px 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}
.viewswitch button.active {
  background: var(--green);
  color: #031003;
}

/* court count input (top-right) */
.courts-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
}
.courts-field select {
  padding: 8px 10px;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #071107;
  color: var(--ink);
  cursor: pointer;
}

/* per-court Prev/Next bar inside a court card */
.court-controls {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 0 14px 14px;
}
.btn-sm {
  padding: 7px 12px;
  font-size: 0.88rem;
}
.match.empty-court {
  opacity: 0.75;
}
.match.empty-court .match-head {
  background: rgba(12, 25, 13, 0.9);
  color: var(--muted);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}
.toggle input {
  display: none;
}
.toggle .track {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #223322;
  position: relative;
  transition: background 0.15s ease;
}
.toggle .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.15s ease;
}
.toggle input:checked + .track {
  background: var(--green);
}
.toggle input:checked + .track::after {
  transform: translateX(18px);
}

/* ---- Match cards ---- */
.matches {
  display: grid;
  gap: 14px;
}
.add-player-card {
  padding: 0;
  margin-top: 16px;
}
.match {
  background:
    linear-gradient(135deg, rgba(68, 214, 44, 0.08), transparent 42%),
    var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.match.current {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(68, 214, 44, 0.45), var(--shadow), var(--glow);
  animation: current-glow 2.2s ease-in-out infinite;
}
.match.queued .match-head {
  background: rgba(45, 36, 4, 0.9);
}
.match.inconclusive {
  border-style: dashed;
  opacity: 0.88;
}
.match.inconclusive .match-head {
  background: rgba(18, 24, 27, 0.94);
  color: var(--muted);
}
.match.card-drop-target {
  outline: 2px dashed var(--green);
  outline-offset: 3px;
  background: rgba(68, 214, 44, 0.12);
}
.match-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(12, 25, 13, 0.92);
  font-weight: 700;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(68, 214, 44, 0.12);
}
.match.current .match-head {
  background: linear-gradient(90deg, var(--green-dark), var(--green));
  color: #031003;
}
.match-head .badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0;
}
.match-note {
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}
.teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px;
  gap: 8px;
}
.team {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.team-head {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.team-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.team-lock {
  width: 34px;
  height: 34px;
  justify-content: center;
  padding: 0;
}
.player-chip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  background: rgba(3, 8, 4, 0.84);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-weight: 600;
  text-align: center;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
  box-shadow: inset 3px 0 0 rgba(68, 214, 44, 0.5);
}
.game-count {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(68, 214, 44, 0.18);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
}
.player-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: left;
}
.chip-delete {
  appearance: none;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 56, 92, 0.5);
  border-radius: 8px;
  background: rgba(25, 5, 10, 0.9);
  color: var(--danger);
  cursor: pointer;
  font-size: 0.9rem;
}
.chip-delete:active {
  transform: scale(0.96);
}
.empty-team {
  opacity: 0.75;
}
.empty-slot {
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 8px 10px;
}
/* draggable court chips (drag one onto another to swap) */
.player-chip.draggable {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.player-chip.dragging {
  opacity: 0.45;
  cursor: grabbing;
}
.player-chip.drop-target {
  outline: 2px dashed var(--green);
  outline-offset: 1px;
  background: rgba(68, 214, 44, 0.16);
}
.vs {
  font-weight: 800;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 560px) {
  .teams {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .team {
    width: 100%;
  }
  .vs {
    text-align: center;
    width: 100%;
    padding: 2px 0;
  }
}

/* ---- Pending requests ---- */
.pending-card {
  padding: 0;
  margin-top: 16px;
}
.pending-head,
.pending-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.pending-head {
  justify-content: space-between;
  background: rgba(12, 25, 13, 0.92);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.pending-head .badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(68, 214, 44, 0.16);
  color: var(--green);
  font-size: 0.72rem;
}
.pending-row:last-child {
  border-bottom: none;
}
.pending-row .name {
  font-weight: 600;
  flex: 1;
}
.pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0;
}
.pill.pending {
  background: rgba(255, 176, 32, 0.16);
  color: #ffcf5d;
}
.pill.active {
  background: rgba(68, 214, 44, 0.16);
  color: var(--green);
}

.join-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 2px;
}

.add-row {
  display: flex;
  gap: 8px;
  padding: 12px;
}
.add-row input {
  flex: 1;
}

/* ---- Forms ---- */
input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 1rem;
  background: rgba(2, 7, 3, 0.88);
  color: var(--ink);
}
input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(68, 214, 44, 0.15), 0 0 18px rgba(68, 214, 44, 0.2);
}
.field {
  margin-bottom: 12px;
}
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

/* ---- Auth / centered ---- */
.center-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}
.auth-card {
  width: 100%;
  max-width: 380px;
}
.auth-card h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
}
.tabs {
  display: flex;
  gap: 6px;
  margin: 16px 0;
}
.tabs button {
  flex: 1;
  padding: 9px;
  border: 1px solid var(--line);
  background: rgba(2, 7, 3, 0.88);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}
.tabs button.active {
  background: var(--green);
  color: #031003;
  border-color: var(--green);
}

/* ---- Open play list ---- */
.op-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.op-item:hover {
  background: rgba(68, 214, 44, 0.07);
  box-shadow: inset 3px 0 0 var(--green);
}
.op-item:last-child {
  border-bottom: none;
}
.op-item .title {
  font-weight: 700;
  flex: 1;
}

/* ---- Modal ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.hidden {
  display: none;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
}
.modal-card {
  position: relative;
  background: linear-gradient(135deg, rgba(68, 214, 44, 0.09), rgba(5, 12, 6, 0.98));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}
.modal-card h2 {
  margin: 0 0 4px;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.qrcode {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}
.qrcode img,
.qrcode canvas {
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.share-url {
  text-align: center;
  margin-bottom: 10px;
  background: rgba(2, 7, 3, 0.88) !important;
}
.install-steps {
  margin: 16px 0;
  padding-left: 22px;
  text-align: left;
  color: var(--ink);
  font-weight: 600;
}
.install-steps li + li {
  margin-top: 8px;
}

/* ---- App update prompt ---- */
.update-banner {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 190;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-weight: 700;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: #071107;
  color: var(--green);
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 200;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
}

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty .big {
  font-size: 2.4rem;
  margin-bottom: 6px;
}

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

.menu-wrap {
  position: relative;
}

.admin-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.admin-menu button {
  width: 100%;
  appearance: none;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: flex-start;
  padding: 10px 12px;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.admin-menu button:hover {
  background: rgba(68, 214, 44, 0.12);
}

.theme-options {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.theme-option {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(2, 7, 3, 0.5);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.theme-option.active {
  border-color: var(--green);
  box-shadow: 0 0 18px rgba(68, 214, 44, 0.18);
}

.hidden {
  display: none !important;
}

@keyframes grid-drift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 38px 38px;
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.82;
  }
  50% {
    transform: scale(1.35);
    opacity: 1;
  }
}

@keyframes current-glow {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(68, 214, 44, 0.42), var(--shadow), 0 0 18px rgba(68, 214, 44, 0.18);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(68, 214, 44, 0.86), var(--shadow), 0 0 34px rgba(68, 214, 44, 0.34);
  }
}

@keyframes panel-sweep {
  0%,
  48% {
    transform: translateX(-120%);
  }
  68%,
  100% {
    transform: translateX(120%);
  }
}

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

/* ---- Plain themes override the Arcade Green experiment ---- */
body[data-theme="light"],
body[data-theme="dark"] {
  --radius: 12px;
  --glow: none;
}

body[data-theme="light"] {
  --green: #0f9d58;
  --green-dark: #0b7c45;
  --ink: #11221b;
  --muted: #6b7d75;
  --bg: #f4f7f5;
  --card: #ffffff;
  --line: #e2e9e5;
  --accent: #ffb020;
  --danger: #e5484d;
  --shadow: 0 4px 18px rgba(15, 60, 40, 0.08);
}

body[data-theme="dark"] {
  --green: #31c46a;
  --green-dark: #1f9a50;
  --ink: #edf5f0;
  --muted: #9cadb2;
  --bg: #111416;
  --card: #1a1f22;
  --line: #31393d;
  --accent: #d8b15f;
  --danger: #ff6673;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
}

body[data-theme="light"],
body[data-theme="dark"] {
  background: var(--bg);
}

body[data-theme="light"]::before,
body[data-theme="light"]::after,
body[data-theme="dark"]::before,
body[data-theme="dark"]::after {
  display: none;
}

body[data-theme="light"] .topbar,
body[data-theme="dark"] .topbar {
  background: var(--bg);
  backdrop-filter: none;
}

body[data-theme="light"] .brand .dot,
body[data-theme="dark"] .brand .dot,
body[data-theme="light"] .match.current,
body[data-theme="dark"] .match.current,
body[data-theme="light"] .card::before,
body[data-theme="light"] .match::before,
body[data-theme="dark"] .card::before,
body[data-theme="dark"] .match::before {
  animation: none;
}

body[data-theme="light"] .card::before,
body[data-theme="light"] .match::before,
body[data-theme="dark"] .card::before,
body[data-theme="dark"] .match::before {
  display: none;
}

body[data-theme="light"] .btn,
body[data-theme="dark"] .btn {
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  text-transform: none;
  box-shadow: none;
}

body[data-theme="light"] .btn-primary,
body[data-theme="dark"] .btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

body[data-theme="light"] .btn-primary:hover,
body[data-theme="dark"] .btn-primary:hover {
  background: var(--green-dark);
}

body[data-theme="light"] .btn-accent,
body[data-theme="dark"] .btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #3a2b00;
}

body[data-theme="light"] .btn-danger,
body[data-theme="dark"] .btn-danger {
  background: var(--card);
  border-color: rgba(229, 72, 77, 0.42);
  color: var(--danger);
}

body[data-theme="light"] .btn-danger {
  background: #fff;
  border-color: #f3c2c4;
}

body[data-theme="light"] .chip-delete {
  background: #fff;
  border-color: #f3c2c4;
  color: var(--danger);
}

body[data-theme="light"] .btn-danger-solid,
body[data-theme="dark"] .btn-danger-solid {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

body[data-theme="light"] .card,
body[data-theme="light"] .match,
body[data-theme="dark"] .card,
body[data-theme="dark"] .match {
  background: var(--card);
}

body[data-theme="light"] .match.current,
body[data-theme="dark"] .match.current {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(15, 157, 88, 0.22), var(--shadow);
}

body[data-theme="light"] .match-head,
body[data-theme="light"] .pending-head,
body[data-theme="dark"] .match-head,
body[data-theme="dark"] .pending-head {
  background: color-mix(in srgb, var(--green) 8%, var(--card));
}

body[data-theme="light"] .match.current .match-head,
body[data-theme="dark"] .match.current .match-head {
  background: var(--green);
  color: #fff;
}

body[data-theme="light"] .match.queued .match-head {
  background: #fff8e6;
  color: var(--ink);
}

body[data-theme="light"] .player-chip,
body[data-theme="dark"] .player-chip {
  background: color-mix(in srgb, var(--bg) 72%, var(--card));
  box-shadow: none;
}

body[data-theme="light"] input[type="text"],
body[data-theme="light"] input[type="password"],
body[data-theme="light"] input[type="email"],
body[data-theme="light"] .courts-field select,
body[data-theme="dark"] input[type="text"],
body[data-theme="dark"] input[type="password"],
body[data-theme="dark"] input[type="email"],
body[data-theme="light"] .tabs button,
body[data-theme="dark"] .tabs button,
body[data-theme="light"] .viewswitch,
body[data-theme="dark"] .viewswitch {
  background: var(--card);
  color: var(--ink);
}

body[data-theme="light"] .modal-card,
body[data-theme="dark"] .modal-card {
  background: var(--card);
}

body[data-theme="light"] .modal-backdrop,
body[data-theme="dark"] .modal-backdrop {
  background: rgba(8, 25, 18, 0.5);
  backdrop-filter: none;
}

body[data-theme="light"] .theme-option,
body[data-theme="dark"] .theme-option {
  background: var(--card);
}

body[data-theme="light"] .share-url,
body[data-theme="dark"] .share-url {
  background: color-mix(in srgb, var(--bg) 72%, var(--card)) !important;
}
