@font-face {
  font-family: "Vazirmatn";
  src:
    url("../fonts/Vazirmatn-Variable.woff2") format("woff2-variations"),
    url("../fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --bg: #07070c;
  --card: #101018;
  --card2: #181824;
  --input: #0c0c14;
  --border: rgba(212, 175, 55, 0.22);
  --soft: rgba(212, 175, 55, 0.09);
  --text: #f8f0d8;
  --muted: #9c9078;
  --primary: #d4af37;
  --dark: #7a5f1a;
  --accent: #f4cf6a;
  --contrast: #07070c;
  --hover: rgba(212, 175, 55, 0.2);
  --success: #4e9a6e;
  --danger: #c4574f;
  --normal: #4e9a6e;
  --mars: #c07f38;
  --black: #9a3f4e;
  --radius: 24px;
  --btnradius: 16px;
  --font: "Vazirmatn", sans-serif;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  min-height: 100vh;
  margin: 0;
  padding: 11px;
  background-color: var(--bg);
  background-image: var(--bgimg, none);
  background-attachment: fixed;
  color: var(--text);
  font-family: Tahoma, system-ui, sans-serif;
  line-height: 1.7;
}
.app {
  max-width: 1050px;
  margin: auto;
}
.hero,
.page,
.card {
  background: linear-gradient(145deg, var(--card2), var(--card));
  border: 1px solid var(--soft);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.06),
    0 2px 6px rgba(0, 0, 0, 0.04);
}
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 12px 14px 10px;
  text-align: center;
  margin-bottom: 8px;
}
.hero:before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  top: -120px;
  right: -40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow:
    0 0 0 20px rgba(255, 255, 255, 0.08),
    0 0 0 40px rgba(255, 255, 255, 0.05);
  pointer-events: none;
  opacity: 0.6;
}
.hero:after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top right, var(--hover), transparent 60%);
  pointer-events: none;
  border-radius: inherit;
}
.hero > * {
  position: relative;
  z-index: 1;
}
.hero-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 42px;
  color: var(--accent);
  filter: drop-shadow(0 3px 8px var(--hover));
  animation: logoFloat 4s ease-in-out infinite;
  flex-shrink: 0;
}
.hero-logo:nth-child(3) {
  animation-delay: -2s;
}
@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}
.cukur-logo {
  width: 100%;
  height: 100%;
  display: block;
}
h1,
h2,
h3 {
  color: var(--accent);
  margin: 0;
  font-family: var(--font, inherit);
  letter-spacing: -0.01em;
}
h1 {
  font-size: clamp(1.7rem, 6.5vw, 2.4rem);
  font-weight: 900;
  line-height: 1.1;
}
h2 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  font-weight: 700;
}
h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  font-weight: 700;
}
.hero p,
.muted {
  color: var(--muted);
  margin: 6px 0 0;
  font-size: 0.85rem;
}
.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 5px;
  overflow: visible;
  padding: 6px 0 12px;
  background: linear-gradient(var(--bg) 75%, transparent);
}
button,
input,
select,
textarea {
  font: inherit;
}
.tab,
.btn,
.choice,
.filter,
.theme {
  cursor: pointer;
}
.tab {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 50px;
  padding: 6px 3px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--soft);
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.72rem;
  transition:
    background 0.25s,
    color 0.25s,
    transform 0.2s,
    box-shadow 0.25s,
    border-color 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}
.tab:hover:not(.active) {
  background: var(--hover);
  color: var(--accent);
  transform: translateY(-2px);
  border-color: var(--border);
}
.tab.active {
  color: var(--contrast);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px var(--hover);
}
.gearbtn {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 9;
  width: 42px;
  height: 42px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--card);
  border: 1px solid var(--soft);
  border-radius: 50%;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.15s,
    box-shadow 0.2s;
}
.gearbtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}
.gearbtn.active {
  color: var(--contrast);
  background: linear-gradient(145deg, var(--primary), var(--dark));
  border-color: var(--primary);
}
.tab.active,
.choice.active,
.filter.active {
  color: var(--contrast);
  background: linear-gradient(145deg, var(--primary), var(--dark));
  border-color: var(--primary);
}
.page {
  display: none;
  border-radius: 24px;
  padding: 16px;
  margin-bottom: 12px;
}
.page.active {
  display: block;
  animation: pageIn 0.28s ease;
}
@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.card {
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 13px;
  transition: box-shadow 0.25s ease;
}
.card.subsection {
  background: none;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 16px 0 0;
  margin: 16px 0 0;
  border-top: 1px solid var(--soft);
}
.card.subsection:hover {
  box-shadow: none;
}
.card:hover {
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.1),
    0 3px 8px rgba(0, 0, 0, 0.05);
}
.grid {
  display: grid;
  gap: 10px;
}
.type-buttons {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.18),
    inset 0 -2px 4px rgba(0, 0, 0, 0.12),
    inset 0 2px 4px rgba(255, 255, 255, 0.15);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  line-height: 1;
  font-family: "Vazirmatn", sans-serif;
  user-select: none;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid rgba(255, 255, 255, 0.15);
}
.avatar.avatar-img {
  background-color: var(--input);
  border-color: var(--primary);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}
.dnd-hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 600;
}
.vs-slots {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 6px;
  align-items: stretch;
  margin-bottom: 10px;
}
.vs-slot {
  position: relative;
  min-height: 58px;
  padding: 8px 6px;
  background: var(--input);
  border: 2px dashed var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  transition:
    border-color 0.2s,
    background 0.25s,
    transform 0.2s,
    box-shadow 0.25s;
  overflow: hidden;
}
.vs-slot:hover {
  border-color: var(--primary);
  background: var(--hover);
}
.vs-slot.filled {
  border-style: solid;
  border-color: var(--primary);
  background: linear-gradient(180deg, var(--hover), transparent 90%);
  box-shadow: 0 6px 20px var(--hover);
}
.vs-slot.dragover {
  border-style: solid;
  border-color: var(--accent);
  background: var(--hover);
  transform: scale(1.04);
  box-shadow:
    0 0 0 4px var(--hover),
    0 10px 30px var(--hover);
}
.vs-slot-label {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}
.vs-slot-hint {
  display: none;
  font-size: 0.62rem;
  color: var(--muted);
  opacity: 0.8;
  line-height: 1.2;
  text-align: center;
  margin-top: 2px;
}
.vs-slot.filled .vs-slot-label {
  display: none;
}
.vs-slot.filled .vs-slot-hint {
  display: none;
}
.vs-slot-name {
  font-weight: 900;
  font-size: 0.8rem;
  line-height: 1.15;
  text-align: center;
  max-width: 100%;
  overflow-wrap: break-word;
}
.vs-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.66rem;
  color: var(--muted);
  font-weight: 600;
  padding: 2px 8px;
  background: var(--hover);
  border-radius: 99px;
  line-height: 1.1;
  white-space: nowrap;
}
.vs-slot-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--card);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
  opacity: 0.6;
  transition:
    opacity 0.2s,
    transform 0.15s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.vs-slot.filled:hover .vs-slot-remove,
