@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg:            #040714;
  --surface:       #0a1628;
  --surface-muted: #0f1f38;
  --text:          #e8f0ff;
  --muted:         #7a9cc7;
  --line:          #1a3466;
  --primary:       #4a9eff;
  --primary-strong:#2a7fff;
  --accent:        #ff8800;
  --accent-soft:   rgba(255, 136, 0, 0.15);
  --danger:        #ff4d67;
  --success:       #00cc88;
  --shadow:        0 18px 32px rgba(0, 0, 0, 0.4);
  --glow-blue:     rgba(74, 158, 255, 0.25);
  --glow-orange:   rgba(255, 136, 0, 0.2);
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    url("data:image/svg+xml,%3Csvg width='52' height='45' viewBox='0 0 52 45' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M26 0L52 13v19L26 45 0 32V13z' fill='none' stroke='%234a9eff' stroke-width='0.6' opacity='0.15'/%3E%3Cpath d='M26 0L52 13v19L26 45 0 32V13z' fill='none' stroke='%23ff8800' stroke-width='0.6' opacity='0.1'/%3E%3C/svg%3E") repeat,
    radial-gradient(1000px 420px at 0% -8%, rgba(74, 158, 255, 0.2), transparent 62%),
    radial-gradient(980px 460px at 100% 0%, rgba(255, 136, 0, 0.15), transparent 58%),
    linear-gradient(180deg, #03060f 0%, var(--bg) 54%, #060c1a 100%);
}

.topbar {
  width: min(1180px, calc(100% - 24px));
  margin: 12px auto 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(12, 18, 38, 0.9);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
  position: sticky;
  top: 10px;
  z-index: 20;
}

.brand {
  text-decoration: none;
  color: #e0f0ff;
  font-family: 'Barlow', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.topbar nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.menu-toggle { display: none; }

.topbar nav a {
  text-decoration: none;
  color: #d4ecff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.topbar nav a:hover { border-color: #3a6db8; background: rgba(74, 158, 255, 0.1); }

.session-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid #2e5aad;
  border-radius: 999px;
  background: rgba(15, 28, 56, 0.8);
}

.session-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #3b6fc2;
}

.session-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #c8e4ff;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 29;
}

.mobile-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(320px, 86vw);
  background: #0b1225;
  border-left: 1px solid #1f4080;
  box-shadow: -10px 0 28px rgba(16, 24, 40, 0.18);
  z-index: 30;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.mobile-sidebar.open {
  transform: translateX(0);
}

.mobile-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid #e1e8f1;
}

.menu-close {
  border: 0;
  background: #eef3fa;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.mobile-sidebar-body {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.mobile-sidebar-body a {
  text-decoration: none;
  color: #c0e0ff;
  border: 1px solid #2d57a0;
  border-radius: 9px;
  padding: 10px 12px;
  font-weight: 600;
  background: rgba(18, 33, 63, 0.9);
}

.mobile-user {
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 6px;
}

.container {
  width: min(1240px, 100%);
  margin: 28px auto 40px;
  padding: 0 18px 22px;
}

h1, h2, h3 {
  margin: 0;
  font-family: 'Barlow', sans-serif;
  color: #e8f0ff;
}

h1 { font-size: clamp(1.9rem, 3vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 2.2vw, 1.8rem); margin-bottom: 10px; }
h3 { font-size: 1.2rem; }

p { line-height: 1.65; color: var(--muted); margin: 0; }

.page-header,
.hero {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(13, 19, 38, 0.95), rgba(13, 22, 44, 0.95));
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.landing-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}

.landing-main,
.landing-side {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(13, 19, 38, 0.96), rgba(15, 24, 47, 0.96));
  box-shadow: var(--shadow);
  padding: 26px;
  animation: fadeUp 0.55s ease both;
}

.kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7abfff;
  font-weight: 700;
  margin-bottom: 10px;
}

.landing-side h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.hero.mini { padding: 18px; }
.lead { margin-top: 8px; max-width: 78ch; }

.section-block,
.card,
.stat-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(13, 19, 38, 0.96), rgba(16, 25, 50, 0.96));
  box-shadow: var(--shadow);
}

