:root {
  color-scheme: dark;
  --bg: #090b0e;
  --panel: #12161b;
  --panel-2: #171c22;
  --line: #2a3139;
  --text: #f4f6f8;
  --muted: #9aa5b1;
  --gold: #d71920;
  --red: #d84a4a;
  --green: #39b56a;
  --blue: #e8edf2;
  --ink: #0c0e10;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(215, 25, 32, 0.22), transparent 28%),
    linear-gradient(180deg, #11161b 0%, var(--bg) 360px),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 42px) 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 11, 14, 0.78);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 280px;
  width: min(1180px, 74vw);
}

.site-logo {
  display: block;
  width: 100%;
  max-height: 210px;
  object-fit: contain;
  object-position: left center;
}

.site-logo-fallback {
  color: var(--text);
  font-size: clamp(2.2rem, 7vw, 5rem);
  font-weight: 950;
  letter-spacing: 0;
}

.brand-mark,
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(215, 25, 32, 0.75);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(215, 25, 32, 0.95), rgba(216, 74, 74, 0.9)),
    var(--gold);
  color: var(--ink);
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.brand h1,
.section-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand p,
.section-heading p {
  margin: 3px 0 0;
  color: var(--muted);
}

.login-form,
.user-panel {
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-form label {
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: var(--panel);
  color: var(--text);
}

.login-form button,
.user-panel button,
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
}

.login-form button {
  background: var(--gold);
  color: var(--text);
  border-color: var(--gold);
  font-weight: 800;
}

.register-link {
  color: var(--gold);
  font-size: 0.85rem;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}

.register-link:hover {
  border-bottom-color: var(--gold);
}

.login-message {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  flex: 1 0 100%;
  min-height: 1.1em;
}

.login-message[data-kind="error"] {
  color: #ff8a8a;
}

.login-message[data-kind="success"] {
  color: #8df0a4;
}

.register-topbar {
  justify-content: flex-start;
}

.register-brand {
  display: inline-flex;
  text-decoration: none;
}

.register-view {
  display: flex;
  justify-content: center;
  padding: 30px 0;
}

.register-card {
  width: min(520px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px clamp(18px, 4vw, 30px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

.register-card h1 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  letter-spacing: 0.02em;
}

.register-intro {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.register-field {
  display: grid;
  gap: 5px;
}

.register-field span {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.register-field input,
.register-field select {
  width: 100%;
  box-sizing: border-box;
}

.register-submit {
  margin-top: 6px;
  min-height: 44px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  background: var(--gold);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.04em;
}

.register-submit:hover {
  filter: brightness(1.05);
}

.register-message {
  margin: 0;
  min-height: 1.1em;
  font-size: 0.9rem;
  color: var(--muted);
}

.register-message[data-kind="error"] {
  color: #ff8a8a;
}

.register-message[data-kind="success"] {
  color: #8df0a4;
}

.register-login-link {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.9rem;
}

.register-login-link a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}

.register-login-link a:hover {
  border-bottom-color: var(--gold);
}

.hidden,
.view {
  display: none;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 26px clamp(14px, 4vw, 42px) 50px;
}

.news-ticker {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin: 0 0 10px;
  border: 1px solid rgba(255, 212, 84, 0.28);
  border-radius: 6px;
  background: rgba(5, 8, 12, 0.88);
  overflow: hidden;
}

.news-ticker.hidden {
  display: none;
}

.news-ticker-label {
  flex: 0 0 auto;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  background: var(--gold);
  color: #111;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
  z-index: 1;
}

.news-ticker-window {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.news-ticker-track {
  display: flex;
  align-items: center;
  width: max-content;
  will-change: transform;
  animation: news-ticker-scroll 160s linear infinite;
}

.news-ticker-window:hover .news-ticker-track {
  animation-play-state: paused;
}

@keyframes news-ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.news-ticker-group {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
  padding-right: 42px;
}

.news-ticker-item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.news-ticker-item time {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.news-ticker-item span {
  white-space: nowrap;
}

.controls,
.promotion-card,
.match-card,
.news-editor-form,
.news-card,
.season-panel,
.database-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 22, 27, 0.9);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px 16px;
  margin: 18px 0;
  padding: 10px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 0 100%;
  width: 100%;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}

.tab.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--text);
  font-weight: 800;
}

.forum-tab-link {
  margin-left: auto;
}

.search-box,
.period-box,
.week-box {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.search-box input {
  width: min(330px, 42vw);
}

.period-box select {
  width: 150px;
}

.week-box select {
  width: 200px;
}

.week-box select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(9, 11, 14, 0.82);
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 18px clamp(14px, 4vw, 42px);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.site-footer nav,
.trust-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.site-footer a,
.trust-nav a,
.trust-page a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}

.site-footer a:hover,
.trust-nav a:hover,
.trust-page a:hover {
  border-bottom-color: var(--gold);
}

.trust-shell {
  max-width: 980px;
}

.trust-nav {
  margin: 8px 0 18px;
  padding: 10px 0 16px;
  border-bottom: 1px solid var(--line);
}

.trust-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}

.trust-nav a.active {
  color: var(--text);
  border-bottom-color: var(--gold);
  font-weight: 800;
}

.trust-page {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 22, 27, 0.9);
  padding: clamp(20px, 4vw, 36px);
}

.trust-kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trust-page h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.trust-page h2 {
  margin: 28px 0 8px;
  font-size: 1.15rem;
}

.trust-page p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.trust-page .trust-updated {
  color: var(--text);
  font-size: 0.9rem;
}