.vs-slot.filled:focus-visible .vs-slot-remove {
  opacity: 1;
}
.vs-slot-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
}
.vs-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--contrast);
  font-weight: 900;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  font-family: "Vazirmatn", sans-serif;
  box-shadow:
    0 6px 18px var(--hover),
    0 0 22px var(--hover);
  animation: vsPulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes vsPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.07);
  }
}
.vs-text.small {
  width: 34px;
  height: 34px;
  font-size: 0.78rem;
}
.player-pool {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.pool-player {
  position: relative;
  padding: 9px 4px 8px;
  background: var(--input);
  border: 2px solid var(--soft);
  border-radius: 14px;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: element;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition:
    transform 0.18s,
    border-color 0.2s,
    box-shadow 0.25s,
    background 0.2s,
    opacity 0.2s;
  text-align: center;
  font: inherit;
  color: var(--text);
  overflow: hidden;
}
.pool-player:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}
.pool-player:active {
  transform: translateY(-1px) scale(0.97);
  cursor: grabbing;
}
.pool-player.dragging {
  opacity: 0.35;
  cursor: grabbing;
}
.pool-player.placed {
  opacity: 0.45;
  border-color: var(--primary);
  cursor: pointer;
}
.pool-player.placed:hover {
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}
.pool-player.placed .pp-stats {
  color: var(--accent);
}
.pool-player .pp-name {
  font-weight: 900;
  font-size: 0.78rem;
  line-height: 1.15;
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 100%;
}
.pool-player .pp-stats {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.66rem;
  color: var(--muted);
  font-weight: 600;
  padding: 2px 7px;
  background: var(--hover);
  border-radius: 99px;
  line-height: 1.1;
}
.player-pool .empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 18px;
  color: var(--muted);
  font-size: 0.85rem;
}
.vs-comparison {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--input);
  border-radius: 14px;
  border: 1px solid var(--soft);
}
.vs-comp-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}
.vs-comp-val {
  font-weight: 900;
  font-size: 1rem;
  color: var(--accent);
  font-family: var(--font, inherit);
}
.vs-comp-val.left {
  text-align: left;
}
.vs-comp-val.right {
  text-align: right;
}
.vs-comp-label {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.winner-arena {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 4px;
  align-items: stretch;
  background: var(--input);
  border: 2px solid var(--soft);
  border-radius: 22px;
  padding: 14px 6px;
  overflow: hidden;
}
.winner-side {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 6px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  transition:
    transform 0.2s,
    background 0.25s,
    border-color 0.25s,
    box-shadow 0.25s;
  z-index: 1;
  overflow-wrap: break-word;
  word-break: break-word;
}
.winner-side:hover {
  background: var(--hover);
  border-color: var(--border);
  transform: translateY(-2px);
}
.winner-side.active {
  background: linear-gradient(180deg, var(--hover), transparent 90%);
  border-color: var(--primary);
  box-shadow:
    0 0 0 3px var(--hover),
    0 8px 24px var(--hover);
}
.winner-side .avatar {
  transition: transform 0.25s;
}
.winner-side.active .avatar {
  transform: scale(1.1);
  box-shadow:
    0 8px 26px var(--hover),
    0 0 30px var(--accent);
}
.winner-name {
  font-weight: 900;
  font-size: 0.88rem;
  line-height: 1.15;
  text-align: center;
  max-width: 100%;
  overflow-wrap: break-word;
}
.winner-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.66rem;
  color: var(--muted);
  font-weight: 600;
  padding: 2px 8px;
  background: var(--hover);
  border-radius: 99px;
  line-height: 1.1;
  white-space: nowrap;
}
.winner-side.active .winner-stat {
  color: var(--accent);
}
.winner-pick {
  font-size: 0.64rem;
  color: var(--muted);
  font-weight: 700;
  margin-top: 2px;
  opacity: 0;
  transition: opacity 0.2s;
  letter-spacing: 0.02em;
}
.winner-side:hover .winner-pick {
  opacity: 0.9;
  color: var(--accent);
}
.winner-side.active .winner-pick {
  opacity: 1;
  color: var(--accent);
}
.winner-side.active .winner-pick:before {
  content: "✓ ";
}
.winner-question {
  text-align: center;
  margin: 16px 0 8px;
  font-size: 1rem;
  color: var(--accent);
  font-weight: 900;
  font-family: var(--font, inherit);
}
.type-buttons .choice {
  padding: 16px 6px;
  font-size: 1.08rem;
  min-height: 128px;
  overflow-wrap: break-word;
}
.choice {
  color: var(--text);
  background: var(--input);
  border: 2px solid var(--soft);
  border-radius: 14px;
  font-weight: 700;
  line-height: 1.3;
  transition:
    transform 0.15s,
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.choice-emoji {
  font-size: 2rem;
  line-height: 1;
}
.choice-name {
  font-size: inherit;
  line-height: 1.2;
}
.choice:hover:not(.active) {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.choice small {
  color: var(--muted);
  font-size: 0.82rem;
  display: block;
  margin-top: 4px;
}
.choice.active small {
  color: var(--contrast);
  opacity: 0.85;
}
.preview {
  background: var(--input);
  border-right: 4px solid var(--primary);
  border-radius: 16px;
  min-height: 44px;
  padding: 0;
  overflow: hidden;
}
.preview-empty {
  padding: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}
.preview-versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 14px 12px;
  background: linear-gradient(180deg, var(--hover), transparent);
}
.preview-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  position: relative;
}
.preview-player.is-winner .avatar {
  transform: scale(1.08);
  box-shadow:
    0 6px 20px var(--hover),
    0 0 24px var(--accent);
}
.preview-player.is-loser .avatar {
  opacity: 0.55;
  filter: saturate(0.6);
}
.preview-player .pp-pname {
  font-weight: 900;
  font-size: 0.82rem;
  line-height: 1.15;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}
.preview-player.is-winner .pp-pname {
  color: var(--accent);
}
.preview-player.is-loser .pp-pname {
  color: var(--muted);
}
.preview-check {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--contrast);
  background: var(--success);
  padding: 2px 8px;
  border-radius: 99px;
  line-height: 1.4;
  margin-top: 2px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}
.preview-x-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card);
  color: var(--accent);
  font-weight: 900;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}
