:root {
  --bg: #020617;
  --bg-card: rgba(15, 23, 42, 0.88);
  --border-subtle: rgba(148, 163, 184, 0.35);
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.1);
  --danger: #ef4444;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --radius-xl: 18px;
  --shadow-soft: 0 20px 50px rgba(15, 23, 42, 0.9);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #0b1120 0, #000 65%);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

#pong-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  background: transparent;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  backdrop-filter: blur(16px);
  background: radial-gradient(
      circle at top,
      rgba(15, 23, 42, 0.7),
      rgba(15, 23, 42, 0.9)
    );
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  backdrop-filter: blur(18px);
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.95),
    rgba(15, 23, 42, 0.7),
    transparent
  );
  border-bottom: 1px solid var(--border-subtle);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 0.75rem;
}

.nav-links a {
  font-size: 0.9rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: border-color 0.18s ease, background-color 0.18s ease,
    transform 0.15s ease;
}

.nav-links a:hover {
  border-color: var(--border-subtle);
  background-color: rgba(15, 23, 42, 0.85);
  transform: translateY(-1px);
}

.page {
  max-width: 960px;
  margin: 1.5rem auto 3rem auto;
  padding: 0 1rem;
}

.card {
  background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.96),
      rgba(15, 23, 42, 0.8)
    );
  border-radius: var(--radius-xl);
  padding: 1.6rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(24px);
  animation: card-fade-in 0.3s ease-out;
}

@keyframes card-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

h1 {
  margin: 0;
  font-size: 1.4rem;
}

.subtitle {
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.85);
  padding: 0.6rem 0.9rem;
  color: var(--text-main);
  outline: none;
  font-size: 0.9rem;
  transition: border-color 0.16s ease, box-shadow 0.16s ease,
    background-color 0.16s ease;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.45);
  background: rgba(15, 23, 42, 0.95);
}

.color-input {
  width: 64px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  cursor: pointer;
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    background-color 0.12s ease, border-color 0.12s ease;
}

.btn.primary {
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  border-color: transparent;
  color: #f9fafb;
  box-shadow: 0 12px 30px rgba(34, 197, 94, 0.35);
}

.btn.danger {
  border-color: rgba(248, 113, 113, 0.85);
  color: #fecaca;
}

.btn.small {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}

.btn.big {
  padding: 0.7rem 1.4rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.9);
}

.btn.primary:hover {
  filter: brightness(1.03);
}

.flash-area {
  margin-bottom: 1rem;
}

.flash {
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
}

.flash-success {
  border-color: rgba(34, 197, 94, 0.7);
}

.flash-danger {
  border-color: rgba(248, 113, 113, 0.7);
}

.flash-info {
  border-color: rgba(56, 189, 248, 0.7);
}

.flash-warning {
  border-color: rgba(234, 179, 8, 0.7);
}

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

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.8);
}

.list-row:last-child {
  border-bottom: none;
}

.row-actions {
  display: flex;
  gap: 0.35rem;
}

.player-pill {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.pill-name {
  font-weight: 500;
}

.pill-tag {
  font-size: 0.75rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background-color: var(--accent-soft);
  border: 1px solid rgba(56, 189, 248, 0.5);
}

.pill-tag.warn {
  background-color: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.7);
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.9);
  background: var(--dot-color, #38bdf8);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.3);
}

.details-block {
  margin-top: 1rem;
  border-radius: var(--radius-xl);
  border: 1px dashed var(--border-subtle);
  padding: 0.75rem 0.9rem;
  background: rgba(15, 23, 42, 0.7);
}

.details-block > summary {
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}

.details-block[open] {
  background: rgba(15, 23, 42, 0.92);
}

.details-block[open] > summary {
  margin-bottom: 0.5rem;
}

.hint {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.pill-multi-select {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.6rem;
  font-size: 0.85rem;
}

.pill-option input {
  accent-color: var(--accent);
}

/* SCOREBOARD */

.scoreboard {
  background: radial-gradient(
      circle at top,
      rgba(56, 189, 248, 0.16),
      transparent 55%
    ),
    linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.96),
      rgba(15, 23, 42, 0.9)
    );
  border-radius: var(--radius-xl);
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.score-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.score-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.9rem;
  margin-top: 0.8rem;
}

.player-card {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 1.2rem;
  padding: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  position: relative;
  overflow: hidden;
}

.player-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  opacity: 0.2;
  background: radial-gradient(
    circle at top,
    var(--player-color, var(--accent)),
    transparent 60%
  );
  pointer-events: none;
}

.player-name {
  font-size: 0.95rem;
  font-weight: 500;
}

.player-points {
  font-size: 2.1rem;
  font-weight: 700;
  text-align: center;
  margin: 0.25rem 0 0.3rem 0;
}

.player-controls {
  display: flex;
  gap: 0.4rem;
  justify-content: space-between;
}

.team-card {
  border-style: dashed;
}

.team-players {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.3rem;
}

/* PODIUM STYLES */

.podium-gold {
  border-color: rgba(250, 204, 21, 0.95);
}

.podium-gold::before {
  opacity: 0.55;
  background: radial-gradient(
    circle at top,
    rgba(250, 204, 21, 0.95),
    transparent 65%
  );
}

.podium-silver {
  border-color: rgba(209, 213, 219, 0.9);
}

.podium-silver::before {
  opacity: 0.5;
  background: radial-gradient(
    circle at top,
    rgba(209, 213, 219, 0.9),
    transparent 65%
  );
}

.podium-bronze {
  border-color: rgba(234, 88, 12, 0.9);
}

.podium-bronze::before {
  opacity: 0.5;
  background: radial-gradient(
    circle at top,
    rgba(234, 88, 12, 0.9),
    transparent 65%
  );
}

.score-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* RESPONSYWNOŚĆ */

@media (max-width: 640px) {
  .topbar {
    padding-inline: 0.8rem;
  }

  .card,
  .scoreboard {
    padding: 1rem;
  }

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

/***** LOCK SCREEN – MINIMALISTYCZNY STYL *****/

.code-card {
  max-width: 360px;
  margin-inline: auto;
  margin-top: 12vh;
  text-align: center;
  padding-block: 2rem;
}

.code-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.6rem;
}

.code-logo-circle {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 0, #38bdf8, #22c55e);
  color: #f9fafb;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 1.05rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.9);
}

.code-title {
  font-weight: 600;
  font-size: 1.15rem;
}

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

.code-form {
  gap: 0.8rem;
}

.code-label {
  align-items: stretch;
}

.code-label-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: left;
}

.code-input {
  text-align: center;
  letter-spacing: 0.4em;
  font-size: 1.25rem;
  font-weight: 600;
}

.code-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.45rem 0 0.2rem 0;
}

.code-actions {
  justify-content: center;
  margin-top: 0.4rem;
}

@media (max-width: 640px) {
  .code-card {
    margin-top: 8vh;
  }
}

/***** PIN – 4 OKIENKA *****/

.pin-row {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
  margin-bottom: 0.3rem;
}

.pin-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1.5px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 600;
  outline: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease,
    transform 0.08s ease;
}

.pin-box:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.7);
  background: rgba(15, 23, 42, 0.99);
  transform: translateY(-1px);
}

.pin-box::-ms-reveal,
.pin-box::-ms-clear {
  display: none;
}

/* Karta wykresu w scoreboardzie */
.chart-card {
  margin-top: 1rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(148, 163, 184, 0.45);
}

