/* ==========================================================
   WSPÓLNY ARKUSZ STYLÓW - System Turniejowy
   Wartości paringów pochodzą z panelu administratora.
   ========================================================== */

:root {
  --pair-primary:#004085;--pair-header-bg:#004085;--pair-header-text:#ffffff;--pair-bg:#f0f2f5;--pair-card-bg:#ffffff;--pair-text:#333333;--pair-border:#dee2e6;--pair-table-bg:#e9ecef;--pair-table-text:#495057;--pair-time-bg:#ffc107;--pair-time-text:#000000;--pair-font-size:16px;--pair-padding:10px;--pair-radius:8px;--pair-gap:3px;--pair-table-size:35px;--pair-logo-height:48px;--pair-static-color:#7c3aed;--pair-autoscroll-speed:35px;--pair-autoscroll-edge-pause:3px;--pair-autoscroll-resume-delay:4px;--pair-refresh-interval:20px;--pair-timer-bg:#ffffff;--pair-timer-title-color:#475569;--pair-timer-text:#0f172a;--pair-timer-warn:#d97706;--pair-timer-end:#dc2626;--pair-timer-idle:#94a3b8;--pair-timer-font-size:28px;--pair-timer-warn-minutes:5px;--pair-timer-poll:5px;  --bg: #f1f5f9; --card: #ffffff; --text: #0f172a; --muted: #64748b; --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 2px 8px rgba(15,23,42,.05);
  --header-bg: #1e293b; --header-text: #ffffff;
  --blue: #2563eb;   --blue-d: #1d4ed8;
  --green: #16a34a;  --green-d: #15803d;
  --amber: #d97706;  --amber-d: #b45309;
  --red: #dc2626;    --red-d: #b91c1c;
  --teal: #0d9488;   --teal-d: #0f766e;
  --violet: #7c3aed; --violet-d: #6d28d9;
  --slate: #475569;  --slate-d: #334155;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.4;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
a { color: var(--blue); }

/* ---------- Układ ---------- */
.container { max-width: 1040px; margin: 0 auto; padding: 24px 16px 40px; }
.container.narrow { max-width: 540px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid-2 .full { grid-column: 1 / -1; }

.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg); color: var(--header-text);
  padding: 14px 24px; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.header h1, .header h2 { color: var(--header-text); font-size: 1.1rem; font-weight: 700; }
.header p { margin: 2px 0 0; opacity: .75; font-size: .85rem; }
.header .who { font-size: .9rem; opacity: .85; }
.header-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.header a {
  color: #fff; text-decoration: none; font-weight: 600; font-size: .88rem;
  background: rgba(255,255,255,.14); padding: 7px 14px; border-radius: 8px;
}
.header a:hover { background: rgba(255,255,255,.26); }

/* ---------- Karty i komunikaty ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px;
}
.card.scroll { overflow-x: auto; }
.card-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; }
.card-sub { color: var(--muted); font-size: .88rem; margin: 0 0 14px; }
.card h3 {
  font-size: 1rem; color: var(--blue-d); margin: 0 0 12px;
  padding-left: 10px; border-left: 4px solid var(--blue);
}
.section-title {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
  color: var(--muted); margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.msg { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-weight: 600; border: 1px solid transparent; }
.msg.success, .success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.msg.error,   .error   { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.msg.info,    .info    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }

/* ---------- Przyciski (kolorowe) ---------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 8px; padding: 9px 16px; font: inherit; font-weight: 600;
  font-size: .9rem; line-height: 1.2; color: #fff; background: var(--blue);
  cursor: pointer; text-decoration: none; transition: filter .15s, transform .05s;
}
button:hover, .btn:hover { filter: brightness(.92); }
button:active, .btn:active { transform: translateY(1px); }
.btn-blue   { background: var(--blue); }
.btn-green  { background: var(--green); }
.btn-amber  { background: var(--amber); }
.btn-red    { background: var(--red); }
.btn-teal   { background: var(--teal); }
.btn-violet { background: var(--violet); }
.btn-slate  { background: var(--slate); }
.btn-outline-red { background: #fff; color: var(--red); border: 1px solid var(--red); }
.btn-danger  { background: var(--red); }
.btn-success { background: var(--green); }
.btn-info    { background: var(--teal); }
.btn-sm { padding: 5px 10px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn-back { background: var(--slate); color: #fff; margin-bottom: 14px; }
.btn-note    { background: var(--teal); }
.btn-penalty { background: var(--red); }
.btn-time    { background: var(--blue); }
.btn-dc      { background: var(--slate); }
.btn-dc.checked { background: var(--green); }
.btn-save   { background: var(--green); }
.btn-cancel { background: var(--slate); }
.btn-register { background: var(--green); color: #fff; padding: 12px 24px; border-radius: 10px; font-size: 1rem; box-shadow: 0 2px 6px rgba(22,163,74,.3); }

.actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.actions form { margin: 0; }

/* ---------- Formularze ---------- */
input[type=text], input[type=password], input[type=number], input[type=file],
input:not([type]), select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 8px;
  font: inherit; font-size: .95rem; background: #fff; color: var(--text);
}
input[type=file] { padding: 7px; }
input[type=color] { width: 100%; height: 40px; padding: 3px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--blue); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
select { cursor: pointer; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 5px; }
.form-group { margin-bottom: 14px; }
.add-user { background: #f8fafc; padding: 16px; border-radius: 10px; border: 1px solid var(--border); margin: 14px 0; }
.add-user .fields { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: start; }
.add-user input { margin: 0; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row output { min-width: 52px; text-align: right; font-weight: 700; color: var(--blue-d); font-size: .9rem; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ---------- Tabele ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { background: #f8fafc; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
tbody tr:hover { background: #fafbff; }
.me-badge { font-size: .75rem; background: #e0e7ff; color: var(--blue-d); padding: 3px 9px; border-radius: 999px; font-weight: 700; }

/* ---------- Przełączniki (panel administratora) ---------- */
.toggle-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; margin: 0; border-top: 1px solid var(--border); }
.toggle-row:first-of-type { border-top: 0; }
.toggle-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.toggle-info strong { font-size: .95rem; }
.toggle-info small { color: var(--muted); font-size: .8rem; }
.pill { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.pill.on  { background: #dcfce7; color: #166534; }
.pill.off { background: #f1f5f9; color: var(--muted); }
.switch {
  position: relative; width: 48px; height: 26px; border-radius: 999px; border: 0; padding: 0;
  background: #cbd5e1; flex-shrink: 0; cursor: pointer; transition: background .2s;
}
.switch:hover { filter: brightness(.95); }
.switch.on { background: var(--green); }
.switch .knob {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff;
  border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s;
}
.switch.on .knob { transform: translateX(22px); }
.switch:focus-visible { outline: 3px solid #bfdbfe; outline-offset: 2px; }
/* Kafelki QR: nazwa i opis na górze, status i przełącznik w jednym rzędzie pod spodem.
   Układ siatki zapobiega nachodzeniu tekstu na plakietkę i przełącznik. */
.qr-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.qr-tiles .toggle-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 12px;
  margin: 0; padding: 14px 16px; background: #f8fafc;
  border: 1px solid var(--border); border-radius: 12px;
}
.qr-tiles .toggle-info { grid-column: 1 / -1; min-width: 0; }
.qr-tiles .toggle-info strong { font-size: 1rem; overflow-wrap: anywhere; }
.qr-tiles .toggle-info small { overflow-wrap: anywhere; }
.qr-tiles .pill { justify-self: start; }
.qr-tiles .switch { justify-self: end; }

/* ---------- Pliki ---------- */
.file-status {
  display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; margin-bottom: 12px;
  padding: 6px 12px; border-radius: 8px; background: #f1f5f9; color: var(--muted);
}
.file-status.ok { background: #dcfce7; color: #166534; }

/* ---------- Nawigacja (kafelki) ---------- */
.nav-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 22px; }
.nav-tile {
  display: flex; align-items: center; gap: 10px; background: var(--card); color: var(--text);
  text-decoration: none; font-weight: 600; font-size: .95rem; padding: 13px 15px;
  border: 1px solid var(--border); border-left: 4px solid var(--c, var(--blue));
  border-radius: 10px; box-shadow: var(--shadow); transition: transform .12s;
}
.nav-tile:hover { transform: translateY(-2px); }

/* ---------- Konta (rozwijane) ---------- */
details.acc summary {
  cursor: pointer; font-size: 1.05rem; font-weight: 700; list-style: none;
  display: flex; align-items: center; gap: 8px;
}
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 1.3rem; font-weight: 400; }
details.acc[open] summary::after { content: "−"; }

/* ---------- Modal (sędzia) ---------- */
.modal { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 1000; overflow-y: auto; }
.modal-content {
  background: #fff; width: 92%; max-width: 460px; margin: 70px auto; padding: 24px;
  border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.modal-content h3 { margin: 0 0 14px; font-size: 1.1rem; color: var(--text); border: 0; padding: 0; }
.modal-content label { margin-top: 12px; }
.modal-content select, .modal-content input, .modal-content textarea { margin-top: 4px; }
.modal-banner { padding: 10px 12px; border-radius: 8px; font-weight: 700; margin-bottom: 6px; }
.modal-banner.note    { background: #ccfbf1; color: #115e59; }
.modal-banner.penalty { background: #fee2e2; color: #991b1b; }
.modal-actions { margin-top: 20px; display: flex; gap: 10px; }
.modal-actions button { flex: 1; }

/* ---------- Panel sędziego ---------- */
.actions-inline { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.time-form { display: flex; gap: 6px; align-items: center; }
.time-form input[type=number] { width: 72px; padding: 6px 8px; }
.time-badge { background: #fef3c7; color: #92400e; padding: 4px 10px; border-radius: 999px; font-size: .85em; font-weight: 700; white-space: nowrap; }

/* ---------- Wyszukiwarka gracza ---------- */
.search-box { display: flex; gap: 10px; }
.search-box input { flex: 1; }
.player-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.player-list a { display: block; padding: 8px 12px; background: #eef2ff; color: var(--blue-d); text-decoration: none; border-radius: 8px; font-weight: 600; }
.player-list a.active { background: var(--blue); color: #fff; }
.note-item { background: #f8fafc; border-left: 4px solid var(--teal); padding: 10px 14px; margin-bottom: 10px; border-radius: 0 8px 8px 0; }
.note-item .date { font-size: .78em; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-weight: 700; font-size: .78rem; color: #fff; }
.bg-win     { background: var(--green); }
.bg-loss    { background: var(--red); }
.bg-draw    { background: var(--amber); }
.bg-pending { background: var(--slate); }

/* ---------- Rejestracja ---------- */
.register-header { text-align: center; }

/* ---------- Strona główna: oczekiwanie i QR ---------- */
.waiting-box { text-align: center; padding: 40px 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.waiting-box h2 { color: var(--muted); margin-bottom: 10px; font-size: 1.3rem; }
.spinner {
  display: inline-block; width: 40px; height: 40px; margin-bottom: 15px;
  border: 4px solid rgba(0,0,0,.1); border-left-color: var(--pair-primary);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.registration-cta { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.qr-section { margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--border); display: flex; justify-content: center; }
.qr-grid { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.qr-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.qr-card h4 { margin: 0 0 3px; font-size: .8rem; color: var(--pair-primary); text-transform: uppercase; letter-spacing: .04em; }
.qr-card p { margin: 0 0 8px; font-size: .7rem; color: var(--muted); }
.qr-code { display: flex; justify-content: center; background: #fff; padding: 4px; border-radius: 6px; border: 1px solid var(--border); }

.floating-qr-container {
  z-index: 10000; position: fixed; bottom: 20px; right: 20px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(15,23,42,.18);
}
.floating-qr-header {
  background: var(--pair-primary); color: #fff; padding: 9px 12px; border-radius: 11px 11px 0 0;
  font-size: .82rem; font-weight: 700; display: flex; justify-content: space-between; align-items: center;
  gap: 10px; cursor: pointer;
}
.floating-qr-body { padding: 10px; display: flex; justify-content: center; flex-wrap: wrap; max-width: 280px; }
.floating-qr-body .qr-grid { gap: 8px; }
.floating-qr-body .qr-card { padding: 6px; }
.floating-qr-body .qr-card h4 { font-size: .7rem; }
.floating-qr-body .qr-card p { font-size: .6rem; }

.mobile-app-links {
  display: flex; flex-direction: column; gap: 10px; margin-top: 24px; padding: 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.mobile-app-links h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--pair-primary); text-align: center; border: 0; padding: 0; }
.btn-mobile-app { display: flex; align-items: center; justify-content: center; padding: 12px 16px; border-radius: 9px; text-decoration: none; font-weight: 700; font-size: .95rem; color: #fff; }
.btn-mobile-app:hover { filter: brightness(.92); }
.btn-mobile-connect { background: var(--blue); }
.btn-mobile-android { background: var(--green); }
.btn-mobile-ios     { background: #111827; }
.btn-mobile-web     { background: var(--amber); }

@media (max-width: 768px) {
  .desktop-qr-only, .floating-qr-container { display: none !important; }
  .mobile-app-links { display: flex; }
}
@media (min-width: 769px) {
  .mobile-app-links { display: none !important; }
}

/* ==========================================================
   PAROWANIE - wygląd paringów na stronie głównej (index.php)
   ========================================================== */
.pair-page {
  --pair-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-family: var(--pair-font);
  background: var(--pair-bg); color: var(--pair-text);
}
.pf-system { --pair-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.pf-serif  { --pair-font: Georgia, "Times New Roman", serif; }
.pf-mono   { --pair-font: ui-monospace, Menlo, Consolas, monospace; }

.pair-header {
  background: var(--pair-header-bg); color: var(--pair-header-text);
  padding: 18px 20px; display: flex; align-items: center; justify-content: center; gap: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,.12); text-align: left;
}
.pair-header h1 { margin: 0; font-size: 1.5rem; color: var(--pair-header-text); }
.pair-header p  { margin: 4px 0 0; opacity: .85; font-size: .92rem; }
.brand-logo { height: var(--pair-logo-height); width: auto; max-width: 40vw; object-fit: contain; }

.pair-wrap { max-width: 820px; margin: 0 auto; padding: 20px 14px 40px; }
.pair-division { margin-bottom: 30px; }
.pair-division-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  border-bottom: 2px solid var(--pair-primary); padding-bottom: 8px; margin-bottom: 14px;
  color: var(--pair-primary);
}
.pair-division-head h2 { margin: 0; font-size: 1.25rem; color: var(--pair-primary); }
.pair-round {
  background: var(--pair-primary); color: #fff; padding: 4px 10px; border-radius: 6px;
  font-weight: 700; font-size: .88rem; white-space: nowrap;
}
.pair-card {
  position: relative; overflow: hidden; display: flex; align-items: center;
  background: var(--pair-card-bg); border: 1px solid var(--pair-border);
  border-radius: var(--pair-radius); padding: var(--pair-padding); margin-bottom: var(--pair-gap);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.pair-table {
  flex-shrink: 0; z-index: 2; width: var(--pair-table-size); height: var(--pair-table-size);
  display: flex; align-items: center; justify-content: center;
  background: var(--pair-table-bg); color: var(--pair-table-text);
  font-weight: 700; font-size: calc(var(--pair-table-size) * .4); border-radius: 50%;
}
.ts-round  .pair-table { border-radius: 50%; }
.ts-square .pair-table { border-radius: calc(var(--pair-radius) / 2); }
.pair-players { flex-grow: 1; margin-left: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 2; min-width: 0; }
.pair-player { font-size: var(--pair-font-size); font-weight: 600; overflow-wrap: anywhere; color: var(--pair-text); }
.pair-vs { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pair-time {
  position: absolute; right: 0; top: 0; bottom: 0; display: flex; align-items: center;
  padding: 0 14px; background: var(--pair-time-bg); color: var(--pair-time-text);
  font-weight: 700; font-size: .85rem; white-space: nowrap;
}
.pair-empty { color: var(--muted); text-align: center; padding: 10px; }
@media (min-width: 600px) {
  .pair-players { flex-direction: row; align-items: center; justify-content: space-between; padding-right: 90px; }
  .pair-player { flex: 1; text-align: center; }
  .pair-vs { margin: 0 14px; }
}

.pair-footer-text {
  margin-top: 24px; padding: 14px 16px; text-align: center; font-size: .95rem;
  background: var(--pair-card-bg); color: var(--pair-text);
  border: 1px solid var(--pair-border); border-radius: var(--pair-radius);
  overflow-wrap: anywhere;
}

/* ---------- Podgląd w panelu wyglądu ---------- */
.appearance-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.sticky-preview { position: sticky; top: 90px; }
.preview-frame { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.preview-frame .pair-wrap { padding: 16px 12px 20px; }
.preview-frame .pair-header h1 { font-size: 1.2rem; }
.preview-frame .pair-player { font-size: calc(var(--pair-font-size) * .9); }

@media (max-width: 860px) {
  .grid-2, .appearance-grid { grid-template-columns: 1fr; }
  .sticky-preview { position: static; }
}
@media (max-width: 600px) {
  .header { padding: 12px 14px; }
  .header .who { display: none; }
  .container { padding: 16px 10px 30px; }
  .card { padding: 16px; }
  .add-user .fields { grid-template-columns: 1fr; }
  .add-user button { width: 100%; }
  .search-box { flex-direction: column; }
}

/* Adres strony na stronie paringów */
.pair-address {
  margin-top: 24px; padding: 12px 16px; text-align: center; font-size: .95rem;
  background: var(--pair-card-bg); color: var(--pair-text);
  border: 1px solid var(--pair-border); border-radius: var(--pair-radius);
  overflow-wrap: anywhere;
}
.pair-address strong { color: var(--pair-primary); }

/* ==========================================================
   REJESTRACJA GRACZA (register.php)
   ========================================================== */
.reg-card { padding: 28px; }
.reg-card .form-group { margin-bottom: 18px; }
.reg-card label { font-size: .92rem; margin-bottom: 6px; color: var(--text); }
.reg-card input[type=text],
.reg-card input[type=number] { padding: 11px 14px; font-size: 1rem; }
.reg-card button.btn-green { padding: 13px; font-size: 1rem; margin-top: 8px; }

.reg-status { text-align: center; padding: 16px 8px; }
.reg-status h2 { font-size: 1.35rem; margin-bottom: 8px; }
.reg-status p { color: var(--muted); margin: 0 0 20px; }
.reg-status.open h2   { color: var(--green-d); }
.reg-status.closed h2 { color: var(--red-d); }

/* Plakietka miejsca stałego */
.pair-static {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; color: #fff; white-space: nowrap; vertical-align: middle;
  background: var(--pair-static-color);
}


/* ==========================================================
   TEAMLISTY (decklisty) - rejestracja, panel sędziego, admin_decklist.php
   ========================================================== */
.hidden { display: none !important; }
.check-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 2px; margin: 4px 0 2px;
  font-weight: 600; font-size: .92rem; color: var(--text); cursor: pointer;
}
.check-row input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); flex-shrink: 0; }

.btn-decklist { background: var(--violet); }
.btn-decklist-add { background: var(--slate); }

.decklist-pre {
  white-space: pre-wrap; word-break: break-word; max-height: 55vh; overflow-y: auto;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86rem; color: var(--text);
  margin-top: 6px;
}
.decklist-row-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.decklist-row-head .meta { color: var(--muted); font-size: .82rem; }

/* ==========================================================
   ZEGARY RUND - strona paringów (index.php) i panel admina
   Kolory pochodzą z "Wygląd paringów" (pair_timer_*).
   ========================================================== */
.timers-box[hidden] { display: none !important; }
.timers-card {
  background: var(--pair-timer-bg); color: var(--pair-text);
  border: 1px solid var(--pair-border); border-radius: var(--pair-radius);
  box-shadow: var(--shadow);
}
.timers-head {
  display: flex; align-items: center; gap: 8px; padding: .55em .8em;
  background: var(--pair-primary); color: #fff; font-weight: 700; font-size: .8em;
  letter-spacing: .05em; text-transform: uppercase;
  border-radius: calc(var(--pair-radius) - 1px) calc(var(--pair-radius) - 1px) 0 0;
}
.timers-list { display: flex; flex-direction: column; gap: .5em; padding: .7em; }

.timer-item {
  --timer-c: var(--pair-timer-text);
  display: flex; align-items: center; justify-content: space-between; gap: .8em;
  padding: .5em .75em; background: var(--pair-timer-bg);
  border: 1px solid var(--pair-border); border-left: .3em solid var(--timer-c);
  border-radius: calc(var(--pair-radius) / 1.5);
}
.timer-item.st-warn   { --timer-c: var(--pair-timer-warn); }
.timer-item.st-end    { --timer-c: var(--pair-timer-end); }
.timer-item.st-idle,
.timer-item.st-paused { --timer-c: var(--pair-timer-idle); }
.timer-name { font-weight: 700; font-size: .9em; color: var(--pair-timer-title-color); overflow-wrap: anywhere; min-width: 0; }
.timer-time-wrap { text-align: right; flex-shrink: 0; }
.timer-time {
  font-variant-numeric: tabular-nums; font-weight: 800; line-height: 1.1; white-space: nowrap;
  font-size: calc(var(--pair-timer-font-size) * var(--tscale, 1)); color: var(--timer-c);
}
.timer-item.st-idle .timer-time { font-size: calc(var(--pair-timer-font-size) * .5 * var(--tscale, 1)); }
.timer-note { display: block; font-size: .7em; font-weight: 700; color: var(--timer-c); text-transform: uppercase; letter-spacing: .05em; }

/* Komputer: pływający panel (przeciągany i skalowany) */
.timers-float {
  position: fixed; top: 90px; right: 20px; z-index: 9990;
  width: calc(260px * var(--tscale, 1)); font-size: calc(16px * var(--tscale, 1));
  user-select: none; -webkit-user-select: none;
}
.timers-float .timers-head { cursor: grab; touch-action: none; }
.timers-float.dragging .timers-head { cursor: grabbing; }
.timers-float .timers-list { max-height: calc(100vh - 80px); overflow-y: auto; padding-bottom: 1.4em; }
.timers-tools { margin-left: auto; display: flex; gap: 4px; }
.timers-tools button {
  width: 1.9em; height: 1.9em; padding: 0; font-size: 1em; line-height: 1; border-radius: 6px;
  background: rgba(255,255,255,.22); color: #fff;
}
.timers-resize {
  position: absolute; right: 0; bottom: 0; width: 1.5em; height: 1.5em; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 50%, var(--pair-primary) 50%);
  border-bottom-right-radius: var(--pair-radius);
}

/* Telefon: zwykły blok nad przyciskami aplikacji */
.timers-mobile { margin-top: 24px; font-size: 16px; text-align: left; }
.timers-mobile .timers-head { justify-content: center; }

@media (max-width: 768px) { .timers-float { display: none !important; } }
@media (min-width: 769px) { .timers-mobile { display: none !important; } }

/* Podgląd w panelu wyglądu */
.timers-preview { margin-top: 16px; font-size: 16px; }

/* Panel administratora: zarządzanie zegarami */
.pill.warn { background: #fef3c7; color: #92400e; }
.pill.end  { background: #fee2e2; color: #991b1b; }
.timer-admin-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.timer-admin-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: center;
  padding: 12px 14px; background: #f8fafc; border: 1px solid var(--border);
  border-left: 4px solid var(--slate); border-radius: 10px;
}
.timer-admin-row.running { border-left-color: var(--green); }
.timer-admin-row.paused  { border-left-color: var(--amber); }
.timer-admin-row.ended   { border-left-color: var(--red); }
.timer-admin-row .t-info { display: flex; flex-direction: column; min-width: 0; }
.timer-admin-row .t-info strong { overflow-wrap: anywhere; }
.timer-admin-row .t-left { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); font-size: .9rem; }
.timer-admin-row form { margin: 0; }
.timer-admin-controls { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.timer-admin-controls .mins { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.timer-admin-controls input[type=number] { width: 84px; padding: 6px 8px; }
.timer-admin-actions { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 600px) {
  .timer-admin-actions { width: 100%; }
  .timer-admin-actions button { flex: 1; }
}