.preview-summary {
  padding: 12px 14px;
  border-top: 1px dashed var(--soft);
  text-align: center;
}
.preview-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
}
.preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  color: #fff;
}
.preview-badge.badge-normal {
  background: var(--normal);
}
.preview-badge.badge-mars {
  background: var(--mars);
}
.preview-badge.badge-black {
  background: var(--black);
}
.preview-badge.badge-points {
  background: linear-gradient(135deg, var(--primary), var(--dark));
  color: var(--contrast);
}
.preview-line {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 700;
}
.preview-line b {
  color: var(--accent);
  font-weight: 900;
}
.preview-hint {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 13px;
}
.btn {
  min-height: 47px;
  padding: 9px 16px;
  border: 0;
  border-radius: var(--btnradius, 14px);
  color: var(--contrast);
  background: linear-gradient(145deg, var(--primary), var(--dark));
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.15s,
    box-shadow 0.2s,
    filter 0.15s;
}
.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}
.btn.secondary {
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn.secondary:hover:not(:disabled) {
  background: var(--hover);
  box-shadow: none;
}
.btn.danger {
  color: #fff;
  background: linear-gradient(145deg, var(--danger), #7e3936);
}
.btn.success {
  color: #fff;
  background: linear-gradient(145deg, var(--success), #39634a);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.warning {
  margin-top: 11px;
  padding: 11px 14px;
  border-radius: 13px;
  font-size: 0.88rem;
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--border);
}
.summary,
.headgrid,
.records {
  display: grid;
  gap: 10px;
}
.summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 13px;
}
.stat,
.paircard,
.record,
.game,
.chart {
  background: linear-gradient(145deg, var(--card2), var(--card));
  border: 1px solid var(--soft);
  border-radius: 16px;
}
.stat {
  padding: 12px;
  text-align: center;
}
.stat strong {
  display: block;
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 900;
  margin-top: 3px;
}
.stat span {
  font-size: 0.76rem;
  color: var(--muted);
}
.stat:hover,
.paircard:hover,
.record:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}
.wrap {
  overflow: auto;
  border: 1px solid var(--soft);
  border-radius: 16px;
}
table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}
th,
td {
  padding: 11px 8px;
  text-align: center;
  border-bottom: 1px solid var(--soft);
  white-space: nowrap;
  font-size: 0.82rem;
}
th {
  background: linear-gradient(145deg, var(--primary), var(--dark));
  color: var(--contrast);
  font-weight: 700;
}
tbody tr:first-child {
  background: var(--hover);
}
.evaluation {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--muted);
  font-size: 0.7rem;
}
.headgrid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.paircard {
  padding: 13px;
}
.paircard-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.paircard-header .pair-x {
  color: var(--muted);
}
.score {
  color: var(--accent);
  font-size: 1.4rem;
  text-align: center;
  font-weight: 900;
  font-family: var(--font, inherit);
  letter-spacing: 0.02em;
}
.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.filters2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 9px;
}
label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}
input,
select,
textarea {
  width: 100%;
  min-height: 45px;
  margin-top: 4px;
  padding: 9px 11px;
  background: var(--input);
  color: var(--text);
  border: 1.5px solid var(--soft);
  border-radius: 12px;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--hover);
}
textarea {
  min-height: 80px;
  resize: vertical;
}
.list {
  display: grid;
  gap: 10px;
}
.game {
  position: relative;
  overflow: hidden;
  padding: 15px;
}
.game:before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(var(--accent), var(--dark));
}
.gamehead {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.winner {
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 900;
  font-family: var(--font, inherit);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
}
.normal {
  background: var(--normal);
}
.mars {
  background: var(--mars);
}
.blackmars {
  background: var(--black);
}
.tag {
  display: inline-block;
  padding: 3px 9px;
  margin: 2px;
  border-radius: 99px;
  background: var(--hover);
  color: var(--accent);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
}
.meta {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--soft);
  font-size: 0.83rem;
  color: var(--muted);
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 26px;
}
.records {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.record {
  padding: 12px;
}
.record small {
  color: var(--muted);
  font-size: 0.78rem;
}
.record strong {
  display: block;
  color: var(--accent);
  line-height: 1.4;
  margin-top: 4px;
  font-weight: 700;
}
.chart {
  padding: 14px;
  margin-top: 12px;
}
.chartbox {
  overflow: auto;
  background: var(--input);
  border: 1px solid var(--soft);
  border-radius: 14px;
}
.chartbox svg {
  display: block;
  width: 100%;
  min-width: 560px;
  height: 230px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--muted);
  font-size: 0.77rem;
  margin-top: 7px;
}
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-left: 4px;
}
.theme-current {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  background: var(--input);
  border: 1px solid var(--soft);
  border-radius: 14px;
  margin-bottom: 10px;
  font-weight: 700;
}
.theme-current .swatch {
  width: 36px;
  height: 36px;
  margin: 0;
  flex-shrink: 0;
  border-radius: 10px;
}
.themegrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.theme {
  min-height: 62px;
  padding: 8px 6px;
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--soft);
  border-radius: var(--btnradius, 12px);
  font-size: 0.72rem;
  line-height: 1.2;
  font-weight: 700;
}
.theme:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.theme.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--hover);
}
.swatch {
  height: 22px;
  border-radius: 8px;
  margin-bottom: 5px;
}
.modalbg {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(20, 10, 5, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modalbg.show {
  display: flex;
}
.modal {
  width: min(100%, 600px);
  max-height: 92vh;
  overflow: auto;
  padding: 19px;
  border: 1px solid var(--soft);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
#top {
  position: fixed;
  display: none;
  left: 16px;
  bottom: 16px;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  color: var(--contrast);
  background: linear-gradient(145deg, var(--primary), var(--dark));
  font-size: 1.3rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  z-index: 9;
}
.hidden {
  display: none !important;
}
.guest-mode .tab[data-page="register"] {
  display: none !important;
}
.guest-mode #settingsGear {
  display: none !important;
}
.guest-mode #add,
.guest-mode #last,
.guest-mode [data-edit],
.guest-mode [data-del] {
  display: none !important;
}
body.guest-mode [data-edit],
body.guest-mode #tReset,
body.guest-mode #tEditName,
body.guest-mode #tEditStart {
  display: none !important;
}
.toast {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: #fff;
  padding: 12px 20px;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  z-index: 210;
  opacity: 0;
  transition:
    opacity 0.25s,
    transform 0.25s;
  pointer-events: none;
  max-width: 90%;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  font-weight: 600;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
  pointer-events: auto;
}
.toast.bad {
  background: var(--danger);
}
.toast button {
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
  padding: 4px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
}
.card.reveal {
  animation: cardIn 0.35s;
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
#quickTags .tag {
  cursor: pointer;
  user-select: none;
  background: transparent;
  color: var(--muted);
}
#quickTags .tag:hover {
  border-color: var(--primary);
}
#quickTags .tag.active {
  background: var(--primary);
  color: var(--contrast);
  border-color: var(--primary);
}
[data-theme="rainy"] .hero,
[data-theme="rainy"] .page,
[data-theme="rainy"] .card,
[data-theme="rainy"] .stat,
[data-theme="rainy"] .paircard,
[data-theme="rainy"] .record,
[data-theme="rainy"] .game,
[data-theme="rainy"] .chart,
[data-theme="rainy"] .tab,
[data-theme="rainy"] .modal,
[data-theme="rainy"] .theme-current,
[data-theme="rainy"] .pool-player,
[data-theme="rainy"] .winner-arena {
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}
[data-theme="rainy"] .hero {
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
@media (max-width: 760px) {
  .headgrid {
    grid-template-columns: 1fr;
  }
  .themegrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .page {
    padding: 13px;
  }
  .btn {
    flex: 1 1 145px;
  }
  .card {
    padding: 12px;
  }
  .player-pool {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .pool-player {
    padding: 10px 5px 9px;
    border-radius: 12px;
    gap: 4px;
  }
  .pool-player .pp-name {
    font-size: 0.72rem;
  }
  .pool-player .pp-stats {
    font-size: 0.6rem;
    padding: 2px 6px;
  }
  .vs-slots {
    gap: 4px;
  }
  .vs-slot {
    min-height: 112px;
    padding: 10px 5px;
    border-radius: 14px;
    gap: 5px;
  }
  .vs-slot-name {
    font-size: 0.78rem;
  }
  .vs-text {
    width: 34px;
    height: 34px;
    font-size: 0.76rem;
  }
  .vs-text.small {
    width: 28px;
    height: 28px;
    font-size: 0.68rem;
  }
  .winner-arena {
    padding: 10px 4px;
    gap: 2px;
    border-radius: 18px;
  }
  .winner-side {
    padding: 10px 4px;
    gap: 5px;
    border-radius: 14px;
  }
  .winner-name {
    font-size: 0.78rem;
  }
  .winner-stat {
    font-size: 0.6rem;
    padding: 2px 6px;
  }
  .preview-versus {
    padding: 11px 8px;
    gap: 5px;
  }
  .preview-player .pp-pname {
    font-size: 0.74rem;
  }
  .preview-x-circle {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }
  .type-buttons {
    gap: 6px;
  }
  .type-buttons .choice {
    font-size: 0.94rem;
    min-height: 112px;
    padding: 12px 4px;
  }
  .choice-emoji {
    font-size: 1.7rem;
  }
  .type-buttons .choice small {
    font-size: 0.76rem;
    margin-top: 2px;
  }
  h2 {
    font-size: 1.08rem;
    margin-bottom: 9px;
  }
  h1 {
    font-size: clamp(1.5rem, 6.5vw, 2rem);
  }
  .hero {
    padding: 10px 12px 8px;
  }
  .hero-logo {
    width: 18px;
    height: 36px;
  }
  .tabs {
    gap: 4px;
    padding: 5px 0 10px;
  }
  .tab {
    min-height: 48px;
    padding: 6px 2px;
    font-size: 0.68rem;
    gap: 2px;
    border-radius: 12px;
  }
  .dnd-hint {
    font-size: 0.7rem;
    margin-bottom: 9px;
  }
}
@media (max-width: 400px) {
  .tab {
    font-size: 0.62rem;
    padding: 6px 1px;
    gap: 1px;
  }
  .pool-player .pp-name {
    font-size: 0.66rem;
  }
  .pool-player .pp-stats {
    font-size: 0.56rem;
    padding: 1px 5px;
  }
  .vs-slot {
    min-height: 100px;
    padding: 9px 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
@media print {
  .tabs,
  .gearbtn,
  #top,
  .actions,
  .modalbg,
  .hero p,
  #storageWarning,
  #fatal,
  .toast {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
    padding: 0;
  }
  .hero,
  .page,
  .card,
  .stat,
  .game,
  .record,
  .chart,
  .paircard {
    background: #fff !important;
    border-color: #999 !important;
    box-shadow: none !important;
  }
  h1,
  h2,
  h3 {
    color: #000 !important;
  }
  .page {
    display: block !important;
  }
}
.sort-indicator {
  display: inline-block;
  font-size: 0.68rem;
  margin-right: 3px;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.sort-indicator.active {
  opacity: 1;
}
th.sortable {
  cursor: pointer;
  user-select: none;
}
th.sortable:hover {
  filter: brightness(1.08);
}
.theme-current.clickable {
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.15s;
  position: relative;
  padding-left: 120px;
}
.theme-current.clickable:hover {
  background: var(--hover);
  border-color: var(--border);
  transform: translateY(-1px);
}
.theme-current.clickable:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--hover);
}
.theme-hint {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  pointer-events: none;
  opacity: 0.85;
}
.theme-current.clickable:hover .theme-hint {
  color: var(--accent);
  opacity: 1;
}
.card.collapsible {
  padding: 0;
  overflow: hidden;
}
.collapse-header {
  width: 100%;
  background: transparent;
  border: 0;
  padding: 15px;
  color: var(--accent);
  font-family: var(--font, inherit);
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: right;
  transition: background 0.2s;
}
.collapse-header:hover {
  background: var(--hover);
}
.collapse-header:focus-visible {
  outline: none;
  background: var(--hover);
}
.collapse-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.collapse-count {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 600;
  background: var(--hover);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 99px;
}
.collapse-arrow {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--muted);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}
.collapse-header[aria-expanded="true"] .collapse-arrow {
  transform: rotate(180deg);
}
.collapse-body {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.35s ease,
    padding 0.3s ease,
    opacity 0.25s ease;
  opacity: 0;
  padding: 0 15px;
}
.collapse-body.open {
  max-height: 3000px;
  opacity: 1;
  padding: 0 15px 15px;
}
@media (max-width: 760px) {
  .collapse-header {
    padding: 12px;
    font-size: 1.08rem;
  }
  .collapse-body {
    padding: 0 12px;
  }
  .collapse-body.open {
    padding: 0 12px 12px;
  }
}
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(244, 207, 106, 0.08), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(212, 175, 55, 0.05), transparent 50%),
    linear-gradient(180deg, #0e0e16 0%, #07070c 60%, #04040a 100%);
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}
.loading-screen.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 30px;
  max-width: 340px;
  width: 100%;
}
.loading-content .logo-wrap {
  position: relative;
  width: 80px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-content .logo-wrap::before {
  content: "";
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 207, 106, 0.18), transparent 65%);
  animation: loadingGlow 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes loadingGlow {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}