.chart-title {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 0.4rem 0;
}

#match-progress-chart {
  width: 100%;
  max-height: 260px;
}

/* Overall ranking */

.ranking-card {
  max-width: 960px;
  margin-inline: auto;
}

.ranking-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 0.6rem;
}

.ranking-table-wrapper {
  flex: 1 1 260px;
  overflow-x: auto;
}

.ranking-chart-wrapper {
  flex: 1 1 260px;
  min-height: 220px;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ranking-table th,
.ranking-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.8);
}

.ranking-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
}

.ranking-table tr:hover {
  background-color: rgba(15, 23, 42, 0.85);
}

@media (max-width: 768px) {
  .ranking-layout {
    flex-direction: column;
  }
}

/* Stylizowane checkboxy / radio dla wyboru graczy i trybu */

.pill-multi-select {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pill-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.95);
  cursor: pointer;
  font-size: 0.85rem;
  transition:
    background-color 0.14s ease,
    border-color 0.14s ease,
    transform 0.08s ease;
}

.pill-option:hover {
  background: rgba(15, 23, 42, 1);
  transform: translateY(-1px);
}

.pill-option input[type="checkbox"],
.pill-option input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.8);
  background: transparent;
  display: inline-block;
  position: relative;
  outline: none;
  flex-shrink: 0;
}

.pill-option input[type="checkbox"]::after,
.pill-option input[type="radio"]::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  opacity: 0;
  transition: opacity 0.14s ease;
}

.pill-option input[type="checkbox"]:checked,
.pill-option input[type="radio"]:checked {
  border-color: #22c55e;
}

.pill-option input[type="checkbox"]:checked::after,
.pill-option input[type="radio"]:checked::after {
  opacity: 1;
}

/* Boisko 4 graczy + ławka */

.court-card {
  margin-top: 0.9rem;
  padding: 0.75rem 0.9rem;
  border-radius: 1rem;
  border: 1px dashed var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
}

.court-field {
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 0.6rem 0.8rem;
  background: radial-gradient(
    circle at top,
    rgba(15,23,42,0.96),
    rgba(15,23,42,0.9)
  );
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.7rem;
}

.court-player {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
}

.court-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--player-color, #38bdf8);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
}

.court-dot.tiny {
  width: 8px;
  height: 8px;
}

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

.court-bench {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.78rem;
}

.bench-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.96);
}

.bench-pill .court-dot {
  background: var(--player-color, #38bdf8);
}

.court-card form {
  margin-top: 0.55rem;
  display: flex;
  justify-content: center;
}

/* Sekcje: label nad blokami */

.section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

/* Økter – lista */

.sessions-card {
  max-width: 980px;
  margin-inline: auto;
}

.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.8rem;
}

.session-item {
  border-radius: 1.1rem;
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at top left,
              rgba(15,23,42,0.98),
              rgba(15,23,42,0.9));
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.session-head {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.session-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.session-title {
  font-size: 0.95rem;
}

.session-meta {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.session-tag {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.5);
}

.session-footer {
  margin-top: 0.45rem;
  display: flex;
  justify-content: flex-end;
}

/* Økter – detail */

.sessions-detail {
  max-width: 980px;
  margin-inline: auto;
}

.sessions-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 0.6rem;
}

.sessions-column {
  border-radius: 1rem;
  border: 1px solid rgba(15,23,42,0.9);
  padding: 0.75rem 0.9rem;
  background: radial-gradient(circle at top,
              rgba(15,23,42,0.98),
              rgba(15,23,42,0.9));
}

@media (max-width: 860px) {
  .sessions-detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Bench – małe kartki podzielone od scoreboardu */

.bench-section {
  margin-top: 0.85rem;
}

.bench-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.bench-card {
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  border: 1px solid rgba(148,163,184,0.5);
  background: rgba(15,23,42,0.96);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
}

.bench-main {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

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

/* Kropka koloru gracza w tabeli rankingowej */
.player-dot {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  margin-right: 0.4rem;
  box-shadow: 0 0 0 2px rgba(15,23,42,0.9);
  vertical-align: -0.12rem;
}

/* Layout rankingowy (gdyby jeszcze nie było) */
.ranking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1rem;
}

.ranking-chart {
  min-height: 220px;
}

@media (max-width: 860px) {
  .ranking-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Quick Match --- */

.quickmatch-card {
  margin-bottom: 1.5rem;
}

.quickmatch-body {
  padding-top: 0.75rem;
}

.quickmatch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 1.25rem;
}

@media (max-width: 1024px) {
  .quickmatch-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.quickmatch-column {
  min-width: 0;
}

/* gracze */

.qm-player-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.qm-player-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: rgba(15,23,42,0.7);
  border: 1px solid rgba(148,163,184,0.35);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
  font-size: 0.8rem;
}

.qm-player-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(15,23,42,0.8);
  border-color: rgba(56,189,248,0.5);
}

.qm-player-chip input[type="checkbox"] {
  display: none;
}

.qm-player-chip input[type="checkbox"]:checked + .qm-player-avatar,
.qm-player-chip input[type="checkbox"]:checked ~ .qm-player-avatar {
  box-shadow: 0 0 0 2px rgba(56,189,248,0.7);
}

.qm-player-avatar {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(15,23,42,0.8);
}

.qm-player-name {
  white-space: nowrap;
}

/* boisko */

.qm-court {
  position: relative;
  border-radius: 1.2rem;
  padding: 0.7rem;
  border: 1px solid rgba(148,163,184,0.3);
  background: radial-gradient(circle at top, rgba(56,189,248,0.12), transparent),
              radial-gradient(circle at bottom, rgba(56,189,248,0.06), transparent),
              rgba(15,23,42,0.85);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.qm-half {
  border-radius: 0.9rem;
  border: 1px dashed rgba(148,163,184,0.35);
  padding: 0.4rem;
  display: grid;
  grid-template-rows: auto auto auto;
  row-gap: 0.3rem;
}

.qm-team-label {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148,163,184,0.9);
}

.qm-slot {
  min-height: 1.6rem;
  border-radius: 999px;
  background: rgba(15,23,42,0.9);
  border: 1px dashed rgba(75,85,99,0.7);
  display: flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
}

.qm-slot-player {
  position: relative;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: radial-gradient(circle at top left, rgba(56,189,248,0.45), rgba(59,130,246,0.55));
  font-size: 0.75rem;
  font-weight: 500;
  color: #f9fafb;
  box-shadow: 0 10px 20px rgba(15,23,42,0.8);
}

.qm-slot-player::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,0.25);
  opacity: 0.8;
}

.qm-bench {
  grid-column: 1 / -1;
  margin-top: 0.4rem;
  border-radius: 0.9rem;
  border: 1px dashed rgba(148,163,184,0.3);
  padding: 0.35rem 0.4rem;
}

.qm-bench-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.qm-bench-player {
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(148,163,184,0.5);
  font-size: 0.7rem;
}

/* przyciski */

.qm-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease, background 0.1s ease;
  text-decoration: none;
}

.btn-pill-primary {
  background: linear-gradient(135deg, #22d3ee, #0ea5e9);
  color: #0b1220;
  box-shadow: 0 12px 30px rgba(8,47,73,0.8);
}

.btn-pill-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(8,47,73,0.95);
}

.btn-pill-ghost {
  background: rgba(15,23,42,0.9);
  border-color: rgba(148,163,184,0.5);
  color: #e5e7eb;
}

