:root {
  --bg: #060b16;
  --bg-2: #0b1222;
  --panel: rgba(12, 18, 34, 0.82);
  --line: rgba(255,255,255,0.09);
  --text: #f8fafc;
  --muted: #b8c4d8;
  --accent: #7cff5b;
  --accent-2: #37e36d;
  --danger: #ef4444;
  --shadow: 0 20px 60px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124,255,91,0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(255,255,255,0.08), transparent 18%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
  min-height: 100vh;
}

img { max-width: 100%; }
a { color: inherit; }

.app-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px;
}

.small-shell {
  max-width: 860px;
  padding-top: 42px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 24px;
}

.hero-actions,
.actions,
.panel-tools,
.match-actions,
.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.compact-brand { margin-bottom: 22px; }

.brand-mark-wrap {
  width: 170px;
  min-width: 170px;
  padding: 14px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.compact-mark {
  width: 120px;
  min-width: 120px;
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: #b7ff9f;
  font-size: .78rem;
}

h1, h2, h3, h4, p { margin-top: 0; }
h1 {
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 0;
}

.subtitle {
  color: var(--muted);
  margin: 10px 0 0;
  max-width: 780px;
}

.hero-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* Ranking de puntos y valoración van side by side en desktop grande */
@media (min-width: 1024px) {
  .layout-public {
    grid-template-columns: 1fr 1fr;
  }
  .layout-public .full-width {
    grid-column: 1 / -1;
  }
}

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.panel-highlight {
  position: relative;
  overflow: hidden;
}

.panel-highlight::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(124,255,91,.14), transparent 70%);
  pointer-events: none;
}

.install-panel { margin-top: 24px; }
.full-width { grid-column: 1 / -1; }

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

.badge {
  background: rgba(124,255,91,.11);
  color: #d8ffd0;
  border: 1px solid rgba(124,255,91,.25);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .9rem;
}

.small-badge { font-size: .75rem; padding: 6px 10px; }

.badge-muted {
  background: rgba(255,255,255,.06);
  color: #dbe7f8;
  border-color: var(--line);
}

.badge-admin {
  background: rgba(124,255,91,.18);
  color: #ebffdf;
  border-color: rgba(124,255,91,.35);
}

.match-form label,
.team-card label,
.auth-form label,
.admin-grid-form label,
.vote-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: #e2e8f0;
}

.field-grid,
.admin-grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.full-span { grid-column: 1 / -1; }

.form-hint {
  margin: 0 0 16px;
  color: #fde68a;
  font-size: .95rem;
}

.form-hint.ready { color: #86efac; }

.teams-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}

.team-card {
  background: rgba(20,31,56,.8);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  display: grid;
  gap: 14px;
}

.versus {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 900;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  color: #eff7ff;
}

input,
select,
button,
a.button-like {
  font: inherit;
}

input,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(7,11,22,.9);
  color: var(--text);
  padding: 12px 14px;
}

input:focus,
select:focus {
  outline: 2px solid rgba(124,255,91,.35);
  border-color: rgba(124,255,91,.4);
}

input:disabled,
select:disabled,
button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

button,
a.button-like {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, opacity .2s ease, background .2s ease, border-color .2s ease;
}

button:hover,
a.button-like:hover { transform: translateY(-1px); }
button:active,
a.button-like:active { transform: translateY(0); }
.primary { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: #07110a; }
.primary:hover { color: #06110a; }
.secondary {
  background: rgba(255,255,255,.06);
  color: var(--text);
  border: 1px solid var(--line);
}
.secondary:hover { background: rgba(255,255,255,.1); }
.ghost { background: transparent; border: 1px solid rgba(239,68,68,.35); color: #fecaca; }
.danger { background: var(--danger); color: white; }
.small { padding: 9px 12px; font-size: .92rem; }

.table-wrap { overflow-x: auto; }

#rankingTable {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

#rankingTable th,
#rankingTable td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

#rankingTable th {
  color: #b7c5da;
  font-size: .9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

#rankingTable tbody tr:hover { background: rgba(255,255,255,.03); }
.top-3 { background: rgba(124,255,91,.06); }

.player-cell {
  display: grid;
  gap: 2px;
}
.player-cell small,
.alias-line,
.muted {
  color: var(--muted);
}

.stats-grid,
.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.stats-card,
.player-card,
.match-item {
  background: rgba(20,31,56,.78);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
}

.stats-card.is-top,
.player-card:target,
.match-item:target {
  border-color: rgba(124,255,91,.38);
  box-shadow: 0 0 0 1px rgba(124,255,91,.1) inset;
}

.stats-card-head,
.player-card-head,
.match-top,
.opinion-head,
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.stats-rank {
  font-size: .85rem;
  color: #d8ffd0;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.stats-points {
  min-width: 82px;
  text-align: center;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(124,255,91,.12);
  color: #eaffdf;
  font-weight: 800;
}

.stats-metrics,
.player-mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stats-metrics div,
.player-mini-stats div {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 14px;
  padding: 12px;
}

.stats-metrics span,
.player-mini-stats span {
  display: block;
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: 6px;
}

.stats-metrics strong,
.player-mini-stats strong { font-size: 1rem; }

.player-avatar {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
}

.player-avatar.placeholder {
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: .06em;
  background: linear-gradient(180deg, rgba(124,255,91,.16), rgba(255,255,255,.06));
}

.player-card-head {
  align-items: center;
}

.player-heading-text {
  flex: 1;
}

.rating-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 0;
}

.stars-inline {
  color: #fde68a;
  letter-spacing: .08em;
}

.opinion-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.vote-form {
  display: grid;
  gap: 14px;
}

.stars-field {
  display: grid;
  gap: 8px;
}

.star-rating {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 6px;
  justify-content: flex-end;
}

.star-rating input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.star-rating label {
  font-size: 1.75rem;
  cursor: pointer;
  color: rgba(255,255,255,.24);
  line-height: 1;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
  color: #facc15;
}

.matches-list {
  display: grid;
  gap: 14px;
}

.match-item { display: grid; gap: 14px; }
.match-date {
  font-weight: 700;
  margin-bottom: 6px;
}
.match-note {
  margin-bottom: 0;
  color: var(--muted);
}
.match-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}
.pair {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid transparent;
}
.pair.winner {
  border-color: rgba(124,255,91,.35);
  background: rgba(124,255,91,.08);
}
.result {
  font-size: 1.25rem;
  font-weight: 900;
  text-align: center;
  min-width: 70px;
}

.empty-state {
  padding: 24px;
  border: 1px dashed rgba(255,255,255,.18);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.hidden-section {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.hidden-section.is-open { display: block; }
.match-editor { margin-top: 0; }
.compact-form { margin-top: 0; }

.message {
  display: none;
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
}
.message.visible { display: block; }
.message.success {
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.28);
  color: #dcfce7;
}
.message.error {
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.25);
  color: #fecaca;
}
.global-message { margin-bottom: 20px; }
.inline-note { margin-top: 16px; }

.modal.hidden { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2,6,23,.68);
  backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  max-width: 460px;
  margin: 10vh auto 0;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(20,31,56,.96), rgba(8,12,25,.96));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.modal-text,
.install-text { color: var(--muted); }
.icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  font-size: 1.7rem;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.06);
  color: var(--text);
  border: 1px solid var(--line);
}
.auth-form { display: grid; gap: 14px; }
.hidden-form { display: none; }

.steps-list,
.error-box {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
}
.error-box {
  white-space: pre-wrap;
  word-break: break-word;
  color: #fecaca;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .hero,
  .match-top,
  .player-card-head,
  .stats-card-head {
    flex-direction: column;
  }

  .hero-actions {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .app-shell { padding: 18px; }
  .brand-block { flex-direction: column; align-items: flex-start; }
  .brand-mark-wrap { width: 120px; min-width: 120px; }
  .teams-grid,
  .match-body,
  .field-grid,
  .admin-grid-form {
    grid-template-columns: 1fr;
  }
  .versus { margin: 0 auto; }
  .stats-metrics,
  .player-mini-stats {
    grid-template-columns: 1fr 1fr;
  }
  .modal-card {
    margin: 6vh 16px 0;
  }
}

.clean-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.top-space {
  margin-top: 18px;
}

.inline-message {
  margin-bottom: 16px;
}

.message.info {
  background: rgba(59,130,246,.12);
  color: #dbeafe;
  border-color: rgba(59,130,246,.25);
}

.player-panel-head {
  align-items: flex-end;
}

.section-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

.toolbar-wrap {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.toolbar-field {
  display: grid;
  gap: 8px;
  min-width: 210px;
  font-weight: 600;
  color: #e2e8f0;
}

.search-field input {
  min-width: 220px;
}

.cell-subtext {
  color: var(--muted);
  font-size: .88rem;
  margin-top: 4px;
}

.profile-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.checkline {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.checkline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.is-hidden-filter {
  display: none !important;
}

fieldset[disabled] {
  opacity: .72;
}

@media (max-width: 860px) {
  .toolbar-wrap,
  .player-panel-head {
    align-items: stretch;
  }

  .toolbar-field,
  .search-field input {
    min-width: 100%;
  }
}


.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.summary-card {
  background: rgba(20,31,56,.78);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  display: grid;
  gap: 8px;
}

.summary-label {
  color: var(--muted);
  font-size: .9rem;
}

.summary-value {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.05;
}

.summary-name {
  font-size: clamp(1.3rem, 2.3vw, 1.8rem);
}

.summary-foot {
  color: #dfe8f6;
  font-size: .95rem;
}

.player-heading {
  display: flex;
  gap: 14px;
  align-items: center;
}

.player-photo {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
}

.player-photo.placeholder {
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: .06em;
  background: linear-gradient(180deg, rgba(124,255,91,.16), rgba(255,255,255,.06));
}

.player-history {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.05);
}

.history-win {
  border-color: rgba(124,255,91,.25);
  background: rgba(124,255,91,.08);
}

.history-draw {
  border-color: rgba(250,204,21,.22);
  background: rgba(250,204,21,.08);
}

.history-loss {
  border-color: rgba(239,68,68,.22);
  background: rgba(239,68,68,.08);
}

.history-title,
.history-text {
  margin-bottom: 0;
}

.history-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.history-side {
  display: grid;
  gap: 4px;
  text-align: right;
}

.history-badge {
  color: var(--muted);
  font-size: .88rem;
}

@media (max-width: 760px) {
  .history-item,
  .player-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-side {
    text-align: left;
  }
}

.body-lock {
  overflow: hidden;
}

.admin-drawer.hidden {
  display: none;
}

.admin-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.admin-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, .72);
  backdrop-filter: blur(6px);
}

.admin-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(94vw, 620px);
  height: 100%;
  overflow-y: auto;
  padding: 20px;
  background: linear-gradient(180deg, rgba(10,15,28,.98), rgba(20,31,56,.98));
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.admin-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.admin-quick-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.admin-quick-nav a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
}

.admin-panel-block {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
}

.compact-head {
  margin-bottom: 14px;
}

.admin-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}

.admin-tools-grid form,
.admin-tools-grid .button-like,
.admin-tools-grid button {
  width: 100%;
}

.admin-form-stack .team-card {
  min-width: 0;
}

.admin-subblock {
  display: block;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  margin-bottom: 14px;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-list-item {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.05);
}

.admin-list-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.admin-list-head-match {
  align-items: flex-start;
}
.admin-toolbar-wrap {
  margin-bottom: 14px;
}

.admin-toolbar-wrap-tight {
  margin-bottom: 12px;
}


@media (max-width: 760px) {
  .admin-drawer-panel {
    width: 100%;
    padding: 16px;
  }

  .admin-tools-grid,
  .admin-list-head {
    grid-template-columns: 1fr;
    display: grid;
  }
}