.loading-content .logo-svg {
  width: 100%;
  height: 100%;
  color: #f4cf6a;
  filter: drop-shadow(0 3px 12px rgba(244, 207, 106, 0.5));
  animation: loadingFloat 3s ease-in-out infinite;
}
@keyframes loadingFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
.loading-content .logo-svg circle {
  animation: loadingDotPulse 2.4s ease-in-out infinite;
}
.loading-content .logo-svg circle:nth-child(2) {
  animation-delay: 0s;
}
.loading-content .logo-svg circle:nth-child(3) {
  animation-delay: 0.15s;
}
.loading-content .logo-svg circle:nth-child(4) {
  animation-delay: 0.3s;
}
@keyframes loadingDotPulse {
  0%,
  100% {
    opacity: 0.5;
    r: 2.6;
  }
  50% {
    opacity: 1;
    r: 3.4;
  }
}
.loading-msg {
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #f4cf6a;
  letter-spacing: 0.02em;
  text-align: center;
  min-height: 1.6em;
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}
.loading-msg.swap {
  opacity: 0;
  transform: translateY(6px);
}
.loading-bar {
  width: 100%;
  max-width: 260px;
  height: 3px;
  background: rgba(212, 175, 55, 0.12);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.loading-bar::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, #f4cf6a, #d4af37, #f4cf6a, transparent);
  box-shadow: 0 0 12px rgba(244, 207, 106, 0.6);
  animation: loadingSlide 1.8s ease-in-out infinite;
}
@keyframes loadingSlide {
  0% {
    right: -45%;
  }
  100% {
    right: 105%;
  }
}
.loading-sub {
  font-size: 0.72rem;
  color: #a8987a;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.03em;
  opacity: 0.85;
}
/* ===== کاربران آنلاین (شناور پایین راست) ===== */
.online-users {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  right: 16px;
  z-index: 8;
  display: none;
  align-items: center;
  padding: 5px 12px 5px 16px;
  background: linear-gradient(145deg, var(--card2), var(--card));
  border: 1px solid var(--border);
  border-radius: 99px;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}
.online-users.show {
  display: flex;
  animation: onlineIn 0.35s ease;
}
@keyframes onlineIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.online-avatars {
  display: flex;
  align-items: center;
}
.online-av {
  display: inline-flex;
  margin-left: -7px;
  cursor: default;
  transition: transform 0.2s ease;
  position: relative;
}
.online-av:first-child {
  margin-left: 0;
}
.online-av:hover {
  transform: translateY(-4px) scale(1.15);
  z-index: 2;
}
.online-av .avatar {
  border: 2px solid var(--card);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  width: 24px;
  height: 24px;
  font-size: 10px;
}
.online-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  margin-left: -7px;
  border: 2px solid var(--card);
  font-family: var(--font);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