.btn-pill-ghost:hover {
  border-color: rgba(56,189,248,0.7);
}

.btn-pill-strong {
  background: radial-gradient(circle at top left, #22c55e, #16a34a);
  color: #ecfdf5;
  box-shadow: 0 14px 35px rgba(6,78,59,0.9);
}

.btn-mini {
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.7rem;
  cursor: pointer;
  text-decoration: none;
}

.btn-mini-ghost {
  background: rgba(15,23,42,0.9);
  border-color: rgba(148,163,184,0.5);
  color: #e5e7eb;
}

.btn-mini-danger {
  background: rgba(248,113,113,0.18);
  border-color: rgba(248,113,113,0.8);
  color: #fecaca;
}

/* wynik */

.qm-score-row {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.4rem;
}

.qm-score-box {
  flex: 1;
  border-radius: 1rem;
  padding: 0.55rem 0.7rem;
  background: radial-gradient(circle at top, rgba(56,189,248,0.2), rgba(15,23,42,0.95));
  border: 1px solid rgba(148,163,184,0.6);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  cursor: pointer;
  transition: box-shadow 0.1s ease, transform 0.1s ease, border-color 0.1s ease;
}

.qm-score-box:hover {
  transform: translateY(-1px);
  box-shadow: 0 15px 35px rgba(15,23,42,0.95);
  border-color: rgba(56,189,248,0.9);
}

.qm-score-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148,163,184,0.92);
}

.qm-score-value {
  font-size: 1.8rem;
  font-weight: 600;
  color: #f9fafb;
}

.qm-submit-row {
  margin-top: 0.8rem;
}

/* modal */

.qm-score-modal {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(15,23,42,0.9), rgba(15,23,42,0.98));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.qm-score-modal.hidden {
  display: none;
}

.qm-score-modal-inner {
  width: min(420px, 92vw);
  border-radius: 1.3rem;
  background: radial-gradient(circle at top left, rgba(56,189,248,0.16), rgba(15,23,42,0.98));
  border: 1px solid rgba(148,163,184,0.6);
  padding: 0.9rem 1rem 1rem;
  box-shadow: 0 24px 70px rgba(15,23,42,0.98);
}

.qm-score-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #e5e7eb;
  margin-bottom: 0.5rem;
}

.qm-score-modal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.qm-score-number {
  border-radius: 0.7rem;
  border: 1px solid rgba(148,163,184,0.6);
  background: rgba(15,23,42,0.9);
  color: #e5e7eb;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.1s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

.qm-score-number:hover {
  background: radial-gradient(circle at top, rgba(56,189,248,0.35), rgba(15,23,42,0.95));
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15,23,42,0.95);
}

.qm-modal-close {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1rem;
  cursor: pointer;
}

.qm-modal-close:hover {
  color: #e5e7eb;
}

/* nagłówek listy økter */

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

/* === Quick Match – wyraźne zaznaczenie graczy === */

#quickmatch-form label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.7rem;
  margin: 0.15rem 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: radial-gradient(circle at top left,
                              rgba(15,23,42,0.98),
                              rgba(15,23,42,0.7));
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.1;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.12s ease;
}

#quickmatch-form label:hover {
  border-color: rgba(56, 189, 248, 0.95);
  transform: translateY(-1px);
}

/* własny wygląd checkboxa – grubsza ramka, kolor pasujący do reszty UI */
#quickmatch-form input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 2px solid rgba(148, 163, 184, 0.8);
  background: rgba(15,23,42,0.9);
  display: inline-block;
  position: relative;
  margin-right: 2px;
}

#quickmatch-form input[type="checkbox"]:checked {
  border-color: #22d3ee;
  box-shadow: 0 0 0 1px rgba(34,211,238,0.45);
}

#quickmatch-form input[type="checkbox"]:checked::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 0, #22c55e, #06b6d4);
}

/* dodatkowe podświetlenie całego „pill-a” zaznaczonego gracza */
#quickmatch-form label.qm-selected {
  border-width: 2px;
  border-color: rgba(45, 212, 191, 0.95);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.35);
}

/* === Quick Match – ukryj natywny kwadracik checkboxa, zostaw tylko pille === */

#quickmatch-form input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  position: absolute;
}

/* label nadal jest "pill-em" (ustawione wcześniej),
   a .qm-selected daje wyraźną obwódkę */
#quickmatch-form label.qm-selected {
  border-width: 2px;
  border-color: rgba(45, 212, 191, 0.95);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.35);
}

/* === Padel Manager – Quick Match Random: pływający przycisk po prawej === */
/* Zakładamy, że przycisk Random ma jedno z tych oznaczeń (używanych już w JS):
   - id="qm-random-btn"
   - id="qm-random"
   - id="quickmatch-random"
   - data-qm-random lub data-action="qm-random"
*/

#qm-random-btn,
#qm-random,
#quickmatch-random,
button[data-qm-random],
button[data-action="qm-random"] {
  position: fixed;
  right: 1.1rem;
  bottom: 1.2rem;
  z-index: 65;
  border-radius: 999px;
  padding: 0.7rem 1.3rem;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  background: radial-gradient(circle at 0 0, #22c55e, #06b6d4);
  border: 1px solid rgba(15,23,42,0.85);
  box-shadow:
    0 18px 35px rgba(15,23,42,0.85),
    0 0 0 1px rgba(34,211,238,0.55);
  color: #0b1120;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

#qm-random-btn::before,
#qm-random::before,
#quickmatch-random::before,
button[data-qm-random]::before,
button[data-action="qm-random"]::before {
  content: "🎲";
  font-size: 1rem;
}

#qm-random-btn:hover,
#qm-random:hover,
#quickmatch-random:hover,
button[data-qm-random]:hover,
button[data-action="qm-random"]:hover {
  transform: translateY(-1px);
}

/* na bardzo małych ekranach trochę wyżej */
@media (max-width: 480px) {
  #qm-random-btn,
  #qm-random,
  #quickmatch-random,
  button[data-qm-random],
  button[data-action="qm-random"] {
    bottom: 1.6rem;
  }
}

/* === Padel Manager – Quick Match: Random obok Nullstill, bez fixed na dole === */

/* Nadpisanie poprzedniego fixed / float – wracamy do normalnego układu w rzędzie */
#qm-random-btn,
#qm-random,
#quickmatch-random,
button[data-qm-random],
button[data-action="qm-random"] {
  position: static !important;
  float: none !important;
  bottom: auto !important;
  right: auto !important;
  margin-left: 1rem;           /* większa przerwa między Nullstill a Random */
}

/* Jeżeli przyciski siedzą obok siebie w jednym kontenerze,
   to dzięki temu Random będzie bardziej "po prawej" */
#quickmatch-form .qm-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 1.25rem;                 /* jeszcze trochę powietrza między przyciskami */
}

/* fallback: jeżeli przyciski siedzą bez qm-actions,
   to i tak margin-left na Random robi odstęp, a kolejność Nullstill -> Random
   daje efekt: Nullstill po lewej, Random po prawej */

/* === Padel Manager – Quick Match: Nullstill lewo, Random prawo === */

/* Kontener na przyciski (jeśli istnieje .qm-actions) – odwracamy kolejność,
   więc DOM: [Random][Nullstill] -> wizualnie: Nullstill (lewo), Random (prawo) */
#quickmatch-form .qm-actions {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  align-items: center;
  gap: 1.4rem;
}