.contact-panel {
  display: grid;
  gap: 4px;
  margin: 22px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.contact-panel span {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contact-panel a {
  font-size: 1.15rem;
  font-weight: 800;
}

.active-view {
  display: block;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 16px;
}

.add-wrestler-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 22, 27, 0.88);
}

.add-wrestler-row input,
.add-wrestler-row select {
  width: 100%;
  min-width: 0;
}

.add-wrestler-row button {
  min-height: 40px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--gold);
  color: var(--text);
  font-weight: 850;
  white-space: nowrap;
}

.add-wrestler-message {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: -2px 2px 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.load-more-rankings {
  display: block;
  width: fit-content;
  margin: 12px auto 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}

.load-more-rankings.hidden {
  display: none;
}

.promotion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.promotion-card {
  overflow: hidden;
}

.promotion-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--line);
}

.promotion-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.promotion-card h2 {
  margin: 0;
  font-size: 1rem;
}

.promotion-logo {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: inset 0 -10px 20px rgba(0, 0, 0, 0.18);
}

.logo-aew {
  background: linear-gradient(135deg, #111, #c9a334);
  color: #fff7ce;
}

.logo-roh {
  background: linear-gradient(135deg, #101010, #b7192f);
}

.logo-wwe {
  background: linear-gradient(135deg, #f2f2f2, #cf1f2f);
  color: #111;
}

.logo-wcw {
  background: linear-gradient(135deg, #163f8f, #d7b65d);
  color: #fff;
}

.logo-nxt {
  background: linear-gradient(135deg, #111, #d71920);
  color: #f7f7f7;
}

.logo-njpw {
  background: linear-gradient(135deg, #d71920, #111);
}

.logo-tna {
  background: linear-gradient(135deg, #0b4ea2, #f33f2d);
}

.logo-cmll {
  background: linear-gradient(135deg, #006847, #ce1126);
}

.logo-aaa {
  background: linear-gradient(135deg, #111, #26a65b 45%, #ce1126);
}

.logo-independent {
  background: linear-gradient(135deg, #343b43, #5ab2ff);
  color: #0c0e10;
}

.promotion-badge {
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(215, 25, 32, 0.13);
  color: var(--gold);
  font-weight: 800;
  font-size: 0.78rem;
}

.week-badge {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.promotion-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.promotion-add-form input,
.promotion-add-form button {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.promotion-add-form input {
  width: 100%;
  padding: 7px 8px;
  background: rgba(5, 8, 12, 0.85);
  color: var(--text);
}

.promotion-add-form button {
  padding: 7px 10px;
  background: var(--gold);
  color: #111;
  font-weight: 900;
  cursor: pointer;
}

.promotion-add-form input:disabled,
.promotion-add-form button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.promotion-add-message {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.82rem;
  min-height: 1.1em;
  color: var(--muted);
}

.promotion-add-message.success {
  color: #8df0a4;
}

.promotion-add-message.error {
  color: #ff8a8a;
}

.editor-wrestler-tools {
  grid-column: 3 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
}

.editor-wrestler-tools select,
.editor-rank-control select,
.user-rank-editor-control input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 7px;
  background: rgba(5, 8, 12, 0.9);
  color: var(--text);
  font: inherit;
  font-size: 0.72rem;
}

.editor-rank-control {
  display: grid;
  gap: 3px;
  min-width: 58px;
}

.editor-rank-control span,
.user-rank-editor-control span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.user-rank-editor-control {
  grid-column: 5;
  display: grid;
  gap: 3px;
  min-width: 72px;
}

/* Quick-jump buttons (Top / Bottom) shown next to the editor rank input. */
.user-rank-quick-actions {
  grid-column: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
}

.user-rank-quick-actions button {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}

.user-rank-quick-actions button:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.user-rank-quick-actions button:active {
  transform: translateY(0);
}

/* Drag handle column shown only in editor mode. */
.user-rank-drag-handle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  color: var(--muted);
  font-size: 1.05rem;
  cursor: grab;
  user-select: none;
}

body.user-rank-editor-mode .user-rank-row .user-rank-drag-handle {
  display: flex;
}

body.user-rank-editor-mode .user-rank-row[draggable="true"] {
  cursor: grab;
}

body.user-rank-editor-mode .user-rank-row.dragging {
  opacity: 0.45;
  cursor: grabbing;
}

body.user-rank-editor-mode .user-rank-row.drag-over-above {
  box-shadow: inset 0 3px 0 0 var(--gold);
}

body.user-rank-editor-mode .user-rank-row.drag-over-below {
  box-shadow: inset 0 -3px 0 0 var(--gold);
}

/* Briefly flash the row after a booker edit so the move is unmistakable. */
.user-rank-row.just-edited {
  animation: just-edited-flash 1.2s ease-out;
}

@keyframes just-edited-flash {
  0%   { background: rgba(243, 179, 44, 0.32); box-shadow: inset 0 0 0 2px var(--gold); }
  60%  { background: rgba(243, 179, 44, 0.18); box-shadow: inset 0 0 0 2px rgba(243, 179, 44, 0.5); }
  100% { background: transparent; box-shadow: none; }
}

.editor-details-panel {
  grid-column: 3 / -1;
  min-width: 0;
}

.editor-details-panel summary {
  width: fit-content;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

.editor-details-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 8, 12, 0.62);
}

.editor-details-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.editor-details-form fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.editor-details-form legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.editor-details-form span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.editor-details-form input,
.editor-details-form select,
.editor-details-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  background: rgba(5, 8, 12, 0.9);
  color: var(--text);
  font: inherit;
  font-size: 0.74rem;
}

.editor-details-form textarea {
  resize: vertical;
}

.editor-details-wide,
.editor-details-form button {
  grid-column: 1 / -1;
}

.editor-details-form button {
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--gold);
  color: #111;
  font-weight: 950;
  cursor: pointer;
}

.ranking-list {
  display: grid;
  gap: 0;
  padding: 0 8px;
}

.large-list {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 22, 27, 0.9);
  overflow: hidden;
}

.rank-row {
  display: grid;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
  cursor: pointer;
}

.user-rank-row {
  grid-template-columns: 52px 58px minmax(0, 1fr) 74px 82px;
}

/* When the booker is editing, prepend a drag-handle column so the grid still
   has 5 named tracks for the existing children (#52, #58, 1fr, #74, #82). */
body.user-rank-editor-mode .user-rank-row {
  grid-template-columns: 24px 52px 58px minmax(0, 1fr) 74px 82px;
}

body.user-rank-editor-mode .user-rank-row .user-rank-editor-control,
body.user-rank-editor-mode .user-rank-row .user-rank-quick-actions {
  grid-column: 6;
}

.editor-rank-row {
  grid-template-columns: 38px 50px minmax(0, 1fr) 62px;
  min-height: 94px;
  gap: 10px;
  padding: 10px 6px;
}

.editor-rank-info {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}

.editor-rank-row .avatar {
  width: 50px;
  height: 50px;
  font-size: 0.86rem;
}

.editor-rank-row .wrestler-name {
  width: 100%;
  font-size: 1.18rem;
  line-height: 1.08;
}

.editor-rank-row .wrestler-name-text {
  flex: 0 1 auto;
  min-width: auto;
  overflow: visible;
  text-overflow: clip;
}

.editor-title-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.editor-rank-row .wrestler-meta {
  align-self: start;
  font-size: 0.54rem;
  gap: 3px;
  margin-top: 1px;
  line-height: 1.15;
}

.editor-rank-row .title-holder-tag,
.editor-rank-row .injury-tag,
.editor-rank-row .out-action-tag,
.editor-rank-row .comeback-tag,
.editor-rank-row .jumped-promotion-tag,
.editor-rank-row .new-signing-tag,
.editor-rank-row .retired-tag,
.editor-rank-row .deceased-tag,
.editor-rank-row .hot-tag {
  max-width: 100%;
  padding: 2px 5px;
  font-size: 0.5rem;
  line-height: 1.2;
}

.editor-rank-row .editor-rank-control {
  align-self: center;
  grid-column: 4;
}

.editor-rank-row .editor-wrestler-tools {
  grid-column: 3 / -1;
}

.rank-row:last-child {
  border-bottom: 0;
}

.rank-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.rank-number {
  color: var(--gold);
  font-weight: 900;
  text-align: center;
}

.rank-row > div {
  min-width: 0;
}

.avatar {
  width: 54px;
  height: 54px;
  font-size: 0.96rem;
  border-radius: 6px;
  box-shadow: none;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(215, 25, 32, 0.32), rgba(255, 255, 255, 0.08)),
    #11161b;
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wrestler-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 850;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  white-space: nowrap;
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.wrestler-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-delta {
  display: inline-block;
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  vertical-align: middle;
  line-height: 1.5;
  border: 1px solid transparent;
}

.rank-delta.up {
  color: #07210f;
  background: #5fe39a;
  border-color: rgba(95, 227, 154, 0.5);
}

.rank-delta.down {
  color: #2a0808;
  background: #ff8a8a;
  border-color: rgba(255, 138, 138, 0.5);
}

.rank-delta.same {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.rank-delta.new {
  color: #062213;
  background: #42d77d;
  border-color: rgba(66, 215, 125, 0.55);
}

body.mobile .rank-delta {
  font-size: 0.66rem;
  padding: 1px 5px;
  margin-left: 4px;
}

.wrestler-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.style-pill {
  color: var(--blue);
}

.title-holder-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(255, 212, 84, 0.62);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255, 212, 84, 0.14);
  color: #ffd454;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.injury-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(255, 188, 66, 0.48);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255, 188, 66, 0.12);
  color: #ffbc42;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.out-action-tag,
.comeback-tag,
.jumped-promotion-tag,
.new-signing-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.out-action-tag {
  border: 1px solid rgba(255, 112, 112, 0.58);
  background: rgba(255, 112, 112, 0.13);
  color: #ff7070;
}

.comeback-tag {
  border: 1px solid rgba(123, 191, 255, 0.62);
  background: rgba(123, 191, 255, 0.13);
  color: #7bbfff;
}

.jumped-promotion-tag {
  border: 1px solid rgba(78, 205, 196, 0.62);
  background: rgba(78, 205, 196, 0.13);
  color: #4ecdc4;
}

.new-signing-tag {
  border: 1px solid rgba(141, 240, 164, 0.58);
  background: rgba(141, 240, 164, 0.12);
  color: #8df0a4;
}

.retired-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(74, 163, 255, 0.62);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(74, 163, 255, 0.16);
  color: #4aa3ff;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.deceased-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 4px 10px;
  background: #000;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.hot-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(255, 140, 0, 0.7);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 140, 0, 0.15);
  color: #ff8c00;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.vote-count {
  display: grid;
  gap: 1px;
  justify-items: end;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.vote-count strong {
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
}

.vote-buttons {
  display: grid;
  grid-template-columns: 36px 36px;
  gap: 6px;
}

.rank-lock {
  min-width: 78px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 9px;
  color: var(--muted);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
}

.vote {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

.vote.requires-login {
  opacity: 0.78;
}

.vote-login-prompt {
  position: fixed;
  right: clamp(14px, 4vw, 42px);
  bottom: 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(520px, calc(100vw - 28px));
  border: 1px solid rgba(215, 25, 32, 0.65);
  border-radius: 8px;
  padding: 14px;
  background: rgba(18, 22, 27, 0.98);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
}

.vote-login-prompt.hidden {
  display: none;
}

.vote-login-prompt strong {
  display: block;
  margin-bottom: 3px;
}

.vote-login-prompt p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.vote-login-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.vote-login-actions button,
.vote-login-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 0 12px;
  background: var(--gold);
  color: var(--text);
  font-weight: 850;
  text-decoration: none;
}

.vote-login-actions a {
  background: transparent;
  color: var(--gold);
}

.vote-limit-popup {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 30;
  width: min(460px, calc(100vw - 28px));
  transform: translate(-50%, 18px);
  border: 1px solid rgba(215, 25, 32, 0.78);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(18, 22, 27, 0.98);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.vote-limit-popup.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.vote-limit-popup strong {
  display: block;
  color: var(--gold);
  margin-bottom: 4px;
}

.vote-limit-popup p {
  margin: 0;
  color: var(--text);
  font-size: 0.93rem;
  line-height: 1.45;
}

.profile-topbar {
  justify-content: center;
}

.profile-brand {
  width: min(980px, 90vw);
  min-width: 0;
}

.profile-view {
  display: grid;
  gap: 18px;
}

.profile-hero,
.profile-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 22, 27, 0.92);
}

.profile-hero {
  display: grid;
  grid-template-columns: minmax(130px, 220px) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 34px);
  align-items: center;
  padding: clamp(18px, 4vw, 34px);
}

.profile-photo {
  display: grid;
  place-items: center;
  width: min(220px, 42vw);
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(215, 25, 32, 0.42), rgba(255, 255, 255, 0.08)),
    #11161b;
  color: var(--text);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 950;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-hero h1 {
  margin: 8px 0;
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: 0.95;
}

.profile-aliases {
  margin: -2px 0 8px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.profile-aliases span {
  display: inline-block;
  margin-right: 8px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-promotion {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.profile-promotion-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-promotion .promotion-logo {
  width: 42px;
  height: 30px;
  font-size: 0.7rem;
}

.profile-hero p,
.profile-panel p {
  color: var(--muted);
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.profile-tags span,
.profile-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.85rem;
  text-decoration: none;
}

.profile-tags .injury-tag {
  border-color: rgba(255, 188, 66, 0.48);
  color: #ffbc42;
}

.profile-tags .out-action-tag {
  border-color: rgba(255, 112, 112, 0.58);
  color: #ff7070;
}

.profile-tags .comeback-tag {
  border-color: rgba(123, 191, 255, 0.62);
  color: #7bbfff;
}

.profile-tags .jumped-promotion-tag {
  border-color: rgba(78, 205, 196, 0.62);
  color: #4ecdc4;
}

.profile-tags .new-signing-tag {
  border-color: rgba(141, 240, 164, 0.58);
  color: #8df0a4;
}

.profile-tags .title-holder-tag {
  border-color: rgba(255, 212, 84, 0.62);
  background: rgba(255, 212, 84, 0.14);
  color: #ffd454;
}

.profile-tags .retired-tag {
  border-color: rgba(74, 163, 255, 0.62);
  color: #4aa3ff;
}

.profile-tags .deceased-tag {
  border-color: rgba(255, 255, 255, 0.72);
  color: #fff;
}

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

.title-history-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.title-history-row strong,
.title-history-row span,
.title-history-row a {
  display: block;
}

.title-history-row strong {
  color: var(--text);
}

.title-history-row span,
.title-history-row p,
.title-history-row a {
  color: var(--muted);
  font-size: 0.84rem;
}

.title-history-row p {
  margin: 8px 0 0;
}

.title-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.title-history-meta span,
.title-history-meta a {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  padding: 4px 8px;
  text-decoration: none;
}

.profile-link {
  display: inline-flex;
  margin-bottom: 6px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.profile-panel {
  padding: 18px;
  overflow: auto;
}

.profile-panel h2 {
  margin: 0 0 12px;
}

.profile-editor-panel {
  padding: clamp(14px, 3vw, 22px);
}

.profile-editor-message {
  grid-column: 1 / -1;
  min-height: 1.2em;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.profile-editor-message[data-kind="error"] {
  color: #ff8b8b;
}

.editor-tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.editor-tag-option {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.editor-tag-option input {
  width: auto;
  min-width: 16px;
  margin: 0;
  accent-color: var(--gold);
}

.editor-tag-option span {
  color: var(--text);
  font-size: 0.74rem;
  text-transform: none;
}

/* ── Structured title history editor ─────────────────────────────────────── */
.editor-section-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.title-history-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.title-entry-row {
  background: var(--card-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 8px;
  padding: 12px;
  position: relative;
}

.title-entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.title-entry-full {
  grid-column: 1 / -1;
}

.title-entry-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.title-entry-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

.remove-title-entry {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,0.15));
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 7px;
}

.remove-title-entry:hover {
  background: rgba(255, 100, 100, 0.15);
  color: #ff8b8b;
}

.add-title-entry-btn {
  background: transparent;
  border: 1px dashed var(--border, rgba(255,255,255,0.2));
  border-radius: 6px;
  color: var(--gold, #c9a84c);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 7px 14px;
  width: 100%;
  margin-bottom: 4px;
  transition: background 0.15s;
}

.add-title-entry-btn:hover {
  background: rgba(201, 168, 76, 0.1);
}

.bio-source {
  display: inline-flex;
  margin-top: 8px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.bio-source:hover {
  text-decoration: underline;
}

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

.profile-stat-grid div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.profile-stat-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.profile-stat-grid strong {
  display: block;
  margin-top: 4px;
}

.profile-secondary-title-stat {
  grid-column: 1 / -1;
}

.profile-secondary-title-stat strong {
  line-height: 1.45;
}

.profile-vote-title {
  margin-top: 22px;
}

.profile-rank-averages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.profile-rank-average {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.profile-rank-average span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-rank-average strong {
  display: block;
  margin-top: 6px;
  font-size: 1.35rem;
}

.profile-promotion-history {
  display: grid;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.profile-promotion-history-row {
  display: grid;
  grid-template-columns: minmax(92px, 1.4fr) repeat(3, minmax(48px, 0.65fr));
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.profile-promotion-history-row:first-child {
  border-top: 0;
}

.profile-promotion-history-header {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-promotion-history-row span:first-child {
  color: var(--muted);
  font-weight: 800;
}

.profile-promotion-history-row strong,
.profile-promotion-history-row span:not(:first-child) {
  text-align: right;
}

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

.stable-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
  display: grid;
  gap: 6px;
}

.stable-row-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stable-row-header strong {
  color: var(--text);
  font-size: 0.95rem;
}

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

.stable-row-meta span {
  color: var(--muted);
  font-size: 0.84rem;
}

.stable-row-meta span + span::before {
  content: "·";
  margin-right: 8px;
  opacity: 0.4;
}

.stable-members {
  color: var(--muted);
  font-size: 0.82rem;
}

.stable-tag-current {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(80, 200, 120, 0.55);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(80, 200, 120, 0.12);
  color: #50c878;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
  white-space: nowrap;
}

.stable-tag-former {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(154, 165, 177, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(154, 165, 177, 0.08);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
  white-space: nowrap;
}

.profile-promotion-years {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.profile-promotion-year-row {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) minmax(120px, 1.4fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
}

.profile-promotion-year-row .promotion-logo {
  width: 42px;
  height: 30px;
  font-size: 0.7rem;
}

.profile-promotion-year-row span:nth-child(2) {
  color: var(--muted);
  font-weight: 900;
}

.profile-promotion-year-row strong {
  text-align: right;
}

.profile-vote-breakdown {
  display: grid;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.profile-vote-row {
  display: grid;
  grid-template-columns: minmax(86px, 1.4fr) repeat(4, minmax(46px, 0.65fr));
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.profile-vote-row:first-child {
  border-top: 0;
}

.profile-vote-header {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-vote-row span:first-child {
  color: var(--muted);
  font-weight: 800;
}

.profile-vote-row strong,
.profile-vote-row span:not(:first-child) {
  text-align: right;
}

.profile-history {
  grid-column: 1 / -1;
}

.vote.up.active,
.vote.up:hover {
  background: var(--green);
  border-color: var(--green);
  color: var(--ink);
}

.vote.down.active,
.vote.down:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--text);
}

.match-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.match-card {
  padding: 14px;
}

.match-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.match-card p {
  margin: 4px 0;
  color: var(--muted);
}

.match-rating {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--gold);
  font-weight: 900;
}

.news-editor-form {
  display: grid;
  gap: 12px;
  margin: 0 8px 16px;
  padding: 14px;
}

.news-editor-form.hidden {
  display: none;
}

.news-editor-form label {
  display: grid;
  gap: 6px;
}

.news-editor-form span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.news-editor-form input,
.news-editor-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  background: rgba(5, 8, 12, 0.9);
  color: var(--text);
  font: inherit;
}

.news-editor-form textarea {
  resize: vertical;
}

.news-editor-form button,
.news-delete-button {
  width: fit-content;
  border: 0;
  border-radius: 6px;
  padding: 9px 12px;
  background: var(--gold);
  color: #111;
  font-weight: 950;
  cursor: pointer;
}

.news-editor-message {
  min-height: 1.2em;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.news-editor-message[data-kind="success"] {
  color: #75d99a;
}

.news-editor-message[data-kind="error"] {
  color: #ff8b8b;
}

.news-list {
  display: grid;
  gap: 14px;
  padding: 0 8px 8px;
}

.news-card {
  padding: 16px;
}

.news-card time {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.news-card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.news-story-body {
  display: grid;
  gap: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.news-story-body p {
  margin: 0;
}

.news-delete-button {
  margin-top: 14px;
  background: #402128;
  color: #ffd5d5;
}

.database-table {
  overflow: auto;
}

.season-panel {
  display: grid;
  gap: 18px;
  padding: 14px;
  overflow: auto;
}

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

.promotion-division-heading {
  margin: 18px 8px 8px;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.promotion-division-heading:first-child {
  margin-top: 4px;
}

.ranking-disclaimer {
  margin: -2px 8px 12px;
  max-width: 820px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.editor-rank-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 8px 14px;
}

.save-editor-rankings-btn {
  border: 0;
  border-radius: 6px;
  padding: 9px 12px;
  background: var(--gold);
  color: #111;
  font-weight: 950;
  cursor: pointer;
}

.save-editor-rankings-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.save-editor-rankings-btn.hidden {
  display: none;
}

.save-editor-rankings-message {
  min-height: 1.2em;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.save-editor-rankings-message[data-kind="success"] {
  color: #75d99a;
}

.save-editor-rankings-message[data-kind="error"] {
  color: #ff8b8b;
}

.user-rank-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 8px 14px;
}

/* When the booker is editing, the action bar sticks to the top of the User
   Rank section so the save button is always one click away. */
.user-rank-actions.editor-active {
  position: sticky;
  top: 8px;
  z-index: 30;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(12, 16, 22, 0.96), rgba(12, 16, 22, 0.86));
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.save-user-ranks-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  background: var(--gold);
  color: #111;
  font-weight: 950;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.save-user-ranks-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.save-user-ranks-btn:not(:disabled) {
  background: linear-gradient(180deg, #ffd86b, #f3b32c);
  animation: save-user-ranks-pulse 1.6s ease-in-out infinite;
}

@keyframes save-user-ranks-pulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(243, 179, 44, 0.35); }
  50%      { box-shadow: 0 4px 22px rgba(243, 179, 44, 0.75); }
}

.save-user-ranks-btn:disabled {
  opacity: 0.55;
  cursor: default;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  box-shadow: none;
  animation: none;
}

.save-user-ranks-icon {
  font-size: 1.05rem;
}

.save-user-ranks-badge {
  display: none;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #b3261e;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.4;
  text-align: center;
}

.save-user-ranks-btn[data-pending-count]:not([data-pending-count="0"]) .save-user-ranks-badge {
  display: inline-block;
}

.save-user-ranks-btn.hidden {
  display: none;
}

.user-rank-editor-hint {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.user-rank-editor-hint.hidden {
  display: none;
}

.save-user-ranks-message {
  min-height: 1.2em;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.save-user-ranks-message[data-kind="success"] {
  color: #75d99a;
}

.save-user-ranks-message[data-kind="error"] {
  color: #ff8b8b;
}

.tag-team-row {
  cursor: default;
}

.snapshot-row {
  background: rgba(255, 255, 255, 0.02);
}

.snapshot-row:not([data-profile-id]) {
  cursor: default;
}

.snapshot-row .wrestler-meta span:nth-child(n+3) {
  color: var(--gold);
}

.snapshot-now-btn {
  margin-top: 8px;
  align-self: flex-start;
  padding: 6px 12px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(215, 25, 32, 0.12);
  color: var(--gold);
  border: 1px solid rgba(215, 25, 32, 0.4);
  border-radius: 6px;
  cursor: pointer;
}

.snapshot-now-btn:hover {
  background: rgba(215, 25, 32, 0.22);
}

.snapshot-now-btn.hidden {
  display: none;
}

.tag-team-row .tag-avatar {
  background:
    linear-gradient(135deg, rgba(40, 90, 180, 0.45), rgba(255, 255, 255, 0.08)),
    #11161b;
}

.tag-team-row .tag-members {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.season-block h3 {
  margin: 0 0 10px;
}

.season-note {
  margin: 0;
  color: var(--muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}

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

th {
  position: sticky;
  top: 91px;
  background: #15191d;
  color: var(--muted);
  z-index: 1;
}

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

.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.forum-shell {
  max-width: 1280px;
}

.forum-nav {
  margin-top: 0;
}

.forum-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.forum-main,
.forum-sidebar {
  display: grid;
  gap: 14px;
}

.forum-heading {
  align-items: center;
}

.forum-card,
.forum-list,
.forum-post {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 22, 27, 0.92);
}

.forum-card {
  padding: 18px;
}

.forum-card h3,
.forum-form h3,
.forum-category-header h3 {
  margin: 0 0 10px;
}

.forum-card p,
.forum-category-header p,
.forum-breadcrumb,
.forum-muted {
  color: var(--muted);
}

.forum-breadcrumb a,
.forum-category-header a {
  color: var(--text);
}

.forum-form,
.forum-mini-form {
  display: grid;
  gap: 12px;
}

.forum-form label,
.forum-mini-form label {
  display: grid;
  gap: 6px;
}

.forum-form label span {
  color: var(--muted);
  font-size: 0.88rem;
}

textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  resize: vertical;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.forum-primary,
.forum-secondary {
  min-height: 40px;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 800;
}

.forum-primary {
  border: 1px solid var(--gold);
  background: var(--gold);
  color: var(--text);
}

.forum-secondary {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}

.forum-list {
  overflow: hidden;
}

.forum-category-row,
.forum-thread-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 210px;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.forum-category-row:last-child,
.forum-thread-row:last-child {
  border-bottom: 0;
}

.forum-category-row:hover,
.forum-thread-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.forum-category-row strong,
.forum-thread-row strong {
  display: block;
  margin-bottom: 4px;
}

.forum-category-row small,
.forum-thread-row small,
.forum-last {
  color: var(--muted);
}

.forum-counts {
  color: var(--muted);
  font-size: 0.9rem;
}

.forum-counts b {
  color: var(--text);
}

.forum-category-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.forum-user-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.forum-user-line span {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.forum-register-details {
  margin-top: 14px;
}

.forum-register-details summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
}

.forum-register-details form {
  margin-top: 12px;
}

.forum-message {
  min-height: 1.2em;
  margin: 0;
  color: var(--muted);
}

.forum-message[data-kind="error"] {
  color: #ff8a8a;
}

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

.forum-post {
  overflow: hidden;
}

.forum-post.is-hidden {
  opacity: 0.55;
}

.forum-post header,
.forum-post footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
}

.forum-post header span,
.forum-post header time {
  color: var(--muted);
  font-size: 0.88rem;
}

.forum-post-body {
  padding: 18px 16px;
  line-height: 1.6;
}

.forum-post-body p {
  margin: 0;
}

.forum-link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.forum-guidelines ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.forum-guidelines li + li {
  margin-top: 8px;
}

@media (max-width: 800px) {
  .topbar,
  .controls,
  .section-heading,
  .add-wrestler-row,
  .forum-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .forum-grid {
    grid-template-columns: 1fr;
  }

  .forum-tab-link {
    margin-left: 0;
  }

  .forum-category-row,
  .forum-thread-row {
    grid-template-columns: 1fr;
  }

  .forum-last {
    font-size: 0.9rem;
  }

  .site-footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .trust-page {
    padding: 20px 16px;
  }

  .vote-login-prompt {
    left: 14px;
    right: 14px;
    bottom: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .vote-login-actions {
    width: 100%;
  }

  .vote-login-actions button,
  .vote-login-actions a {
    flex: 1;
  }

  .brand {
    width: 100%;
    min-width: 0;
  }

  .site-logo {
    max-height: 170px;
    object-position: center;
  }

  .login-form,
  .user-panel,
  .search-box,
  .period-box,
  .week-box {
    align-items: stretch;
  }

  .login-form,
  .search-box,
  .period-box,
  .week-box {
    flex-direction: column;
  }

  .search-box input,
  .period-box select,
  .week-box select {
    width: 100%;
  }

  .add-wrestler-row {
    grid-template-columns: 1fr;
  }

  .rank-row {
    grid-template-columns: 36px 48px minmax(0, 1fr);
  }

  .user-rank-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .editor-rank-row {
    grid-template-columns: 38px 50px minmax(0, 1fr);
  }

  .vote-count,
  .vote-buttons,
  .rank-lock,
  .user-rank-editor-control,
  .editor-wrestler-tools,
  .editor-details-panel {
    grid-column: 3;
    justify-self: start;
  }

  .editor-rank-row .editor-rank-control,
  .editor-rank-row .editor-wrestler-tools,
  .editor-rank-row .editor-details-panel {
    grid-column: 3;
  }

  .profile-hero {
    grid-template-columns: 1fr;
  }

  .profile-photo {
    width: min(190px, 70vw);
  }
}

@media (min-width: 801px) {
  .promotion-card .editor-rank-row {
    grid-template-columns: 38px 50px minmax(0, 1fr) 62px;
    min-height: 94px;
    gap: 10px;
  }

  .promotion-card .avatar {
    width: 50px;
    height: 50px;
  }

  .promotion-card .wrestler-name {
    font-size: clamp(1.08rem, 1.25vw, 1.28rem);
  }

  .promotion-card .wrestler-meta {
    font-size: 0.54rem;
  }
}

/* ===== Mobile-friendly view: applied when mobile.js detects a mobile browser ===== */
body.mobile {
  font-size: 15px;
}

body.mobile .topbar {
  flex-direction: column;
  align-items: stretch;
  padding: 10px;
  gap: 8px;
}

body.mobile .brand {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

body.mobile .site-logo {
  max-height: 78px;
  object-fit: contain;
  object-position: center;
}

body.mobile .login-form,
body.mobile .user-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
}

body.mobile .login-form label {
  display: none;
}

body.mobile .login-form input {
  width: 100%;
  font-size: 16px; /* prevent iOS zoom-on-focus */
}

body.mobile .login-form button,
body.mobile .user-panel button {
  grid-column: 1 / -1;
  min-height: 42px;
}

body.mobile .login-form .register-link,
body.mobile .login-form .login-message {
  grid-column: 1 / -1;
  text-align: center;
}

body.mobile .register-card {
  padding: 18px 14px;
  border-radius: 10px;
}

body.mobile .register-form input,
body.mobile .register-form select {
  font-size: 16px; /* prevent iOS zoom-on-focus */
}

body.mobile .user-panel {
  grid-template-columns: 1fr auto;
  align-items: center;
}

body.mobile main {
  padding: 14px 12px 36px;
}

body.mobile .controls {
  padding: 8px;
  gap: 8px;
  flex-direction: column;
  align-items: stretch;
}

body.mobile .tabs {
  flex: 1 0 100%;
  width: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-bottom: 4px;
  gap: 6px;
}

body.mobile .tabs::-webkit-scrollbar {
  display: none;
}

body.mobile .tabs {
  scrollbar-width: none;
}

body.mobile .tab {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.85rem;
  white-space: nowrap;
}

body.mobile .search-box,
body.mobile .period-box,
body.mobile .week-box {
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
}

body.mobile .search-box span,
body.mobile .period-box span,
body.mobile .week-box span {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

body.mobile .search-box input,
body.mobile .period-box select,
body.mobile .week-box select {
  width: 100%;
  font-size: 16px; /* prevent iOS zoom-on-focus */
  min-height: 40px;
}

body.mobile .section-heading {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

body.mobile .section-heading h2 {
  font-size: 1.25rem;
}

body.mobile .promotion-grid {
  grid-template-columns: 1fr;
}

body.mobile .promotion-card header {
  padding: 8px 10px;
}

body.mobile .promotion-card h2 {
  font-size: 1.05rem;
}

body.mobile .promotion-card .week-badge {
  font-size: 0.66rem;
  padding: 4px 8px;
}

body.mobile .promotion-add-form {
  grid-template-columns: 1fr;
}

body.mobile .editor-wrestler-tools {
  grid-template-columns: 1fr;
}

body.mobile .editor-details-form {
  grid-template-columns: 1fr;
}

body.mobile .promotion-division-heading {
  margin: 14px 4px 6px;
  font-size: 0.92rem;
}

body.mobile .ranking-disclaimer {
  margin: -2px 4px 10px;
  font-size: 0.84rem;
}

body.mobile .ranking-list {
  border-radius: 6px;
}

body.mobile .rank-row {
  grid-template-columns: 34px 46px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 6px;
  min-height: 66px;
}

body.mobile .user-rank-row {
  grid-template-columns: 34px 46px minmax(0, 1fr) auto;
}

body.mobile.user-rank-editor-mode .user-rank-row {
  grid-template-columns: 22px 34px 46px minmax(0, 1fr) auto;
}

body.mobile .editor-rank-row {
  grid-template-columns: 32px 44px minmax(0, 1fr);
  min-height: 88px;
  padding: 8px 4px;
}

body.mobile .rank-number {
  font-size: 0.86rem;
}

body.mobile .avatar {
  width: 44px;
  height: 44px;
  font-size: 0.82rem;
}

body.mobile .editor-rank-row .avatar {
  width: 44px;
  height: 44px;
  font-size: 0.78rem;
}

body.mobile .wrestler-name {
  font-size: 1.02rem;
}

body.mobile .editor-rank-row .wrestler-name {
  font-size: 1.08rem;
}

body.mobile .wrestler-meta {
  font-size: 0.7rem;
  gap: 4px;
}

body.mobile .editor-rank-row .wrestler-meta {
  font-size: 0.52rem;
}

body.mobile .user-rank-row .wrestler-meta > span:nth-child(n+4) {
  display: none;
}

body.mobile .vote-count {
  font-size: 0.6rem;
}

body.mobile .vote-count strong {
  font-size: 0.86rem;
}

body.mobile .user-rank-editor-control {
  grid-column: 3;
  width: min(110px, 100%);
}

body.mobile .vote-buttons {
  grid-template-columns: 36px 36px;
  gap: 6px;
}

body.mobile .vote-buttons button {
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
}

body.mobile .promotion-card .vote-buttons {
  grid-template-columns: 30px 30px;
  gap: 4px;
}

body.mobile .promotion-card .vote-buttons button {
  width: 30px;
  height: 30px;
}

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

body.mobile .match-card {
  padding: 12px;
}

body.mobile .match-card h3 {
  font-size: 0.95rem;
}

body.mobile .match-card p {
  font-size: 0.82rem;
}

body.mobile .add-wrestler-row {
  grid-template-columns: 1fr;
  gap: 8px;
}

body.mobile .add-wrestler-row input,
body.mobile .add-wrestler-row select,
body.mobile .add-wrestler-row button {
  width: 100%;
  font-size: 16px;
  min-height: 42px;
}

body.mobile .database-table {
  -webkit-overflow-scrolling: touch;
}

body.mobile .database-table table {
  font-size: 0.78rem;
  min-width: 720px;
}

body.mobile th,
body.mobile td {
  padding: 8px 10px;
}

body.mobile th {
  top: 0; /* sticky header doesn't need offset on mobile */
}

body.mobile .season-panel {
  padding: 10px;
}

body.mobile .season-grid {
  grid-template-columns: 1fr;
}

body.mobile .snapshot-now-btn {
  align-self: stretch;
  text-align: center;
  font-size: 0.78rem;
}

body.mobile .tag-team-row .tag-members {
  font-size: 0.68rem;
}

body.mobile .profile-topbar .brand {
  justify-content: center;
}

body.mobile .profile-hero {
  grid-template-columns: 1fr;
  text-align: center;
  padding: 18px;
  gap: 14px;
}

body.mobile .profile-photo {
  width: min(180px, 60vw);
  margin: 0 auto;
}

body.mobile .profile-hero h1 {
  font-size: clamp(1.7rem, 7vw, 2.6rem);
}

body.mobile .profile-promotion {
  justify-content: center;
}

body.mobile .profile-tags {
  justify-content: center;
}

body.mobile .profile-grid {
  grid-template-columns: 1fr;
}

body.mobile .profile-panel {
  padding: 14px;
}

body.mobile .profile-rank-averages {
  grid-template-columns: 1fr;
}

/* Featured Sponsors */
.featured-partners {
  margin: 16px 0;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.featured-partners-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  text-align: center;
  color: var(--text);
}
.featured-partners-grid {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: stretch;
}
.featured-partner {
  display: block;
  flex: 1 1 0;
  min-width: 0;
}
.featured-partner img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
}

/* Stack login / user panel / votes-remaining vertically at the top-right */
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* Votes-remaining-per-section panel — floats in the top-right and stays put
   while scrolling. */
.vote-allowance {
  position: fixed;
  top: 70px;
  right: clamp(12px, 2vw, 24px);
  z-index: 50;
  width: 190px;
  max-height: min(70vh, 360px);
  overflow-y: auto;
  padding: 8px 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
.vote-allowance-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 6px;
}
.vote-allowance-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
}
.vote-allowance-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text);
  padding: 2px 4px;
  border-radius: 6px;
}
.vote-allowance-list li strong {
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
.vote-allowance-list li.spent {
  color: var(--muted);
}
.vote-allowance-list li.spent strong {
  color: var(--red);
}
@media (max-width: 800px) {
  .vote-allowance {
    position: static;
    width: 100%;
    max-height: none;
    margin-top: 10px;
  }
  .vote-allowance-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 12px;
  }
}

/* ── Homepage crawlable content (AdSense / SEO) ───────────────────────────── */
.site-intro {
  max-width: 1100px;
  margin: 18px auto 0;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
}
.site-intro h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  color: var(--text);
}
.site-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 80ch;
}
.site-intro a { color: var(--gold); }

.site-content {
  max-width: 1100px;
  margin: 28px auto 8px;
  padding: 6px 20px 24px;
}
.site-content-inner {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 22px 24px;
}
.site-content-inner h2 {
  margin: 18px 0 8px;
  font-size: 1.15rem;
  color: var(--text);
}
.site-content-inner h2:first-child { margin-top: 0; }
.site-content-inner p {
  margin: 0 0 6px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 85ch;
}
.site-content-inner a { color: var(--gold); }
.site-content-links {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.9;
}
.site-content-links a { color: var(--gold); }