.section-block {
  margin-top: 20px;
  animation: fadeUp 0.5s ease both;
}
.section-block h2 { margin-bottom: 8px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  background: linear-gradient(180deg, rgba(13, 19, 38, 0.96), rgba(17, 29, 58, 0.98));
}

.stat-card h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7aadde;
}

.stat-card p {
  margin-top: 8px;
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  color: #ddf0ff;
  font-weight: 700;
}

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

.competition-card {
  display: grid;
  gap: 12px;
  position: relative;
  border: 1px solid transparent;
  background-clip: padding-box;
}

.competition-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 13px;
  padding: 1px;
  background: linear-gradient(135deg, var(--primary), var(--accent), var(--primary));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  background-size: 300% 300%;
  animation: borderSweep 5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes borderSweep {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.competition-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 26px rgba(16, 24, 40, 0.12);
}

.competition-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #94bae3;
  font-size: 0.93rem;
}

.meta-item { background: rgba(74, 158, 255, 0.1); border: 1px solid #2550a0; border-radius: 999px; padding: 5px 11px; }

.status-pill {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill.open { background: rgba(0, 204, 136, 0.14); color: #5ce6b0; border: 1px solid rgba(0, 204, 136, 0.35); }
.status-pill.closed { background: rgba(255, 77, 103, 0.16); color: #ff9aad; border: 1px solid rgba(255, 77, 103, 0.36); }

.btn {
  appearance: none;
  border: 0;
  border-radius: 9px;
  background: var(--primary);
  color: #040c18;
  text-decoration: none;
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 9px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn:hover { background: var(--primary-strong); transform: translateY(-1px); }
.btn:active { transform: scale(0.96); }
.btn.secondary { background: var(--accent); color: #040c18; }
.btn.secondary:hover { background: #e67a00; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #e04055; }

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

.form-card { background: linear-gradient(180deg, rgba(12, 20, 40, 0.95), rgba(14, 24, 48, 0.95)); }
.form-card form { display: grid; gap: 10px; }

label { display: grid; gap: 6px; font-weight: 600; color: #bddbff; }

input, textarea, select {
  width: 100%;
  border: 1px solid #2a5cad;
  background: rgba(8, 15, 32, 0.92);
  color: #d0ecff;
  border-radius: 9px;
  padding: 10px;
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(74, 158, 255, 0.25); border-color: #2a7fff; }

.alert {
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0 14px;
  font-weight: 600;
  border: 1px solid transparent;
}

.alert.success { background: rgba(0, 204, 136, 0.14); border-color: rgba(0, 204, 136, 0.36); color: #5ce6b0; }
.alert.error { background: rgba(255, 77, 103, 0.16); border-color: rgba(255, 77, 103, 0.36); color: #ffb0bf; }

a { color: #7abfff; }

.layout-two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

.info-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.info-list li {
  border: 1px solid #1f4080;
  border-radius: 8px;
  background: rgba(12, 22, 46, 0.86);
  padding: 8px 10px;
  color: #b8d8f5;
}

.info-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.panel {
  border: 1px solid #1f4080;
  border-radius: 10px;
  background: rgba(12, 20, 40, 0.9);
  padding: 18px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 24px rgba(16, 24, 40, 0.1);
}

.panel h3 {
  font-size: 1.02rem;
  margin-bottom: 8px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #1f4080;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(10, 18, 36, 0.92);
}

th, td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid #1a3466;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7db8e8;
  background: rgba(14, 28, 54, 0.95);
}

tr:last-child td { border-bottom: 0; }

.table-clean th,
.table-clean td {
  padding: 8px 9px;
}

ul { margin: 0; padding-left: 18px; }
li { margin-bottom: 8px; color: #3a4e67; }

.wizard-form { position: relative; }
.wizard-progress { margin: 0 0 8px; color: #5578a8; font-weight: 600; }
.wizard-step { display: none; opacity: 0; transform: translateY(8px) rotateX(-4deg); transform-origin: top center; }
.wizard-step.active { display: grid; gap: 10px; opacity: 1; transform: translateY(0) rotateX(0); animation: wizardStepIn 0.35s ease; }
@keyframes wizardStepIn {
  from { opacity: 0; transform: translateY(10px) rotateX(-4deg); }
  to { opacity: 1; transform: translateY(0) rotateX(0); }
}
.wizard-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.member-rows { display: grid; gap: 10px; }
.member-row {
  border: 1px solid #2550a0;
  background: linear-gradient(180deg, rgba(12, 22, 44, 0.94), rgba(11, 20, 40, 0.92));
}
.member-results {
  border: 1px solid #1f4080;
  border-radius: 8px;
  max-height: 180px;
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 6px;
  background: rgba(8, 16, 33, 0.95);
}

.member-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.member-option:hover { border-color: #3a6db8; background: rgba(19, 37, 70, 0.9); }
.member-option input { margin: 2px 0 0; width: 14px; height: 14px; }
.member-empty, .selected-user { margin: 0; color: #87b0d4; font-size: 0.93rem; }
.member-row label {
  color: #c0e0ff;
}

.edit-panel {
  margin-top: 10px;
  border: 1px solid #2550a0;
  border-radius: 10px;
  padding: 10px;
  background: rgba(10, 19, 38, 0.78);
}

.edit-panel summary {
  cursor: pointer;
  font-weight: 700;
  color: #7abfff;
  margin-bottom: 10px;
}

details.panel > summary,
.edit-panel > summary {
  position: relative;
  list-style: none;
  padding-right: 22px;
  transition: color 0.2s ease;
}

details.panel > summary::-webkit-details-marker,
.edit-panel > summary::-webkit-details-marker {
  display: none;
}

details.panel > summary::after,
.edit-panel > summary::after {
  content: '▸';
  position: absolute;
  right: 0;
  top: 0;
  color: #6bb5ff;
  transform-origin: center;
  transition: transform 0.2s ease, color 0.2s ease;
}

details.panel[open] > summary::after,
.edit-panel[open] > summary::after {
  transform: rotate(90deg);
  color: #a0d4ff;
}

details.panel > summary:hover,
.edit-panel > summary:hover {
  color: #b0dcff;
}

details.panel > *:not(summary),
.edit-panel > *:not(summary) {
  display: block;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition:
    max-height 1.25s ease,
    opacity 0.95s ease,
    transform 0.95s ease;
  will-change: max-height, opacity, transform;
}

details.panel[open] > *:not(summary),
.edit-panel[open] > *:not(summary) {
  max-height: 4000px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.edit-panel form {
  display: grid;
  gap: 10px;
}

.competition-card,
.edit-panel,
.edit-panel form {
  overflow: visible;
}

.portal-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 280px;
  gap: 22px;
}

.portal-sidebar {
  display: grid;
  gap: 14px;
  align-content: start;
}

.portal-main {
  display: grid;
  gap: 20px;
}

.neon-card {
  border: 1px solid #2550a0;
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(10, 18, 35, 0.94), rgba(12, 24, 49, 0.94));
  box-shadow: 0 0 0 1px rgba(74, 158, 255, 0.08), 0 0 24px rgba(74, 158, 255, 0.12);
}

.neon-hero {
  box-shadow:
    0 0 0 1px rgba(74, 158, 255, 0.14),
    0 0 34px rgba(74, 158, 255, 0.16),
    0 18px 34px rgba(0, 0, 0, 0.34);
}

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

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

@keyframes sectionIn {
  from {
    opacity: 0;
    transform: translateX(12px) translateY(4px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
    filter: blur(0);
  }
}

@keyframes bgDrift {
  0%   { background-position: 0 0, 0% -8%, 100% 0%, 0 0; }
  100% { background-position: 40px 20px, 2% -6%, 98% -2%, 0 0; }
}

body {
  animation: bgDrift 30s ease-in-out infinite alternate;
}

@keyframes shine {
  0%   { transform: translateX(-100%) skewX(-15deg); }
  60%  { transform: translateX(200%) skewX(-15deg); }
  100% { transform: translateX(200%) skewX(-15deg); }
}

/* ─── Hub link hover indicator ─── */
.hub-link {
  position: relative;
  border: 1px solid #2a5cad;
  border-radius: 11px;
  background: rgba(16, 30, 59, 0.84);
  color: #d8efff;
  padding: 11px 12px;
  text-align: left;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
}

.hub-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--primary);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.2s ease;
}

.hub-link:hover::before { transform: scaleY(1); }
.hub-link.active::before { transform: scaleY(1); }

.hub-link:hover {
  background: rgba(74, 158, 255, 0.12);
  border-color: #3a8ad0;
}

.hub-link.active {
  background: linear-gradient(90deg, rgba(74, 158, 255, 0.24), rgba(255, 136, 0, 0.2));
  border-color: #6bb5ff;
  box-shadow: inset 0 0 0 1px rgba(74, 158, 255, 0.26);
}

@media (max-width: 940px) {
  .topbar {
    width: calc(100% - 14px);
    padding: 10px 12px;
    gap: 10px;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar nav { display: none; }

  .menu-toggle {
    display: inline-flex;
    width: 42px;
    height: 36px;
    border: 1px solid #c7d7ea;
    border-radius: 10px;
    background: #f4f8ff;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-direction: column;
    cursor: pointer;
    padding: 0;
  }

  .menu-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 99px;
    background: #1a3466;
  }

  .container { margin-top: 16px; padding: 0 9px 18px; }
  .portal-shell { grid-template-columns: 1fr; gap: 14px; }
  .portal-sidebar { order: 2; }
  .portal-main { order: 1; }
  .landing-grid { grid-template-columns: 1fr; }
  .layout-two-col { grid-template-columns: 1fr; }

  table { display: block; overflow-x: auto; white-space: nowrap; }

  .row-actions form,
  .row-actions .btn,
  .wizard-actions .btn,
  .btn { width: 100%; }

  .landing-main,
  .landing-side,
  .section-block,
  .panel,
  .card {
    padding: 16px;
  }
}

body.menu-open {
  overflow: hidden;
}

/* Home portal layout: single left sidebar + section content */
.hub-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 26px;
  padding: 20px 20px 24px;
}

.hub-sidebar {
  position: sticky;
  top: 14px;
  align-self: start;
  display: grid;
  gap: 20px;
  border: 1px solid #2550a0;
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(10, 18, 35, 0.96), rgba(12, 24, 49, 0.96));
  box-shadow: 0 0 0 1px rgba(74, 158, 255, 0.08), 0 0 26px rgba(74, 158, 255, 0.14);
}

.hub-brand {
  display: grid;
  grid-template-columns: 78px 1fr;
  align-items: center;
  gap: 12px;
}

.hub-logo {
  width: 78px;
  height: 78px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid #2a5cad;
  box-shadow: 0 0 20px rgba(74, 158, 255, 0.25);
  position: relative;
  overflow: hidden;
}

.hub-logo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  transform: translateX(-100%) skewX(-15deg);
  animation: shine 3s ease 0.8s forwards;
}

.hub-kicker {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7abfff;
  font-weight: 700;
}

.hub-title {
  margin: 4px 0 0;
  font-size: 1.6rem;
}

.hub-nav {
  display: grid;
  gap: 8px;
}

.hub-auth {
  display: grid;
  gap: 10px;
}

.hub-auth p {
  color: #a8c8ef;
}

.hub-content {
  border: 1px solid #1a3466;
  border-radius: 16px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(8, 15, 31, 0.88), rgba(10, 19, 39, 0.9));
  min-height: calc(100vh - 44px);
  overflow: hidden;
}

.hub-section {
  display: none;
  animation: sectionIn 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hub-section.active {
  display: block;
}

.hub-grid-3 {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

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

.hub-stat {
  font-size: 2rem;
  color: #7abfff;
  font-weight: 700;
  margin-top: 8px;
}

@media (max-width: 1100px) {
  .hub-layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .hub-sidebar {
    position: static;
  }

  .hub-content {
    min-height: auto;
  }

  .hub-grid-3,
  .hub-grid-2 {
    grid-template-columns: 1fr;
  }
}

.hub-mobilebar,
.hub-sidebar-close,
.hub-sidebar-overlay {
  display: none;
}

.hub-user {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
}

.hub-user-avatar {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid #4a9eff;
  background: linear-gradient(180deg, rgba(26, 50, 94, 0.95), rgba(14, 29, 58, 0.95));
  box-shadow: 0 0 18px rgba(74, 158, 255, 0.28);
}

.hub-user-meta {
  display: grid;
  gap: 2px;
}

.hub-user-meta span {
  font-size: 0.75rem;
  color: #80afd4;
}

.hub-user-meta strong {
  color: #ebf8ff;
  font-size: 0.96rem;
}

@media (max-width: 1100px) {
  .hub-layout {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0;
  }

  .hub-mobilebar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #1f4080;
    background: rgba(6, 10, 20, 0.95);
    backdrop-filter: blur(8px);
  }

  .hub-mobilebrand {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .hub-mobilebrand img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid #2a5cad;
  }

  .hub-mobilebrand strong {
    font-family: 'Barlow', sans-serif;
    color: #eaf6ff;
  }

  .hub-menu-btn,
  .hub-sidebar-close {
    appearance: none;
    border: 1px solid #2a5cad;
    background: rgba(15, 29, 58, 0.95);
    color: #c8e4ff;
    border-radius: 10px;
    width: 40px;
    height: 36px;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
  }

  .hub-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 70;
    width: min(340px, 88vw);
    height: 100vh;
    border-radius: 0 16px 16px 0;
    overflow: auto;
    transform: translateX(-110%);
    transition: transform 0.22s ease;
  }

  .hub-sidebar.open {
    transform: translateX(0);
  }

  .hub-sidebar-head {
    display: none;
  }

  .hub-sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
  }

  .hub-sidebar-overlay.open {
    position: fixed;
    inset: 0;
    z-index: 65;
    display: block;
    background: rgba(2, 7, 16, 0.62);
  }

  .hub-content {
    min-height: auto;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding: 16px 12px 20px;
  }

  .hub-grid-3,
  .hub-grid-2 {
    grid-template-columns: 1fr;
  }

  .hub-menu-open {
    overflow: hidden;
  }
}

.ranking-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ranking-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(15, 28, 56, 0.92);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.ranking-tab.active {
  border-color: var(--primary);
  background: rgba(74, 158, 255, 0.14);
  color: #d0ecff;
}

.ranking-panel {
  display: none;
}

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

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

.ranking-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ranking-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ranking-position-card {
  min-width: 170px;
  padding: 14px 16px;
  border: 1px solid rgba(74, 158, 255, 0.28);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(15, 28, 56, 0.98), rgba(18, 37, 72, 0.96));
  text-align: right;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.ranking-position-label {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 4px;
}

.ranking-position-value {
  display: block;
  color: #d8f0ff;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  line-height: 1;
}

.ranking-search {
  display: grid;
  gap: 6px;
  min-width: min(320px, 100%);
}

.ranking-search span,
.ranking-counter {
  color: var(--muted);
  font-size: 0.92rem;
}

.ranking-search input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(15, 28, 56, 0.92);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
}

.ranking-player {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.ranking-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #2a5cad;
  background: rgba(19, 36, 70, 0.9);
}

.ranking-avatar-fallback {
  display: inline-block;
}

.ranking-current-user td {
  background: rgba(74, 158, 255, 0.08);
  animation: rowPulse 3s ease-in-out infinite;
}

@keyframes rowPulse {
  0%, 100% { background: rgba(74, 158, 255, 0.08); }
  50% { background: rgba(74, 158, 255, 0.18); }
}

.ranking-current-user .ranking-player span:last-child {
  text-decoration: underline;
  text-decoration-color: #a8e0ff;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.ranking-mmr-cell {
  display: grid;
  gap: 6px;
}

.ranking-rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.ranking-rank-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.ranking-rank-label,
.ranking-stats-inline {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

.ranking-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.ranking-page-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(15, 28, 56, 0.92);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.ranking-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ranking-page-indicator {
  color: var(--muted);
  font-size: 0.92rem;
}

/* ─── Live ticker ─── */
.live-ticker {
  background: linear-gradient(90deg, rgba(255,136,0,0.15), rgba(74,158,255,0.15));
  border-bottom: 1px solid var(--line);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.85rem;
}
.live-ticker-icon {
  color: #ff4d4d;
  animation: livePulse 1.2s infinite;
  flex-shrink: 0;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.live-ticker-track {
  display: flex;
  gap: 24px;
  animation: tickerScroll 20s linear infinite;
}
@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.live-ticker-item {
  color: var(--text);
  flex-shrink: 0;
}

/* ─── Competition countdown ─── */
.competition-countdown {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--accent);
}
.competition-countdown .countdown-label {
  color: var(--muted);
}

/* ─── Hall of Fame (categorías) ─── */
.hof-category-section {
  margin-top: 32px;
}
.hof-category-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 10px;
}
.hof-category-header::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--hof-cat-color, var(--accent)) 0%, transparent 100%);
  border-radius: 1px;
}
.hof-category-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--hof-cat-color, var(--text));
  text-shadow: 0 0 20px color-mix(in srgb, var(--hof-cat-color, var(--accent)) 40%, transparent);
  white-space: nowrap;
}
.hof-category-entries {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hof-entry-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--hof-cat-color, var(--accent));
  border-radius: var(--radius-md);
  padding: 16px 20px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
}
.hof-entry-card:hover {
  transform: translateX(6px) scale(1.01);
  box-shadow: 0 6px 24px color-mix(in srgb, var(--hof-cat-color, var(--accent)) 20%, transparent);
  border-color: var(--hof-cat-color, var(--accent));
}
.hof-entry-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--hof-cat-color, var(--accent));
  flex-shrink: 0;
  box-shadow: 0 0 12px color-mix(in srgb, var(--hof-cat-color, var(--accent)) 30%, transparent);
}
.hof-entry-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--line);
  color: var(--hof-cat-color, var(--text));
  font-size: 1.4rem;
  font-weight: 800;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 3px solid var(--hof-cat-color, var(--accent));
}
.hof-entry-body {
  flex: 1;
  min-width: 0;
}
.hof-entry-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  display: block;
}
.hof-entry-reason {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 4px 0 0;
}