/* ===== فرم تغییر رمز ===== */
.pwd-eye {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  line-height: 1;
  transition:
    background 0.2s,
    color 0.2s;
}
.pwd-eye:hover {
  color: var(--accent);
  background: var(--hover);
}
#profilePasswordFormBox label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
#profilePasswordFormBox input {
  padding-left: 44px !important;
  margin-top: 6px;
}
#profilePasswordFormBox .actions {
  margin-top: 4px;
}
/* ===== دکمه سینک دستی (کنار چرخ‌دنده تنظیمات) ===== */
.syncbtn {
  position: fixed;
  top: 14px;
  left: 60px;
  z-index: 9;
  width: 34px;
  height: 34px;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--card);
  border: 1px solid var(--soft);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  padding: 0;
  transition:
    transform 0.15s,
    box-shadow 0.2s,
    background 0.2s;
}
.syncbtn svg {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.syncbtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.16);
  background: var(--hover);
}
.syncbtn:active {
  transform: translateY(0) scale(0.92);
}
.syncbtn.syncing {
  pointer-events: none;
  border-color: var(--border);
  color: var(--accent);
}
.syncbtn.syncing svg {
  animation: syncSpin 1s linear infinite;
}
@keyframes syncSpin {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}
.syncbtn.ok {
  color: var(--success);
  border-color: var(--success);
  background: rgba(84, 139, 103, 0.15);
}
.syncbtn.err {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(170, 80, 75, 0.15);
}
/* ===== مخفی کردن دکمه‌های عملی هنگام اسکرول پایین ===== */
#settingsGear,
#profileBtn,
#syncBtn {
  transition:
    transform 0.28s ease,
    opacity 0.28s ease;
}
body.hide-actions #settingsGear,
body.hide-actions #profileBtn,
body.hide-actions #syncBtn {
  opacity: 0;
  transform: translateY(-16px);
  pointer-events: none;
}

/* =====================================================
   UI OVERRIDE LAYER — ادغام الگوی «پاتوق» (patoogh-ui-pattern)
   ---------------------------------------------------------------
   • همه‌ی اسم‌های کلاس دست‌نخورده است؛ فقط ظاهر عوض می‌شود.
   • رنگ‌ها از متغیرهای تم مشتق شده‌اند تا تم‌های فعال کار کنند.
     (نکته: تم متغیرها را با setProperty روی <html> می‌نویسد و بر
      هر قاعده‌ی :root غلبه می‌کند، پس توکن‌های :root بازنویسی نشدند؛
      به‌جایش از نام‌های تازه استفاده شده و روی خودِ کامپوننت‌ها
      اعمال شده است.)
   ===================================================== */
:root {
  /* فاصله‌گذاری */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 28px;
  /* شعاع */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-full: 9999px;
  /* تایپوگرافی */
  --t-xs: 0.72rem;
  --t-sm: 0.82rem;
  --t-base: 0.95rem;
  --t-lg: 1.1rem;
  /* ناحیه‌ی امن موبایل */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  /* هدف لمسی */
  --tap: 44px;
  /* خطوط مویی مشتق از تم */
  --hair: color-mix(in srgb, var(--primary) 22%, transparent);
  --hair-strong: color-mix(in srgb, var(--primary) 40%, transparent);
  --glass: color-mix(in srgb, var(--bg) 74%, transparent);
}

/* فونت از CDN لود می‌شود (لینک در head). قوانین @font-face بالا به
   vendor/ اشاره می‌کردند که وجود نداشت و هر بار ۴۰۴ می‌دادند. */

/* ---------- پایه ---------- */
html {
  height: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  font-family: var(--font, "Vazirmatn"), system-ui, sans-serif;
  font-size: var(--t-base);
  line-height: 1.6;
  padding: calc(var(--space-md) + var(--safe-t)) calc(var(--space-md) + var(--safe-r))
    calc(var(--space-2xl) + var(--safe-b)) calc(var(--space-md) + var(--safe-l));
}
h1,
h2,
h3 {
  font-family: var(--font, "Vazirmatn"), system-ui, sans-serif;
  letter-spacing: -0.02em;
}
.hero {
  border-radius: var(--r-xl);
}
.hero p,
.muted {
  font-size: var(--t-sm);
}

/* ---------- کارت‌ها ---------- */
.card {
  border-radius: var(--r-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}
.card.subsection {
  padding: var(--space-lg) 0 0;
  margin-top: var(--space-lg);
}

/* ---------- نوار تب بالا (الگوی nav-item) ---------- */
.tabs {
  gap: var(--space-xs);
  padding: var(--space-sm) 0 var(--space-lg);
}
.tab {
  min-height: var(--tap);
  border-radius: var(--r-md);
  font-size: var(--t-xs);
  font-weight: 600;
}
.tab:hover:not(.active) {
  transform: translateY(-2px);
}
.tab.active {
  transform: none;
  box-shadow: 0 4px 16px var(--hover);
}

/* ---------- دکمه‌ها ----------
   عمداً flex ست نشده تا چیدمان ردیف‌های .actions (مثل CSV/چاپ) نشکند */
.btn {
  min-height: var(--tap);
  border-radius: var(--r-md);
  font-size: var(--t-base);
  font-weight: 700;
}
.actions {
  gap: 10px;
}
.btn.secondary {
  border-radius: var(--r-md);
}

/* نوار اقدام چسبان صفحه‌ی ثبت (الگوی sticky-actions) */
#register .actions {
  position: sticky;
  bottom: calc(8px + var(--safe-b));
  z-index: 50;
  margin-top: var(--space-lg);
  padding: 12px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--soft);
  border-radius: var(--r-lg);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
}

/* ---------- اسلات‌های VS (الگوی player-slot) ---------- */
.vs-slots {
  gap: 10px;
  margin-bottom: var(--space-lg);
}
.vs-slot {
  min-height: 120px;
  border-radius: var(--r-lg);
  padding: 12px 8px;
  gap: 6px;
}
.vs-slot.filled {
  background: linear-gradient(180deg, var(--hover), transparent 80%);
  box-shadow: 0 4px 16px var(--hover);
}
.vs-slot-name {
  font-size: var(--t-sm);
  font-weight: 900;
}
.vs-slot-label {
  font-size: var(--t-xs);
}
.vs-slot-hint {
  font-size: var(--t-xs);
}
.vs-stat,
.winner-stat {
  font-size: var(--t-xs);
  border-radius: var(--r-full);
}

/* ---------- استخر بازیکن (الگوی pool-card) ---------- */
.player-pool {
  gap: var(--space-sm);
}
.pool-player {
  border-radius: var(--r-md);
  min-height: 96px;
  padding: 12px 6px;
  gap: 6px;
}
.pool-player .pp-name {
  font-size: var(--t-sm);
  font-weight: 700;
  line-height: 1.2;
}
.pool-player .pp-stats {
  font-size: var(--t-xs);
  border-radius: var(--r-full);
}

/* ---------- نبرد (الگوی winner-card) ---------- */
.winner-arena {
  border-radius: var(--r-xl);
  padding: var(--space-md) 6px;
}
.winner-side {
  border-radius: var(--r-lg);
  min-height: 110px;
  padding: 16px 10px;
  gap: var(--space-sm);
}
.winner-name {
  font-size: var(--t-base);
}
.winner-pick {
  font-size: var(--t-xs);
}

/* ---------- نوع برد (الگوی type-btn) ---------- */
.choice {
  border-radius: var(--r-md);
}
.type-buttons {
  gap: var(--space-sm);
}
.type-buttons .choice {
  min-height: 88px;
  padding: 14px 6px;
  gap: 4px;
  font-size: 1.1rem;
}
.choice-emoji {
  font-size: 1.6rem;
}
.type-buttons .choice small {
  font-size: var(--t-xs);
  font-weight: 600;
}