/* ═══════════════════════════════════════════════════════════════
   DESIGN SYSTEM — consolidated (replaces v6/v7/v8/v9 overrides)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #050914;
  --bg-2: #0a1020;
  --line: rgba(255,255,255,0.08);
  --text: #f7fbff;
  --muted: #aab7cb;
  --accent: #b8ff3b;
  --accent-2: #54f07a;
  --danger: #ef4444;
  --shadow: 0 24px 70px rgba(0,0,0,.42);
  --glow: 0 0 0 1px rgba(184,255,59,.06), 0 24px 70px rgba(0,0,0,.42);
  --surface-1: rgba(255,255,255,.055);
  --surface-2: rgba(255,255,255,.03);
}

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(184,255,59,.16), transparent 24%),
    radial-gradient(circle at 88% 8%, rgba(84,240,122,.12), transparent 18%),
    linear-gradient(135deg, rgba(255,255,255,.03) 0 2px, transparent 2px 100%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-size: auto, auto, 28px 28px, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(184,255,59,.03) 8% 8.2%, transparent 8.2% 91.8%, rgba(184,255,59,.03) 91.8% 92%, transparent 92%),
    linear-gradient(0deg, transparent 0 12%, rgba(184,255,59,.025) 12% 12.2%, transparent 12.2% 87.8%, rgba(184,255,59,.025) 87.8% 88%, transparent 88%);
  opacity: .5;
}

.app-shell {
  max-width: 1360px;
  padding-top: 20px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 26px 28px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.08);
  background:
    linear-gradient(135deg, rgba(184,255,59,.1), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
  box-shadow: 0 26px 80px rgba(0,0,0,.45);
  margin-bottom: 20px;
}

.hero::after {
  content: "KMAKUS CLUB";
  position: absolute;
  right: 18px;
  bottom: 12px;
  font-size: clamp(2.2rem, 7vw, 5rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: .08em;
  color: rgba(255,255,255,.035);
  pointer-events: none;
}

h1 {
  text-transform: uppercase;
  letter-spacing: -.025em;
}

.eyebrow {
  color: #dfff94;
  font-weight: 800;
}

.badge {
  background: rgba(184,255,59,.11);
  color: #efffd1;
  border-color: rgba(184,255,59,.28);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}

.badge-muted {
  background: rgba(255,255,255,.05);
  color: #d4e1f4;
  border-color: var(--line);
}

.badge-admin {
  background: rgba(184,255,59,.18);
  color: #ebffdf;
  border-color: rgba(184,255,59,.35);
}

.button-like.primary,
.primary {
  background: linear-gradient(180deg, #d7ff63, #67f27c);
  box-shadow: 0 10px 24px rgba(103,242,124,.18);
  color: #07110a;
}

.secondary,
.ghost,
.danger {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.panel {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.014));
  box-shadow: var(--glow);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(184,255,59,.35), transparent 38%);
  pointer-events: none;
}

.panel-premium {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(12,20,36,.94), rgba(8,14,26,.92));
  border: 1px solid rgba(255,255,255,.075);
  box-shadow: 0 24px 60px rgba(0,0,0,.30);
}

.panel-premium::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(124,255,91,.10), transparent 72%);
  pointer-events: none;
}

.summary-card,
.player-card,
.stats-card,
.match-item {
  background: linear-gradient(180deg, rgba(18,28,52,.9), rgba(10,16,31,.9));
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}

.summary-card {
  min-height: 150px;
}

.summary-value { font-weight: 900; color: #f7fbff; }
.summary-foot  { color: #c9d7eb; }

.player-card,
.match-item {
  box-shadow: 0 18px 34px rgba(0,0,0,.24);
  border-radius: 24px;
}

.player-card:hover,
.match-item:hover,
.summary-card:hover,
.stats-card:hover {
  transform: translateY(-2px);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  box-shadow: 0 24px 38px rgba(0,0,0,.28);
  border-color: rgba(184,255,59,.18);
}

.player-photo,
.player-avatar,
.player-avatar.placeholder,
.player-photo.placeholder {
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
}

.player-photo {
  width: 88px;
  height: 88px;
  border-radius: 24px;
}

.player-heading { gap: 16px; }

.player-heading-text h3,
.panel-premium h2,
.panel-head h2,
.player-card h3,
.stats-card h3 {
  letter-spacing: -.02em;
}

.player-mini-stats div,
.stats-metrics div,
.history-item {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.06);
}

.opinion-box,
.player-history {
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 18px;
  padding: 16px;
}

.history-item { border-radius: 16px; }
.history-title { color: #efffd1; }

.pair {
  min-height: 74px;
  display: flex;
  align-items: center;
  font-size: 1rem;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.05);
}

.pair.winner {
  background: linear-gradient(180deg, rgba(184,255,59,.14), rgba(84,240,122,.08));
}

.result {
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
  font-weight: 900;
}

.table-wrap {
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px;
  background: rgba(255,255,255,.02);
}

#rankingTable,
#ratingRankingTable {
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

#rankingTable thead th,
#ratingRankingTable thead th {
  padding: 14px 12px;
  border-bottom: none;
  color: #d0ddf0;
  position: sticky;
  top: 0;
  background: rgba(6,11,22,.95);
  backdrop-filter: blur(8px);
  z-index: 1;
}

#rankingTable tbody tr,
#ratingRankingTable tbody tr {
  background: rgba(255,255,255,.03);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
  transition: background .16s ease, transform .16s ease;
}

#rankingTable tbody tr:hover,
#ratingRankingTable tbody tr:hover {
  background: rgba(124,255,91,.06);
}

#rankingTable tbody td,
#ratingRankingTable tbody td {
  padding: 14px 12px;
  border-bottom: none;
}

#rankingTable td:first-child,
#ratingRankingTable td:first-child {
  font-weight: 800;
  color: #d8ffd0;
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
}

#rankingTable tbody tr td:last-child,
#ratingRankingTable tbody tr td:last-child {
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}

.top-3 {
  background: linear-gradient(90deg, rgba(184,255,59,.12), rgba(255,255,255,.03)) !important;
  box-shadow: inset 0 0 0 1px rgba(184,255,59,.22) !important;
}

.toolbar-field input,
.toolbar-field select,
input,
select {
  background: rgba(7,11,22,.92);
  border-color: rgba(255,255,255,.08);
  min-height: 48px;
}

input::placeholder { color: #93a4bf; }

.section-subtitle,
.muted,
.alias-line,
.cell-subtext { color: #9fb0c5; }

.message.success,
.message.info,
.message.error {
  box-shadow: 0 12px 34px rgba(0,0,0,.16);
}

/* Admin panel */
.admin-drawer-panel,
.admin-fullscreen-panel,
.modal-card {
  background: linear-gradient(180deg, rgba(8,12,24,.98), rgba(16,24,44,.98));
}

.admin-drawer-panel { border-left-color: rgba(255,255,255,.08); }

.admin-fullscreen-panel {
  position: relative;
  z-index: 1;
  width: min(1360px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  margin: 14px auto;
  overflow: auto;
  padding: 28px;
  border-radius: 32px;
  border: 1px solid rgba(255,255,255,.09);
  background:
    radial-gradient(circle at top right, rgba(124,255,91,.12), transparent 22%),
    linear-gradient(180deg, rgba(8,13,24,.98), rgba(17,26,48,.97));
  box-shadow: 0 30px 90px rgba(0,0,0,.45);
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-overview-card {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.08);
  display: grid;
  gap: 8px;
}

.admin-overview-card-accent {
  border-color: rgba(124,255,91,.24);
  box-shadow: inset 0 0 0 1px rgba(124,255,91,.07);
}

.admin-overview-label { color: var(--muted); font-size: .9rem; }
.admin-overview-value { font-size: clamp(1.3rem, 2vw, 2rem); line-height: 1.05; }
.admin-overview-foot  { color: #dce6f5; font-size: .92rem; }

.admin-nav-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 22px;
  text-decoration: none;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.08);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.admin-nav-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124,255,91,.22);
  background: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.03));
}

.admin-nav-kicker { color: #b7ff9f; letter-spacing: .08em; text-transform: uppercase; font-size: .76rem; }
.admin-nav-card strong { font-size: 1.05rem; }
.admin-nav-card small  { color: var(--muted); }

.admin-tools-grid-elegant {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-tool-card {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  text-align: left;
  gap: 8px;
  padding: 18px;
}

.admin-tool-card strong { font-size: 1rem; }
.admin-tool-card small  { color: var(--muted); }
.admin-tool-danger { background: linear-gradient(180deg, rgba(239,68,68,.15), rgba(239,68,68,.05)); }
.admin-panel-block { border-radius: 24px; }
.admin-panel-block-tools { margin-bottom: 22px; }

.admin-quick-nav a {
  background: rgba(255,255,255,.05);
  transition: background .18s ease, border-color .18s ease;
}

.admin-quick-nav a:hover {
  background: rgba(255,255,255,.09);
  border-color: rgba(124,255,91,.22);
}

/* Responsive */
@media (max-width: 1100px) {
  .admin-overview-grid,
  .admin-quick-nav-cards,
  .admin-tools-grid-elegant {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .hero { padding: 20px; }
  .hero::after { font-size: clamp(2rem, 11vw, 4rem); right: 12px; }
  .layout-public { grid-template-columns: 1fr !important; }
}

@media (max-width: 760px) {
  .hero { border-radius: 24px; padding: 18px; }
  .panel { border-radius: 22px; }
  .panel-premium { border-radius: 22px; }
  .hero::after { bottom: 10px; opacity: .8; }
  .admin-fullscreen-panel {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
    margin: 6px auto;
    padding: 18px;
    border-radius: 24px;
  }
  .admin-overview-grid,
  .admin-quick-nav-cards,
  .admin-tools-grid-elegant { grid-template-columns: 1fr; }
  .admin-nav-card,
  .admin-tool-card,
  .admin-overview-card { border-radius: 18px; }
  .match-item, .player-card, .summary-card { border-radius: 20px; }
  .pair { min-height: 62px; }
  .app-shell { padding: 14px; }
  .summary-grid, .players-grid { grid-template-columns: 1fr; }
}

.player-photo-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.profile-mood {
  margin-top: 6px;
  color: #d8f3ff;
  font-size: .92rem;
}

.profile-extra-block {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.profile-form-row {
  display: grid;
  gap: 8px;
}

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

.form-chip,
.streak-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .84rem;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
}

.form-w, .streak-win { background: rgba(34,197,94,.14); color: #c7ffd8; }
.form-e, .streak-draw { background: rgba(250,204,21,.14); color: #fff1b8; }
.form-l, .streak-loss { background: rgba(239,68,68,.14); color: #ffd0d0; }
.streak-none { color: var(--muted); }

.vote-groups {
  display: grid;
  gap: 12px;
}

.vote-group {
  display: grid;
  gap: 8px;
}

.vote-title {
  color: var(--muted);
  font-size: .9rem;
}

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

.reaction-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.reaction-pill {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  cursor: pointer;
  font-weight: 700;
  font-size: .86rem;
}

.reaction-pill.positive { color: #d8ffd0; }
.reaction-pill.negative { color: #ffd7d7; }

.reaction-grid input:checked + .reaction-pill.positive,
.reaction-pill.positive:hover {
  background: rgba(34,197,94,.18);
  border-color: rgba(34,197,94,.35);
}

.reaction-grid input:checked + .reaction-pill.negative,
.reaction-pill.negative:hover {
  background: rgba(239,68,68,.18);
  border-color: rgba(239,68,68,.35);
}

.current-vote-line {
  color: var(--muted);
  font-size: .9rem;
}

.photo-modal-card {
  max-width: 720px;
}

.photo-modal-body {
  display: grid;
  gap: 12px;
}

.photo-modal-image {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 20px;
  background: rgba(255,255,255,.04);
}

.photo-modal-name {
  margin: 0;
  text-align: center;
  color: var(--muted);
}


.summary-card-accent {
  border-color: rgba(124,255,91,.28);
  box-shadow: inset 0 0 0 1px rgba(124,255,91,.06);
}

.summary-card-danger-soft {
  border-color: rgba(239,68,68,.22);
  box-shadow: inset 0 0 0 1px rgba(239,68,68,.04);
}

.fun-rankings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.fun-ranking-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: rgba(255,255,255,.03);
}

.fun-ranking-card-positive {
  background: linear-gradient(180deg, rgba(124,255,91,.08), rgba(255,255,255,.03));
}

.fun-ranking-card-negative {
  background: linear-gradient(180deg, rgba(239,68,68,.08), rgba(255,255,255,.03));
}

.fun-ranking-list {
  display: grid;
  gap: 10px;
}

.fun-ranking-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.05);
}

.fun-pos {
  font-weight: 800;
  color: #dfffd6;
}

.fun-body {
  display: grid;
  gap: 2px;
}

.fun-body small,
.fun-score small {
  color: var(--muted);
}

.fun-score {
  text-align: right;
  display: grid;
  gap: 2px;
}

@media (max-width: 900px) {
  .fun-rankings-grid {
    grid-template-columns: 1fr;
  }
}

.activity-panel {
  margin-bottom: 20px;
}

.notifications-list,
.comment-list,
.h2h-list,
.achievement-list {
  display: grid;
  gap: 12px;
}

.notification-item,
.comment-item,
.h2h-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}

.notification-item p,
.comment-item p {
  margin: 6px 0 0;
}

.notification-rating {
  border-color: rgba(124,255,91,.18);
}

.notification-comment {
  border-color: rgba(59,130,246,.18);
}

.player-achievements,
.player-headtohead,
.player-comments-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.achievement-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(124,255,91,.10);
  border: 1px solid rgba(124,255,91,.18);
  color: #eaffdf;
  font-size: .92rem;
  margin-right: 8px;
}

.comment-form textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(7,11,22,.9);
  color: var(--text);
  padding: 12px 14px;
  resize: vertical;
  min-height: 78px;
}

.comment-form textarea:focus {
  outline: 2px solid rgba(124,255,91,.35);
  border-color: rgba(124,255,91,.4);
}

@media (max-width: 760px) {
  .notification-item,
  .comment-item,
  .h2h-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

.tutorial-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(124,255,91,.14), transparent 24%),
    radial-gradient(circle at top right, rgba(59,130,246,.14), transparent 22%),
    linear-gradient(180deg, #060b16 0%, #0b1222 100%);
}

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

.tutorial-onboarding {
  width: min(100%, 1080px);
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  align-items: stretch;
}

.tutorial-sidebar,
.tutorial-stage {
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.tutorial-sidebar {
  padding: 24px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.tutorial-stage {
  position: relative;
  overflow: hidden;
  padding: 28px;
}

.tutorial-logo {
  width: 100%;
  max-width: 180px;
}

.tutorial-kicker {
  color: #b7ff9f;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .78rem;
  margin: 0;
}

.tutorial-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  margin: 0;
  line-height: 1;
}

.tutorial-copy,
.tutorial-small,
.tutorial-step-copy {
  color: var(--muted);
}

.tutorial-progress {
  display: grid;
  gap: 10px;
}

.tutorial-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}

.tutorial-progress-fill {
  display: block;
  height: 100%;
  width: 16.66%;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  border-radius: inherit;
  transition: width .25s ease;
}

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

.tutorial-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.1);
}

