:root {
  color-scheme: dark;
  --bg: #050914;
  --ink: #f8fafc;
  --muted: #a8b0bd;
  --line: rgba(224, 231, 241, 0.16);
  --panel: rgba(10, 15, 27, 0.7);
  --panel-2: rgba(255, 255, 255, 0.1);
  --field: rgba(255, 255, 255, 0.12);
  --accent: #e5092f;
  --accent-2: #ff3d55;
  --accent-3: #f6f7fb;
  --blue: #6f8cff;
  --cyan: #19d3c5;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(5, 9, 20, 0.18), rgba(5, 9, 20, 0.02) 48%, rgba(5, 9, 20, 0.18)),
    linear-gradient(180deg, rgba(5, 9, 20, 0), rgba(5, 9, 20, 0.2)),
    url("assets/background.jpg?v=37") center top / cover fixed no-repeat,
    var(--bg);
  color: var(--ink);
  position: relative;
}

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

body::before {
  background:
    radial-gradient(circle at 15% 8%, rgba(229, 9, 47, 0.05), transparent 30%),
    radial-gradient(circle at 82% 4%, rgba(111, 140, 255, 0.03), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.01), transparent 34%);
  z-index: 0;
}

.admin-mode {
  --panel: rgba(17, 12, 20, 0.74);
  --line: rgba(229, 9, 47, 0.26);
}

.app-shell {
  position: relative;
  z-index: 1;
}

.app-launch-splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(5, 9, 20, 0.12), rgba(5, 9, 20, 0.8)),
    url("assets/background.jpg?v=37") center / cover no-repeat,
    #050914;
  color: white;
  opacity: 1;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.app-launch-splash.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.app-launch-splash img {
  width: min(260px, 64vw);
  height: auto;
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.55));
}

.app-launch-splash strong {
  color: #ffffff;
  font-size: clamp(1.65rem, 6vw, 3.4rem);
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.splash-version {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  color: rgba(248, 250, 252, 0.62);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: right;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

::placeholder {
  color: rgba(248, 250, 252, 0.48);
}

option {
  background: #101620;
  color: var(--ink);
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 9, 20, 0.62);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.view-tabs {
  display: flex;
  gap: 8px;
  padding: 14px clamp(16px, 4vw, 44px) 0;
  overflow-x: auto;
}

.view-tab {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.view-tab[aria-current="true"] {
  background: rgba(229, 9, 47, 0.82);
  border-color: rgba(255, 255, 255, 0.22);
  color: white;
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.18), 0 12px 28px rgba(229, 9, 47, 0.24);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 70px;
  height: 70px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(229, 9, 47, 0.24));
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.35rem, 2.3vw, 2rem);
}

h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.35rem);
}

h3 {
  font-size: 1rem;
}

.topbar-actions,
.pool-tools,
.inline-form,
.matches-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-mode-badge {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  border: 1px solid rgba(229, 9, 47, 0.46);
  background: rgba(229, 9, 47, 0.18);
  color: #ffe8ec;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 0 18px rgba(229, 9, 47, 0.18);
}