/* ---------- پیش‌نمایش ---------- */
.preview {
  border-radius: var(--r-lg);
  border-right-width: 4px;
}
.preview-badge {
  border-radius: var(--r-full);
  font-size: var(--t-xs);
  font-weight: 800;
}

/* ---------- کارت آمار (الگوی summary-chip) ---------- */
.summary {
  gap: 10px;
  margin-bottom: var(--space-lg);
}
.stat {
  border-radius: var(--r-md);
  padding: 14px 12px;
}
.stat strong {
  font-size: 1.25rem;
}
.stat span {
  font-size: var(--t-xs);
  font-weight: 600;
}

/* ---------- کارت بازی و رکورد (الگوی history-card) ---------- */
.game,
.record,
.paircard,
.chart {
  border-radius: var(--r-lg);
}
.game {
  padding: 14px;
}
.record {
  padding: 14px;
}
.chart {
  padding: var(--space-lg);
}
.badge {
  border-radius: var(--r-full);
  font-size: var(--t-xs);
  font-weight: 700;
}
.tag {
  border-radius: var(--r-full);
  font-size: var(--t-xs);
}
.meta {
  font-size: var(--t-sm);
}
.record small {
  font-size: var(--t-xs);
}

/* ---------- آواتار ----------
   فقط استایل؛ عرض/ارتفاع عمداً ست نشده چون JS آن را inline می‌نویسد
   (avatarHTML در خط ~694) و هر مقدار CSS اینجا بی‌اثر می‌شد */
.avatar {
  font-weight: 900;
  border: 2px solid rgba(255, 255, 255, 0.12);
}

/* ---------- فرم‌ها ---------- */
label {
  font-size: var(--t-sm);
  font-weight: 600;
}
input,
select,
textarea {
  min-height: var(--tap);
  border-radius: var(--r-md);
  font-size: var(--t-base);
}

/* ---------- حالت خالی (الگوی empty-state) ---------- */
.empty {
  padding: 40px 20px;
  font-size: var(--t-sm);
}

/* ---------- مودال و تم ---------- */
.modal {
  border-radius: var(--r-xl);
  padding: var(--space-lg);
}
.theme {
  border-radius: var(--r-md);
}
.themegrid {
  gap: var(--space-sm);
}
.theme-current {
  border-radius: var(--r-md);
}

/* ---------- جدول تورنمنت: کارت به‌جای جدول (الگوی rank-card) ----------
   جدول قبلی min-width:860px داشت و روی موبایل اسکرول افقی می‌داد */
.sortbar {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: var(--space-md);
  -webkit-overflow-scrolling: touch;
}
.sort-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  background: var(--input);
  border: 1px solid var(--soft);
  border-radius: var(--r-full);
  color: var(--muted);
  font-family: var(--font, "Vazirmatn"), system-ui, sans-serif;
  font-size: var(--t-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.18s,
    color 0.18s,
    border-color 0.18s;
  min-height: 38px;
}
.sort-chip:hover {
  border-color: var(--border);
  color: var(--text);
}
.sort-chip:has(.sort-indicator.active) {
  background: linear-gradient(145deg, var(--primary), var(--dark));
  border-color: var(--primary);
  color: var(--contrast);
}
.sort-chip .sort-indicator {
  font-size: 0.7rem;
  opacity: 0.7;
}
.sort-chip .sort-indicator.active {
  opacity: 1;
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rank-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--soft);
  border-radius: var(--r-lg);
  transition:
    background 0.18s,
    transform 0.18s;
}
.rank-card.alt {
  background: var(--card2);
}
.rank-card:active {
  transform: scale(0.99);
}
.rank-card .rank-pos {
  flex: 0 0 34px;
  width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--accent);
}
.rank-card .rank-pos.gold {
  color: #ffd700;
  font-size: 1.3rem;
}
.rank-card .rank-pos.silver {
  color: #c0c0c0;
  font-size: 1.3rem;
}
.rank-card .rank-pos.bronze {
  color: #cd7f32;
  font-size: 1.3rem;
}
.rank-card .rank-info {
  flex: 1;
  min-width: 0;
}
.rank-card .rank-name {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 700;
  font-size: var(--t-base);
  margin-bottom: 4px;
}
.rank-card .rank-name .evaluation {
  font-size: var(--t-xs);
  font-weight: 600;
  padding: 1px 8px;
  border-radius: var(--r-full);
  color: var(--muted);
}
.rank-card .rank-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--t-xs);
  color: var(--muted);
  font-weight: 600;
}
.rank-card .rank-stats .sep {
  opacity: 0.45;
}
.rank-card .rank-stats b {
  font-weight: 900;
}
.rank-card .rank-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.rank-card .rank-breakdown .rb {
  font-size: var(--t-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.04);
}
.rank-card .rank-breakdown .ok {
  color: var(--success);
}
.rank-card .rank-breakdown .mid {
  color: var(--mars);
}
.rank-card .rank-breakdown .bad {
  color: var(--black);
}
.rank-card .rank-side {
  flex: 0 0 auto;
  text-align: center;
  padding-inline-start: 10px;
  border-inline-start: 1px solid var(--soft);
}
.rank-card .rank-points {
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--primary);
  line-height: 1.1;
}
.rank-card .rank-avg {
  font-size: var(--t-xs);
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
}

/* ---------- اصلاحات چیدمان موبایل ----------
   media query اصلی برنامه (max-width:760px) همه‌چیز را تک‌ستونه/کوچک می‌کرد
   جز .records و چند مورد دیگر. اینها همان جاهایی هستند که روی موبایل
   بد به‌نظر می‌رسیدند. */

/* رکوردهای آمار: روی موبایل دو ستون خیلی تنگ بود و متن روی ۳ خط می‌شکست.
   یک ستون + چیدمان سطری (برچسب کنار مقدار) فضای افقی را استفاده می‌کند. */
@media (max-width: 760px) {
  .records {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .record {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 11px 13px;
  }
  .record small {
    flex: 0 0 auto;
    font-size: var(--t-xs);
    color: var(--muted);
    font-weight: 600;
    max-width: 42%;
  }
  .record strong {
    flex: 1 1 auto;
    min-width: 0;
    margin-top: 0;
    font-size: var(--t-sm);
    line-height: 1.55;
    color: var(--accent);
  }
}

/* فیلترهای تاریخچه: ۲ ورودی در یک ردیف در عرض کم فشرده می‌شد */
@media (max-width: 420px) {
  .filters2 {
    grid-template-columns: 1fr;
  }
  .filters {
    grid-template-columns: 1fr;
  }
}

/* فیلدهای تاریخ در اپ RTL با فرمت آمریکایی نمایش داده می‌شدند
   و جهت متن با محتوا هم‌خوان نبود. */
input[type="date"],
input[type="datetime-local"],
input[type="time"] {
  direction: ltr;
  text-align: right;
}
html[dir="rtl"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.6);
}

/* نمودارها min-width:560px داشتند و روی موبایل اسکرول افقی می‌دادند */
@media (max-width: 760px) {
  .chartbox {
    border-radius: var(--r-md);
  }
  .chartbox svg {
    min-width: 0;
    width: 100%;
    height: 200px;
  }
  .chart {
    padding: var(--space-md);
  }
}

/* دکمه‌های نوع برد در عرض خیلی کم سه‌ستونی تنگ می‌شدند */
@media (max-width: 400px) {
  .type-buttons {
    gap: 6px;
  }
  .type-buttons .choice {
    padding: 12px 3px;
    font-size: 0.95rem;
    min-height: 80px;
  }
  .choice-emoji {
    font-size: 1.35rem;
  }
}

