:root {
  --bg: #09090f;
  --bg-soft: #0d0d14;
  --panel: #12121b;
  --panel-strong: #191824;
  --text: #ffffff;
  --muted: #c7c1d2;
  --purple: #d8abf7;
  --purple-strong: #9f51e5;
  --green: #10f05a;
  --yellow: #f3f400;
  --red: #ff001f;
  --gold: #ffcd37;
  --border: rgba(216, 171, 247, .18);
  --content: 1220px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: #09090f;
  font-family: Inter, Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
[hidden] { display: none !important; }

.site-header {
  min-height: 126px;
  background: #09090f;
  border-bottom: 1px solid rgba(255,255,255,.035);
}
.header-inner {
  width: min(calc(100% - 62px), var(--content));
  min-height: 126px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 132px minmax(0,1fr) 132px;
  align-items: center;
  gap: 22px;
}
.brand-logo {
  width: 112px;
  height: 108px;
  display: inline-grid;
  place-items: center;
}
.brand-logo img {
  width: 104px;
  height: 104px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.55));
}
.brand-center { text-align: center; transform: translateY(1px); }
.brand-center h1 {
  margin: 0 0 17px;
  font-family: Montserrat, Inter, Arial, sans-serif;
  font-size: clamp(42px, 4.75vw, 62px);
  line-height: .93;
  letter-spacing: -2.2px;
  font-weight: 900;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255,255,255,.12);
}
.brand-center h1 span {
  color: var(--purple);
  background: linear-gradient(90deg,#e2baf9 0%,#d4a1f1 48%,#c99aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.main-nav { display: flex; justify-content: center; gap: 38px; }
.main-nav a {
  position: relative;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  font-weight: 750;
  transition: color .18s ease;
}
.main-nav a:hover { color: var(--purple); }
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 1px;
  background: transparent;
}
.main-nav a.active::after, .main-nav a:hover::after { background: currentColor; }
.header-actions {
  justify-self: end;
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.header-action {
  min-width: 74px;
  height: 37px;
  padding: 0 17px;
  border: 0;
  border-radius: 999px;
  color: #17121d;
  background: var(--purple);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 17px 42px rgba(0,0,0,.62);
  transition: transform .18s ease, background .18s ease;
}
.header-action:hover { transform: translateY(-1px); background: #e6c5fb; }
.header-action.secondary {
  min-width: auto;
  color: #f5effa;
  background: #20182b;
  border: 1px solid rgba(213,172,247,.2);
  box-shadow: none;
}

.players-section {
  width: min(calc(100% - 62px), var(--content));
  margin: 0 auto;
  padding: 5px 0 86px;
}
.section-heading {
  max-width: 850px;
  margin: 0 auto 26px;
  text-align: center;
}
.section-heading h2 {
  margin: 0 0 11px;
  font-family: Montserrat, Inter, Arial, sans-serif;
  font-size: clamp(34px, 3.8vw, 48px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -1.6px;
  text-shadow: 1px 1px 0 rgba(255,255,255,.06);
}
.section-heading p {
  margin: 0;
  color: #cfc9da;
  font-size: clamp(12px, 1.13vw, 15px);
  line-height: 1.5;
  font-weight: 450;
}
.section-heading strong { color: #f3eff8; font-weight: 800; }
.eyebrow {
  display: inline-block;
  color: var(--purple);
  font-size: .69rem;
  font-weight: 850;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.players-toolbar {
  position: sticky;
  top: 8px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(260px,1.15fr) auto minmax(200px,.75fr);
  gap: 12px;
  align-items: center;
  margin: 0 0 26px;
  padding: 10px 12px;
  border: 1px solid rgba(216,171,247,.2);
  border-radius: 14px;
  background: rgba(14,13,21,.94);
  backdrop-filter: blur(16px);
  box-shadow: 0 15px 38px rgba(0,0,0,.28);
}
.search-control {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 39px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  background: #090910;
  color: #9a92a8;
}
.search-control input { width: 100%; border: 0; outline: 0; color: #fff; background: transparent; font-size: 12px; }
.search-control input::placeholder { color: #8c8597; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.filter-chip {
  min-height: 32px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 999px;
  padding: 0 12px;
  color: #d3ccdc;
  background: #171620;
  cursor: pointer;
  font-weight: 750;
  font-size: 10px;
}
.filter-chip:hover, .filter-chip.active {
  color: #fff;
  border-color: rgba(222,184,250,.6);
  background: linear-gradient(135deg,#7d31b8,#a756e8);
}
.toolbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: #afa8b9;
  font-size: 9px;
  flex-wrap: wrap;
}
.toolbar-meta strong { color: #fff; font-size: 13px; }
.source-badge {
  margin-left: 3px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #22182d;
  color: #dcc0ef;
  border: 1px solid rgba(213,172,247,.22);
  font-weight: 750;
}
.source-badge.remote { color: #a7ffc0; background: #13271a; border-color: #285e36; }

.players-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 31px 44px;
  align-items: start;
}
.player-card {
  --accent: #fff;
  position: relative;
  min-width: 0;
  padding: 0;
  text-align: center;
}
.player-card.leader { --accent: var(--red); }
.player-card.moderator { --accent: var(--green); }
.player-card.special { --accent: #cb70ff; }
.player-card.vacancy { --accent: var(--gold); }
.card-topline, .player-description { display: none; }
.player-name {
  margin: 0 0 3px;
  color: #fff;
  font-family: Montserrat, Inter, Arial, sans-serif;
  font-size: clamp(13px,1.22vw,17px);
  line-height: 1.05;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -.35px;
  text-shadow: 0 1px 0 #000;
}
.player-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: #56545b;
  border: 1px solid var(--accent);
}
.player-photo { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center center; }
.photo-placeholder {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  gap: 7px;
  overflow: hidden;
  background: linear-gradient(145deg,rgba(213,172,247,.13),transparent 48%),radial-gradient(circle at 50% 22%,#47404e 0 17%,transparent 18%),radial-gradient(ellipse at 50% 98%,#2b2730 0 39%,transparent 40%),#64606a;
}
.photo-placeholder img { position: absolute; width: 74%; height: 74%; left: 13%; top: 13%; object-fit: contain; opacity: .05; filter: grayscale(1); }
.placeholder-initial { position: relative; color: rgba(255,255,255,.32); font-size: clamp(42px,5vw,72px); font-weight: 950; letter-spacing: -4px; }
.photo-placeholder small { position: relative; color: rgba(255,255,255,.7); font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .09em; }
.player-details { padding-top: 2px; }
.player-role, .player-function, .player-date { margin: 0; line-height: 1.2; }
.player-role {
  min-height: 14px;
  color: #fff;
  font-family: Inter, Arial, sans-serif;
  font-size: clamp(11px,1.02vw,13px);
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: -.2px;
}
.player-role .role-primary { color: #fff; }
.player-role .role-separator { color: #fff; }
.player-role .role-accent { color: var(--accent); }
.player-function, .player-date {
  color: #fff;
  font-size: clamp(10px,.9vw,12px);
  font-weight: 650;
}
.player-function strong, .player-date strong { color: var(--yellow); font-weight: 900; }
.empty-state { padding: 48px 20px; border: 1px dashed rgba(213,172,247,.25); border-radius: 15px; color: #aaa3b7; text-align: center; }

.site-footer {
  min-height: 106px;
  padding: 17px 28px;
  border-top: 1px solid rgba(255,255,255,.055);
  background: #08080c;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #aaa3b7;
}
.site-footer img { width: 54px; height: 54px; object-fit: contain; }
.site-footer div { display: grid; gap: 2px; }
.site-footer strong { color: #e6dcef; }
.site-footer span { font-size: .74rem; }

/* Modais e painel */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3,3,7,.84);
  backdrop-filter: blur(10px);
}
.modal-card {
  position: relative;
  width: min(100%,440px);
  padding: 34px;
  border: 1px solid rgba(213,172,247,.22);
  border-radius: 24px;
  background: linear-gradient(160deg,#1b1724,#0f0e16);
  box-shadow: 0 30px 100px rgba(0,0,0,.65);
}
.modal-logo { width: 74px; height: 74px; object-fit: contain; display: block; margin: 0 auto 10px; }
.login-modal { text-align: center; }
.modal-card h2 { margin: 6px 0 8px; font-family: Montserrat,Inter,sans-serif; font-size: 1.75rem; }
.modal-card p { color: #aaa3b7; line-height: 1.45; }
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #d5cde0;
  background: #282331;
  font-size: 1.5rem;
  cursor: pointer;
}
.modal-close.inline { position: static; flex: 0 0 auto; }
.field { display: grid; gap: 7px; text-align: left; }
.field > span { color: #cfc5db; font-size: .75rem; font-weight: 800; }
.field input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 11px;
  color: #fff;
  background: #0e0e16;
  outline: 0;
}
.field input[type="file"] { padding: 9px 10px; }
.field input:focus { border-color: var(--purple-strong); box-shadow: 0 0 0 3px rgba(157,85,232,.14); }
.field-help { color: #81798e; font-size: .68rem; line-height: 1.4; }
.login-modal .field { margin-top: 14px; }
.primary-button, .outline-button, .danger-button {
  min-height: 43px;
  padding: 0 16px;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 850;
}
.primary-button { border: 0; color: #fff; background: linear-gradient(135deg,#7e32b8,#a45dea); }
.primary-button:hover { filter: brightness(1.12); }
.primary-button.compact, .outline-button.compact { min-height: 38px; padding: 0 13px; }
.outline-button { border: 1px solid rgba(255,255,255,.13); color: #ded5e8; background: #191721; }
.danger-button { border: 1px solid rgba(255,62,91,.35); color: #ffb1bd; background: #37131b; }
.text-button { border: 0; padding: 0; background: transparent; cursor: pointer; font-weight: 800; }
.text-button.danger { color: #ff7187; }
.login-modal .primary-button { width: 100%; margin-top: 18px; }
.form-message { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; color: #b9ffc9; background: #142b1b; border: 1px solid #285f37; font-size: .79rem; }
.form-message.error { color: #ffc0c9; background: #34151b; border-color: #71313e; }

.admin-overlay { place-items: stretch; padding: 18px; }
.admin-shell {
  position: relative;
  width: min(100%,1500px);
  height: min(930px,calc(100vh - 36px));
  margin: auto;
  overflow: hidden;
  border: 1px solid rgba(213,172,247,.22);
  border-radius: 24px;
  background: #0d0d14;
  box-shadow: 0 35px 120px rgba(0,0,0,.72);
}
.admin-header {
  min-height: 104px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: linear-gradient(135deg,#181320,#11101a);
}
.admin-header h2 { margin: 4px 0 2px; font-family: Montserrat,Inter,sans-serif; font-size: 1.7rem; }
.admin-header p { margin: 0; color: #9e96aa; font-size: .82rem; }
.admin-header-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.admin-layout { height: calc(100% - 104px); display: grid; grid-template-columns: 360px 1fr; }
.admin-list-panel { min-width: 0; overflow: hidden; border-right: 1px solid rgba(255,255,255,.07); background: #111019; }
.admin-list-toolbar { padding: 14px; display: grid; grid-template-columns: 1fr auto; gap: 8px; border-bottom: 1px solid rgba(255,255,255,.06); }
.admin-list-toolbar input { min-width: 0; height: 40px; padding: 0 11px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; color: #fff; background: #0b0b11; }
.admin-player-list { height: calc(100% - 69px); overflow: auto; padding: 8px; }
.admin-player-item { width: 100%; display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 9px; border: 1px solid transparent; border-radius: 12px; color: #fff; background: transparent; text-align: left; cursor: pointer; }
.admin-player-item:hover, .admin-player-item.active { border-color: rgba(213,172,247,.2); background: #1a1723; }
.admin-player-avatar { width: 48px; height: 48px; border-radius: 9px; object-fit: cover; background: #312d38; }
.admin-player-fallback { display: grid; place-items: center; font-weight: 950; color: #cab2dc; }
.admin-player-item strong { display: block; font-size: .82rem; }
.admin-player-item small { display: block; margin-top: 2px; color: #8f879c; font-size: .67rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-player-item em { color: #827a8e; font-size: .67rem; font-style: normal; }
.player-form { min-width: 0; overflow: auto; padding: 24px 24px 110px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two-columns { grid-template-columns: repeat(2,minmax(0,1fr)); }
.player-form > .field, .player-form > .form-grid, .toggle-row, .photo-editor { margin-bottom: 16px; }
.toggle-row { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: #12111a; }
.toggle-field { display: flex; align-items: center; gap: 9px; color: #d1c8da; font-size: .8rem; font-weight: 750; }
.toggle-field input { width: 18px; height: 18px; accent-color: var(--purple-strong); }
.photo-editor { display: grid; grid-template-columns: 190px 1fr; gap: 18px; padding: 14px; border: 1px solid rgba(255,255,255,.08); border-radius: 15px; background: #111019; }
.photo-preview-wrap { width: 190px; aspect-ratio: 1/1; overflow: hidden; border: 1px solid rgba(213,172,247,.25); background: #292631; }
.photo-preview-wrap img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.photo-preview-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: #847d90; font-size: .75rem; }
.photo-editor-controls { display: grid; align-content: start; gap: 12px; }
.photo-editor-controls p { margin: 0; color: #8f879c; font-size: .72rem; line-height: 1.5; }
.photo-action-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.form-actions { display: grid; grid-template-columns: auto 1fr auto auto; gap: 9px; align-items: center; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.07); }
.confirm-modal h2 { margin-top: 0; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.toast { position: fixed; z-index: 2000; left: 50%; bottom: 28px; max-width: min(520px,calc(100% - 32px)); padding: 12px 16px; border: 1px solid rgba(213,172,247,.24); border-radius: 12px; color: #fff; background: #23192e; box-shadow: 0 18px 50px rgba(0,0,0,.5); opacity: 0; transform: translate(-50%,20px); pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

/* Editor de imagem */
.image-editor-overlay { z-index: 1300; }
.image-editor-dialog {
  width: min(100%,900px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid rgba(216,171,247,.24);
  border-radius: 22px;
  background: #0e0d15;
  box-shadow: 0 32px 110px rgba(0,0,0,.72);
}
.image-editor-header {
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: linear-gradient(135deg,#181320,#11101a);
}
.image-editor-header h2 { margin: 4px 0 2px; font-family: Montserrat,Inter,sans-serif; font-size: 1.45rem; }
.image-editor-header p { margin: 0; color: #9e96aa; font-size: .76rem; }
.image-editor-body { display: grid; grid-template-columns: minmax(330px,560px) 1fr; gap: 22px; padding: 20px; align-items: center; }
.crop-stage {
  position: relative;
  width: min(100%,560px);
  aspect-ratio: 1/1;
  margin: auto;
  overflow: hidden;
  border: 1px solid rgba(216,171,247,.28);
  background: #17151d;
  cursor: grab;
  touch-action: none;
}
.crop-stage.dragging { cursor: grabbing; }
.crop-stage canvas { width: 100%; height: 100%; display: block; }
.crop-guide { position: absolute; inset: 10%; pointer-events: none; border: 1px solid rgba(255,255,255,.26); box-shadow: 0 0 0 999px rgba(0,0,0,.08); }
.crop-guide::before, .crop-guide::after { content: ""; position: absolute; background: rgba(255,255,255,.17); }
.crop-guide::before { left: 33.333%; top: 0; bottom: 0; width: 1px; box-shadow: calc(100% + 33.333%) 0 0 rgba(255,255,255,.17); }
.crop-guide::after { top: 33.333%; left: 0; right: 0; height: 1px; box-shadow: 0 calc(100% + 33.333%) 0 rgba(255,255,255,.17); }
.image-editor-controls-panel { display: grid; gap: 18px; align-content: center; }
.range-field { display: grid; gap: 9px; color: #d7cfdf; font-size: .78rem; font-weight: 800; }
.range-field input { width: 100%; accent-color: var(--purple-strong); }
.editor-button-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.editor-button-grid button:last-child { grid-column: 1/-1; }
.editor-tip { margin: 0; color: #92899f; font-size: .72rem; line-height: 1.5; }
.image-editor-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 20px; border-top: 1px solid rgba(255,255,255,.07); background: #111019; }

@media (max-width: 850px) {
  .site-header, .header-inner { min-height: auto; }
  .header-inner { padding: 16px 0 20px; grid-template-columns: 88px 1fr 98px; gap: 12px; }
  .brand-logo, .brand-logo img { width: 82px; height: 82px; }
  .brand-center h1 { font-size: clamp(29px,6vw,44px); white-space: normal; margin-bottom: 15px; }
  .main-nav { gap: 27px; }
  .players-section { padding-top: 20px; }
  .players-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 36px 30px; }
  .admin-layout { grid-template-columns: 300px 1fr; }
  .image-editor-body { grid-template-columns: 1fr; }
  .image-editor-controls-panel { width: min(560px,100%); margin: auto; }
}
@media (max-width: 650px) {
  .header-inner { width: min(calc(100% - 28px),var(--content)); grid-template-columns: 72px 1fr; grid-template-areas: "logo actions" "center center"; }
  .brand-logo { grid-area: logo; }
  .brand-logo, .brand-logo img { width: 70px; height: 70px; }
  .brand-center { grid-area: center; transform: none; }
  .brand-center h1 { font-size: clamp(27px,9vw,39px); }
  .header-actions { grid-area: actions; }
  .players-section { width: min(calc(100% - 28px),var(--content)); }
  .players-toolbar { position: static; grid-template-columns: 1fr; }
  .filter-chips { justify-content: flex-start; }
  .toolbar-meta { grid-column: auto; justify-content: flex-start; }
  .admin-overlay { padding: 0; }
  .admin-shell { width: 100%; height: 100vh; border: 0; border-radius: 0; }
  .admin-header { min-height: 132px; align-items: flex-start; }
  .admin-layout { height: calc(100% - 132px); grid-template-columns: 1fr; grid-template-rows: 250px 1fr; }
  .admin-list-panel { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.07); }
  .form-grid.two-columns { grid-template-columns: 1fr; }
  .photo-editor { grid-template-columns: 1fr; }
  .photo-preview-wrap { width: min(230px,100%); }
  .form-actions { grid-template-columns: 1fr 1fr; }
  .form-actions span { display: none; }
  .image-editor-overlay { padding: 0; }
  .image-editor-dialog { max-height: 100vh; height: 100vh; border: 0; border-radius: 0; }
}
@media (max-width: 500px) {
  .players-grid { grid-template-columns: 1fr; }
  .player-card { width: min(330px,100%); margin: 0 auto; }
  .section-heading h2 { font-size: 31px; }
  .admin-header-actions .outline-button { display: none; }
  .player-form { padding: 17px; }
}

/* =========================================================
   V4 · ORDEM, MOLDURAS, INFORMAÇÕES EXTRAS E FOTO HD
   ========================================================= */
.player-photo-wrap {
  --player-border-color: transparent;
  --player-border-width: 0px;
  --player-border-radius: 0px;
  --player-frame-shadow: none;
  border: var(--player-border-width) solid var(--player-border-color);
  border-radius: var(--player-border-radius);
  box-shadow: var(--player-frame-shadow);
  isolation: isolate;
}
.player-photo-wrap.frame-none { border-color: transparent !important; box-shadow: none !important; }
.player-photo-wrap.frame-double { border-style: double; }
.player-photo-wrap.frame-neon {
  box-shadow: 0 0 8px color-mix(in srgb,var(--player-border-color) 88%,transparent),
              0 0 19px color-mix(in srgb,var(--player-border-color) 48%,transparent),
              inset 0 0 9px color-mix(in srgb,var(--player-border-color) 26%,transparent);
}
.player-photo-wrap.frame-premium::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 5px;
  pointer-events: none;
  border: 1px solid color-mix(in srgb,var(--player-border-color) 78%,white 22%);
  border-radius: max(0px,calc(var(--player-border-radius) - 4px));
  box-shadow: inset 0 0 10px rgba(255,255,255,.08);
}
.player-photo {
  image-rendering: auto;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.player-extra {
  margin: 1px 0 0;
  min-height: 13px;
  color: var(--extra-color,#fff);
  font-family: Inter,Arial,sans-serif;
  font-size: clamp(10px,.9vw,12px);
  line-height: 1.18;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 1px 0 #000;
}

.order-manager {
  margin: 10px 10px 0;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(213,172,247,.16);
  border-radius: 11px;
  background: #17131f;
}
.order-manager div { min-width: 0; }
.order-manager strong { display: block; color: #fff; font-size: .75rem; }
.order-manager small { display: block; margin-top: 2px; color: #948a9f; font-size: .63rem; line-height: 1.3; }
.order-help { margin: 7px 12px 8px; color: #817888; font-size: .62rem; line-height: 1.35; }
.admin-player-list { height: calc(100% - 166px); }
.admin-player-item {
  grid-template-columns: 24px 46px minmax(0,1fr) auto auto;
  user-select: none;
}
.admin-player-item.dragging { opacity: .42; border-color: #d5acf7; }
.admin-player-item.drag-over { border-color: #a84ce6; background: #24172f; transform: translateY(1px); }
.drag-handle {
  height: 38px;
  display: grid;
  place-items: center;
  color: #72697c;
  font-size: 18px;
  cursor: grab;
  touch-action: none;
}
.drag-handle:active { cursor: grabbing; }
.admin-item-actions { display: grid; grid-template-columns: repeat(2,24px); gap: 3px; }
.admin-move-button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  color: #bcb1c7;
  background: #0d0c13;
  cursor: pointer;
  font-size: 11px;
}
.admin-move-button:hover { color: #fff; border-color: rgba(213,172,247,.35); background: #22172c; }
.admin-player-item em { min-width: 32px; text-align: right; }

.inline-input-action { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.color-input-row { display: grid; grid-template-columns: 48px 1fr; gap: 8px; }
.color-picker {
  width: 48px !important;
  min-width: 48px;
  padding: 3px !important;
  cursor: pointer;
}
.frame-editor {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 15px;
  background: #111019;
}
.frame-editor-heading {
  margin-bottom: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.frame-editor-heading strong { display: block; color: #fff; font-size: .84rem; }
.frame-editor-heading span { display: block; margin-top: 3px; color: #91889c; font-size: .69rem; }
.frame-color-preview {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border: 3px solid #fff;
  background: linear-gradient(145deg,#4d4655,#2c2931);
}
.form-grid.four-columns { grid-template-columns: repeat(4,minmax(0,1fr)); }
.field select {
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 10px;
  color: #fff;
  background: #0b0b11;
  outline: none;
}
.border-presets { margin-top: 12px; display: flex; gap: 7px; flex-wrap: wrap; }
.border-presets button {
  position: relative;
  padding: 7px 10px 7px 24px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: #ddd5e4;
  background: #0d0c13;
  cursor: pointer;
  font-size: .67rem;
  font-weight: 800;
}
.border-presets button:not([data-border-off])::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--preset);
  transform: translateY(-50%);
  box-shadow: 0 0 8px var(--preset);
}
.border-presets button:hover { border-color: rgba(213,172,247,.35); }
.photo-preview-wrap {
  --preview-border-color: rgba(213,172,247,.25);
  --preview-border-width: 1px;
  --preview-radius: 0px;
  border: var(--preview-border-width) solid var(--preview-border-color);
  border-radius: var(--preview-radius);
  box-shadow: var(--preview-shadow,none);
}
.photo-preview-wrap.preview-double { border-style: double; }
.photo-preview-wrap.preview-neon { box-shadow: 0 0 14px color-mix(in srgb,var(--preview-border-color) 55%,transparent); }
.photo-preview-wrap.preview-premium { outline: 1px solid color-mix(in srgb,var(--preview-border-color) 55%,white 45%); outline-offset: -7px; }

.image-editor-controls-panel .field { margin: 0; }
.editor-button-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.editor-button-grid button:last-child { grid-column: auto; }

@media (max-width: 1100px) {
  .form-grid.four-columns { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 650px) {
  .order-manager { align-items: flex-start; flex-direction: column; }
  .admin-player-list { height: calc(100% - 206px); }
  .form-grid.four-columns { grid-template-columns: 1fr; }
  .admin-player-item { grid-template-columns: 22px 42px minmax(0,1fr) auto; }
  .admin-item-actions { display: none; }
}
.admin-player-main {
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.admin-player-main strong { display: block; color: #fff; font-size: .82rem; }
.admin-player-main small { display: block; margin-top: 2px; color: #8f879c; font-size: .65rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-card.developer { --accent: #ff6a00; }
.player-card.developer .role-primary { color: var(--accent); }
.player-card.developer .role-accent { color: #fff; }


/* ==================== V5 · RODAPÉ, CONFIGURAÇÕES E PROPORÇÕES ==================== */
:root {
  --site-brand-size: 62px;
  --site-section-title-size: 48px;
  --site-section-subtitle-size: 18px;
  --site-footer-title-size: 24px;
  --site-footer-subtitle-size: 15px;
  --site-footer-logo-size: 500px;
}
.brand-center h1 { font-size: clamp(30px, var(--site-brand-size), 82px); }
.brand-center h1 .brand-prefix { color: #fff; }
.section-heading h2 { font-size: clamp(26px, var(--site-section-title-size), 72px); }
.section-heading p { font-size: clamp(12px, var(--site-section-subtitle-size), 30px); }

.site-footer {
  min-height: 650px;
  padding: 92px 20px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  background: #09090f;
  border-top: 0;
  text-align: center;
}
.footer-logo-stage { width: 100%; display: grid; place-items: center; }
.site-footer .footer-logo-stage img {
  width: min(var(--site-footer-logo-size), 78vw);
  height: auto;
  max-height: 590px;
  object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(137,70,255,.18));
}
.footer-copy { display: grid; gap: 7px; justify-items: center; }
.footer-copy strong { color: #fff; font-size: var(--site-footer-title-size); font-family: Montserrat,Inter,sans-serif; }
.footer-copy span { color: #a7a0b2; font-size: var(--site-footer-subtitle-size); }

.site-settings-card {
  margin: 0 20px 18px;
  border: 1px solid rgba(213,172,247,.16);
  border-radius: 16px;
  background: linear-gradient(180deg,rgba(30,20,43,.94),rgba(16,14,23,.96));
  overflow: hidden;
}
.site-settings-card summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; cursor: pointer; list-style: none; color: #fff; font-weight: 850;
}
.site-settings-card summary::-webkit-details-marker { display:none; }
.site-settings-card summary small { color:#9d91aa; font-size:.7rem; font-weight:600; }
.site-settings-card[open] summary { border-bottom:1px solid rgba(255,255,255,.07); }
.site-settings-grid { padding: 17px 18px 6px; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.site-settings-grid .settings-wide { grid-column: span 2; }
.site-settings-actions { display:flex; justify-content:flex-end; gap:9px; padding:10px 18px 18px; }
.size-control { display:grid; grid-template-columns:1fr 58px; align-items:center; gap:10px; }
.size-control output { color:#d9b8f5; font-size:.72rem; font-weight:800; text-align:right; }

.saved-photo-ratio { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border:1px solid rgba(213,172,247,.16); border-radius:11px; background:#0d0c13; }
.saved-photo-ratio span { color:#9e96aa; font-size:.72rem; }
.saved-photo-ratio strong { color:#fff; font-family:Montserrat,Inter,sans-serif; }
.custom-ratio-fields { display:grid; grid-template-columns:1fr auto 1fr; align-items:end; gap:8px; }
.custom-ratio-fields > span { padding-bottom:10px; color:#d5acf7; font-weight:900; }
.custom-ratio-fields .field { margin:0; }
.crop-stage { aspect-ratio: var(--editor-aspect-ratio,1/1); max-height: 620px; width: 100%; justify-self:center; }
.photo-preview-wrap { aspect-ratio: var(--preview-photo-ratio,1/1); }
.player-photo-wrap { aspect-ratio: var(--player-photo-ratio,1/1); }

@media (max-width: 900px) {
  .site-settings-grid { grid-template-columns:1fr 1fr; }
  .site-settings-grid .settings-wide { grid-column:1/-1; }
  .site-footer { min-height:520px; padding-top:70px; }
}
@media (max-width: 620px) {
  .site-settings-grid { grid-template-columns:1fr; }
  .site-settings-grid .settings-wide { grid-column:auto; }
  .site-settings-card summary { align-items:flex-start; flex-direction:column; }
  .site-settings-actions { flex-direction:column-reverse; }
  .site-footer { min-height:430px; padding:52px 12px 34px; }
}


/* =========================================================
   V5.1 · SALVAMENTO SEMPRE VISÍVEL
   ========================================================= */
.admin-save-dock {
  position: absolute;
  right: 28px;
  bottom: 22px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100% - 420px);
  padding: 9px 10px 9px 15px;
  border: 1px solid rgba(213,172,247,.34);
  border-radius: 16px;
  background: rgba(15,13,22,.94);
  box-shadow: 0 16px 46px rgba(0,0,0,.58), 0 0 28px rgba(157,85,232,.12);
  backdrop-filter: blur(14px);
}
.admin-save-dock span {
  color: #aaa1b6;
  font-size: .74rem;
  font-weight: 800;
  white-space: nowrap;
}
.admin-save-dock.dirty {
  border-color: rgba(255,215,80,.48);
  box-shadow: 0 16px 46px rgba(0,0,0,.58), 0 0 28px rgba(255,207,62,.12);
}
.admin-save-dock.dirty span { color: #ffe173; }
.save-player-button {
  min-width: 190px;
  padding-inline: 22px;
  font-family: Montserrat,Inter,sans-serif;
  font-size: .82rem;
  font-weight: 950;
  letter-spacing: .02em;
  text-transform: uppercase;
  box-shadow: 0 8px 24px rgba(133,50,190,.28);
}
.save-player-button:disabled { opacity: .62; cursor: wait; }
.photo-save-reminder {
  margin: 0 !important;
  padding: 10px 12px;
  border: 1px solid rgba(89,255,132,.3);
  border-radius: 10px;
  color: #bfffcf !important;
  background: rgba(22,67,35,.44);
  font-size: .73rem !important;
  font-weight: 750;
}
.photo-save-reminder strong { color: #ffffff; }

@media (max-width: 850px) {
  .admin-save-dock { max-width: calc(100% - 340px); right: 18px; bottom: 14px; }
  .admin-save-dock span { display: none; }
}
@media (max-width: 650px) {
  .player-form { padding: 17px 17px 98px; }
  .admin-save-dock {
    left: 12px;
    right: 12px;
    bottom: 10px;
    max-width: none;
    padding: 8px;
    border-radius: 14px;
  }
  .admin-save-dock .save-player-button { width: 100%; min-width: 0; }
}