.tutorial-dot.is-active {
  background: linear-gradient(180deg, var(--accent), #60a5fa);
  border-color: transparent;
}

.tutorial-steps {
  position: relative;
  min-height: 520px;
}

.tutorial-step {
  display: none;
  grid-template-columns: 1fr;
  gap: 18px;
  align-content: start;
  animation: tutorialFade .28s ease;
}

.tutorial-step.is-active {
  display: grid;
}

@keyframes tutorialFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tutorial-step-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.tutorial-step-number {
  background: rgba(124,255,91,.12);
  color: #dfffd6;
  border: 1px solid rgba(124,255,91,.22);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}

.tutorial-step-title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
}

.tutorial-highlight,
.tutorial-bullets,
.tutorial-phone {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 22px;
}

.tutorial-highlight {
  padding: 18px;
}

.tutorial-highlight-emoji {
  font-size: 2rem;
  margin-bottom: 10px;
}

.tutorial-bullets {
  padding: 18px 18px 18px 34px;
  margin: 0;
  display: grid;
  gap: 10px;
}

.tutorial-phone {
  padding: 16px;
  max-width: 420px;
}

.tutorial-phone-screen {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20,31,56,.92), rgba(8,12,25,.98));
  border: 1px solid rgba(255,255,255,.08);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.tutorial-phone-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.tutorial-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(124,255,91,.12);
  color: #eaffdf;
  border: 1px solid rgba(124,255,91,.2);
  font-weight: 700;
}

.tutorial-chip.is-danger {
  background: rgba(239,68,68,.14);
  color: #fee2e2;
  border-color: rgba(239,68,68,.2);
}

.tutorial-chip.is-accent {
  background: rgba(59,130,246,.14);
  color: #dbeafe;
  border-color: rgba(59,130,246,.2);
}

.tutorial-mini-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 16px;
  padding: 14px;
}

.tutorial-mini-card strong,
.tutorial-mini-card span,
.tutorial-mini-card small {
  display: block;
}

.tutorial-mini-card span,
.tutorial-mini-card small {
  color: var(--muted);
}

.tutorial-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 22px;
}

.tutorial-nav-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tutorial-hidden {
  display: none !important;
}

@media (max-width: 960px) {
  .tutorial-onboarding {
    grid-template-columns: 1fr;
  }

  .tutorial-steps {
    min-height: auto;
  }
}


.nav-inline-form,
.mobile-menu-form {
  margin: 0;
}

.site-nav-shell {
  margin-bottom: 20px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(12,18,34,.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.site-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--text);
  font-size: .9rem;
  transition: .2s ease;
  white-space: nowrap;
}

.site-nav-link:hover {
  background: rgba(255,255,255,.08);
  border-color: var(--line);
}

.site-nav-spacer {
  flex: 1 1 auto;
}

.mobile-nav-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(12,18,34,.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.mobile-nav-title {
  font-weight: 800;
  letter-spacing: .04em;
}

.hamburger-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.hamburger-btn span {
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  display: block;
}

.mobile-menu.hidden { display: none; }
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 70;
}

.mobile-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2,6,23,.72);
  backdrop-filter: blur(6px);
}

.mobile-menu-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(88vw, 360px);
  height: 100%;
  padding: 22px;
  background: linear-gradient(180deg, rgba(20,31,56,.98), rgba(8,12,25,.98));
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mobile-menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mobile-menu-links {
  display: grid;
  gap: 10px;
}

.mobile-menu-link {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.05);
  text-decoration: none;
}

.mobile-menu-actions {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

@media (max-width: 900px) {
  .desktop-nav { display: none; }
  .mobile-nav-bar { display: none; }
}

.site-nav-shell { position: sticky; top: 12px; z-index: 30; }
.activity-panel { margin-bottom: 0; }
.layout-public { align-items: start; }


.activity-list {
  display: grid;
  gap: 12px;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
}

.activity-rating {
  border-color: rgba(124,255,91,.24);
}

.activity-comment {
  border-color: rgba(96,165,250,.22);
}

.activity-title {
  margin-bottom: 4px;
  font-weight: 700;
}

.activity-text,
.activity-date {
  margin-bottom: 0;
  color: var(--muted);
}

.activity-date {
  white-space: nowrap;
  font-size: .88rem;
}

@media (max-width: 760px) {
  .activity-item {
    flex-direction: column;
  }

  .activity-date {
    white-space: normal;
  }
}


/* Mobile ranking visibility fix */
.mobile-ranking-list { display:none; }
@media (max-width: 760px) {
  .desktop-table-wrap { display:none; }
  .mobile-ranking-list {
    display:grid;
    gap:12px;
  }
  .mobile-ranking-card {
    background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
    border:1px solid rgba(255,255,255,.08);
    border-radius:18px;
    padding:14px;
    box-shadow: 0 8px 20px rgba(0,0,0,.16);
  }
  .top-3-mobile {
    border-color: rgba(124,255,91,.24);
    box-shadow: 0 0 0 1px rgba(124,255,91,.08) inset;
  }
  .mobile-ranking-head {
    display:flex;
    align-items:flex-start;
    gap:12px;
    justify-content:space-between;
    margin-bottom:12px;
  }
  .mobile-rank-pos {
    min-width:44px;
    padding:8px 10px;
    border-radius:999px;
    background: rgba(124,255,91,.12);
    color:#eaffdf;
    font-weight:800;
    text-align:center;
  }
  .mobile-rank-main {
    white-space:nowrap;
    font-weight:800;
    color:#fff;
  }
  .mobile-ranking-stats {
    display:grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap:10px;
  }
  .mobile-ranking-stats div {
    background: rgba(255,255,255,.04);
    border:1px solid rgba(255,255,255,.05);
    border-radius:14px;
    padding:10px 12px;
  }
  .mobile-ranking-stats span {
    display:block;
    color: var(--muted);
    font-size:.82rem;
    margin-bottom:4px;
  }
  .mobile-ranking-stats strong {
    display:block;
    font-size:.98rem;
  }
}

/* === FIX ESTÉTICA TABLAS ESCRITORIO / MÓVIL === */
.desktop-table-wrap {
  display: block;
}

@media (min-width: 761px) {
  .desktop-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    background: rgba(7, 12, 24, .55);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
  }

  .mobile-ranking-list {
    display: none !important;
  }

  #rankingTable,
  #ratingRankingTable {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
    background: transparent;
  }

  #rankingTable thead th,
  #ratingRankingTable thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(16,24,44,.96), rgba(12,19,35,.96));
    color: #d9e3f3;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 800;
    padding: 14px 14px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    white-space: nowrap;
  }

  #rankingTable thead th:first-child,
  #ratingRankingTable thead th:first-child {
    border-top-left-radius: 18px;
  }

  #rankingTable thead th:last-child,
  #ratingRankingTable thead th:last-child {
    border-top-right-radius: 18px;
  }

  #rankingTable tbody td,
  #ratingRankingTable tbody td {
    padding: 14px 14px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    vertical-align: middle;
    color: #eef3fb;
    background: transparent;
  }

  #rankingTable tbody tr,
  #ratingRankingTable tbody tr {
    transition: background .18s ease, transform .18s ease;
  }

  #rankingTable tbody tr:nth-child(even),
  #ratingRankingTable tbody tr:nth-child(even) {
    background: rgba(255,255,255,.015);
  }

  #rankingTable tbody tr:hover,
  #ratingRankingTable tbody tr:hover {
    background: rgba(124,255,91,.06) !important;
  }

  #rankingTable tbody tr.top-3 {
    background: linear-gradient(90deg, rgba(124,255,91,.07), rgba(255,255,255,.015));
  }

  #rankingTable tbody td:first-child,
  #ratingRankingTable tbody td:first-child {
    font-weight: 800;
    color: #d8ffd0;
    white-space: nowrap;
  }

  #rankingTable tbody td:nth-child(2) strong,
  #ratingRankingTable tbody td:nth-child(2) strong {
    display: block;
    font-size: 1rem;
    color: #ffffff;
  }

  .cell-subtext {
    color: #9eb0c8;
    font-size: .84rem;
    margin-top: 3px;
  }

  .stars-inline {
    letter-spacing: .12em;
    font-size: 1rem;
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .desktop-table-wrap {
    display: none !important;
  }

  .mobile-ranking-list {
    display: grid !important;
    gap: 12px;
    margin-top: 4px;
  }

  .mobile-ranking-card {
    background: rgba(16, 24, 44, .82);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 12px 30px rgba(0,0,0,.22);
  }

  .mobile-ranking-card.top-3-mobile {
    border-color: rgba(124,255,91,.26);
    background: linear-gradient(180deg, rgba(124,255,91,.08), rgba(16,24,44,.85));
  }

  .mobile-ranking-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
  }

  .mobile-rank-pos,
  .mobile-rank-main {
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    font-weight: 800;
    white-space: nowrap;
  }

  .mobile-rank-pos {
    color: #d8ffd0;
  }

  .mobile-ranking-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .mobile-ranking-stats > div {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 14px;
    padding: 10px 12px;
  }

  .mobile-ranking-stats span {
    display: block;
    color: #9eb0c8;
    font-size: .8rem;
    margin-bottom: 4px;
  }

  .mobile-ranking-stats strong {
    color: #ffffff;
    font-size: .96rem;
  }
}

/* === HOTFIX VISIBILIDAD CONTENIDO MÓVIL === */
@media (max-width: 760px) {
  .desktop-table-wrap,
  #rankingTable,
  #ratingRankingTable {
    display: none !important;
  }

  .mobile-ranking-list {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
    margin-top: 12px !important;
  }

  .mobile-ranking-card {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .mobile-ranking-card + .mobile-ranking-card {
    margin-top: 12px;
  }

  .fun-ranking-list {
    display: grid !important;
    gap: 12px !important;
    margin-top: 12px !important;
  }

  .fun-ranking-item {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    align-items: center !important;
  }

  .fun-score,
  .fun-body,
  .mobile-ranking-stats strong,
  .mobile-ranking-head strong {
    color: #ffffff !important;
  }

  .panel .badge,
  .panel .cell-subtext,
  .panel .muted,
  .panel .summary-foot,
  .panel .fun-body small,
  .panel .fun-score small,
  .panel .mobile-ranking-stats span {
    opacity: 1 !important;
  }
}

.player-account-grid {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
}

.player-account-card {
  background: rgba(10, 16, 31, 0.78);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
}

.player-account-heading {
  align-items: center;
}

.top-space-small {
  margin-top: 12px;
}

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

@media (max-width: 900px) {
  .player-account-grid {
    grid-template-columns: 1fr;
  }
}


.comment-item-main {
  min-width: 0;
  flex: 1 1 auto;
}

.comment-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.inline-form {
  margin: 0;
}