/* متن دکمه‌های ردیف .actions روی عرض کم می‌شکست (مثلاً «خروجی CSV اکسل») */
@media (max-width: 430px) {
  .actions .btn {
    font-size: var(--t-sm);
    padding: 9px 10px;
    flex: 1 1 100%;
  }
}

/* =====================================================
   ناوبری پایین صفحه
   الگو: روی موبایل نوار پایین، روی دسکتاپ نوار تب بالایی.
   ===================================================== */
:root {
  --nav-h: 62px;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 120;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  padding-inline: 4px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-top: 1px solid var(--soft);
}
.nav-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: 0;
  color: var(--muted);
  font-family: var(--font, "Vazirmatn"), system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.nav-item .nav-icon {
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.2s;
}
.nav-item span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-item.active {
  color: var(--accent);
}
.nav-item.active .nav-icon {
  transform: translateY(-2px) scale(1.1);
}
.nav-item.active::after {
  content: "";
  position: absolute;
  top: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
}
.nav-item:active {
  transform: scale(0.94);
}
.nav-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -3px;
  border-radius: 10px;
}

/* حالت مهمان: تب «ثبت» در نوار بالا پنهان می‌شود، پس آیتم متناظرش در
   نوار پایین هم باید پنهان شود — وگرنه مهمان از راه پایین صفحه‌ی ثبت را
   باز می‌کند و محدودیت دور زده می‌شود. */
.guest-mode .nav-item[data-page="register"] {
  display: none !important;
}

/* روی موبایل نوار تب بالایی پنهان و نوار پایین جایگزین می‌شود */
@media (max-width: 767px) {
  .tabs {
    display: none;
  }
  body {
    padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  }
  /* نوار اقدام چسبان باید بالای ناوبری بنشیند، نه زیرش */
  #register .actions {
    bottom: calc(var(--nav-h) + var(--safe-b) + 8px);
  }
  .toast {
    bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  }
  #top {
    bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  }
  .online-users {
    bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  }
}
/* روی دسکتاپ نوار پایین حذف می‌شود و نوار تب بالایی می‌ماند */
@media (min-width: 768px) {
  .bottom-nav {
    display: none;
  }
}

/* ---------- دسکتاپ ---------- */
@media (min-width: 768px) {
  .page {
    padding: 24px;
  }
  .player-pool {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- کاهش حرکت ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================================
   بهبودهای UI (نسخه‌ی ۲)
   ===================================================== */
.btn.link-danger,
.btn.danger-text {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--soft);
  box-shadow: none;
}
#register #last {
  min-height: 36px;
  padding: 6px 12px;
  font-size: var(--t-sm);
}
#quickTags .tag {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
}
.hsearch {
  display: block;
  margin-bottom: 10px;
}
.filterbox {
  border: 1px solid var(--soft);
  border-radius: var(--r-md);
  padding: 0 12px;
}
.filterbox > summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 700;
  color: var(--accent);
}
.filterbox[open] {
  padding-bottom: 12px;
}
.game-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}
.btn.mini {
  min-height: 36px;
  padding: 6px 14px;
  font-size: var(--t-sm);
  flex: 0 0 auto;
}
.more-btn {
  width: 100%;
  margin-top: 12px;
}
#ranking .wrap {
  scrollbar-width: thin;
  scrollbar-color: var(--soft) transparent;
}
#ranking .wrap::-webkit-scrollbar {
  height: 6px;
}
#ranking .wrap::-webkit-scrollbar-track {
  background: transparent;
}
#ranking .wrap::-webkit-scrollbar-thumb {
  background: var(--soft);
  border-radius: 9px;
}
#ranking table th:first-child,
#ranking table td:first-child {
  position: sticky;
  right: 0;
  z-index: 1;
}
#ranking table th:first-child {
  background: var(--dark);
}
#ranking table td:first-child {
  background: var(--card);
}
.rchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.rchip {
  padding: 3px 10px;
  border-radius: var(--r-full, 99px);
  background: var(--hover);
  border: 1px solid var(--soft);
  font-size: var(--t-sm);
  white-space: nowrap;
}
@media (min-width: 1100px) {
  .gearbtn {
    left: calc(50% - 525px + 14px);
    top: 24px;
  }
}

/* =====================================================
   تم‌های لوکس (شاهانه، زمرد سلطنتی، گردو و چرم)
   فعال با [data-lux] که apply() در app.js ست می‌کند
   ===================================================== */
[data-lux] body {
  background-attachment: fixed;
}
[data-lux] h1 {
  background: linear-gradient(
    100deg,
    var(--dark) 0%,
    var(--primary) 22%,
    #fff7dc 40%,
    var(--accent) 50%,
    var(--primary) 66%,
    var(--dark) 100%
  );
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 12px rgba(227, 194, 122, 0.28));
  animation: luxShine 7s linear infinite;
}
@keyframes luxShine {
  to {
    background-position: -250% center;
  }
}
[data-lux] h2,
[data-lux] h3 {
  color: var(--accent);
  text-shadow: 0 0 18px rgba(227, 194, 122, 0.25);
  letter-spacing: 0.2px;
}
[data-lux] .hero-logo {
  color: var(--primary);
  filter: drop-shadow(0 0 8px rgba(227, 194, 122, 0.45));
}
[data-lux] .hero,
[data-lux] .card,
[data-lux] .stat,
[data-lux] .record,
[data-lux] .game,
[data-lux] .chart,
[data-lux] .pool-player,
[data-lux] .modal,
[data-lux] .theme-current {
  border: 1px solid transparent;
  background:
    linear-gradient(160deg, var(--card2), var(--card)) padding-box,
    linear-gradient(
        135deg,
        rgba(255, 236, 180, 0.6),
        rgba(227, 194, 122, 0.1) 28%,
        rgba(227, 194, 122, 0.04) 70%,
        rgba(255, 236, 180, 0.45)
      )
      border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 200, 0.07),
    0 22px 44px -22px rgba(0, 0, 0, 0.85);
}
[data-lux] .hero {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(247, 226, 168, 0.16), transparent 70%) padding-box,
    linear-gradient(160deg, var(--card2), var(--card)) padding-box,
    linear-gradient(90deg, rgba(255, 236, 180, 0.15), rgba(255, 236, 180, 0.7), rgba(255, 236, 180, 0.15)) border-box;
}
[data-lux] .stat strong,
[data-lux] .record strong {
  color: var(--accent);
  text-shadow: 0 0 14px rgba(227, 194, 122, 0.3);
}
[data-lux] .pool-player {
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
[data-lux] .pool-player:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(255, 236, 180, 0.35),
    0 14px 30px -12px rgba(227, 194, 122, 0.35);
}
[data-lux] .btn.success:not(:disabled),
[data-lux] .tab.active {
  position: relative;
  overflow: hidden;
  color: var(--contrast);
  background: linear-gradient(135deg, #fff3c4 0%, var(--accent) 20%, var(--primary) 52%, var(--dark) 100%);
  border-color: transparent;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 10px 26px -10px var(--primary);
}
[data-lux] .btn.success:not(:disabled)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: luxSweep 3.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes luxSweep {
  55%,
  100% {
    transform: translateX(120%);
  }
}
[data-lux] .bottom-nav {
  border-top: 1px solid var(--border);
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.6);
}
[data-lux] .gearbtn {
  border-color: var(--border);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 0 14px rgba(227, 194, 122, 0.25);
}
@media (prefers-reduced-motion: reduce) {
  [data-lux] h1,
  [data-lux] .btn.success::after {
    animation: none;
  }
}