.icon-button,
.danger-button,
.ghost-button,
.pool-tools button,
.inline-form button,
.matches-head button,
.add-match {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  background: linear-gradient(135deg, #f8fafc, #c7cfdb);
  color: #07090f;
  font-weight: 750;
}

.icon-button {
  width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
}

.fullscreen-button span {
  width: 20px;
  height: 20px;
  position: relative;
  border: 0;
}

.fullscreen-button span::before {
  content: "";
  position: absolute;
  inset: 1px;
  background:
    linear-gradient(currentColor, currentColor) left top / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left top / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 2px 8px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 2px 8px no-repeat;
}

.fullscreen-button.is-active span::before {
  inset: 4px;
  background:
    linear-gradient(currentColor, currentColor) left top / 7px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left top / 2px 7px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 7px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 2px 7px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 7px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 2px 7px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 7px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 2px 7px no-repeat;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.danger-button {
  background: rgba(255, 61, 113, 0.09);
  color: var(--accent-2);
  border: 1px solid rgba(198, 55, 71, 0.42);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border: 1px solid var(--line);
}

.lock-button,
.notification-button,
.qr-button {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid rgba(224, 231, 241, 0.14);
}

.lock-button:hover,
.notification-button:hover,
.qr-button:hover,
.lock-button.is-active,
.notification-button.is-active,
.qr-button.is-active {
  color: #ffe8ec;
  border-color: rgba(229, 9, 47, 0.42);
  background: rgba(229, 9, 47, 0.14);
}

.lock-button span,
.notification-button span {
  width: 20px;
  height: 20px;
  position: relative;
  display: block;
}

.lock-button span::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 8px;
  height: 10px;
  border-radius: 3px;
  border: 2px solid currentColor;
}

.lock-button span::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 1px;
  width: 8px;
  height: 10px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.notification-button span::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  width: 10px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 10px 10px 5px 5px;
}

.notification-button span::after {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 1px;
  width: 6px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 -15px 0 -1px currentColor;
}

.button-icon {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
}

.lock-button .button-icon,
.notification-button .button-icon {
  filter: drop-shadow(0 0 8px rgba(229, 9, 47, 0.2));
}

.workspace {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 24px;
  padding: 24px clamp(16px, 4vw, 44px) 44px;
  transition: grid-template-columns 180ms ease;
}

.sidebar-collapsed .workspace {
  grid-template-columns: 58px minmax(0, 1fr);
}

.sidebar,
.panel,
.matches-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 114px;
  padding: 14px;
  min-width: 0;
  transition: padding 180ms ease;
  overflow: hidden;
}

.sidebar-collapsed .sidebar {
  padding: 10px 8px;
}

.sidebar-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-head {
  min-height: 34px;
}

.sidebar-toggle {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--ink);
}

.sidebar-icon {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
  transition: transform 180ms ease;
}

.sidebar-collapsed .sidebar-icon {
  transform: rotate(180deg);
}

.sidebar-title {
  min-width: 0;
}

.sidebar-collapsed .sidebar-title,
.sidebar-collapsed #poolCount,
.sidebar-collapsed .pool-tabs {
  display: none;
}

.sidebar-collapsed .sidebar-head {
  justify-content: center;
}

.sidebar-collapsed-label {
  display: none;
}

.sidebar-collapsed .sidebar-collapsed-label {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 12px auto 0;
  border-radius: 8px;
  border: 1px solid rgba(229, 9, 47, 0.42);
  background: rgba(229, 9, 47, 0.16);
  color: white;
  font-weight: 950;
}

.pool-tabs {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.pool-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.pool-tab[aria-current="true"] {
  background: rgba(229, 9, 47, 0.16);
  color: var(--ink);
  border: 1px solid rgba(229, 9, 47, 0.42);
  box-shadow: inset 3px 0 0 var(--accent);
}

.pool-tab small {
  color: inherit;
  opacity: 0.72;
}

.main-panel {
  min-width: 0;
}

.view-page {
  display: none;
}

.view-page.is-active {
  display: block;
}

.pool-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.pool-tools input,
.inline-form input,
.team-select,
.score {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  min-height: 40px;
  padding: 0 12px;
}

.pool-tools input {
  width: min(280px, 42vw);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.2fr);
  gap: 18px;
}

.panel {
  padding: 16px;
}

.login-panel {
  max-width: 440px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 4, 10, 0.68);
  backdrop-filter: blur(12px);
}

.modal-backdrop .login-panel {
  width: min(440px, 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52), 0 0 0 1px rgba(229, 9, 47, 0.18);
}

.qr-panel {
  width: min(420px, 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52), 0 0 0 1px rgba(229, 9, 47, 0.18);
}

.qr-card {
  display: grid;
  justify-items: center;
  gap: 16px;
  margin-top: 18px;
}