/* Random – zwykły element w strumieniu, BEZ fixed, BEZ wysokiego z-index.
   Pozycja statyczna = popupy (position: fixed/absolute) zawsze będą nad nim. */
#qm-random-btn,
#qm-random,
#quickmatch-random,
button[data-qm-random],
button[data-action="qm-random"] {
  position: static !important;
  z-index: 1 !important;
  float: none !important;
  margin-left: 0 !important;   /* odstęp robi teraz gap w flexboxie */
}

/* Nullstill – jeśli ma dedykowaną klasę/ID, można tu dodać jeszcze drobne
   dostosowania, ale układ (lewo/prawo) wynika po prostu z flex row-reverse. */


/* === Padel Manager – Quick Match: popupowy wybór graczy === */

/* mały okrągły guzik z ikoną / liczbą */
#qm-player-trigger {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.6);
  background: radial-gradient(circle at 0 0,
                              rgba(15,23,42,0.98),
                              rgba(15,23,42,0.88));
  box-shadow:
    0 10px 25px rgba(15,23,42,0.9),
    0 0 0 1px rgba(15,23,42,0.9);
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

/* ukryte stare pille z graczami w tle */
.qm-inline-player-hidden {
  display: none !important;
}

/* overlay na całą stronę, ale tylko w obrębie formularza */
.qm-player-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
}

.qm-player-overlay.open {
  display: flex;
}

.qm-player-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top,
                              rgba(15,23,42,0.85),
                              rgba(15,23,42,0.9));
  backdrop-filter: blur(6px);
}

.qm-player-overlay-card {
  position: relative;
  z-index: 61;
  max-width: 22rem;
  width: calc(100% - 2.5rem);
  max-height: calc(100vh - 5rem);
  border-radius: 1.5rem;
  background: radial-gradient(circle at top left,
                              rgba(15,23,42,0.98),
                              rgba(15,23,42,0.94));
  box-shadow:
    0 24px 45px rgba(15,23,42,0.9),
    0 0 0 1px rgba(148,163,184,0.35);
  border: 1px solid rgba(148,163,184,0.4);
  padding: 1rem 1.1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.qm-player-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 500;
  color: #e5e7eb;
}

.qm-player-overlay-close {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.2rem;
  cursor: pointer;
}

.qm-player-overlay-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* każdy gracz w popupie – bazuje na stylu pill-a z listy */
.qm-player-option {
  cursor: pointer;
}

/* podświetlony (wybrany) gracz w popupie */
.qm-player-option.selected {
  border-width: 2px;
  border-color: rgba(45, 212, 191, 0.95);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.35);
}

.qm-player-overlay-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

.qm-player-overlay-save {
  border-radius: 999px;
  padding: 0.45rem 1.3rem;
  border: 1px solid rgba(22,163,74,0.85);
  background: radial-gradient(circle at 0 0, #22c55e, #16a34a);
  box-shadow:
    0 10px 25px rgba(22,163,74,0.85),
    0 0 0 1px rgba(15,23,42,0.9);
  color: #0b1120;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

/* === Padel Manager – przycisk wyboru graczy przy 'Bane og benk' === */

#qm-player-trigger-slot {
  float: right;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: -0.1rem;
}


/* === Padel Manager – popup: różnica między wybranym a niewybranym graczem === */

.qm-player-overlay .qm-player-option {
  border-radius: 999px;
  border-width: 1px !important;
  border-style: solid !important;
  border-color: rgba(148,163,184,0.45) !important;
  box-shadow: none !important;
  opacity: 0.6;
  transition: all 0.15s ease-out;
}

.qm-player-overlay .qm-player-option.selected {
  border-width: 2px !important;
  border-color: rgba(45,212,191,0.95) !important;
  box-shadow: 0 0 0 2px rgba(45,212,191,0.45) !important;
  opacity: 1;
  transform: translateY(-1px);
}


/* === Padel Manager – bardziej przezroczyste "okno" nad animowanym tłem === */

/* Główne "okno" aplikacji – zakładamy, że content siedzi w <main>.
   Zwiększamy przezroczystość, żeby Pong w tle był bardziej widoczny. */
main {
  background: radial-gradient(circle at top,
                              rgba(15,23,42,0.50),
                              rgba(15,23,42,0.28));
  backdrop-filter: blur(14px);
}

/* Popupy (np. wybór graczy, help) – również trochę bardziej transparentne */
.qm-player-overlay-card,
.help-overlay-card,
.pin-modal-card,
.score-modal-card {
  background: radial-gradient(circle at top left,
                              rgba(15,23,42,0.90),
                              rgba(15,23,42,0.78)) !important;
}

/* Lekko zmniejszamy też obrys, żeby wyglądało bardziej "szklanie" */
.qm-player-overlay-card,
.help-overlay-card,
.pin-modal-card,
.score-modal-card {
  border-color: rgba(148,163,184,0.30) !important;
  box-shadow:
    0 20px 40px rgba(15,23,42,0.75),
    0 0 0 1px rgba(15,23,42,0.85);
}

/* === Padel Manager – widoczne tło Pong === */

body {
  background-color: #020617;
  overflow-x: hidden;
}

#pong-bg {
  position: fixed;
  inset: 0;
  z-index: 0;          /* pod całą treścią */
  pointer-events: none;
}

/* główne "okno" nad animacją – bardziej przezroczyste */
main {
  position: relative;
  z-index: 1;
  background: radial-gradient(circle at top,
                              rgba(15,23,42,0.80),
                              rgba(15,23,42,0.62));
  backdrop-filter: blur(14px);
}

/* navbar / nagłówek trochę wyżej, żeby wycinał się na tle */
.navbar,
header {
  position: relative;
  z-index: 2;
  background: linear-gradient(to bottom,
                              rgba(15,23,42,0.95),
                              rgba(15,23,42,0.75));
}

/* na wszelki wypadek: karty popupów też lekko transparentne */
.qm-player-overlay-card,
.help-overlay-card,
.pin-modal-card,
.score-modal-card {
  background: radial-gradient(circle at top left,
                              rgba(15,23,42,0.92),
                              rgba(15,23,42,0.80)) !important;
}

/* === Padel Manager – extra glass mode nad Pongiem === */

/* Główna „szyba” aplikacji – dużo mniejsze krycie,
   tak żeby boisko Pong było wyraźnie widoczne pod spodem. */
main,
.app-shell,
.page-shell,
.content-shell,
.pm-main-container {
  background: radial-gradient(circle at top,
                              rgba(15,23,42,0.55),
                              rgba(15,23,42,0.30)) !important;
  backdrop-filter: blur(10px);
}

/* Duża karta, w której siedzi Bane/Resultat/Økter – jeszcze lżejsza.
   Łapiemy typowe klasy kontenerów, ale nie zmieniamy układu. */
.main-card,
.session-shell,
.session-card,
.qm-main-card,
.qm-section-card,
.overall-card,
.scoreboard-card,
.pm-glass-panel {
  background: radial-gradient(circle at top left,
                              rgba(15,23,42,0.60),
                              rgba(15,23,42,0.32)) !important;
  border-color: rgba(148,163,184,0.28) !important;
}

/* Dla bezpieczeństwa: wszystkie elementy, które wcześniej dostały bardzo ciemne tło
   jako ".glass-card", rozjaśniamy podobnie. */
.glass-card,
.glass-panel {
  background: radial-gradient(circle at top left,
                              rgba(15,23,42,0.58),
                              rgba(15,23,42,0.30)) !important;
}