.link-button {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button:hover {
  color: var(--text);
}

.danger-link:hover {
  color: #fca5a5;
}

.player-account-extra-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.player-account-card-wide {
  grid-column: span 3;
}

.player-account-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.player-account-metrics div {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 14px;
}

.player-account-metrics span {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
  font-size: .9rem;
}

.player-account-metrics strong {
  font-size: 1.18rem;
}

.compact-history-list,
.compact-comment-list {
  gap: 10px;
}

@media (max-width: 1080px) {
  .player-account-extra-grid {
    grid-template-columns: 1fr;
  }

  .player-account-card-wide {
    grid-column: auto;
  }

  .player-account-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .comment-item-side {
    align-items: flex-start;
  }

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


.account-action-stack{flex-wrap:wrap}
.admin-role-permissions-block{border:1px solid rgba(255,255,255,.08)}
.admin-permission-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.admin-permission-card{border-radius:18px;padding:16px;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.03)}
.admin-permission-card strong{display:block;margin-bottom:8px}
.admin-permission-card ul{margin:0;padding-left:18px;display:grid;gap:6px}
.admin-permission-card.is-allowed{background:rgba(58,180,120,.08);border-color:rgba(58,180,120,.22)}
.admin-permission-card.is-blocked{background:rgba(255,120,120,.07);border-color:rgba(255,120,120,.18)}


/* === BLOQUE MÓVIL v15_1 === */
html, body {
  overflow-x: hidden;
}

#resumen-general,
#ranking-puntos,
#ranking-valoracion,
#ranking-cachondeo,
#players,
#mi-cuenta,
#actividad,
#public-matches,
.player-card,
.match-item {
  scroll-margin-top: 92px;
}

@media (max-width: 900px) {
  .site-nav-shell {
    top: 8px;
    margin-bottom: 16px;
  }

  .mobile-nav-bar {
    border-radius: 18px;
    padding: 12px 14px;
  }

  .mobile-nav-title {
    font-size: .98rem;
  }

  .hamburger-btn {
    width: 44px;
    height: 44px;
  }

  .mobile-menu-panel {
    width: min(92vw, 380px);
    padding: 18px;
  }

  .mobile-menu-link,
  .mobile-menu-actions button,
  .mobile-menu-actions .secondary,
  .mobile-menu-actions .primary {
    min-height: 48px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
  }

  .hero {
    padding: 16px;
    gap: 14px;
    margin-bottom: 18px;
  }

  .brand-block {
    gap: 14px;
  }

  .brand-mark-wrap {
    width: 104px;
    min-width: 104px;
    padding: 10px;
    border-radius: 22px;
  }

  h1 {
    font-size: clamp(1.85rem, 9vw, 2.7rem);
    line-height: 1.04;
  }

  .subtitle {
    font-size: .96rem;
  }

  .hero-chips {
    gap: 8px;
  }

  .hero-chips .badge {
    max-width: 100%;
  }

  .panel,
  .panel-premium,
  .player-account-card,
  .mobile-ranking-card,
  .summary-card,
  .player-card,
  .match-item,
  .fun-ranking-card {
    border-radius: 18px;
  }

  .panel,
  .panel-premium,
  .player-account-card {
    padding: 14px;
  }

  .panel-head,
  .player-panel-head,
  .player-card-head,
  .match-top,
  .admin-list-head,
  .admin-list-head-match,
  .modal-head {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-head .badge,
  .player-panel-head .badge,
  .admin-list-head .badge {
    align-self: flex-start;
  }

  .toolbar-wrap,
  .admin-toolbar-wrap,
  .admin-toolbar-wrap-tight,
  .actions,
  .match-actions,
  .card-actions {
    gap: 10px;
  }

  .toolbar-field,
  .toolbar-field input,
  .toolbar-field select,
  .search-field input {
    min-width: 0;
    width: 100%;
  }

  .stats-metrics,
  .player-mini-stats,
  .mobile-ranking-stats,
  .player-account-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-ranking-head {
    grid-template-columns: auto 1fr;
    align-items: start;
  }

  .mobile-rank-main {
    grid-column: 1 / -1;
    justify-self: flex-start;
  }

  .fun-ranking-item {
    grid-template-columns: auto 1fr;
    align-items: start;
  }

  .fun-score {
    grid-column: 1 / -1;
    text-align: left;
  }

  .players-grid,
  .summary-grid,
  .fun-rankings-grid,
  .player-account-grid,
  .player-account-extra-grid {
    gap: 12px;
  }

  .player-card,
  .match-item,
  .summary-card,
  .player-account-card {
    padding: 14px;
  }

  .player-card-head .actions,
  .match-top .actions,
  .comment-item-side,
  .notification-item,
  .comment-item,
  .h2h-item,
  .activity-item {
    width: 100%;
  }

  .comment-item-side {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .comment-item-side .inline-form,
  .comment-item-side .link-button {
    min-height: 42px;
  }

  .match-body {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .pair {
    min-height: 58px;
    justify-content: center;
    text-align: center;
    padding: 12px;
  }

  .result {
    width: 100%;
    text-align: center;
    padding: 12px 14px;
    font-size: 1.05rem;
    font-weight: 800;
  }

  .profile-meta,
  .form-badges,
  .reaction-grid,
  .account-action-stack {
    gap: 8px;
  }

  .reaction-pill,
  .site-nav-link,
  button,
  a.button-like {
    min-height: 44px;
  }

  .auth-form .actions,
  .compact-form .actions,
  .admin-grid-form .actions,
  .player-account-card .actions,
  .comment-form .actions,
  .vote-form .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .auth-form .actions > *,
  .compact-form .actions > *,
  .admin-grid-form .actions > *,
  .player-account-card .actions > *,
  .comment-form .actions > *,
  .vote-form .actions > * {
    width: 100%;
  }

  .modal-card {
    width: calc(100vw - 24px);
    max-width: none;
    margin: 12px auto 0;
    padding: 18px;
    max-height: calc(100vh - 24px);
    overflow: auto;
    border-radius: 22px;
  }

  .mobile-menu-panel {
    width: 100vw;
    max-width: 100vw;
    padding: 16px;
  }

  .admin-fullscreen-panel {
    width: calc(100vw - 8px);
    max-height: calc(100vh - 8px);
    margin: 4px auto;
    padding: 14px;
    border-radius: 20px;
  }

  .admin-fullscreen-head {
    position: sticky;
    top: -14px;
    z-index: 2;
    padding: 0 0 12px;
    background: linear-gradient(180deg, rgba(8,13,24,.98), rgba(8,13,24,.92));
  }

  .admin-overview-grid,
  .admin-quick-nav-cards,
  .admin-tools-grid-elegant,
  .admin-permission-grid {
    grid-template-columns: 1fr;
  }

  .admin-list-item,
  .admin-nav-card,
  .admin-tool-card,
  .admin-overview-card,
  .admin-permission-card {
    border-radius: 16px;
  }

  .admin-list-head .actions,
  .admin-list-head-match .actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .admin-list-head .actions > *,
  .admin-list-head-match .actions > * {
    width: 100%;
  }

  .icon-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 420px) {
  .mobile-ranking-stats,
  .player-account-metrics,
  .stats-metrics,
  .player-mini-stats {
    grid-template-columns: 1fr;
  }

  .hero-chips {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-chips .badge {
    width: 100%;
  }

  .mobile-nav-title {
    font-size: .94rem;
  }

  .mobile-ranking-head {
    gap: 8px;
  }
}


/* === BLOQUE MÓVIL v15_2 === */
:root {
  --mobile-safe-top: env(safe-area-inset-top, 0px);
  --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
}

.player-heading,
.player-heading-text,
.player-card,
.player-card > *,
.match-item,
.match-item > *,
.summary-card,
.summary-card > *,
.activity-item,
.activity-item > *,
.notification-item,
.notification-item > *,
.comment-item,
.comment-item > *,
.admin-list-item,
.admin-list-item > *,
.admin-panel-block,
.admin-panel-block > * {
  min-width: 0;
}

.match-note,
.history-text,
.activity-text,
.comment-item p,
.notification-item p,
.alias-line,
.cell-subtext,
.summary-name,
.player-heading h3,
.mobile-rank-main,
.fun-body strong,
.fun-body small,
.h2h-item,
.achievement-chip,
.badge,
.button-like,
button,
label,
input,
select,
textarea {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 900px) {
  .mobile-menu,
  .admin-drawer,
  .modal {
    overscroll-behavior: contain;
  }

  .site-nav-shell {
    top: calc(6px + var(--mobile-safe-top));
  }

  .mobile-nav-bar {
    gap: 12px;
    padding-top: calc(12px + (var(--mobile-safe-top) * 0.15));
    padding-bottom: 12px;
  }

  .mobile-menu-panel {
    height: 100dvh;
    min-height: 100dvh;
    padding-top: calc(16px + var(--mobile-safe-top));
    padding-bottom: calc(16px + var(--mobile-safe-bottom));
  }

  .modal-card,
  .admin-fullscreen-panel {
    max-height: calc(100dvh - 16px);
  }
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .brand-block {
    width: 100%;
  }

  .player-heading {
    gap: 12px;
  }

  .player-heading-text,
  .player-heading-text h3,
  .player-heading-text p,
  .match-top > div,
  .history-item > div:first-child,
  .activity-item > div:first-child,
  .comment-item-main,
  .admin-list-head > div,
  .admin-list-head-match > div {
    width: 100%;
    min-width: 0;
  }

  .player-photo,
  .player-photo-button {
    align-self: flex-start;
  }

  .profile-meta .badge,
  .hero-chips .badge,
  .form-badges .form-chip,
  .reaction-grid > *,
  .actions > *,
  .panel-tools > *,
  .card-actions > *,
  .match-actions > *,
  .admin-list-head .actions > *,
  .admin-list-head-match .actions > * {
    max-width: 100%;
  }

  .summary-grid,
  .players-grid,
  .fun-rankings-grid,
  .player-account-grid,
  .player-account-extra-grid,
  .admin-list,
  .activity-list {
    gap: 10px;
  }

  .summary-card,
  .player-card,
  .match-item,
  .fun-ranking-card,
  .player-account-card,
  .admin-panel-block,
  .admin-list-item,
  .modal-card,
  .mobile-menu-panel,
  .admin-fullscreen-panel {
    border-radius: 16px;
  }

  .summary-card,
  .player-card,
  .match-item,
  .fun-ranking-card,
  .player-account-card,
  .admin-panel-block,
  .admin-list-item {
    padding: 12px;
  }

  .mobile-ranking-card {
    padding: 12px;
  }

  .mobile-ranking-head {
    gap: 8px;
  }

  .mobile-ranking-stats,
  .player-mini-stats,
  .player-account-metrics,
  .stats-metrics {
    gap: 8px;
  }

  .mobile-ranking-stats > div,
  .player-mini-stats > div,
  .player-account-metrics > div,
  .stats-metrics > div {
    padding: 10px 11px;
    border-radius: 12px;
  }

  .history-item,
  .activity-item,
  .notification-item,
  .comment-item,
  .h2h-item {
    padding: 12px;
    gap: 10px;
  }

  .match-top {
    gap: 8px;
  }

  .match-date {
    font-size: .96rem;
  }

  .match-note {
    font-size: .9rem;
    line-height: 1.35;
  }

  .match-body {
    gap: 8px;
  }

  .pair,
  .result {
    border-radius: 14px;
  }

  .pair {
    min-height: 0;
    padding: 11px 12px;
    line-height: 1.35;
  }

  .result {
    padding: 10px 12px;
    font-size: 1rem;
  }

  .comment-item-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 8px;
  }

  .comment-item-side .inline-form,
  .comment-item-side .link-button {
    width: 100%;
  }

  .comment-item-side .link-button {
    justify-self: stretch;
    text-align: left;
    padding: 10px 0;
  }

  .comment-form textarea {
    min-height: 96px;
  }

  .mobile-menu-link {
    min-height: 46px;
    display: flex;
    align-items: center;
  }

  .mobile-menu-actions {
    padding-bottom: max(6px, var(--mobile-safe-bottom));
  }

  .admin-fullscreen-panel {
    width: calc(100vw - 10px);
    max-height: calc(100dvh - 10px);
    margin: 5px auto;
    padding: 12px;
    padding-bottom: calc(14px + var(--mobile-safe-bottom));
  }

  .admin-fullscreen-head {
    top: -12px;
    margin-bottom: 16px;
  }

  .admin-overview-card,
  .admin-nav-card,
  .admin-tool-card,
  .admin-permission-card {
    padding: 14px;
  }

  .admin-nav-card,
  .admin-tool-card {
    min-height: 0;
  }

  .admin-quick-nav-cards,
  .admin-overview-grid,
  .admin-tools-grid-elegant,
  .admin-permission-grid {
    gap: 10px;
  }

  .admin-role-list,
  .admin-quick-nav,
  .profile-meta,
  .hero-chips,
  .achievement-list,
  .form-badges {
    row-gap: 8px;
  }

  .admin-grid-form,
  .field-grid,
  .teams-grid,
  .compact-form,
  .auth-form {
    gap: 10px;
  }

  .modal-card {
    width: calc(100vw - 16px);
    margin-top: 8px;
    padding: 16px;
    padding-bottom: calc(16px + var(--mobile-safe-bottom));
    max-height: calc(100dvh - 16px);
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding: 10px;
  }

  .hero {
    padding: 14px;
    border-radius: 18px;
  }

  .brand-mark-wrap {
    width: 92px;
    min-width: 92px;
    padding: 8px;
    border-radius: 18px;
  }

  .eyebrow {
    font-size: .72rem;
    letter-spacing: .14em;
  }

  h1 {
    font-size: clamp(1.7rem, 10vw, 2.25rem);
  }

  .subtitle {
    font-size: .92rem;
  }

  .site-nav-shell {
    margin-bottom: 12px;
  }

  .mobile-nav-bar {
    border-radius: 16px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .mobile-nav-title {
    font-size: .92rem;
  }

  .summary-card,
  .player-card,
  .match-item,
  .fun-ranking-card,
  .player-account-card,
  .admin-panel-block,
  .admin-list-item,
  .mobile-ranking-card {
    padding: 11px;
  }

  .mobile-ranking-stats,
  .player-mini-stats,
  .player-account-metrics,
  .stats-metrics,
  .comment-item-side {
    grid-template-columns: 1fr;
  }

  .mobile-rank-pos,
  .mobile-rank-main {
    width: 100%;
    justify-content: flex-start;
  }

  .history-item,
  .activity-item,
  .notification-item,
  .comment-item,
  .h2h-item,
  .admin-overview-card,
  .admin-nav-card,
  .admin-tool-card,
  .admin-permission-card {
    padding: 11px;
  }

  .icon-btn,
  .hamburger-btn,
  .reaction-pill,
  .site-nav-link,
  button,
  a.button-like {
    min-height: 46px;
  }
}


/* === BLOQUE MÓVIL v15_3 === */
.site-nav-link.is-active,
.mobile-menu-link.is-active {
  background: linear-gradient(180deg, rgba(184,255,59,.16), rgba(84,240,122,.08));
  border-color: rgba(184,255,59,.28);
  color: #f4ffe1;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

.site-nav-link[aria-current="page"],
.mobile-menu-link[aria-current="page"] {
  font-weight: 800;
}

@media (max-width: 900px) {
  #resumen-general,
  #ranking-puntos,
  #ranking-valoracion,
  #ranking-cachondeo,
  #players,
  #mi-cuenta,
  #actividad,
  #public-matches,
  .player-card,
  .match-item {
    scroll-margin-top: 112px;
  }

  .mobile-nav-bar {
    backdrop-filter: blur(14px);
  }

  .mobile-menu-links {
    padding-right: 2px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 760px) {
  .mobile-nav-bar {
    position: relative;
    overflow: hidden;
  }

  .mobile-nav-bar::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(184,255,59,0), rgba(184,255,59,.55), rgba(184,255,59,0));
    opacity: .9;
  }

  .mobile-menu-panel,
  .admin-fullscreen-panel,
  .modal-card {
    overscroll-behavior: contain;
  }

  .mobile-menu-links {
    gap: 8px;
    padding-bottom: 4px;
  }

  .mobile-menu-link {
    padding: 13px 14px;
  }

  .mobile-menu-actions {
    position: sticky;
    bottom: 0;
    padding-top: 10px;
    background: linear-gradient(180deg, rgba(10,15,28,0), rgba(10,15,28,.96) 24%);
  }

  .mobile-ranking-card,
  .summary-card,
  .player-card,
  .match-item,
  .player-account-card,
  .admin-panel-block,
  .admin-list-item,
  .fun-ranking-card {
    scroll-margin-top: 116px;
  }
}

@media (max-width: 420px) {
  .mobile-menu-panel {
    padding-left: 12px;
    padding-right: 12px;
  }

  .mobile-menu-link,
  .mobile-menu-actions button,
  .mobile-menu-actions .button-like {
    border-radius: 14px;
  }
}

/* === BLOQUE ESCRITORIO v15_1 === */
@media (min-width: 1101px) {
  .app-shell {
    max-width: 1460px;
    padding: 30px 34px 44px;
  }

  .hero {
    align-items: center;
    gap: 26px;
    margin-bottom: 28px;
  }

  .subtitle {
    max-width: 920px;
  }

  .site-nav-shell {
    position: sticky;
    top: 16px;
    z-index: 32;
    margin-bottom: 24px;
  }

  .desktop-nav {
    padding: 16px 18px;
    gap: 12px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(10,16,31,.92), rgba(10,16,31,.84));
  }

  .nav-inline-form {
    display: flex;
  }

  .site-nav-link {
    padding: 11px 16px;
  }

  .layout-public {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
  }

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

  .players-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .matches-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .match-item,
  .player-card,
  .summary-card,
  .fun-ranking-card,
  .player-account-card,
  .admin-list-item,
  .admin-panel-block {
    border-radius: 22px;
  }

  .match-item,
  .player-card,
  .summary-card,
  .fun-ranking-card,
  .admin-list-item,
  .admin-panel-block {
    box-shadow: 0 18px 44px rgba(0,0,0,.20);
  }

  .match-item {
    height: 100%;
    align-content: start;
  }

  .match-top {
    align-items: center;
  }

  .table-wrap.desktop-table-wrap {
    overflow: auto;
    max-height: 640px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(180deg, rgba(8,13,24,.55), rgba(8,13,24,.30));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
  }

  #rankingTable,
  #ratingRankingTable {
    min-width: 100%;
  }

  #rankingTable thead th,
  #ratingRankingTable thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(8,13,24,.96);
    backdrop-filter: blur(14px);
    box-shadow: inset 0 -1px 0 rgba(255,255,255,.08);
  }

  #rankingTable tbody td,
  #ratingRankingTable tbody td {
    white-space: nowrap;
    vertical-align: middle;
  }

  #rankingTable tbody td:nth-child(n+3),
  #ratingRankingTable tbody td:not(:nth-child(2)) {
    text-align: center;
  }

  #rankingTable tbody td:nth-child(2),
  #ratingRankingTable tbody td:nth-child(2) {
    min-width: 230px;
    white-space: normal;
  }

  #rankingTable tbody tr:nth-child(even),
  #ratingRankingTable tbody tr:nth-child(even) {
    background: rgba(255,255,255,.018);
  }

  #rankingTable tbody tr:hover,
  #ratingRankingTable tbody tr:hover {
    background: rgba(124,255,91,.06);
  }

  .fun-rankings-grid {
    align-items: start;
  }

  .player-account-grid {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    align-items: start;
  }

  .player-account-extra-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .player-account-card-wide {
    grid-column: span 3;
  }

  .admin-fullscreen-panel {
    width: min(1480px, calc(100vw - 40px));
    max-height: calc(100vh - 32px);
    margin: 16px auto;
    padding: 32px 34px 34px;
  }

  .admin-fullscreen-head {
    position: sticky;
    top: -32px;
    z-index: 4;
    padding: 0 0 18px;
    margin-bottom: 20px;
    background: linear-gradient(180deg, rgba(8,13,24,.98), rgba(8,13,24,.92) 72%, rgba(8,13,24,0));
  }

  .admin-overview-grid,
  .admin-quick-nav-cards,
  .admin-tools-grid-elegant {
    gap: 16px;
  }

  #admin-cuenta .admin-grid-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #admin-jugadores .admin-grid-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #admin-partidos .admin-grid-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-list-head,
  .admin-list-head-match {
    align-items: center;
  }

  .admin-list-head-match .actions {
    flex-wrap: nowrap;
  }

  .admin-panel-block .toolbar-wrap {
    align-items: end;
  }
}