[data-lux] .card .card,
[data-lux] .subsection {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding-inline: 0;
}
[data-lux] .subsection > h2,
[data-lux] .subsection > h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}
[data-lux] .subsection > h2:after,
[data-lux] .subsection > h3:after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(270deg, var(--border), transparent);
}
[data-lux] .winner-arena,
[data-lux] #typeButtons > * {
  border: 1px solid transparent;
  background:
    linear-gradient(160deg, var(--card2), var(--card)) padding-box,
    linear-gradient(135deg, rgba(255, 236, 180, 0.45), rgba(227, 194, 122, 0.06) 40%, rgba(255, 236, 180, 0.3))
      border-box;
}
[data-lux] .btn.success:disabled {
  opacity: 1;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  box-shadow: none;
}

/* دکمه‌های شیشه‌ای با درخشش داخلی (تم‌های لوکس) */
[data-lux] {
  --glass-bg: linear-gradient(160deg, rgba(255, 240, 200, 0.1), rgba(255, 240, 200, 0.02) 45%, rgba(0, 0, 0, 0.18));
  --glass-edge: rgba(255, 226, 160, 0.3);
  --glow-in: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    inset 0 0 22px rgba(227, 194, 122, 0.1);
  --gold-glass: linear-gradient(
    160deg,
    rgba(255, 236, 170, 0.55),
    rgba(227, 194, 122, 0.28) 45%,
    rgba(138, 106, 44, 0.4)
  );
  --glow-on: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 0 24px rgba(255, 226, 150, 0.45),
    0 0 22px -4px rgba(227, 194, 122, 0.6);
}
[data-lux] .btn,
[data-lux] .tab,
[data-lux] .choice,
[data-lux] .vs-slot,
[data-lux] .tag,
[data-lux] .theme,
[data-lux] .gearbtn,
[data-lux] .syncbtn {
  background: var(--glass-bg), rgba(20, 16, 10, 0.35);
  border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  box-shadow:
    var(--glow-in),
    0 8px 22px -14px rgba(0, 0, 0, 0.9);
  transition:
    box-shadow 0.25s,
    border-color 0.25s,
    transform 0.15s,
    background 0.25s;
}
[data-lux] .btn,
[data-lux] .tab {
  position: relative;
  overflow: hidden;
}
[data-lux] .btn::before,
[data-lux] .tab::before {
  content: "";
  position: absolute;
  inset: 1px 1px 50% 1px;
  border-radius: inherit;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
  pointer-events: none;
}
[data-lux] .btn:hover:not(:disabled),
[data-lux] .tab:hover:not(.active),
[data-lux] .choice:hover,
[data-lux] .vs-slot:hover,
[data-lux] .theme:hover,
[data-lux] .tag:hover {
  border-color: rgba(255, 226, 160, 0.6);
  box-shadow:
    var(--glow-in),
    inset 0 0 28px rgba(227, 194, 122, 0.22),
    0 0 18px -4px rgba(227, 194, 122, 0.45);
}
[data-lux] .btn:active:not(:disabled),
[data-lux] .choice:active,
[data-lux] .tab:active {
  transform: scale(0.97);
}
[data-lux] .btn.success:not(:disabled),
[data-lux] .tab.active,
[data-lux] .choice.active,
[data-lux] .choice.selected,
[data-lux] .vs-slot.filled,
[data-lux] .theme.active,
[data-lux] .tag.on,
[data-lux] .tag.active {
  background: var(--gold-glass), rgba(20, 16, 10, 0.3);
  color: #fff8e6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 236, 180, 0.8);
  box-shadow: var(--glow-on);
}
[data-lux] .btn.success:not(:disabled) {
  animation: luxPulse 2.8s ease-in-out infinite;
}
@keyframes luxPulse {
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.6),
      inset 0 0 30px rgba(255, 226, 150, 0.6),
      0 0 30px -2px rgba(227, 194, 122, 0.8);
  }
}
[data-lux] .btn.link-danger,
[data-lux] .btn.danger-text,
[data-lux] .btn.danger {
  color: #ff9a8f;
  border-color: rgba(196, 87, 79, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 20px rgba(196, 87, 79, 0.16);
}
[data-lux] .btn.success:disabled {
  background: var(--glass-bg), rgba(0, 0, 0, 0.3);
  color: var(--muted);
}
[data-lux] .bottom-nav {
  background: linear-gradient(180deg, rgba(255, 240, 200, 0.06), rgba(0, 0, 0, 0.35)), rgba(10, 8, 5, 0.55);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}
@media (prefers-reduced-motion: reduce) {
  [data-lux] .btn.success:not(:disabled) {
    animation: none;
  }
}
[data-lux] .choice.active small {
  color: #fff3d0;
  opacity: 0.9;
}
[data-lux] #typeButtons > .choice {
  background: var(--glass-bg), rgba(20, 16, 10, 0.35);
  border-color: var(--glass-edge);
}
[data-lux] #typeButtons > .choice.active {
  background: var(--gold-glass), rgba(20, 16, 10, 0.3);
  border-color: rgba(255, 236, 180, 0.8);
}

/* ===== فصل‌ها و قهرمان ماه ===== */
.seasonbar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: thin; }
.seasonchip { flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--gold-glass); background: rgba(212,175,55,.07); color: var(--primary); font-family: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; transition: all .2s; }
.seasonchip.active { background: linear-gradient(145deg, var(--primary), var(--dark)); color: var(--contrast); border-color: transparent; }
.seasonchip.hof { border-style: dashed; }
#seasonBanner { margin: 0 0 10px; }
.champion-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: linear-gradient(135deg, rgba(212,175,55,.18), rgba(212,175,55,.06)); border: 1px solid var(--gold-glass); }
.cb-crown { font-size: 2rem; filter: drop-shadow(0 2px 6px rgba(212,175,55,.5)); }
.cb-text strong { color: var(--primary); display: block; margin-bottom: 2px; }
.crown { font-size: .9em; }
.hof-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--gold-glass); border-radius: 14px; margin-bottom: 10px; background: rgba(212,175,55,.05); }
.hof-crown { font-size: 1.6rem; }
.hof-main { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.hof-champ { display: flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 700; }
.hof-side { text-align: left; font-size: .85rem; }

/* ===== زنگوله‌ی اعلان بازی جدید ===== */
.notify-bell { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--gold-glass); background: rgba(212,175,55,.08); font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.notify-bell.on { background: linear-gradient(145deg, var(--primary), var(--dark)); border-color: transparent; }

/* 🎲 سوییچر میز */
.league-switch{background:var(--card);border:1px solid var(--soft);color:var(--ink);border-radius:12px;padding:6px 8px;font:inherit;font-size:.8rem;max-width:132px;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.15)}
.league-switch:focus{outline:2px solid var(--accent,#c9a227);outline-offset:1px}

/* جزئیات بیشتر صفحه ثبت */
.more-details {
  margin-top: 10px;
  border-top: 1px solid var(--soft);
  padding-top: 8px;
}
.more-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  user-select: none;
  list-style: none;
}
.more-details summary::-webkit-details-marker { display: none; }
.more-details[open] summary { margin-bottom: 2px; }

/* دکمه ثبت تمام‌عرض در صفحه ثبت */
#register .actions { margin-top: 14px; }
#register #add {
  width: 100%;
  padding: 14px;
  font-size: 1.05rem;
  font-weight: 900;
}