/* === Padel Manager – extra glass mode nad Pongiem === */

/* Główna „szyba” aplikacji – dużo mniejsze krycie,
   tak żeby boisko Pong było wyraźnie widoczne pod spodem. */
main,
.app-shell,
.page-shell,
.content-shell,
.pm-main-container {
  background: radial-gradient(circle at top,
                              rgba(15,23,42,0.55),
                              rgba(15,23,42,0.30)) !important;
  backdrop-filter: blur(10px);
}

/* Duża karta, w której siedzi Bane/Resultat/Økter – jeszcze lżejsza.
   Łapiemy typowe klasy kontenerów, ale nie zmieniamy układu. */
.main-card,
.session-shell,
.session-card,
.qm-main-card,
.qm-section-card,
.overall-card,
.scoreboard-card,
.pm-glass-panel {
  background: radial-gradient(circle at top left,
                              rgba(15,23,42,0.60),
                              rgba(15,23,42,0.32)) !important;
  border-color: rgba(148,163,184,0.28) !important;
}

/* Dla bezpieczeństwa: wszystkie elementy, które wcześniej dostały bardzo ciemne tło
   jako ".glass-card", rozjaśniamy podobnie. */
.glass-card,
.glass-panel {
  background: radial-gradient(circle at top left,
                              rgba(15,23,42,0.58),
                              rgba(15,23,42,0.30)) !important;
}


/* === Padel Manager – glass 0.3 overlay (ostatni blok, nadpisuje poprzednie) === */

/* Główna szyba nad Pongiem – bardzo lekkie krycie */
main,
.app-shell,
.page-shell,
.content-shell,
.pm-main-container {
  background: radial-gradient(circle at top,
                              rgba(15,23,42,0.30),
                              rgba(15,23,42,0.15)) !important;
  backdrop-filter: blur(10px);
}

/* Duże panele (Bane og benk / Resultat / Økter) – trochę mocniejsze, ale dalej ~0.3 */
.main-card,
.session-shell,
.session-card,
.qm-main-card,
.qm-section-card,
.overall-card,
.scoreboard-card,
.pm-glass-panel,
.glass-card,
.glass-panel {
  background: radial-gradient(circle at top left,
                              rgba(15,23,42,0.38),
                              rgba(15,23,42,0.22)) !important;
  border-color: rgba(148,163,184,0.26) !important;
}


/* === Padel Manager – ultra glass (bardziej przezroczyste nad Pongiem) === */

/* Główna szyba nad Pongiem */
main,
.app-shell,
.page-shell,
.content-shell,
.pm-main-container {
  background: radial-gradient(circle at top,
                              rgba(15,23,42,0.24),
                              rgba(15,23,42,0.08)) !important;
  backdrop-filter: blur(10px);
}

/* Duże panele (Bane og benk / Resultat / Økter) */
.main-card,
.session-shell,
.session-card,
.qm-main-card,
.qm-section-card,
.overall-card,
.scoreboard-card,
.pm-glass-panel,
.glass-card,
.glass-panel {
  background: radial-gradient(circle at top left,
                              rgba(15,23,42,0.30),
                              rgba(15,23,42,0.16)) !important;
  border-color: rgba(148,163,184,0.24) !important;
}

/* Logo w navbarze dopasowane do wysokości paska */
.navbar-brand,
.pm-nav-brand,
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pm-logo-img {
  display: block;
  height: 150%;          /* dopasowuje się do wysokości kontenera */
  max-height: 80px;     /* górny limit, żeby nie przeginać na dużych ekranach */
  width: auto;
  object-fit: contain;
}

/* lekki "szklany" pasek nawigacji */
.navbar,
header {
  position: relative;
  z-index: 2;
  background: linear-gradient(to bottom,
                              rgba(15,23,42,0.95),
                              rgba(15,23,42,0.75));
}


/* === Padel Manager – FINAL GLASS OVERRIDE (ultra transparent) === */

/* Główna szyba nad Pongiem (cała zawartość w <main>) */
main,
.app-shell,
.page-shell,
.content-shell,
.pm-main-container {
  background: radial-gradient(circle at top,
                              rgba(15,23,42,0.18),
                              rgba(15,23,42,0.05)) !important;
  backdrop-filter: blur(10px);
}

/* Duże panele (karta z Bane og benk / Resultat / lista økter) */
.main-card,
.session-shell,
.session-card,
.qm-main-card,
.qm-section-card,
.overall-card,
.scoreboard-card,
.pm-glass-panel,
.glass-card,
.glass-panel {
  background: radial-gradient(circle at top left,
                              rgba(15,23,42,0.24),
                              rgba(15,23,42,0.10)) !important;
  border-color: rgba(148,163,184,0.22) !important;
}

/* Logo w navbarze dopasowane do wysokości paska */
.navbar-brand,
.pm-nav-brand,
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pm-logo-img {
  display: block;
  height: 70%;          /* dopasowuje się do wysokości brand-container */
  max-height: 40px;     /* górny limit, żeby logo nie było gigantyczne */
  width: auto;
  object-fit: contain;
}

/* --- PIN overlay (4 okienka) --- */

.pin-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top,
    rgba(0, 240, 255, 0.12),
    rgba(0, 0, 0, 0.92)
  );
  backdrop-filter: blur(24px);
  z-index: 9999;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.pin-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pin-card {
  background: rgba(8, 20, 40, 0.9);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  padding: 26px 24px 20px;
  width: min(360px, 90vw);
  text-align: center;
}

.pin-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.pin-subtitle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
}

.pin-form {
  margin-top: 18px;
}