.qr-card img {
  width: min(260px, 72vw);
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid rgba(224, 231, 241, 0.22);
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.qr-card a {
  color: #ffffff;
  font-weight: 850;
  text-align: center;
  overflow-wrap: anywhere;
  text-decoration-color: rgba(229, 9, 47, 0.82);
  text-underline-offset: 4px;
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 900;
  font-size: 1.1rem;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.login-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
  padding: 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.login-tab {
  min-height: 36px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.login-tab[aria-current="true"] {
  background: rgba(229, 9, 47, 0.82);
  color: white;
}

.player-session-card {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(25, 211, 197, 0.28);
  background: rgba(25, 211, 197, 0.08);
}

.player-session-card strong {
  color: var(--ink);
}

.player-session-card span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.login-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  min-height: 42px;
  padding: 0 12px;
}

.login-form button,
.player-session-card button,
.admin-bar button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(229, 9, 47, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-weight: 850;
  box-shadow: 0 12px 26px rgba(229, 9, 47, 0.2);
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-message[data-state="error"] {
  color: #ffd9df;
}

.form-message[data-state="success"] {
  color: #c9fff8;
}

.form-message[data-state="warning"] {
  color: #ffe7a3;
}

.admin-content {
  display: grid;
  gap: 18px;
}

.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(25, 211, 197, 0.28);
  border-radius: 8px;
  background: rgba(25, 211, 197, 0.08);
  color: #c9fff8;
  font-weight: 850;
}

.admin-mode .topbar,
.admin-mode .view-tabs {
  box-shadow: inset 0 -1px 0 rgba(229, 9, 47, 0.34);
}

.admin-mode .admin-bar {
  border-color: rgba(229, 9, 47, 0.42);
  background: rgba(229, 9, 47, 0.12);
  color: #ffe8ec;
}

.inline-form {
  margin: 14px 0;
  flex-wrap: wrap;
  align-items: flex-end;
}

.inline-form input {
  min-width: 0;
  width: 100%;
}

.field-label {
  display: grid;
  flex: 1 1 210px;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.team-list-title {
  margin: 14px 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.team-list {
  display: grid;
  gap: 8px;
}

.team-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 6px 6px 12px;
  background: var(--panel-2);
  border-radius: 8px;
}

.team-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.team-details {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.team-details strong,
.team-details small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-details strong {
  font-weight: 750;
}

.team-details small {
  color: var(--muted);
  font-size: 0.78rem;
}

.player-access {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.player-card {
  width: min(560px, 100%);
  text-align: center;
}

.player-logo {
  width: min(220px, 70vw);
  height: auto;
  margin-bottom: 18px;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.38));
}

.player-card p:not(.eyebrow) {
  color: var(--muted);
  font-weight: 750;
}

.player-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 14px;
  padding: 0 14px;
  border-radius: 8px;
  background: rgba(229, 9, 47, 0.16);
  border: 1px solid rgba(229, 9, 47, 0.34);
  color: #ffe8ec;
  font-weight: 850;
  text-decoration: none;
}

.player-activation-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  text-align: left;
}

.player-activation-form .player-identity,
.player-activation-form .field-label:first-of-type,
.player-activation-form button,
.player-activation-form .form-message {
  grid-column: 1 / -1;
}

.player-activation-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(224, 231, 241, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  padding: 0 13px;
  font-size: 0.98rem;
  font-weight: 750;
  outline: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.player-activation-form input:focus {
  border-color: rgba(229, 9, 47, 0.72);
  background: rgba(255, 255, 255, 0.13);
  box-shadow: 0 0 0 3px rgba(229, 9, 47, 0.18);
}

.player-activation-form input[readonly] {
  color: #e5e7eb;
  border-color: rgba(229, 9, 47, 0.34);
  background: rgba(229, 9, 47, 0.08);
}

.password-manager-username {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  margin: -1px;
  opacity: 0.01;
  pointer-events: none;
  clip-path: inset(50%);
}

.player-activation-form button,
.player-notification-panel button {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  background: #e5092f;
  color: white;
  font-weight: 900;
  border: 1px solid #ff3d55;
}

.player-notification-panel .secondary-action {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border-color: var(--line);
}

.player-identity,
.player-notification-panel {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.player-identity strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.player-identity span,
.player-notification-panel p {
  color: var(--muted);
  font-weight: 750;
}

.player-notification-panel {
  text-align: left;
  width: min(420px, 100%);
}

.player-notification-panel h2 {
  margin: 0;
  font-size: 1.08rem;
}

.player-notification-backdrop {
  z-index: 110;
}

.team-edit-button,
.team-remove-button,
.remove-match {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 61, 113, 0.1);
  color: var(--accent-2);
  border: 1px solid rgba(198, 55, 71, 0.32);
  font-weight: 900;
}

.team-edit-button {
  width: auto;
  min-width: 62px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border-color: var(--line);
  font-size: 0.78rem;
}

.player-edit-panel {
  width: min(640px, 100%);
}

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

.player-edit-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.player-edit-form label:nth-of-type(1),
.player-edit-form label:nth-of-type(2),
.player-edit-form .player-edit-meta,
.player-edit-form button,
.player-edit-form .form-message {
  grid-column: 1 / -1;
}

.player-edit-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 0 12px;
  outline: 0;
}

.player-edit-form input:focus {
  border-color: rgba(229, 9, 47, 0.72);
  box-shadow: 0 0 0 3px rgba(229, 9, 47, 0.16);
}

.player-edit-meta {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
}

.player-edit-form button {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  background: #e5092f;
  color: white;
  font-weight: 900;
  border: 1px solid #ff3d55;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

th,
td {
  padding: 11px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

td:last-child,
th:last-child {
  font-weight: 900;
}

.all-standings {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 16px;
}

.standing-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0;
}

.matches-section {
  margin-top: 18px;
  padding: clamp(14px, 2vw, 22px);
}

.first-section {
  margin-top: 0;
}

.matches-head {
  justify-content: space-between;
  align-items: start;
  margin-bottom: 16px;
}

.matches-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 14px;
}

.day-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 14px;
  min-width: 0;
  overflow: hidden;
}

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.day-head strong {
  font-size: 0.95rem;
  color: var(--accent-3);
}

