/* ==========================================================================
   OSZ Manager Profile — assets/css/osz-manager-profile.css (Phase 3)
   Dark club aesthetic shared with the player views. All rules scoped .osz-mp.
   Strong table rules defeat theme bleed (same approach as osz-fp).
   ========================================================================== */

.osz-mp {
  --osz-mp-bg: #0c0c0c;
  --osz-mp-panel: #141414;
  --osz-mp-panel-2: #1d1d1d;
  --osz-mp-border: #2a2a2a;
  --osz-mp-red: #d0021b;
  --osz-mp-red-deep: #7a0110;
  --osz-mp-text: #f5f5f5;
  --osz-mp-muted: #9a9a9a;

  background: var(--osz-mp-bg);
  color: var(--osz-mp-text);
  font-size: 16px;
  line-height: 1.5;
}

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

.osz-mp a {
  text-decoration: none;
}

/* Inline SVG icons */
.osz-mp .osz-mp-icon {
  display: inline-flex;
  color: var(--osz-mp-red);
}
.osz-mp .osz-mp-icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

/* ── Hero ──────────────────────────────────────────────────── */

.osz-mp-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 380px;
  padding: 56px 48px;
  overflow: hidden;
  background:
    radial-gradient(
      ellipse 60% 90% at 85% 40%,
      rgba(150, 5, 20, 0.55) 0%,
      rgba(150, 5, 20, 0) 65%
    ),
    radial-gradient(
      ellipse 50% 70% at 70% 100%,
      rgba(90, 3, 12, 0.6) 0%,
      rgba(90, 3, 12, 0) 70%
    ),
    linear-gradient(100deg, #0a0a0a 0%, #150607 55%, #2b090c 100%);
  border-bottom: 3px solid var(--osz-mp-red);
}

.osz-mp-hero-text {
  position: relative;
  z-index: 2;
}

.osz-mp-hero-name {
  margin: 0 0 18px;
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  font-weight: 900;
  line-height: 0.98;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--osz-mp-text);
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.osz-mp-hero-name span {
  display: block;
}

.osz-mp-hero-name .osz-mp-hero-surname {
  color: var(--osz-mp-red);
}

.osz-mp-hero-role {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--osz-mp-text);
}

.osz-mp-hero-role::before {
  content: "";
  display: block;
  width: 3px;
  height: 1.1em;
  background: var(--osz-mp-red);
}

.osz-mp-hero-photo {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.osz-mp-hero-photo img {
  display: block;
  max-height: 360px;
  max-width: 520px;
  width: auto;
  height: auto;
  object-fit: cover;
  object-position: top;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.7));
}

/* ── Breadcrumb ────────────────────────────────────────────── */

.osz-mp-crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 40px 4px;
  font-size: 0.78rem;
  color: var(--osz-mp-muted);
}

.osz-mp-crumbs a {
  color: var(--osz-mp-text);
}

.osz-mp-crumbs a:hover {
  color: var(--osz-mp-red);
}

.osz-mp-crumbs-sep {
  color: var(--osz-mp-muted);
}

.osz-mp-crumbs-current {
  color: var(--osz-mp-text);
  font-weight: 700;
}

/* ── Body layout ───────────────────────────────────────────── */

.osz-mp-body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  padding: 20px 40px 48px;
}

/* ── Sidebar ───────────────────────────────────────────────── */

.osz-mp-side {
  background: var(--osz-mp-panel);
  border: 1px solid var(--osz-mp-border);
  padding: 14px;
  align-self: start;
}

.osz-mp-side-photo {
  position: relative;
  z-index: 1;
}

.osz-mp-side-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.osz-mp-side-name {
  position: relative;
  z-index: 2;
  margin: -54px 0 8px;
  padding: 12px 14px;
  background: linear-gradient(
    100deg,
    rgba(208, 2, 27, 0.92),
    rgba(122, 1, 16, 0.92)
  );
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

@supports (
  (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))
) {
  .osz-mp-side-name {
    background: linear-gradient(
      100deg,
      rgba(208, 2, 27, 0.55),
      rgba(122, 1, 16, 0.5)
    );
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
  }
}

.osz-mp-side-name span {
  display: block;
}

/* No photo → name block sits normally */
.osz-mp-side > .osz-mp-side-name:first-child {
  margin-top: 0;
}

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

.osz-mp-bio-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--osz-mp-border);
  font-size: 0.85rem;
}

.osz-mp-bio-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--osz-mp-muted);
  white-space: nowrap;
}

.osz-mp-bio-label svg {
  width: 14px;
  height: 14px;
  color: var(--osz-mp-red);
  flex-shrink: 0;
}

.osz-mp-bio-value {
  font-weight: 700;
  text-align: right;
  color: var(--osz-mp-text);
}

.osz-mp-bio-value em {
  font-style: normal;
  font-weight: 600;
  color: var(--osz-mp-muted);
  margin-left: 4px;
}

.osz-mp-signature {
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--osz-mp-text);
  background: #000;
}

.osz-mp-signature img {
  display: block;
  width: 100%;
  height: 100px !important;
  object-fit: contain;
}