.pin-input-row {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.pin-input {
  width: 3rem;
  height: 3rem;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: radial-gradient(circle at 30% 0%,
    rgba(0, 255, 200, 0.15),
    rgba(4, 15, 30, 0.95)
  );
  color: #fff;
  font-size: 1.7rem;
  text-align: center;
  outline: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.pin-input:focus {
  border-color: #00e0b8;
  box-shadow: 0 0 0 2px rgba(0, 224, 184, 0.35);
}

.pin-footer {
  margin-top: 16px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.pin-error .pin-card {
  animation: pinShake 0.25s;
  border-color: #ff4d4f;
}

@keyframes pinShake {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-6px); }
  50%  { transform: translateX(6px); }
  75%  { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

/* --- PIN overlay v2 (frontend only) --------------------------------------- */

.pin-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top,
    rgba(0, 240, 255, 0.16),
    rgba(0, 0, 0, 0.80)
  );
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  z-index: 9999;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.pin-overlay.pin-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pin-card {
  background: rgba(8, 20, 40, 0.88);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  padding: 26px 24px 20px;
  width: min(360px, 90vw);
  text-align: center;
}

.pin-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.pin-subtitle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
}

.pin-form {
  margin-top: 18px;
}

.pin-input-row {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.pin-input {
  width: 3rem;
  height: 3rem;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: radial-gradient(circle at 30% 0%,
    rgba(0, 255, 200, 0.18),
    rgba(4, 15, 30, 0.96)
  );
  color: #fff;
  font-size: 1.7rem;
  text-align: center;
  outline: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.pin-input:focus {
  border-color: #00e0b8;
  box-shadow: 0 0 0 2px rgba(0, 224, 184, 0.35);
}

.pin-footer {
  margin-top: 16px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.pin-error .pin-card {
  animation: pinShake 0.25s;
  border-color: #ff4d4f;
}

@keyframes pinShake {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-6px); }
  50%  { transform: translateX(6px); }
  75%  { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}



/* --- PIN overlay v3: bardzo przezroczyste tło, wysoki z-index --- */

.pin-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top,
    rgba(0, 240, 255, 0.10),
    rgba(0, 0, 0, 0.72)
  );
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 9999;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.pin-overlay.pin-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pin-card {
  background: rgba(8, 20, 40, 0.86);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  padding: 26px 24px 20px;
  width: min(360px, 90vw);
  text-align: center;
}

.pin-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.pin-subtitle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
}

.pin-form {
  margin-top: 18px;
}

.pin-input-row {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.pin-input {
  width: 3rem;
  height: 3rem;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: radial-gradient(circle at 30% 0%,
    rgba(0, 255, 200, 0.20),
    rgba(4, 15, 30, 0.96)
  );
  color: #fff;
  font-size: 1.7rem;
  text-align: center;
  outline: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.pin-input:focus {
  border-color: #00e0b8;
  box-shadow: 0 0 0 2px rgba(0, 224, 184, 0.35);
}

.pin-footer {
  margin-top: 16px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.pin-error .pin-card {
  animation: pinShake 0.25s;
  border-color: #ff4d4f;
}

@keyframes pinShake {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-6px); }
  50%  { transform: translateX(6px); }
  75%  { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}


/* --- Pełnoekranowy PIN-screen (4 okienka) ------------------------------- */

.pin-page {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin-card {
  background: rgba(8, 20, 40, 0.86);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
  padding: 26px 24px 20px;
  width: min(360px, 90vw);
  text-align: center;
  margin: 0 auto;
}

.pin-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.pin-subtitle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
}

.pin-form {
  margin-top: 18px;
}

.pin-input-row {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.pin-input {
  width: 3rem;
  height: 3rem;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: radial-gradient(circle at 30% 0%,
    rgba(0, 255, 200, 0.20),
    rgba(4, 15, 30, 0.96)
  );
  color: #fff;
  font-size: 1.7rem;
  text-align: center;
  outline: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.pin-input:focus {
  border-color: #00e0b8;
  box-shadow: 0 0 0 2px rgba(0, 224, 184, 0.35);
}

.pin-footer {
  margin-top: 16px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.pin-messages {
  margin-top: 14px;
}

.pin-message {
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 999px;
}

.pin-danger {
  background: rgba(255, 77, 79, 0.16);
  color: #ffb3b3;
}


/* --- PIN overlay v4: pełnoekranowy, przezroczyste tło, glassmorphism --- */

.pin-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top,
    rgba(0, 240, 255, 0.12),
    rgba(0, 0, 0, 0.78)
  );
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  z-index: 9999;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.pin-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pin-card {
  background: rgba(8, 20, 40, 0.86);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
  padding: 26px 24px 20px;
  width: min(360px, 90vw);
  text-align: center;
}

.pin-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.pin-subtitle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
}

.pin-form {
  margin-top: 18px;
}

.pin-input-row {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.pin-input {
  width: 3rem;
  height: 3rem;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: radial-gradient(circle at 30% 0%,
    rgba(0, 255, 200, 0.20),
    rgba(4, 15, 30, 0.96)
  );
  color: #fff;
  font-size: 1.7rem;
  text-align: center;
  outline: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.pin-input:focus {
  border-color: #00e0b8;
  box-shadow: 0 0 0 2px rgba(0, 224, 184, 0.35);
}

.pin-footer {
  margin-top: 16px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.pin-error .pin-card {
  animation: pinShake 0.25s;
  border-color: #ff4d4f;
}

@keyframes pinShake {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-6px); }
  50%  { transform: translateX(6px); }
  75%  { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}


/* Center court card on Økter page */
.quickmatch-court {
  max-width: 900px;      /* ogranicza szerokość na desktopie */
  margin-left: auto;
  margin-right: auto;    /* klasyczne centrowanie bloku */
}


/* === Padel Manager: layout fixes (court centering + mobile) === */

/* Karta boiska – zawsze na środku, niezależnie od flexów rodzica */
.pm-card-arena,
.quickmatch-court {
  width: 100%;
  max-width: 900px;
  margin-left: auto !important;
  margin-right: auto !important;
  align-self: center;           /* gdy rodzic jest flex-column */
  box-sizing: border-box;
}

/* Unikamy wymuszania szerokiego viewportu */
.pm-table-wrapper,
.pm-chart-wrapper,
.pm-scroll-x {
  width: 100%;
  overflow-x: auto;
}

/* Wykresy (Chart.js) nie mogą być szersze niż ekran */
.chartjs-render-monitor {
  max-width: 100% !important;
  height: auto !important;
}

/* Ogólne kontenery strony – trzymają się środka i nie wychodzą poza ekran */
.pm-main,
.pm-page,
.pm-container,
.pm-shell {
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Mobile tweaks */
@media (max-width: 480px) {
  .pm-main,
  .pm-page,
  .pm-container,
  .pm-shell {
    padding-left: 8px;
    padding-right: 8px;
  }

  .pm-card-arena,
  .quickmatch-court {
    max-width: 100%;
  }
}

/* --- Ranking (Excel-style) --- */

.ranking-section {
  padding-top: 1.5rem;
}

.ranking-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.ranking-tab {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #cbd5f5;
  text-decoration: none;
  background: radial-gradient(circle at top left,
    rgba(56, 189, 248, 0.12),
    rgba(15, 23, 42, 0.85));
  backdrop-filter: blur(18px);
  transition: transform 0.12s ease, box-shadow 0.12s ease,
              border-color 0.12s ease, background 0.12s ease;
}

.ranking-tab.active {
  border-color: rgba(94, 234, 212, 0.9);
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.3);
  background: radial-gradient(circle at top left,
    rgba(94, 234, 212, 0.22),
    rgba(15, 23, 42, 0.9));
}

.ranking-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(94, 234, 212, 0.8);
}

.ranking-view-description {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 1rem;
}

.table-wrapper {
  margin-top: 0.5rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: radial-gradient(circle at top left,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 0.75));
  overflow: hidden;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ranking-table th,
.ranking-table td {
  padding: 0.55rem 0.9rem;
  text-align: left;
}

.ranking-table thead {
  background: linear-gradient(
    90deg,
    rgba(30, 64, 175, 0.9),
    rgba(14, 116, 144, 0.9)
  );
  color: #e5e7eb;
}

.ranking-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.75);
}

.ranking-table tbody tr:nth-child(odd) {
  background: rgba(15, 23, 42, 0.6);
}

.chart-wrapper {
  margin-top: 1.25rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: radial-gradient(circle at top left,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 0.75));
  padding: 0.75rem;
  min-height: 240px;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 220px !important;
}

/* === Excel-style ranking === */

.ranking-section {
  padding-top: 1.5rem;
}

.ranking-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.ranking-tab {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #cbd5f5;
  text-decoration: none;
  background: radial-gradient(circle at top left,
    rgba(56, 189, 248, 0.12),
    rgba(15, 23, 42, 0.85));
  backdrop-filter: blur(18px);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease;
}

.ranking-tab.active {
  border-color: rgba(94, 234, 212, 0.9);
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.3);
  background: radial-gradient(circle at top left,
    rgba(94, 234, 212, 0.22),
    rgba(15, 23, 42, 0.9));
}

.ranking-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(94, 234, 212, 0.8);
}

.table-wrapper {
  margin-top: 0.5rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: radial-gradient(circle at top left,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 0.75));
  overflow: hidden;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ranking-table th,