@media (min-width: 1280px) {
  .summary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .summary-card.summary-card-accent,
  .summary-card.summary-card-danger-soft {
    grid-column: span 1;
  }

  .admin-overview-grid,
  .admin-quick-nav-cards,
  .admin-tools-grid-elegant {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1440px) {
  .players-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

/* === BLOQUE ESCRITORIO v15_2 === */
@media (min-width: 1101px) {
  :root {
    --desktop-sticky-top: 108px;
  }

  html {
    scroll-padding-top: var(--desktop-sticky-top);
  }

  #resumen-general,
  #ranking-puntos,
  #ranking-valoracion,
  #ranking-cachondeo,
  #players,
  #mi-cuenta,
  #actividad,
  #public-matches,
  .player-card,
  .match-item,
  .admin-panel-block {
    scroll-margin-top: var(--desktop-sticky-top);
  }

  .desktop-nav {
    gap: 12px 10px;
    align-items: center;
  }

  .site-nav-link,
  .desktop-nav .secondary.small,
  .desktop-nav .nav-inline-form button {
    min-height: 44px;
  }

  .site-nav-link.is-active {
    box-shadow: 0 10px 24px rgba(124,255,91,.10), inset 0 0 0 1px rgba(255,255,255,.05);
  }

  .layout-public > .panel:not(.full-width) {
    min-height: 100%;
  }

  #ranking-puntos,
  #ranking-valoracion {
    display: flex;
    flex-direction: column;
  }

  #ranking-puntos .desktop-table-wrap,
  #ranking-valoracion .desktop-table-wrap {
    flex: 1 1 auto;
  }

  .table-wrap.desktop-table-wrap {
    scrollbar-gutter: stable;
  }

  #rankingTable thead th:first-child,
  #ratingRankingTable thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: rgba(8,13,24,.985);
  }

  #rankingTable tbody td:first-child,
  #ratingRankingTable tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: rgba(8,13,24,.93);
    box-shadow: 1px 0 0 rgba(255,255,255,.05);
  }

  #rankingTable tbody tr:nth-child(even) td:first-child,
  #ratingRankingTable tbody tr:nth-child(even) td:first-child {
    background: rgba(13,19,34,.96);
  }

  #rankingTable tbody tr:hover td:first-child,
  #ratingRankingTable tbody tr:hover td:first-child {
    background: rgba(31,51,29,.96);
  }

  .player-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background: linear-gradient(180deg, rgba(18,27,48,.88), rgba(10,15,29,.88));
  }

  .player-heading {
    align-items: flex-start;
    gap: 16px;
  }

  .player-heading-text {
    min-width: 0;
  }

  .player-mini-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .player-history,
  .player-headtohead,
  .player-achievements,
  .opinion-box {
    margin-top: 18px;
  }

  .comment-list {
    max-height: 320px;
    overflow: auto;
    padding-right: 4px;
  }

  .player-account-grid > .player-account-card:first-child {
    position: sticky;
    top: calc(var(--desktop-sticky-top) + 8px);
    align-self: start;
  }

  .player-account-card,
  .admin-panel-block,
  .admin-list-item,
  .summary-card,
  .fun-ranking-card,
  .match-item {
    background: linear-gradient(180deg, rgba(16,24,44,.86), rgba(10,15,29,.86));
  }

  .admin-fullscreen-panel {
    scrollbar-gutter: stable both-edges;
  }

  .admin-quick-nav-cards {
    position: sticky;
    top: 84px;
    z-index: 3;
    padding: 6px 0 14px;
    margin: -4px 0 18px;
    background: linear-gradient(180deg, rgba(8,13,24,.98), rgba(8,13,24,.90) 78%, rgba(8,13,24,0));
  }

  .admin-nav-card {
    min-height: 112px;
  }

  .admin-panel-block,
  .admin-list-item {
    box-shadow: 0 18px 42px rgba(0,0,0,.18);
  }

  #admin-jugadores .admin-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  #admin-partidos .admin-list-head-match {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
  }

  .admin-list-head > div,
  .admin-list-head-match > div,
  .comment-item-main {
    min-width: 0;
  }

  .admin-list-head .actions,
  .admin-list-head-match .actions {
    flex-wrap: nowrap;
  }

  .admin-list-head .actions > *,
  .admin-list-head-match .actions > * {
    flex-shrink: 0;
  }
}

@media (min-width: 1400px) {
  .summary-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

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

  #admin-partidos .admin-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (min-width: 1680px) {
  .matches-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* === BLOQUE ESCRITORIO v15_3 === */
@media (min-width: 1101px) {
  .site-nav-shell {
    top: 14px;
    padding: 10px 14px;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(180deg, rgba(8,13,24,.88), rgba(8,13,24,.72));
    box-shadow: 0 18px 40px rgba(0,0,0,.18);
    backdrop-filter: blur(16px);
  }

  .site-nav.desktop-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    padding-bottom: 2px;
  }

  .site-nav.desktop-nav::-webkit-scrollbar {
    height: 8px;
  }

  .site-nav.desktop-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.12);
    border-radius: 999px;
  }

  #players .panel-head,
  #public-matches .panel-head,
  #actividad .panel-head {
    position: sticky;
    top: calc(var(--desktop-sticky-top) - 18px);
    z-index: 3;
    margin: -2px 0 18px;
    padding: 4px 0 14px;
    background: linear-gradient(180deg, rgba(8,13,24,.98), rgba(8,13,24,.90) 78%, rgba(8,13,24,0));
    backdrop-filter: blur(8px);
  }

  #players .player-card {
    padding: 20px;
  }

  #players .opinion-box {
    margin-top: auto;
  }

  #public-matches .match-item,
  #actividad .activity-item,
  .admin-nav-card {
    min-height: 100%;
  }

  #actividad .activity-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .admin-nav-card.is-active {
    border-color: rgba(124,255,91,.28);
    background: linear-gradient(180deg, rgba(124,255,91,.12), rgba(255,255,255,.04));
    box-shadow: 0 14px 30px rgba(0,0,0,.18), inset 0 0 0 1px rgba(124,255,91,.08);
  }

  .admin-panel-block:target {
    border-color: rgba(124,255,91,.24);
    box-shadow: 0 0 0 1px rgba(124,255,91,.06) inset, 0 18px 42px rgba(0,0,0,.18);
  }
}