/* ─── MMR progress bar ─── */
.mmr-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-muted);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}
.mmr-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
}

/* ─── Bracket ─── */
.bracket-wrap {
  position: relative;
}
.bracket-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.bracket-grid {
  position: relative;
  z-index: 1;
}

/* ─── MVP row ─── */
.mvp-row {
  transition: box-shadow 0.3s;
}

/* ─── Live ring heartbeat base ─── */
.live-ring {
  display: inline-block;
}

/* ─── Member search (dashboard) ─── */
.member-results {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}
.member-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface-muted);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.member-option:hover {
  background: var(--line);
}
.member-option input[type="radio"] {
  accent-color: var(--primary);
}
.member-empty {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 8px 0;
}
.selected-user {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--primary);
}

/* ─── Competition card 3D hover ─── */
.competition-card {
  transition: transform 0.2s ease;
  transform-style: preserve-3d;
}

/* ─── Rangos page ─── */
.rangos-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}
.rangos-tab {
  display: inline-block;
  padding: 8px 20px;
  border: 1px solid #1f4080;
  border-radius: 8px;
  color: #7db8e8;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s;
}
.rangos-tab:hover {
  background: rgba(31, 64, 128, 0.3);
}
.rangos-tab.active {
  background: #1f4080;
  color: #fff;
}
.rangos-note {
  margin-top: 16px;
  font-size: 0.8rem;
  color: #5578a8;
}
.hub-nav-secondary {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(31, 64, 128, 0.4);
}

/* ─── Footer ─── */
.hub-footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 0.8rem;
}
.hub-footer a {
  color: #5578a8;
  text-decoration: none;
  margin: 0 12px;
}
.hub-footer a:hover {
  color: #7db8e8;
  text-decoration: underline;
}

/* ─── Legal pages ─── */
.legal-block h3 {
  color: #7db8e8;
  font-size: 1rem;
  margin: 24px 0 8px;
}
.legal-block p {
  color: #b0c8e6;
  line-height: 1.6;
  margin: 0 0 12px;
}
.legal-block ul {
  margin: 0 0 12px;
  padding-left: 20px;
}
.legal-block li {
  color: #b0c8e6;
  line-height: 1.6;
  margin-bottom: 6px;
}
.legal-block li strong {
  color: #7db8e8;
}