/* Sponsor badge (mirrors the player sidebar) */
.osz-mp-sponsor {
  padding: 20px 20px 0;
}

.osz-mp-sponsor img {
  display: block;
  width: 100%;
  height: auto;
}

/* ── Main column / sections ────────────────────────────────── */

.osz-mp-main {
  min-width: 0;
}

.osz-mp-section {
  background: var(--osz-mp-panel);
  border: 1px solid var(--osz-mp-border);
  padding: 22px 24px;
  margin-bottom: 24px;
  scroll-margin-top: 90px;
}

.osz-mp-heading {
  margin: 0 0 18px;
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--osz-mp-text);
}

.osz-mp-heading span {
  color: var(--osz-mp-red);
}

.osz-mp-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.osz-mp-link {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--osz-mp-red);
  white-space: nowrap;
}

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

.osz-mp-no-data {
  color: var(--osz-mp-muted);
  padding: 12px 0;
  margin: 0;
}

/* ── Stat tiles + about ────────────────────────────────────── */

.osz-mp-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

/* Word above, number below (no icons) */
.osz-mp-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--osz-mp-panel-2);
  border: 1px solid var(--osz-mp-border);
  padding: 18px 10px;
  text-align: center;
}

.osz-mp-tile-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1.3;
  color: var(--osz-mp-red);
}

.osz-mp-tile-num {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--osz-mp-text);
}

.osz-mp-about {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--osz-mp-border);
  font-size: 0.92rem;
  color: #d6d6d6;
}

.osz-mp-about p {
  margin: 0 0 12px;
}

.osz-mp-about p:last-child {
  margin-bottom: 0;
}

/* ── Result pills ──────────────────────────────────────────── */

.osz-mp-pill {
  display: inline-block;
  min-width: 28px;
  padding: 3px 10px;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 2px;
}

.osz-mp-pill-w {
  background: var(--osz-mp-red);
  border-color: var(--osz-mp-red);
  color: #fff !important;
}

.osz-mp-pill-d {
  background: #3a3a3a;
  border-color: #3a3a3a;
  color: #fff !important;
}

.osz-mp-pill-l {
  background: transparent;
  border-color: var(--osz-mp-muted);
  color: var(--osz-mp-muted) !important;
}

/* ── Match cards (dual crest) ──────────────────────────────── */

.osz-mp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.osz-mp-match {
  background: var(--osz-mp-panel-2);
  border: 1px solid var(--osz-mp-border);
  padding: 16px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.osz-mp-match-crests {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 2px;
}

.osz-mp-match-crest {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.osz-mp-match-crest img {
  max-width: 40px;
  max-height: 40px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.osz-mp-match-crest svg {
  width: 30px;
  height: 30px;
  color: var(--osz-mp-muted);
}

.osz-mp-match-vs {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--osz-mp-muted);
}

.osz-mp-match-score {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--osz-mp-text);
}

.osz-mp-match-teams {
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  color: var(--osz-mp-text);
}

.osz-mp-match-date {
  font-size: 0.7rem;
  text-align: center;
  color: var(--osz-mp-muted);
}

.osz-mp-match-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--osz-mp-border);
  font-size: 0.7rem;
}

.osz-mp-match-link {
  color: var(--osz-mp-red);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.osz-mp-match-link:hover {
  color: var(--osz-mp-text);
}

.osz-mp-milestone {
  display: flex;
  flex-direction: column;
}

.osz-mp-milestone-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: center;
  margin-bottom: 8px;
  color: var(--osz-mp-text);
}

.osz-mp-milestone .osz-mp-match {
  flex: 1;
}

/* ── Tables — strong overrides to defeat ANY theme bleed ────── */

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

.osz-mp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  background: var(--osz-mp-panel-2) !important;
}

.osz-mp-table thead th,
.osz-mp-table thead td {
  padding: 12px 10px;
  text-align: center;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--osz-mp-muted) !important;
  background: var(--osz-mp-panel-2) !important;
  border: 1px solid var(--osz-mp-border) !important;
}

.osz-mp-table tbody tr,
.osz-mp-table tbody tr:nth-child(odd),
.osz-mp-table tbody tr:nth-child(even) {
  background: var(--osz-mp-panel-2) !important;
}

.osz-mp-table tbody td,
.osz-mp-table tbody th,
.osz-mp-table tfoot td {
  padding: 11px 8px;
  text-align: center;
  border: 1px solid var(--osz-mp-border) !important;
  color: var(--osz-mp-text) !important;
  background: var(--osz-mp-panel-2) !important;
  font-weight: 700;
  white-space: nowrap;
}

/* Opponent / season / competition may wrap so the action column stays in view */
.osz-mp-table tbody td.osz-mp-col-left {
  white-space: normal;
  min-width: 120px;
}

.osz-mp-table tbody td.osz-mp-col-wrap {
  white-space: normal;
}

.osz-mp-table tbody tr:hover,
.osz-mp-table tbody tr:hover td {
  background: var(--osz-mp-panel-2) !important;
  color: var(--osz-mp-text) !important;
}