@media (min-width: 1500px) {
  #actividad .activity-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* === BLOQUE DISEÑO v15_1 === */
:root {
  --design-card-bg: linear-gradient(180deg, rgba(18, 27, 48, .92), rgba(8, 13, 24, .92));
  --design-soft-bg: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  --design-edge: rgba(255,255,255,.1);
  --design-edge-soft: rgba(255,255,255,.06);
  --design-glow-green: rgba(184,255,59,.18);
  --design-glow-blue: rgba(96,165,250,.16);
  --design-shadow: 0 22px 54px rgba(0,0,0,.26);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -10%, rgba(255,255,255,.08), transparent 28%),
    radial-gradient(circle at 0% 40%, rgba(184,255,59,.08), transparent 24%),
    radial-gradient(circle at 100% 58%, rgba(96,165,250,.08), transparent 20%);
  opacity: .8;
}

.hero {
  border-color: rgba(255,255,255,.1);
  background:
    radial-gradient(circle at top left, rgba(184,255,59,.14), transparent 26%),
    radial-gradient(circle at top right, rgba(96,165,250,.1), transparent 18%),
    linear-gradient(180deg, rgba(18,27,48,.94), rgba(8,13,24,.92));
  box-shadow: 0 28px 80px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.05);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255,255,255,.08), transparent 22%, transparent 78%, rgba(255,255,255,.04) 100%),
    linear-gradient(180deg, rgba(255,255,255,.03), transparent 32%);
}

.brand-mark-wrap {
  box-shadow: 0 22px 46px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.05);
}

.eyebrow {
  color: #d7ff92;
  text-shadow: 0 0 18px rgba(184,255,59,.18);
}

.subtitle,
.section-subtitle,
.panel-note,
.admin-subtitle,
.summary-foot,
.alias-line,
.muted,
.modal-text,
.install-text {
  color: #b8c5d9;
}

.section-subtitle {
  max-width: 62ch;
}

.badge,
.form-chip,
.reaction-pill,
.achievement-chip,
.history-badge,
.current-vote-line {
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.badge {
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.045));
  border-color: rgba(255,255,255,.11);
  color: #edf4ff;
}

.badge-admin {
  background: linear-gradient(180deg, rgba(184,255,59,.18), rgba(84,240,122,.1));
  border-color: rgba(184,255,59,.24);
}

.badge-muted {
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
}

.site-nav-shell,
.mobile-nav-bar {
  border-color: rgba(255,255,255,.1);
  box-shadow: 0 18px 34px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.04);
}

.site-nav-link {
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border-color: rgba(255,255,255,.02);
}

.site-nav-link:hover,
.site-nav-link.is-active {
  border-color: rgba(184,255,59,.22);
  background: linear-gradient(180deg, rgba(184,255,59,.16), rgba(255,255,255,.04));
  color: #f3ffe0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 24px rgba(0,0,0,.14);
}

.hamburger-btn,
.icon-btn {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.icon-btn:hover,
.hamburger-btn:hover {
  border-color: rgba(184,255,59,.24);
  background: rgba(255,255,255,.1);
}

.panel-premium,
.summary-card,
.player-card,
.match-item,
.player-account-card,
.player-account-card-wide,
.activity-item,
.admin-panel-block,
.admin-list-item,
.fun-ranking-card,
.comment-item,
.notification-item,
.h2h-item,
.history-item,
.admin-overview-card,
.admin-permission-card,
.admin-role-summary,
.admin-role-permissions-block,
.admin-tool-card,
.admin-nav-card {
  position: relative;
  overflow: hidden;
  background: var(--design-card-bg);
  border-color: var(--design-edge);
  box-shadow: var(--design-shadow), inset 0 1px 0 rgba(255,255,255,.04);
}

.panel-premium::after,
.summary-card::after,
.player-card::after,
.match-item::after,
.player-account-card::after,
.player-account-card-wide::after,
.activity-item::after,
.admin-panel-block::after,
.admin-list-item::after,
.fun-ranking-card::after,
.comment-item::after,
.notification-item::after,
.h2h-item::after,
.history-item::after,
.admin-overview-card::after,
.admin-permission-card::after,
.admin-role-summary::after,
.admin-role-permissions-block::after,
.admin-tool-card::after,
.admin-nav-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.05), transparent 26%);
}

.panel-head h2,
.player-panel-head h2,
.admin-drawer-head h2,
.admin-panel-block h3,
.player-heading-text h3 {
  position: relative;
  display: inline-block;
  padding-bottom: 8px;
  letter-spacing: -.03em;
}

.panel-head h2::after,
.player-panel-head h2::after,
.admin-drawer-head h2::after,
.admin-panel-block h3::after,
.player-heading-text h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(184,255,59,.95), rgba(96,165,250,.8));
}

.summary-card {
  min-height: 174px;
  padding: 20px;
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, rgba(184,255,59,.95), rgba(96,165,250,.75));
  opacity: .9;
}

.summary-card-accent {
  box-shadow: 0 24px 64px rgba(0,0,0,.28), 0 0 0 1px rgba(184,255,59,.06) inset;
}

.summary-value,
.admin-overview-value,
.fun-score,
.stats-points {
  text-shadow: 0 10px 30px rgba(0,0,0,.2);
}

.summary-label,
.admin-overview-label,
.vote-title,
.admin-nav-kicker,
.stats-rank {
  letter-spacing: .08em;
  text-transform: uppercase;
}

.player-card,
.match-item,
.summary-card,
.admin-nav-card,
.admin-tool-card,
.admin-overview-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.player-card:hover,
.match-item:hover,
.summary-card:hover,
.admin-nav-card:hover,
.admin-tool-card:hover,
.admin-overview-card:hover {
  transform: translateY(-3px);
  border-color: rgba(184,255,59,.18);
  box-shadow: 0 28px 60px rgba(0,0,0,.28), 0 0 0 1px rgba(184,255,59,.05) inset;
}

button,
a.button-like {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

button:focus-visible,
a.button-like:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(184,255,59,.36);
  outline-offset: 2px;
}

.secondary,
.ghost,
.link-button {
  border-color: rgba(255,255,255,.1);
}

.primary {
  color: #061109;
  box-shadow: 0 16px 36px rgba(84,240,122,.24), inset 0 1px 0 rgba(255,255,255,.24);
}

.primary:hover {
  box-shadow: 0 20px 42px rgba(84,240,122,.28), inset 0 1px 0 rgba(255,255,255,.28);
}

input,
select,
textarea {
  background: linear-gradient(180deg, rgba(5,9,20,.82), rgba(9,15,28,.74));
  border-color: rgba(255,255,255,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

textarea::placeholder,
input::placeholder {
  color: #8fa1ba;
}

.search-field input {
  background: linear-gradient(180deg, rgba(8,13,24,.92), rgba(9,15,28,.8));
}

.table-wrap,
.desktop-table-wrap {
  border-color: rgba(255,255,255,.09);
  background: linear-gradient(180deg, rgba(10,15,28,.82), rgba(8,13,24,.9));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

#rankingTable th,
#ratingRankingTable th {
  background: rgba(8,13,24,.96);
  color: #dce9fa;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.06);
}

#rankingTable tbody tr:nth-child(even),
#ratingRankingTable tbody tr:nth-child(even) {
  background: rgba(255,255,255,.018);
}

#rankingTable tbody tr:hover,
#ratingRankingTable tbody tr:hover {
  background: linear-gradient(90deg, rgba(184,255,59,.1), rgba(255,255,255,.04));
}

.player-photo,
.player-avatar,
.player-photo.placeholder {
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 16px 34px rgba(0,0,0,.24), 0 0 0 1px rgba(255,255,255,.04) inset;
}

.player-photo-button {
  border-radius: 24px;
}

.player-mini-stats div,
.stats-metrics div,
.profile-extra-block,
.achievement-list,
.admin-subblock,
.team-card,
.pair,
.result,
.form-chip,
.admin-tool-danger {
  background: var(--design-soft-bg);
  border-color: var(--design-edge-soft);
}

.pair.winner,
.history-win,
.fun-ranking-card-positive {
  box-shadow: inset 0 0 0 1px rgba(184,255,59,.08);
}

.fun-ranking-card-negative,
.history-loss,
.admin-tool-danger {
  box-shadow: inset 0 0 0 1px rgba(239,68,68,.08);
}

.comment-item,
.notification-item,
.h2h-item,
.activity-item,
.history-item {
  border-left: 3px solid rgba(184,255,59,.18);
}

.activity-item {
  background:
    linear-gradient(90deg, rgba(184,255,59,.06), transparent 28%),
    var(--design-card-bg);
}

.comment-form textarea {
  background: linear-gradient(180deg, rgba(5,9,20,.88), rgba(9,15,28,.76));
}

.message {
  border-left: 4px solid rgba(255,255,255,.14);
  box-shadow: 0 14px 28px rgba(0,0,0,.12);
}

.message.success { border-left-color: rgba(34,197,94,.55); }
.message.error { border-left-color: rgba(239,68,68,.55); }
.message.info { border-left-color: rgba(96,165,250,.5); }

.admin-drawer-backdrop {
  background: linear-gradient(180deg, rgba(2,6,23,.82), rgba(2,6,23,.68));
}

.admin-drawer-panel,
.modal-card {
  box-shadow: 0 28px 70px rgba(0,0,0,.42);
}

.admin-nav-card.is-active,
.site-nav-link.is-active {
  box-shadow: 0 16px 34px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.06);
}

.admin-overview-card-accent,
.summary-card-accent {
  background:
    radial-gradient(circle at top right, rgba(184,255,59,.16), transparent 32%),
    var(--design-card-bg);
}

@media (max-width: 1100px) {
  .summary-card {
    min-height: 156px;
  }

  .player-card:hover,
  .match-item:hover,
  .summary-card:hover,
  .admin-nav-card:hover,
  .admin-tool-card:hover,
  .admin-overview-card:hover {
    transform: none;
  }
}

@media (max-width: 760px) {
  .hero {
    box-shadow: 0 18px 44px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.04);
  }

  .summary-card {
    min-height: 0;
    padding: 18px;
  }

  .panel-head h2::after,
  .player-panel-head h2::after,
  .admin-drawer-head h2::after,
  .admin-panel-block h3::after,
  .player-heading-text h3::after {
    width: 34px;
  }
}

/* === BLOQUE DISEÑO v15_2 === */
:root {
  --design-glow: rgba(184,255,59,.12);
  --design-glow-2: rgba(96,165,250,.10);
  --design-shadow-soft: 0 16px 40px rgba(0,0,0,.20);
  --design-shadow-strong: 0 28px 80px rgba(0,0,0,.34);
}

body {
  background-attachment: fixed;
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: rgba(255,255,255,.04);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(184,255,59,.28), rgba(96,165,250,.22));
  border: 2px solid rgba(6,11,22,.92);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(184,255,59,.40), rgba(96,165,250,.32));
}

.hero {
  border-radius: 34px;
  border: 1px solid rgba(255,255,255,.08);
}

.hero::after {
  background:
    radial-gradient(circle at 78% 18%, rgba(184,255,59,.16), transparent 18%),
    radial-gradient(circle at 18% 88%, rgba(96,165,250,.10), transparent 20%),
    linear-gradient(135deg, rgba(255,255,255,.06), transparent 34%, transparent 68%, rgba(255,255,255,.03));
  opacity: 1;
}

.hero-actions,
.hero-chips {
  position: relative;
  z-index: 1;
}

.hero-chips .badge {
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.05));
}

.subtitle,
.section-subtitle,
.panel-note {
  line-height: 1.6;
}

.site-nav-shell {
  backdrop-filter: blur(16px);
}

.site-nav-link {
  position: relative;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}

.site-nav-link::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 7px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(184,255,59,.95), rgba(96,165,250,.8));
  opacity: 0;
  transform: scaleX(.55);
  transform-origin: center;
  transition: opacity .18s ease, transform .18s ease;
}

.site-nav-link:hover::after,
.site-nav-link.is-active::after,
.site-nav-link[aria-current="page"]::after {
  opacity: .95;
  transform: scaleX(1);
}

.panel-premium,
.player-account-card,
.player-account-card-wide,
.admin-drawer-panel,
.modal-card {
  backdrop-filter: blur(14px);
}

.panel-premium::before,
.player-card::before,
.match-item::before,
.admin-panel-block::before,
.player-account-card::before,
.admin-overview-card::before,
.admin-nav-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,0));
  pointer-events: none;
}

.summary-card,
.player-card,
.match-item,
.admin-nav-card,
.admin-overview-card,
.admin-tool-card,
.player-account-card,
.comment-item,
.activity-item,
.history-item,
.h2h-item,
.notification-item {
  border-radius: 24px;
}

.summary-card > *,
.player-card > *,
.match-item > *,
.admin-overview-card > *,
.admin-nav-card > *,
.player-account-card > *,
.activity-item > *,
.comment-item > *,
.history-item > *,
.h2h-item > * {
  position: relative;
  z-index: 1;
}