.match-list {
  display: grid;
  gap: 8px;
  min-height: 40px;
}

.match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 12px 42px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.fixture-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  min-width: 0;
  overflow: hidden;
}

.fixture-team {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
  font-size: 0.95rem;
}

.fixture-team:last-child {
  text-align: right;
}

.fixture-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink);
  font-weight: 900;
  flex: 0 0 auto;
}

.bracket {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 14px;
  overflow-x: auto;
}

.bracket-round {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 190px;
}

.bracket-round h4 {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.bracket-match {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
}

.bracket-slot {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--panel-2);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-seed {
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 900;
}

.team-select {
  min-width: 0;
  width: 100%;
}

.score {
  width: 42px;
  padding: 0 4px;
  text-align: center;
}

.versus {
  text-align: center;
  color: var(--muted);
  font-weight: 900;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 72px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 10px;
}

@media (max-width: 1100px) {
  .content-grid,
  .days-grid,
  .all-standings {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .topbar,
  .pool-header,
  .matches-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .admin-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar-collapsed .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .sidebar-collapsed .sidebar {
    padding: 10px;
  }

  .pool-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-collapsed .pool-tabs {
    display: none;
  }

  .content-grid,
  .days-grid,
  .all-standings,
  .bracket {
    grid-template-columns: 1fr;
  }

  .pool-tools {
    align-items: stretch;
  }

  .pool-tools input {
    width: 100%;
  }

  .player-card {
    width: min(430px, 100%);
  }

  .player-activation-form {
    grid-template-columns: 1fr;
  }

  .player-edit-form {
    grid-template-columns: 1fr;
  }

  .match-row {
    grid-template-columns: 1fr 42px 10px 42px 1fr 32px;
  }
}