.ranking-table td {
  padding: 0.55rem 0.9rem;
  text-align: left;
}

.ranking-table thead {
  background: linear-gradient(
    90deg,
    rgba(30, 64, 175, 0.9),
    rgba(14, 116, 144, 0.9)
  );
  color: #e5e7eb;
}

.ranking-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.75);
}

.ranking-table tbody tr:nth-child(odd) {
  background: rgba(15, 23, 42, 0.6);
}

.chart-wrapper {
  margin-top: 1.25rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: radial-gradient(circle at top left,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 0.75));
  padding: 0.75rem;
  min-height: 240px;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 220px !important;
}

/* --- Ranking views: player color dots + inline bar charts --- */
.ranking-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.ranking-tab-btn {
  border-radius: 999px;
  padding: 0.4rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 16, 34, 0.9);
  color: #e5f0ff;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.ranking-tab-btn.active {
  border-color: #19f5c8;
  background: linear-gradient(135deg, #00d0ff, #19f5c8);
  color: #00101a;
  box-shadow: 0 0 18px rgba(25, 245, 200, 0.35);
}

.ranking-panel {
  display: none;
}

.ranking-panel.active {
  display: block;
}

.player-color-dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  margin-right: 0.35rem;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

/* Prosty "wykres" słupkowy w stylu UI aplikacji */
.bar-chart {
  margin-top: 1.75rem;
  padding: 1.1rem 1.2rem 0.5rem;
  border-radius: 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top, rgba(0, 224, 255, 0.12), transparent),
    radial-gradient(circle at bottom, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.8));
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.bar-label {
  min-width: 5.2rem;
  font-size: 0.78rem;
  color: rgba(229, 240, 255, 0.86);
  white-space: nowrap;
}

.bar-track {
  flex: 1;
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(7, 14, 30, 0.9);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.7);
}

.bar-value {
  min-width: 3rem;
  text-align: right;
  font-size: 0.75rem;
  color: rgba(229, 240, 255, 0.9);
}

/* ---- Ranking views (Excel-style) ---- */
.ranking-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 1.25rem;
}

.ranking-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.28);
  background: radial-gradient(circle at 0 0, rgba(0,255,255,0.18), rgba(0,0,0,0.7));
  color: #ffffff;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.7);
  transition: all 0.18s ease-out;
}

.ranking-tab-btn:hover {
  border-color: rgba(0,255,220,0.9);
}

.ranking-tab-btn.active {
  border-color: rgba(0,255,200,0.9);
  box-shadow: 0 0 20px rgba(0,255,200,0.7);
  background: radial-gradient(circle at 0 0, rgba(0,255,200,0.55), rgba(0,0,0,0.7));
}

.ranking-panel {
  display: none;
  margin-top: 1.25rem;
}

.ranking-panel.active {
  display: block;
}

.table-card {
  background: radial-gradient(circle at 0 0, rgba(0,255,255,0.05), rgba(0,0,0,0.75));
  border-radius: 1.5rem;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 1rem 1.25rem;
}

/* kolorowa kropka gracza */
.player-color-dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  margin-right: 0.35rem;
  box-shadow: 0 0 8px rgba(0,0,0,0.9);
}

/* prosty poziomy wykres słupkowy */
.bar-chart {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bar-label {
  width: 90px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bar-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(0,0,0,0.8);
}

.bar-value {
  width: 60px;
  text-align: right;
  font-size: 0.85rem;
}


/* Ograniczenie rozmiaru logo w navbarze / nagłówku */
img[src*="logo.png"] {
    max-height: 42px;
    width: auto;
}


/* Padel Manager header layout */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  z-index: 50;
}

.brand-link {
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  height: 32px;
  max-width: 180px;
  object-fit: contain;
}

.top-nav {
  display: flex;
  gap: 1.75rem;
  font-weight: 500;
}

.top-nav a {
  text-decoration: none;
  color: #f4f7ff;
  padding-bottom: 0.2rem;
}

.top-nav a.active {
  border-bottom: 2px solid #36f0d0;
}


/* === Quick Match – ukryta stara lista graczy pod nawigacją === */
/* Jeśli Twoja lista ma inne klasy – podmień je ręcznie na właściwe */
.quickmatch-players,
.quickmatch-player-strip,
.player-chips-row,
.player-chip-strip {
  display: none;
}

/* === Quick Match – nagłówek 'Bane' + okrągły przycisk po prawej === */
.bane-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.player-popup-trigger {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(0,255,255,0.35);
}

.player-popup-trigger:hover {
  border-color: rgba(0,255,200,0.85);
}

#quickmatch-player-count {
  font-size: 1.1rem;
}

/* --- Ranking: pasek zakładek --- */
.ranking-card .card-header {
  margin-bottom: 0.75rem;
}

.ranking-tabs {
  display: flex;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 1rem auto;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.9);
  box-shadow:
    0 0 0 1px rgba(148, 163, 184, 0.25),
    0 18px 45px rgba(15, 23, 42, 0.9);
}

.rank-tab {
  flex: 1;
  padding: 0.6rem 0.4rem;
  font-size: 0.9rem;
  border: none;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
}

.rank-tab + .rank-tab {
  border-left: 1px solid rgba(148, 163, 184, 0.35);
}

.rank-tab.active {
  background: linear-gradient(135deg, #22c55e, #06b6d4);
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 0 25px rgba(34, 197, 94, 0.45);
}

/* --- FIX: ranking tabs – więcej miejsca na tekst, brak ucinania --- */
.ranking-tabs {
  max-width: 520px;          /* odrobinkę szerzej */
}

.rank-tab {
  padding: 0.75rem 0.8rem;   /* więcej pionu i poziomu */
  font-size: 0.9rem;
  line-height: 1.3;          /* wyższa linia, nie ucina liter */
  display: flex;
  align-items: center;
  justify-content: center;
  text-overflow: clip;
  white-space: nowrap;
}

/* --- OVERRIDE: ranking segmented control – równe, nieprzesuwające się zakładki --- */
.ranking-tabs {
  display: flex;
  align-items: stretch;
  justify-content: center;
  border-radius: 999px;
  overflow: hidden;
}

.rank-tab {
  flex: 1 1 0;                      /* wszystkie zakładki mają taką samą szerokość */
  margin: 0;                         /* kasujemy stare marginesy, które przesuwały highlight */
  padding: 0.75rem 0.45rem;
  font-size: 0.9rem;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.15);  /* cienka pionowa kreska między zakładkami */
  background: transparent;
}

.rank-tab:last-child {
  border-right: none;
}

.rank-tab.active {
  background: linear-gradient(90deg, #00f260, #00c9ff);  /* zielono-turkusowe podświetlenie */
  box-shadow: 0 0 22px rgba(0, 201, 255, 0.35);
}

/* === OVERRIDE: ranking tabs – 4 równe zakładki, bez rozjeżdżania === */
.ranking-tabs {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent),
    rgba(15, 23, 42, 0.9);
}

/* każda zakładka ma dokładnie 1/4 szerokości kontenera */
.ranking-tab {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 0.35rem;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
}

/* cienkie pionowe kreski między zakładkami */
.ranking-tab + .ranking-tab::before {
  content: "";
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 1px;
  background: rgba(148, 163, 184, 0.4);
}