.summary-card {
  background:
    radial-gradient(circle at top right, rgba(184,255,59,.10), transparent 26%),
    linear-gradient(180deg, rgba(18,26,45,.92), rgba(9,14,25,.94));
}

.summary-card::after {
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), transparent 26%),
    radial-gradient(circle at bottom right, rgba(96,165,250,.08), transparent 22%);
}

.summary-value,
.admin-overview-value {
  letter-spacing: -.04em;
}

.summary-label,
.summary-foot {
  max-width: 26ch;
}

.summary-card-accent,
.admin-overview-card-accent {
  background:
    radial-gradient(circle at top right, rgba(184,255,59,.20), transparent 32%),
    radial-gradient(circle at bottom left, rgba(96,165,250,.10), transparent 24%),
    linear-gradient(180deg, rgba(18,26,45,.96), rgba(10,15,26,.94));
}

.summary-card-danger-soft {
  background:
    radial-gradient(circle at top right, rgba(239,68,68,.14), transparent 28%),
    linear-gradient(180deg, rgba(26,15,24,.96), rgba(15,9,14,.94));
}

.player-heading {
  gap: 16px;
}

.player-heading-text h3 {
  margin-bottom: 6px;
}

.alias-line {
  font-weight: 600;
  color: #dce7fb;
}

.rating-summary strong,
.profile-mood {
  color: #eff7ff;
}

.player-card {
  background:
    radial-gradient(circle at top right, rgba(184,255,59,.08), transparent 24%),
    linear-gradient(180deg, rgba(16,23,40,.94), rgba(8,13,24,.94));
}

.player-card:target {
  box-shadow: var(--design-shadow-strong), 0 0 0 1px rgba(184,255,59,.12) inset, 0 0 0 3px rgba(184,255,59,.10);
}

.player-mini-stats div,
.stats-metrics div,
.player-account-metrics div {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.player-mini-stats strong,
.stats-metrics strong,
.player-account-metrics strong {
  letter-spacing: -.03em;
}

.achievement-chip,
.form-chip,
.history-badge,
.streak-chip,
.current-vote-line,
.reaction-pill {
  border-radius: 14px;
}

.achievement-chip {
  background: linear-gradient(180deg, rgba(184,255,59,.12), rgba(255,255,255,.03));
  border: 1px solid rgba(184,255,59,.14);
}

.opinion-head,
.player-panel-head,
.admin-list-head,
.admin-list-head-match {
  margin-bottom: 14px;
}

.opinion-head h4,
.player-account-card h3,
.admin-overview-card h3 {
  letter-spacing: -.02em;
}

.comment-item,
.history-item,
.h2h-item,
.notification-item,
.activity-item {
  background:
    linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,0) 28%),
    var(--design-card-bg);
}

.comment-item p,
.history-text,
.cell-subtext,
.activity-comment {
  line-height: 1.55;
}

.comment-item-side .activity-date,
.history-title,
.activity-date {
  color: #d7e5fb;
}

.comment-form textarea {
  min-height: 92px;
  resize: vertical;
}

.vote-group,
.profile-extra-block,
.player-achievements,
.player-headtohead,
.player-history,
.player-comments-box,
.admin-subblock,
.admin-role-summary,
.admin-role-permissions-block,
.admin-tool-card,
.admin-overview-card,
.admin-panel-block {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.result {
  letter-spacing: -.03em;
}

.match-item {
  background:
    radial-gradient(circle at top right, rgba(96,165,250,.08), transparent 24%),
    linear-gradient(180deg, rgba(16,23,40,.94), rgba(8,13,24,.94));
}

.pair {
  backdrop-filter: blur(8px);
}

.result {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.message {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(15,23,42,.92), rgba(10,15,26,.94));
}

.message.success {
  background: linear-gradient(180deg, rgba(11,36,24,.92), rgba(9,23,18,.94));
}

.message.error {
  background: linear-gradient(180deg, rgba(42,15,20,.92), rgba(26,10,14,.94));
}

.message.info {
  background: linear-gradient(180deg, rgba(13,24,42,.92), rgba(10,15,28,.94));
}

button,
a.button-like {
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.secondary,
.ghost,
a.button-like.secondary,
a.button-like.ghost {
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.04));
}

.secondary:hover,
.ghost:hover,
a.button-like.secondary:hover,
a.button-like.ghost:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.05));
}

input,
select,
textarea {
  border-radius: 16px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(255,255,255,.16);
}

.player-photo,
.player-avatar,
.player-photo.placeholder {
  border-radius: 24px;
}

.player-photo-button:hover .player-photo,
.player-photo-button:hover .player-avatar,
.player-photo-button:hover .player-photo.placeholder {
  box-shadow: 0 20px 38px rgba(0,0,0,.28), 0 0 0 1px rgba(184,255,59,.08) inset;
}

.admin-drawer-panel,
.modal-card {
  background:
    radial-gradient(circle at top right, rgba(184,255,59,.08), transparent 24%),
    linear-gradient(180deg, rgba(15,22,39,.96), rgba(9,14,25,.98));
}

.admin-drawer-head,
.modal-head {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.admin-quick-nav-cards {
  gap: 14px;
}

.admin-nav-card {
  min-height: 112px;
  background:
    radial-gradient(circle at top right, rgba(184,255,59,.10), transparent 28%),
    linear-gradient(180deg, rgba(17,25,42,.96), rgba(10,15,27,.94));
}

.admin-nav-card strong {
  font-size: 1.03rem;
}

.admin-nav-card small {
  line-height: 1.55;
}

.admin-nav-card.is-active {
  border-color: rgba(184,255,59,.24);
  background:
    radial-gradient(circle at top right, rgba(184,255,59,.16), transparent 28%),
    linear-gradient(180deg, rgba(22,31,50,.98), rgba(11,17,29,.96));
}

.admin-overview-card {
  background:
    radial-gradient(circle at top right, rgba(96,165,250,.08), transparent 24%),
    linear-gradient(180deg, rgba(17,25,42,.96), rgba(10,15,27,.94));
}

.admin-panel-block {
  background:
    linear-gradient(180deg, rgba(15,22,39,.96), rgba(9,14,25,.98));
}

@media (min-width: 901px) {
  .hero {
    padding: 26px 28px;
  }

  .players-grid {
    gap: 18px;
  }

  .comment-list,
  .history-list,
  .h2h-list {
    gap: 12px;
  }
}

@media (max-width: 760px) {
  body {
    background-attachment: scroll;
  }

  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  .hero {
    border-radius: 24px;
  }

  .site-nav-link::after {
    left: 12px;
    right: 12px;
  }

  .summary-card,
  .player-card,
  .match-item,
  .admin-nav-card,
  .admin-overview-card,
  .admin-tool-card,
  .player-account-card,
  .comment-item,
  .activity-item,
  .history-item,
  .h2h-item,
  .notification-item {
    border-radius: 20px;
  }

  .message {
    border-radius: 16px;
  }
}


/* ═══════════════════════════════════════════════════════════════
   MOBILE TAB NAVIGATION — Kmakus v16
   Solo activo en pantallas ≤ 760px
   No toca nada de desktop
   ═══════════════════════════════════════════════════════════════ */

/* ── Bottom tab bar ── */
.mobile-tab-bar {
  display: none;
}

@media (max-width: 760px) {

  /* Espacio para que el contenido no quede bajo la tab bar */
  .app-shell {
    padding-bottom: 84px;
  }

  /* Ocultar el hero grande y la nav hamburger en móvil,
     mostramos sólo la top-bar compacta */
  .hero {
    display: none;
  }

  /* Top bar compacta fija */
  .mobile-topbar {
    display: flex !important;
  }

  /* Nav hamburger antigua: ocultar */
  .site-nav-shell {
    display: none;
  }

  /* ── Secciones: ocultar todo excepto la activa ── */
  .tab-section {
    display: none !important;
  }
  .tab-section.tab-active {
    display: block !important;
  }

  /* ── Bottom tab bar ── */
  .mobile-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: rgba(6, 11, 22, 0.97);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255,255,255,0.09);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 4px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #6b7a99;
    font-family: inherit;
    transition: color 0.18s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }

  .tab-btn.tab-btn-active {
    color: var(--accent);
  }

  .tab-btn-icon {
    font-size: 20px;
    line-height: 1;
  }

  .tab-btn-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    line-height: 1;
  }

  .tab-btn-active .tab-btn-label {
    color: var(--accent);
  }

  /* Línea indicadora arriba del tab activo */
  .tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.18s;
  }

  .tab-btn.tab-btn-active::before {
    opacity: 1;
  }

  /* Badge de notificaciones */
  .tab-notif-dot {
    position: absolute;
    top: 8px;
    right: calc(50% - 14px);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--danger);
    border: 1.5px solid #060b16;
  }

  /* ── Top bar compacta ── */
  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 92;
    min-height: 56px;
    background: rgba(6,11,22,0.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .mobile-topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-topbar-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: contain;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 4px;
  }

  .mobile-topbar-title {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    color: var(--text);
  }

  .mobile-topbar-subtitle {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 1px;
  }

  .mobile-topbar-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
  }

  .mobile-topbar-btn {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
  }

  .mobile-topbar-btn.is-active-session {
    border-color: rgba(124,255,91,0.35);
    color: var(--accent);
    background: rgba(124,255,91,0.08);
  }

  .mobile-topbar-btn.is-admin-session {
    border-color: rgba(124,255,91,0.35);
    color: var(--accent);
    background: rgba(124,255,91,0.08);
  }

  /* ── Ajustes de padding en móvil ── */
  .layout-public {
    display: block !important;
    padding-top: 12px;
  }

  /* Quitar margen extra de las secciones en móvil */
  .panel.tab-section {
    margin-bottom: 0;
    border-radius: 20px;
  }

  /* Flash messages siguen visibles */
  .global-message {
    margin: 8px 0 4px;
    border-radius: 14px;
  }

  /* Reducir padding del app-shell en móvil */
  .app-shell {
    padding: 0 14px 84px;
  }
}

/* Topbar compacta: oculta en desktop */
.mobile-topbar {
  display: none;
}


/* ═══════════════════════════════════════════════════════════════
   PLAYER BOTTOM SHEET — Kmakus v16
   Lista compacta en móvil + drawer desde abajo al pulsar jugador
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 760px) {

  /* ── Ocultar las player-card completas, mostrar lista compacta ── */
  .players-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
  }

  /* Ocultar todo el contenido interno de la card en móvil */
  .player-card .player-mini-stats,
  .player-card .profile-extra-block,
  .player-card .player-achievements,
  .player-card .player-headtohead,
  .player-card .player-history,
  .player-card .player-opinions,
  .player-card .player-comments-box,
  .player-card .inline-message {
    display: none !important;
  }

  /* Convertir player-card en fila compacta de lista */
  .player-card {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
    border-radius: 0 !important;
    padding: 12px 4px !important;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
  }

  .player-card:first-child {
    border-top: 1px solid rgba(255,255,255,0.06) !important;
  }

  .player-card:active {
    background: rgba(255,255,255,0.04) !important;
  }

  /* Heading compacto: foto + nombre + stats rápidos + flecha */
  .player-heading {
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
  }

  /* Foto más pequeña en la lista */
  .player-heading .player-photo,
  .player-heading .player-photo-button img,
  .player-heading .player-photo.placeholder {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    border-radius: 14px !important;
    font-size: 0.85rem !important;
  }

  .player-heading .player-photo-button {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    border-radius: 14px !important;
    overflow: hidden;
    display: block;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
  }

  /* Texto del heading compacto */
  .player-heading-text {
    flex: 1;
    min-width: 0;
  }

  .player-heading-text h3 {
    font-size: 0.97rem !important;
    margin-bottom: 1px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .player-heading-text .alias-line {
    font-size: 0.78rem !important;
    color: var(--muted);
    margin: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Ocultar rating y mood en la lista compacta */
  .player-heading-text .rating-summary,
  .player-heading-text .profile-mood {
    display: none !important;
  }

  /* Mini stats rápidos inline */
  .player-card-compact-stats {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    text-align: right;
  }

  .player-card-compact-pts {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
  }

  .player-card-compact-sub {
    font-size: 0.68rem;
    color: var(--muted);
    margin-top: 2px;
  }

  .player-card-compact-pos {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--muted);
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 2px 6px;
    margin-bottom: 4px;
  }

  .player-card-chevron {
    color: rgba(255,255,255,0.25);
    font-size: 1rem;
    flex-shrink: 0;
    margin-left: 2px;
  }

  /* ── BOTTOM SHEET (drawer desde abajo) ── */
  .player-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(2,6,23,0.75);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .player-sheet-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .player-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 81;
    background: linear-gradient(180deg, #0e1628, #080d1c);
    border-top: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px 24px 0 0;
    max-height: 92vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    pointer-events: none;
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -20px 60px rgba(0,0,0,0.5);
  }

  .player-sheet.is-open {
    transform: translateY(0);
    pointer-events: auto;
  }

  /* Handle de arrastre */
  .player-sheet-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.18);
    margin: 14px auto 0;
  }

  .player-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, #0e1628 80%, transparent);
    z-index: 1;
  }

  .player-sheet-title {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .player-sheet-photo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.05);
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 0.9rem;
    letter-spacing: .04em;
  }

  .player-sheet-name {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.1;
  }

  .player-sheet-alias {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 2px;
  }

  .player-sheet-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: var(--muted);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
  }

  .player-sheet-body {
    padding: 0 16px 16px;
  }

  /* Dentro del sheet, mostrar contenido normal */
  .player-sheet-body .player-mini-stats {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 14px;
  }

  .player-sheet-body .player-mini-stats div {
    padding: 10px 8px !important;
    text-align: center;
  }

  .player-sheet-body .player-mini-stats span {
    font-size: 0.72rem !important;
    margin-bottom: 4px !important;
  }

  .player-sheet-body .player-mini-stats strong {
    font-size: 0.92rem !important;
  }

  .player-sheet-body .profile-extra-block,
  .player-sheet-body .player-achievements,
  .player-sheet-body .player-headtohead,
  .player-sheet-body .player-history,
  .player-sheet-body .player-opinions,
  .player-sheet-body .player-comments-box,
  .player-sheet-body .rating-summary,
  .player-sheet-body .profile-mood {
    display: block !important;
  }

  .player-sheet-body .inline-message {
    display: block !important;
    margin-bottom: 12px;
  }
}