.osz-mp-table tfoot .osz-mp-table-total td {
  background: var(--osz-mp-panel) !important;
  border-top: 2px solid var(--osz-mp-red) !important;
  font-weight: 800;
}

.osz-mp-table a {
  color: var(--osz-mp-text) !important;
}

/* Plain links turn red on hover; buttons keep their own (white-on-red) hover */
.osz-mp-table a:not(.osz-mp-btn):hover {
  color: var(--osz-mp-red) !important;
}

.osz-mp-table .osz-mp-col-left {
  text-align: left !important;
}

.osz-mp-opponent-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.osz-mp-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  overflow: hidden;
  display: block;
}

.osz-mp-avatar img {
  width: 32px !important;
  height: 32px !important;
  max-width: 100% !important;
  object-fit: contain !important;
}

.osz-mp-opp-name {
  color: var(--osz-mp-text) !important;
  font-weight: 700;
  font-size: 0.84rem;
}

.osz-mp-opp-name:hover {
  color: var(--osz-mp-red) !important;
}

.osz-mp-action {
  width: 1%;
}

/* ── Season filter ─────────────────────────────────────────── */

.osz-mp-season-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--osz-mp-panel-2);
  padding: 16px 20px;
  border: 1px solid var(--osz-mp-border);
  margin-bottom: 18px;
}

.osz-mp-season-filter label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--osz-mp-text);
}

#osz-mp-season-select {
  padding: 8px 16px;
  font-size: 0.85rem;
  border: 1px solid var(--osz-mp-border);
  background: var(--osz-mp-panel);
  color: var(--osz-mp-text);
  cursor: pointer;
  min-width: 200px;
  font-weight: 500;
}

#osz-mp-season-select:focus {
  outline: none;
  border-color: var(--osz-mp-red);
}

@keyframes osz-mp-spin {
  to {
    transform: rotate(360deg);
  }
}

.osz-mp-loading {
  color: var(--osz-mp-muted);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 6px;
}

.osz-mp-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--osz-mp-border);
  border-top-color: var(--osz-mp-red);
  border-radius: 50%;
  animation: osz-mp-spin 0.6s linear infinite;
}

#osz-mp-matches-table-wrap.osz-mp-updating {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.3s;
}

/* ── Most players picked ───────────────────────────────────── */

.osz-mp-mates {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.osz-mp-mate {
  background: var(--osz-mp-panel-2);
  border: 1px solid var(--osz-mp-border);
  padding: 10px 10px 12px;
  text-align: center;
  color: var(--osz-mp-text);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}

.osz-mp-mate:hover {
  border-color: var(--osz-mp-red);
  transform: translateY(-2px);
  color: var(--osz-mp-text) !important;
}

.osz-mp-mate-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  height: auto;
  object-fit: cover;
  object-position: top;
}

.osz-mp-mate-name {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--osz-mp-text);
}

.osz-mp-mate-count {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--osz-mp-text);
}

.osz-mp-mate-count em {
  font-style: normal;
  color: var(--osz-mp-red);
  text-transform: uppercase;
  font-size: 0.64rem;
  letter-spacing: 0.06em;
}

/* ── Buttons ───────────────────────────────────────────────── */

.osz-mp-btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--osz-mp-red);
  color: #fff !important;
  transition: background 0.15s ease;
}

.osz-mp-btn-ghost {
  background: transparent;
  padding: 6px 11px;
  border-color: var(--osz-mp-border);
  font-size: 0.64rem;
  white-space: nowrap;
}

.osz-mp-btn-ghost:hover {
  background: var(--osz-mp-red);
  border-color: var(--osz-mp-red);
  color: #fff !important;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 900px) {
  .osz-mp-body {
    grid-template-columns: 1fr;
    padding: 16px 20px 40px;
  }
  .osz-mp-crumbs {
    padding: 14px 20px 0;
  }
  .osz-mp-side {
    max-width: 380px;
  }
  .osz-mp-hero {
    padding: 40px 24px;
    flex-direction: column;
    align-items: flex-start;
    min-height: 0;
  }
  /* No hero photo on small screens — matches the player pages (client request) */
  .osz-mp-hero-photo {
    display: none;
  }
  .osz-mp-table th,
  .osz-mp-table td {
    padding: 10px 8px;
  }
  .osz-mp-mates {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
}

@media (max-width: 760px) {
  .osz-mp-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .osz-mp-tiles {
    gap: 8px;
  }
  .osz-mp-tile {
    padding: 14px 6px;
  }
  .osz-mp-tile-num {
    font-size: 1.45rem;
  }
  .osz-mp-tile-label {
    font-size: 0.6rem;
  }
  .osz-mp-cards {
    grid-template-columns: 1fr;
  }
  .osz-mp-mates {
    grid-template-columns: 1fr 1fr;
  }
  .osz-mp-side-photo img {
    height: 300px !important;
    object-fit: contain;
  }
  .osz-mp-heading-row {
    flex-direction: column;
    gap: 4px;
  }
  #osz-mp-season-select {
    min-width: 0;
    width: 100%;
  }
}