/* podświetlenie aktywnej zakładki – bez zmiany szerokości */
.ranking-tab.active {
  background: linear-gradient(90deg, #22c55e, #06b6d4);
  color: #02111f;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.45);
}

/* zaokrąglenia tylko na skrajnych zakładkach */
.ranking-tab:first-child {
  border-radius: 9999px 0 0 9999px;
}

.ranking-tab:last-child {
  border-radius: 0 9999px 9999px 0;
}

/* === FIX: więcej przestrzeni pionowej w zakładkach rankingu === */
/* Te reguły nadpisują poprzednie – są na samym końcu pliku.      */

.ranking-tabs {
  padding: 0.35rem 0.5rem;     /* trochę odstępu od górnej krawędzi "piguły" */
}

.ranking-tab {
  padding-top: 0.65rem;        /* więcej miejsca nad tekstem */
  padding-bottom: 0.65rem;     /* i pod tekstem                */
  line-height: 1.2;
  font-size: 0.9rem;
}

/* Upewniamy się, że wszystkie cztery zakładki mają identyczną szerokość */
.ranking-tab {
  flex: 1 1 0;
}

/* === FIX: ranking – zakładki 2×2, równa szerokość, bez rozjeżdżania === */

.ranking-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 kolumny, równa szerokość */
  grid-auto-rows: minmax(2.6rem, auto);            /* ta sama wysokość wierszy   */
  border-radius: 9999px;
  padding: 0.25rem;
  background: radial-gradient(circle at top left, rgba(45,212,191,.35), transparent 55%),
              radial-gradient(circle at bottom right, rgba(56,189,248,.35), transparent 55%);
  overflow: hidden;                                 /* nic nie wychodzi poza "pigułę" */
}

/* Podstawowy styl przycisków – równe pola 2×2 */

.ranking-tab {
  width: 100%;
  flex: none;                 /* nadpisuje stare flex:1 */
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 0.86rem;
  line-height: 1.2;
  padding: 0.55rem 0.35rem;
  white-space: nowrap;        /* nie zawijamy, ale pole jest stałej szerokości */
}

/* Linie oddzielające ćwiartki */

.ranking-tab:nth-child(1),
.ranking-tab:nth-child(2) {
  border-bottom: 1px solid rgba(148,163,184,0.35);
}

.ranking-tab:nth-child(1),
.ranking-tab:nth-child(3) {
  border-right: 1px solid rgba(148,163,184,0.35);
}

/* Zaokrąglone rogi piguły – każdy narożnik osobno */

.ranking-tab:nth-child(1) {
  border-top-left-radius: 9999px;
}

.ranking-tab:nth-child(2) {
  border-top-right-radius: 9999px;
}

.ranking-tab:nth-child(3) {
  border-bottom-left-radius: 9999px;
}

.ranking-tab:nth-child(4) {
  border-bottom-right-radius: 9999px;
}

/* Stan aktywny – tylko tło, bez zmiany rozmiaru */

.ranking-tab.active {
  background: linear-gradient(90deg, #22c55e, #22d3ee);
  color: #020617;
  font-weight: 600;
}

/* === FIX: ranking-tabs – brak szczeliny między pigułą a pierwszym przyciskiem === */
.ranking-tabs {
  padding: 0;                 /* zero wewnętrznego marginesu – przycisk dotyka krawędzi */
}

/* === Quick Match – wybór graczy w popupie === */

.qm-player-trigger {
  margin-left: 0.75rem;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 9999px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: linear-gradient(135deg, #22c55e, #06b6d4);
  box-shadow:
    0 0 0 1px rgba(148, 163, 184, 0.55),
    0 18px 40px rgba(0, 0, 0, 0.65);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #020617;
  font-weight: 700;
  font-size: 0.95rem;
}

.qm-player-trigger:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(148, 163, 184, 0.7),
    0 22px 50px rgba(0, 0, 0, 0.7);
}

.qm-player-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.16), transparent 55%),
    rgba(15, 23, 42, 0.9);
}

.qm-player-modal.hidden {
  display: none;
}

.qm-player-modal-inner {
  width: min(480px, 100% - 2rem);
  max-height: min(560px, 100% - 4rem);
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, 0.22), transparent 55%),
    rgba(15, 23, 42, 0.97);
  border-radius: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.55);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.85);
  padding: 1.25rem 1.5rem 1rem;
  display: flex;
  flex-direction: column;
}

.qm-player-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  color: #e5e7eb;
  font-weight: 600;
}

.qm-player-modal-close {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.3rem;
  cursor: pointer;
}

.qm-player-modal-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.25rem;
  margin-bottom: 0.75rem;
}

.qm-player-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* siatka graczy – podbijamy trochę marginesy w modalu */
.qm-player-modal .qm-player-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Quick Match – wyraźne podświetlenie zaznaczonych graczy w popupie */
.qm-player-chip {
  border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
}

/* wymaga :has, ale działa na nowoczesnych przeglądarkach (Chrome/Android) */
.qm-player-chip:has(.qm-player-checkbox:checked) {
  border-color: #22c55e;
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.7),
    0 12px 30px rgba(34, 197, 94, 0.35);
  background: radial-gradient(circle at top left,
    rgba(34, 197, 94, 0.22),
    transparent 55%);
}

/* Quick Match – upewnij się, że glow nie jest ucinany */
.qm-player-modal-inner,
.qm-player-modal-body,
.qm-player-grid {
  overflow: visible;
}

/* --- Navbar: soft glow pod logo --- */
.top-bar .brand-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-bottom: 0.4rem;   /* trochę miejsca na poświatę */
}

.top-bar .brand-link::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -4px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(
    ellipse at center,
    rgba(56, 189, 248, 0.75) 0%,
    rgba(56, 189, 248, 0.0) 70%
  );
  opacity: 0.7;
  filter: blur(3px);
  pointer-events: none;
}

/* lekkie podświetlenie samego logo */
.top-bar .brand-logo {
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.85));
}

/* --- Navbar logo glow (v2 – trochę mocniejszy, turkus + niebieski) --- */
.top-bar .brand-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-bottom: 0.55rem; /* trochę miejsca na poświatę */
}

.top-bar .brand-link::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -6px;
  height: 16px;
  border-radius: 999px;
  background: radial-gradient(
    ellipse at center,
    rgba(34, 211, 238, 0.95) 0%,   /* jasny turkus */
    rgba(59, 130, 246, 0.65) 35%,  /* niebieski pasujący do tła */
    rgba(15, 23, 42, 0.0) 80%
  );
  opacity: 0.95;
  filter: blur(5px);
  pointer-events: none;
}

/* logo z nieco mocniejszym neonem */
.top-bar .brand-logo {
  filter:
    drop-shadow(0 0 6px  rgba(34, 211, 238, 0.9))
    drop-shadow(0 0 12px rgba(59, 130, 246, 0.75));
}

/* === Padel Manager – mocne centrowanie kart na desktopie === */
@media (min-width: 1200px) {

  /* Wszystkie główne karty w sekcjach (Økter, Spillere, itp.)
     mają być węższe i wycentrowane */
  .page-section .glass-card {
    max-width: 1180px;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Kontener center-wrapper też dostaje max-width,
     żeby nie rozciągał się na cały ekran */
  .page-section .center-wrapper,
  .center-wrapper {
    max-width: 1180px;
    margin-left: auto !important;
    margin-right: auto !important;
  }

}

/* === Dodatkowe centrowanie kart na stronach (Økter, Spillere, itd.) === */
@media (min-width: 1200px) {
  .page-main .glass-card {
    max-width: 1180px;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}