/* ═══════════════════════════════════════════════════════════════
   ESTADÍSTICAS DE PAREJAS — Kmakus v17
   ═══════════════════════════════════════════════════════════════ */

/* ── Podio top 3 ── */
.pairs-podium {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.pairs-podium-item {
  flex: 1;
  min-width: 140px;
  padding: 16px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform .15s;
}

.pairs-podium-pos-1 {
  border-color: rgba(255,215,0,.35);
  background: rgba(255,215,0,.07);
}

.pairs-podium-pos-2 {
  border-color: rgba(200,200,200,.3);
  background: rgba(200,200,200,.05);
}

.pairs-podium-pos-3 {
  border-color: rgba(205,127,50,.3);
  background: rgba(205,127,50,.05);
}

.pairs-podium-pos {
  font-size: 1.6rem;
  line-height: 1;
}

.pairs-podium-name {
  font-weight: 700;
  font-size: .92rem;
  color: var(--text);
  line-height: 1.3;
}

.pairs-podium-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--muted);
  margin-top: 2px;
}

.pairs-podium-stats strong {
  color: var(--accent);
  font-size: .95rem;
}

/* ── Tabla de parejas ── */
.pairs-table td:first-child {
  color: var(--muted);
  font-size: .88rem;
}

.pairs-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  min-width: 620px;
}

.pairs-table thead th {
  padding: 14px 12px;
  text-align: left;
  color: #d0ddf0;
  font-size: .9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: none;
  position: sticky;
  top: 0;
  background: rgba(6,11,22,.95);
  backdrop-filter: blur(8px);
  z-index: 1;
}

.pairs-table tbody tr {
  background: rgba(255,255,255,.03);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
  transition: background .16s ease, transform .16s ease;
}

.pairs-table tbody tr:hover {
  background: rgba(124,255,91,.06);
  transform: translateY(-1px);
}

.pairs-table tbody td {
  padding: 14px 12px;
  border-bottom: none;
}

.pairs-table tbody tr td:first-child {
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
  font-weight: 800;
  color: #d8ffd0;
}

.pairs-table tbody tr td:last-child {
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}

.pairs-table .top-3 {
  background: linear-gradient(90deg, rgba(124,255,91,.12), rgba(255,255,255,.03)) !important;
  box-shadow: inset 0 0 0 1px rgba(124,255,91,.22) !important;
}

/* ── Móvil ── */
.pairs-mobile-list {
  margin-top: 0;
}

.pairs-mobile-card .mobile-ranking-head strong {
  white-space: normal;
  line-height: 1.3;
}

/* ── Bottom 3 ── */
.pairs-bottom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.pairs-bottom-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(239,68,68,.06);
  border: 1px solid rgba(239,68,68,.18);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.pairs-bottom-name {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.pairs-bottom-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.pairs-bottom-stats span {
  font-size: .75rem;
  color: var(--muted);
}

.pairs-bottom-stats strong {
  font-size: .95rem;
  color: var(--danger);
}

@media (max-width: 760px) {
  .pairs-podium {
    gap: 8px;
  }
  .pairs-podium-item {
    min-width: 110px;
    padding: 12px 10px;
  }
  .pairs-podium-name {
    font-size: .82rem;
  }
  .pairs-bottom-grid {
    grid-template-columns: 1fr;
  }
}


/* ═══════════════════════════════════════════════════════════════
   EVOLUCIÓN DEL RANKING — Kmakus v17
   ═══════════════════════════════════════════════════════════════ */

.evo-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.evo-empty-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
}

.evo-empty-hint {
  font-size: .88rem;
  opacity: .7;
  margin-top: 8px;
}

/* Filtro de jugadores */
.evo-filter {
  margin-bottom: 20px;
}

.evo-filter-label {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.evo-filter-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.evo-filter-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.4);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s ease;
  opacity: .5;
}

.evo-filter-btn.is-active {
  opacity: 1;
  color: #fff;
  border-color: var(--evo-color, rgba(255,255,255,.3));
  /* Fallback para Safari < 16.2 y Chrome < 111 */
  background: rgba(255,255,255,.1);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset;
  /* Browsers con soporte color-mix */
  background: color-mix(in srgb, var(--evo-color, #fff) 15%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--evo-color, #fff) 20%, transparent) inset;
}

.evo-all-btn {
  --evo-color: #b8ff3b;
}

/* Canvas */
.evo-chart-wrap {
  position: relative;
  width: 100%;
  height: 340px;
  margin-bottom: 20px;
}

@media (max-width: 760px) {
  .evo-chart-wrap {
    height: 260px;
  }
}

/* Leyenda */
.evo-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.evo-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .85rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background .14s;
}

.evo-legend-item:hover {
  background: rgba(255,255,255,.05);
}

.evo-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.evo-legend-name {
  color: var(--text);
  font-weight: 600;
}

.evo-legend-pos {
  color: var(--muted);
  font-size: .78rem;
}

.evo-legend-trend {
  font-size: .75rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 5px;
}

.evo-trend-up   { color: #4ade80; background: rgba(74,222,128,.12); }
.evo-trend-down { color: #f87171; background: rgba(248,113,113,.12); }
.evo-trend-flat { color: var(--muted); }


/* ═══════════════════════════════════════════════════════════════
   MIS STATS — Kmakus v17
   ═══════════════════════════════════════════════════════════════ */

/* ── Hero del jugador ── */
.stats-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 0 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.stats-hero-photo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}

.stats-hero-placeholder {
  background: linear-gradient(135deg, rgba(184,255,59,.18), rgba(255,255,255,.06));
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: .04em;
  color: #eaffdf;
}

.stats-hero-info {
  flex: 1;
  min-width: 0;
}

.stats-hero-name {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-hero-alias {
  font-size: .85rem;
  color: var(--muted);
  margin-top: 2px;
}

.stats-hero-mood {
  font-size: .78rem;
  color: #b8ff3b;
  margin-top: 4px;
  font-weight: 600;
}

.stats-hero-pos {
  text-align: center;
  flex-shrink: 0;
  padding: 10px 16px;
  border-radius: 16px;
  background: rgba(184,255,59,.1);
  border: 1px solid rgba(184,255,59,.2);
}

.stats-hero-pos-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 900;
  color: #b8ff3b;
  line-height: 1;
}

.stats-hero-pos-label {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(184,255,59,.6);
  margin-top: 3px;
}

/* ── Grid de métricas ── */
.stats-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stats-metric-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 12px 10px;
  display: grid;
  gap: 3px;
  text-align: center;
}

.stats-metric-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.stats-metric-value {
  font-size: 1.3rem;
  font-weight: 900;
  color: #b8ff3b;
  line-height: 1.1;
}

.stats-metric-sub {
  font-size: .7rem;
  color: rgba(255,255,255,.3);
}

/* ── Bloques genéricos ── */
.stats-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.stats-block {
  flex: 1;
  min-width: 140px;
}

.stats-block-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stats-form-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.stats-notif-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  display: inline-block;
}

/* ── Pantalla de login ── */
.stats-login-screen {
  text-align: center;
  padding: 40px 20px 32px;
}

.stats-login-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.stats-login-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 10px;
  color: var(--text);
}

.stats-login-desc {
  color: var(--muted);
  max-width: 320px;
  margin: 0 auto 24px;
  font-size: .95rem;
  line-height: 1.5;
}

.stats-login-btn {
  padding: 14px 32px;
  font-size: 1rem;
  border-radius: 16px;
  margin-bottom: 16px;
}

.stats-login-hint {
  font-size: .8rem;
  color: rgba(255,255,255,.25);
  margin: 0;
}

/* Responsive */
@media (max-width: 480px) {
  .stats-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-hero-pos-num { font-size: 1.5rem; }
}


/* ═══════════════════════════════════════════════════════════════
   GALERÍA DE EVENTOS — Kmakus v17
   ═══════════════════════════════════════════════════════════════ */

.gallery-events-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.gallery-event-head {
  margin-bottom: 14px;
}

.gallery-event-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 4px;
}

.gallery-event-meta {
  font-size: .82rem;
  color: var(--muted);
}

.gallery-event-desc {
  font-size: .88rem;
  color: var(--muted);
  margin: 6px 0 0;
}

/* Grid de fotos */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.gallery-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  border: none;
  padding: 0;
  cursor: zoom-in;
  background: rgba(255,255,255,.04);
  transition: transform .15s ease, box-shadow .15s ease;
}

.gallery-thumb:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 28px rgba(0,0,0,.4);
  z-index: 1;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumb-main {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-thumb-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  font-size: .75rem;
  color: #fff;
  text-align: left;
  line-height: 1.3;
}

/* Lightbox */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.95);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.gallery-lightbox.hidden { display: none; }

.gallery-lightbox-imgwrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  min-height: 80px;
}

.gallery-lightbox-spinner {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: rgba(255,255,255,.7);
  border-radius: 50%;
  animation: glSpin .7s linear infinite;
  display: none;
}

@keyframes glSpin {
  to { transform: rotate(360deg); }
}

.gallery-lightbox-img {
  max-width: calc(100vw - 120px);
  max-height: calc(100vh - 160px);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  opacity: 0;
  transition: opacity .25s ease;
}

.gallery-lightbox-caption {
  font-size: .9rem;
  color: rgba(255,255,255,.6);
  text-align: center;
  max-width: 500px;
}

.gallery-lightbox-counter {
  font-size: .78rem;
  color: rgba(255,255,255,.35);
  letter-spacing: .06em;
}

.gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
}

.gallery-lightbox-nav:hover { background: rgba(255,255,255,.15); }
.gallery-lightbox-prev { left: 16px; }
.gallery-lightbox-next { right: 16px; }

.gallery-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Admin grid de miniaturas */
.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.gallery-admin-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,.04);
}

.gallery-admin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-admin-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(239,68,68,.9);
  color: #fff;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-weight: 700;
}

@media (max-width: 760px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .gallery-thumb-main {
    grid-column: span 2;
    grid-row: span 2;
  }
  .gallery-lightbox-img {
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 180px);
  }
  .gallery-lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  .gallery-lightbox-prev { left: 8px; }
  .gallery-lightbox-next { right: 8px; }
}


/* ── Bonus points badge ── */
.bonus-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #1a0a00;
  font-weight: 800;
  font-size: .8rem;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}


/* ── Edit photo button in Stats ── */
.stats-hero-photo-wrap {
  position: relative;
  flex-shrink: 0;
}

.stats-hero-edit-photo {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--accent);
  color: #0a1500;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  padding: 0;
  transition: transform .15s ease;
}

.stats-hero-edit-photo:hover {
  transform: scale(1.15);
}

.stats-photo-form {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 16px;
}

.stats-photo-label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: #e2e8f0;
}


/* ═══════════════════════════════════════════════════════════════
   RANKING SUB-TABS — solo móvil
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 760px) {

  .ranking-subtabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 0 12px;
    margin-bottom: 4px;
    position: sticky;
    top: 56px;
    z-index: 20;
    background: var(--bg);
    padding-top: 10px;
  }

  .ranking-subtabs::-webkit-scrollbar { display: none; }

  .ranking-subtab-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.05);
    color: rgba(255,255,255,.45);
    font-size: .84rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s ease;
    white-space: nowrap;
  }

  .ranking-subtab-btn.is-active {
    background: rgba(184,255,59,.12);
    border-color: rgba(184,255,59,.35);
    color: #b8ff3b;
    box-shadow: 0 0 0 1px rgba(184,255,59,.12) inset;
  }

}

@media (min-width: 761px) {
  .ranking-subtabs { display: none !important; }
}
