/* --- ПАТЧ: адаптивные кнопки Deposit и баланс --- */
@media (max-width: 600px) {
  .user-info > div {
    flex-direction: column !important;
    gap: 8px !important;
    align-items: stretch !important;
  }
  .user-info .user-action-btn {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    font-size: 1em !important;
    box-sizing: border-box !important;
  }
  #userBalance {
    font-size: 1em !important;
    max-width: 95vw !important;
    word-break: break-all !important;
    white-space: normal !important;
    text-align: center !important;
    display: block !important;
    margin: 0 auto !important;
  }
}
@media (max-width: 400px) {
  #userBalance {
    font-size: 0.93em !important;
  }
}


/* --- ПАТЧ: унификация позиционирования модалок --- */
.user-modal {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}


/* --- ПАТЧ: модалки, игровые поля, шрифты (безопасно добавлено) --- */
.user-modal {
  background: #fff;
  border: 1.5px solid #4a90e2;
  border-radius: 8px;
  box-shadow: 0 2px 8px #0002;
  padding: 18px 16px;
  font-size: 1.08em;
  color: #222;
  margin-top: 8px;
  margin-bottom: 8px;
  text-align: center;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1200;
  min-width: 220px;
  max-width: 90vw;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: visible;
  max-height: 80vh;
  overflow-y: auto;
}

#faqModal, #supportModal {
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  padding-bottom: 18px;
}

#withdrawModal .centered-status,
#withdrawModal div {
  max-width: 340px;
  margin: 0 auto;
  word-break: break-word;
  white-space: normal;
  text-align: center;
}

.neon-title {
  font-family: 'Orbitron', 'SF Pro Display', 'Segoe UI', Arial, sans-serif;
  font-size: 3.2em;
  font-weight: 900;
  letter-spacing: 2.5px;
  color: var(--brand-neon);
  text-shadow: none !important;
  background: none;
  margin: 0;
  padding: 0;
  user-select: none;
  transition: text-shadow 0.2s;
}

body {
  font-family: 'SF Pro Display', 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(135deg, #181c24 0%, #1a233a 100%);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

#botBoard, #gameBoard {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  min-height: 440px;
}
/* --- КОНЕЦ ПАТЧА --- */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700;900&display=swap');

:root {
  --brand-neon: #00ffe7;
  --brand-green: #2ecc40;
  --brand-green-dark: #27ae60;
}

/* --- Единый брендовый цвет --- */
.brand-color {
  color: var(--brand-neon) !important;
  text-shadow: none !important;
}

/* --- НЕОНОВЫЙ ЗАГОЛОВОК --- */
.neon-title {
  font-family: 'Orbitron', 'SF Pro Display', 'Segoe UI', Arial, sans-serif;
  font-size: 3.2em;
  font-weight: 900;
  letter-spacing: 2.5px;
  color: var(--brand-neon);
  text-shadow: none !important;
  background: none;
  margin: 0;
  padding: 0;
  user-select: none;
  transition: text-shadow 0.2s;
}

/* --- НЕОНОВЫЙ БЛОК ОНЛАЙН-СТАТИСТИКИ --- */
.online-counter-neon-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 32px;
  margin-bottom: 18px;
}
.online-counter-neon {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(20, 20, 30, 0.85);
  border-radius: 16px;
  box-shadow: 0 0 16px var(--brand-green), 0 0 4px #fff;
  padding: 12px 32px;
  font-family: 'Orbitron', 'SF Pro Display', 'Segoe UI', Arial, sans-serif;
  font-size: 1.35em;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--brand-green);
  position: relative;
}
/* --- GREEN ONLINE DOT --- */
.online-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--brand-green) 60%, var(--brand-green-dark) 100%);
  box-shadow: 0 0 12px var(--brand-green), 0 0 2px #fff;
  margin-right: 8px;
  animation: online-dot-pulse 1.2s infinite alternate;
  display: inline-block;
}
@keyframes online-dot-pulse {
  0% { box-shadow: 0 0 8px var(--brand-green), 0 0 2px #fff; }
  100% { box-shadow: 0 0 24px var(--brand-green), 0 0 8px #fff; }
}
.online-label-neon {
  color: var(--brand-green);
  text-shadow: none !important;
  margin-right: 0;
  margin-left: 0;
}
.online-value-neon {
  color: var(--brand-green);
  text-shadow: none !important;
  font-size: 1.25em;
  font-weight: 900;
  margin-left: 4px;
  margin-right: 4px;
  letter-spacing: 1px;
}

/* --- ОСТАЛЬНОЙ СТАРЫЙ CSS --- */
@font-face {
  font-family: 'SF Pro Display';
  src: url('https://cdn.jsdelivr.net/npm/@fontsource-variable/sf-pro-display/files/sf-pro-display-latin-variable-wghtOnly-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  scrollbar-width: none;
}
body::-webkit-scrollbar {
  display: none;
}
body {
  font-family: 'SF Pro Display', 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(135deg, #181c24 0%, #1a233a 100%);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}
/* --- СТАРЫЙ БЛОК ОНЛАЙН СКРЫТ --- */
.online-counter-wrapper { display: none !important; }

.crypto-title-bg {
  width: 100%;
  text-align: center;
  margin-top: 40px;
  margin-bottom: 0;
  position: relative;
  z-index: 2;
}

/* --- USER INFO --- */
.user-info {
  margin-top: 8px;
  font-size: 1.18em;
  text-align: center;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}
.user-info .neon-title {
  font-size: 2em;
  margin-bottom: 0;
}
.user-info #userBalance.neon-title {
  font-size: 1.2em;
  margin-bottom: 0;
}
.user-info > div {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.user-info .user-action-btn {
  background: #f0f4fa;
  color: #357ab8;
  border: 1px solid #4a90e2;
  border-radius: 6px;
  padding: 7px 18px;
  font-size: 1em;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  margin: 0 2px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  display: inline-block;
}
.user-info .user-action-btn.logout-btn {
  color: #e94e77;
  border-color: #e94e77;
}
.user-info .user-action-btn:hover {
  background: #e8f5e9;
  color: #222;
}
.user-modal {
  background: #fff;
  border: 1.5px solid #4a90e2;
  border-radius: 8px;
  box-shadow: 0 2px 8px #0002;
  padding: 18px 16px;
  font-size: 1.08em;
  color: #222;
  margin-top: 8px;
  margin-bottom: 8px;
  text-align: center;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1200;
  min-width: 220px;
  max-width: 90vw;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: visible;
}
#depositStep1, #depositStep2 {
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* --- DEPOSIT MODAL ENHANCED --- */
.wallet-network-chooser {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin-bottom: 18px;
}
.wallet-network-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f8fafc;
  border: 2px solid #4a90e2;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 1.13em;
  font-weight: 700;
  color: #357ab8;
  cursor: pointer;
  transition: background 0.15s, border 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px #4a90e222;
  min-width: 150px;
}
.wallet-network-btn span {
  width: 100%;
  text-align: center;
}
.wallet-network-btn:hover, .wallet-network-btn:focus {
  background: #eaf6ff;
  border-color: #2ecc40;
  box-shadow: 0 4px 16px #2ecc4022;
}
.wallet-card {
  background: linear-gradient(120deg, #f8fafc 80%, #eafaf1 100%);
  border: 2px solid #4a90e2;
  border-radius: 14px;
  box-shadow: 0 4px 24px #4a90e222;
  padding: 18px 16px 12px 16px;
  margin-bottom: 10px;
  position: relative;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.wallet-card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.wallet-network-name {
  font-size: 1.18em;
  font-weight: 700;
  color: #357ab8;
  text-align: center;
  width: 100%;
}
.wallet-address-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 7px;
  border: 1.5px solid #4a90e2;
  padding: 8px 12px;
  font-size: 1.13em;
  font-family: 'SF Pro Display', 'Segoe UI', Arial, sans-serif;
  margin-bottom: 8px;
  word-break: break-all;
  position: relative;
  justify-content: center;
}
.wallet-address {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 1.08em;
  color: #222;
  letter-spacing: 0.5px;
  user-select: all;
}
.copy-btn.trust-copy-btn {
  background: #eafaf1;
  border: 1.5px solid #2ecc40;
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  margin-left: 4px;
  transition: background 0.12s, border 0.12s;
}
.copy-btn.trust-copy-btn:hover {
  background: #d4fbe3;
  border-color: #27ae60;
}
.copy-success-msg {
  color: #2ecc40;
  font-weight: 600;
  font-size: 1em;
  margin-left: 8px;
  display: inline-block;
  vertical-align: middle;
  animation: fadeInOut 1.2s;
}
@keyframes fadeInOut {
  0% { opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; }
}
.wallet-card-footer {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.wallet-trust-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #eafaf1;
  border-radius: 6px;
  padding: 3px 10px 3px 6px;
  font-size: 0.98em;
  color: #2ecc40;
  font-weight: 600;
  box-shadow: 0 1px 4px #2ecc4011;
}
.wallet-instruction {
  background: #f8fafc;
  border-left: 4px solid #4a90e2;
  border-radius: 6px;
  padding: 10px 12px;
  margin: 12px 0 10px 0;
  font-size: 1.08em;
  color: #222;
}
.wallet-sent-btn {
  margin-top: 8px;
  width: 100%;
  font-size: 1.13em !important;
  padding: 10px 0 !important;
  border-radius: 8px !important;
}
.deposit-status-msg {
  margin-top: 10px;
  font-size: 1.08em;
  font-weight: 600;
  color: #357ab8;
  text-align: center;
  min-height: 24px;
}
@media (max-width: 480px) {
  .wallet-card { padding: 10px 4px 8px 4px; min-width: 0; }
  .wallet-network-btn { padding: 8px 8px; font-size: 1em; }
  .wallet-instruction { font-size: 0.98em; padding: 7px 6px; }
}

/* --- Вертикальный отступ и центрирование для поиска матча --- */
#play-section {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px #0001;
  margin-bottom: 2px;
  padding: 32px 24px 0px 24px;
  min-height: 140px;
  margin-top: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#play-section h2,
#play-section .find-match-row-form,
#play-section #matchStatus,
#play-section #gameArea {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
#play-section h2 {
  margin-top: 0;
  margin-bottom: 12px;
}
.find-match-row-form {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.find-match-row-form label {
  margin: 0;
  font-size: 1.18em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.find-match-row-form .big-select {
  margin-left: 6px;
}
@media (max-width: 900px) {
  .find-match-row-form {
    gap: 12px;
  }
}
@media (max-width: 700px) {
  #play-section {
    margin-top: 12px;
    padding: 10px 2vw 0 2vw;
    min-height: 0;
  }
  .find-match-row-form {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .find-match-row-form label {
    font-size: 1em;
    flex-direction: row;
    justify-content: flex-start;
  }
}
@media (max-width: 600px) {
  #play-section {
    margin-top: 6px;
    padding: 6px 0 0 0;
    min-height: 0;
  }
  .find-match-row-form {
    gap: 8px;
  }
}

/* --- Настройка размера текста футера для моб/деск --- */
.footer-text-size {
  font-size: 1.1em;
}
/* --- остальной ваш CSS без изменений --- */
/* --- МИНИМАЛЬНЫЕ ОТСТУПЫ ПОД ИГРОВЫМ ПОЛЕМ (desktop) --- */
#bot-simulation,
#play-section {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px #0001;
  margin-bottom: 2px;
  padding: 32px 24px 0px 24px; /* padding-bottom: 4px */
}
#botMatch {
  margin: 0 auto 16px auto;
  max-width: 600px;
}
.bot-match-info {
  font-size: 1.2em;
  margin-bottom: 8px;
  text-align: center;
}
#botPlayers {
  font-size: 1.18em;
  margin-bottom: 2px;
  text-align: center;
}
#botRules {
  font-size: 1.08em;
  margin-bottom: 16px;
  color: #555;
  text-align: center;
}
.bot-match-result {
  margin-top: 8px;
  font-weight: bold;
  color: #4a90e2;
  text-align: center;
}
.bot-username {
  font-weight: 600;
  color: #222;
  margin: 0 2px;
}
.demo-victory {
  color: #2ecc40 !important;
  font-weight: 700;
  font-size: 1.13em;
  text-align: center;
  display: inline-block;
}
#playNowBtn {
  background: linear-gradient(90deg, #4a90e2 10%, #2ecc40 90%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 36px;
  font-size: 1.18em;
  font-family: 'SF Pro Display', 'Segoe UI', Arial, sans-serif;
  font-weight: 700;
  cursor: pointer;
  margin: 0 auto 18px auto;
  display: block;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px #4a90e233;
}
#playNowBtn:hover {
  background: linear-gradient(90deg, #357ab8 10%, #27ae60 90%);
  box-shadow: 0 4px 16px #4a90e244;
}
#play-section h2 {
  text-align: center;
  font-size: 1.55em;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: 1px;
  color: #222;
  font-family: 'SF Pro Display', 'Segoe UI', Arial, sans-serif;
}
#findMatchForm {
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  align-items: center;
  justify-content: center;
}
#findMatchForm label {
  margin-right: 0;
  font-size: 1.18em;
}
.big-select {
  font-size: 1.18em !important;
  padding: 8px 18px !important;
  border-radius: 7px !important;
  border: 1.5px solid #4a90e2 !important;
  margin-left: 8px;
  min-width: 110px;
  background: #f8fafc;
}
.big-btn {
  font-size: 1.18em !important;
  padding: 10px 32px !important;
  border-radius: 8px !important;
  background: linear-gradient(90deg, #4a90e2 10%, #2ecc40 90%);
  color: #fff;
  border: none;
  font-family: 'SF Pro Display', 'Segoe UI', Arial, sans-serif;
  font-weight: 700;
  cursor: pointer;
  margin: 0 8px;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px #4a90e233;
}
.big-btn:hover {
  background: linear-gradient(90deg, #357ab8 10%, #27ae60 90%);
  box-shadow: 0 4px 16px #4a90e244;
}
#matchInfo {
  display: block;
  margin-bottom: 0;
  min-height: 48px;
}
.timer-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
  font-size: 1.13em;
  font-family: 'SF Pro Display', 'Segoe UI', Arial, sans-serif;
}
@media (max-width: 700px) {
  .timer-label {
    min-width: 80px;
    font-size: 1em;
  }
}
#newMatchBtn {
  display: none !important;
}
#gameResult span[style*="color:#888"] {
  display: none !important;
}
/* --- LEADERBOARD --- */
.leaderboard-section {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.leaderboard-section .neon-title {
  font-size: 2em;
  margin-bottom: 12px;
  text-align: center !important;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0;
  margin-bottom: 18px;
}

.leaderboard {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px #0001;
  font-family: 'SF Pro Display', 'Segoe UI', Arial, sans-serif;
}
.leaderboard th, .leaderboard td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  text-align: center;
  font-size: 1.05em;
}
.leaderboard th {
  background: #f0f4fa;
  font-weight: bold;
}
.leaderboard tr:last-child td {
  border-bottom: none;
}
/* --- FOOTER --- */
.site-footer {
  width: 100%;
  background: transparent;
  margin-top: 2px; /* Было 12px, теперь меньше отступ под лидербордом */
  padding-bottom: 10px;
  padding-top: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.footer-inner {
  text-align: center;
  font-family: 'Cinzel', 'Georgia', serif;
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.85;
  color: var(--brand-neon) !important;
  text-shadow: none !important;
}
.footer-inner .footer-copyright,
.footer-inner .footer-desc {
  font-family: inherit;
  color: var(--brand-neon) !important;
  text-shadow: none !important;
}
.footer-copyright {
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-align: center;
  font-size: 1.1em;
}
.footer-desc {
  font-size: 0.95em;
  line-height: 1.5;
}
/* Чекбокс и текст идеально по центру, клик только по чекбоксу */
.over21-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  margin-top: 0;
  justify-content: flex-start;
  height: 32px;
  user-select: none;
}
.over21-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  vertical-align: middle;
  align-self: center;
  accent-color: #4a90e2;
  cursor: pointer;
  position: relative;
  top: 6px;
}
.over21-row .over21-text {
  font-size: 1em;
  line-height: 1;
  vertical-align: middle;
  margin: 0;
  padding: 0;
  position: relative;
  top: 0;
  cursor: default;
  user-select: none;
  pointer-events: none;
}
/* --- Modal styles --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.3);
}
.modal-content {
  background: #fff;
  margin: 48px auto 0 auto;
  padding: 32px 24px 24px 24px;
  border-radius: 10px;
  width: 340px;
  position: relative;
  box-shadow: 0 4px 24px #0002;
}
.close {
  position: absolute;
  top: 2px;
  right: 10px;
  width: 32px;
  height: 32px;
  font-size: 1.6em;
  cursor: pointer;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  z-index: 1100;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}
.close:hover svg line {
  stroke: #e94e77;
}
#modalTabs {
  display: flex;
  margin-bottom: 18px;
}
#modalTabs button {
  flex: 1;
  background: #f0f4fa;
  border: none;
  padding: 8px 0;
  font-size: 1.1em;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  margin-right: 2px;
  transition: background 0.15s;
}
#modalTabs button.active {
  background: #4a90e2;
  color: #fff;
}
#signInForm, #signUpForm {
  display: flex;
  flex-direction: column;
}
#signInForm input, #signUpForm input {
  margin-bottom: 10px;
  padding: 8px;
  font-size: 1em;
  border: 1px solid #bbb;
  border-radius: 5px;
}
#signInForm button, #signUpForm button {
  background: #4a90e2;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 0;
  font-size: 1.1em;
  cursor: pointer;
  margin-top: 4px;
}
.form-error {
  color: #e94e77;
  font-size: 0.98em;
  margin-top: 4px;
  min-height: 18px;
}
/* --- GAME BOARD CENTERING AND COLORS --- */
#botBoard, #gameBoard {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  min-height: 440px;
}
.game-board {
  margin: 0 auto;
  border-collapse: collapse;
}
/* Фикс для демо-борды: всегда одинаковый размер ячеек */
.demo-board-fixed td {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  box-sizing: border-box;
  text-align: center;
  vertical-align: middle;
  font-size: 1.3em;
  font-weight: bold;
  background: #f9f9f9;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid #bbb;
  padding: 0;
  line-height: 32px;
}
.game-board td {
  text-align: center;
  vertical-align: middle;
  padding: 0;
  width: 28px;
  height: 28px;
  font-size: 1.3em;
  font-weight: bold;
  background: #f9f9f9;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid #bbb;
}
.cell-x {
  color: #357ab8 !important;
  font-size: 1.3em;
  text-align: center;
  vertical-align: middle;
}
.cell-o {
  color: #e94e77 !important;
  font-size: 1.3em;
  text-align: center;
  vertical-align: middle;
}
.last-move {
  background: #ffe6b3 !important;
  border: 2px solid #f9a602 !important;
}
.win-line {
  background: #fff4d6 !important;
  border: 2px solid #f9a602 !important;
  box-shadow: 0 0 6px #f9a602;
}
/* --- MOBILE ADAPTATION --- */
main {
  margin: 0 auto;
}
@media (max-width: 900px) {
  main {
    max-width: 98vw;
    padding: 10px 2vw 32px 2vw;
  }
  #bot-simulation,
  #play-section {
    margin-bottom: 4px;
    padding: 18px 6px 2px 6px;
  }
  .leaderboard th, .leaderboard td {
    padding: 7px 4px;
    font-size: 0.98em;
  }
}
@media (max-width: 700px) {
  #play-section {
    margin-top: 12px;
    padding: 10px 2vw 0 2vw;
    min-height: 0;
  }
  .find-match-row-form {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .find-match-row-form label {
    font-size: 1em;
    flex-direction: row;
    justify-content: flex-start;
  }
  .neon-title { font-size: 2em; }
  .online-counter-neon { font-size: 1.05em; padding: 8px 12px; }
  .crypto-title-bg h1 { font-size: 2em; }
  #bot-simulation,
  #play-section {
    margin-bottom: 2px;
    padding: 10px 2vw 0 2vw;
  }
  .leaderboard th, .leaderboard td { font-size: 0.93em; }
  .footer-inner { font-size: 0.97em; }
  .timer-label { min-width: 80px; font-size: 1em; }
}
@media (max-width: 600px) {
  #play-section {
    margin-top: 6px;
    padding: 6px 0 0 0;
    min-height: 0;
  }
  .find-match-row-form {
    gap: 8px;
  }
  .crypto-title-bg { margin-top: 18px; margin-bottom: 6px; }
  .online-counter-neon-wrapper { margin-top: 16px; margin-bottom: 8px; }
  #bot-simulation,
  #play-section {
    margin-bottom: 2px;
    padding: 6px 0 0 0;
  }
  .leaderboard-section { margin-top: 12px; }
  .leaderboard-title { font-size: 1.08em; margin-bottom: 6px; }
  .leaderboard { font-size: 0.93em; }
  .leaderboard th, .leaderboard td { padding: 5px 2px; font-size: 0.92em; }
  .footer-inner { font-size: 0.93em; padding: 0 8px; }
}
/* --- MOBILE: Play now button and rules/texts below --- */
@media (max-width: 600px) {
  #bot-simulation {
    padding-top: 20px !important;
    padding-bottom: 0px !important;
  }
  #playNowBtn {
    margin-bottom: 20px !important; /* увеличиваем отступ под кнопкой */
  }
  #botRules {
    max-width: 95vw;
    margin-left: auto;
    margin-right: auto;
    padding-left: 6vw;
    padding-right: 6vw;
    font-size: 1em;
    margin-bottom: 18px;
  }
  #botPlayers, .bot-match-info, .bot-match-result {
    max-width: 95vw;
    margin-left: auto;
    margin-right: auto;
    padding-left: 6vw;
    padding-right: 6vw;
    font-size: 1em;
  }
  #botMatch {
    max-width: 99vw;
    padding-left: 0;
    padding-right: 0;
  }
  .user-info {
    max-width: 96vw;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2vw;
    padding-right: 2vw;
    font-size: 1em;
  }
  .user-info .neon-title {
    font-size: 1.2em;
  }
  .user-info #userBalance.neon-title {
    font-size: 1em;
  }
}
@media (max-width: 480px) {
  .wallet-card { padding: 10px 4px 8px 4px; min-width: 0; }
  .wallet-network-btn { padding: 8px 8px; font-size: 1em; }
  .wallet-instruction { font-size: 0.98em; padding: 7px 6px; }
  .neon-title { font-size: 1.2em; }
  .online-counter-neon { font-size: 0.93em; padding: 6px 6px; }
  .crypto-title-bg h1 { font-size: 1.25em; }
  .online-counter { font-size: 1em; }
  .online-counter-wrapper { margin-top: 8px; margin-bottom: 4px; }
  #bot-simulation,
  #play-section {
    margin-bottom: 1px;
    padding: 2px 0 0 0;
  }
  .leaderboard th, .leaderboard td { padding: 3px 1px; font-size: 0.89em; }
  .footer-inner { font-size: 0.89em; padding: 0 2px; }
  #botRules, #botPlayers, .bot-match-info, .bot-match-result {
    font-size: 0.97em;
    padding-left: 2vw;
    padding-right: 2vw;
  }
  .user-info {
    font-size: 0.97em;
    padding-left: 1vw;
    padding-right: 1vw;
  }
}
@media (max-width: 450px) {
  .crypto-title-bg h1 { font-size: 1em; }
  .leaderboard th, .leaderboard td { font-size: 0.85em; }
  .footer-inner { font-size: 0.85em; }
  #botRules, #botPlayers, .bot-match-info, .bot-match-result {
    font-size: 0.93em;
  }
  .user-info {
    font-size: 0.93em;
  }
}
/* --- BUG 1: Desktop only: Add margin-bottom to #botRules --- */
@media (min-width: 601px) {
  #botRules {
    margin-bottom: 29px !important; /* Было 32px, стало меньше */
  }
  #botPlayers {
    margin-bottom: 18px !important;
  }
}
@media (max-width: 700px) {
  .neon-title { font-size: 2em !important; }
  .crypto-title-bg h1 { font-size: 2em !important; }
}
@media (max-width: 600px) {
  .neon-title { font-size: 2em !important; }
  .crypto-title-bg h1 { font-size: 2em !important; }
}
@media (max-width: 480px) {
  .neon-title { font-size: 2em !important; }
  .crypto-title-bg h1 { font-size: 2em !important; }
}
@media (max-width: 450px) {
  .neon-title { font-size: 1.5em !important; }
  .crypto-title-bg h1 { font-size: 1.5em !important; }
}
/* === MOBILE CABINET IMPROVEMENTS === */
@media (max-width: 600px) {
  /* Сетка 2xN для кнопок */
  .user-info .actions-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px 10px;
    width: 100%;
    margin-bottom: 0px;
  }
  .user-info .user-action-btn {
    font-size: 1.13em !important;
    min-height: 58px !important;
    padding: 16px 0 !important;
    border-radius: 9px !important;
    width: 100% !important;
  }
  /* Logout — на отдельную строку */
  .user-info .user-action-btn.logout-btn {
    grid-column: 1/3 !important;
    margin-top: 4px;
  }

  /* Блок Start match и форма — вниз/по центру */
  #play-section {
    margin-top: 28vh !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 340px !important;
  }
  #play-section > * {
    justify-content: center !important;
    align-items: center !important;
    width: 100%;
  }
  .find-match-row-form, #findMatchForm {
    margin-top: 18px !important;
    margin-bottom: 6px !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100%;
  }
  #play-section .big-btn {
    font-size: 1.23em !important;
    padding: 14px 0 !important;
    border-radius: 10px !important;
    width: 100% !important;
    margin-top: 8px !important;
  }
}
@media (max-width: 400px) {
  #play-section {
    margin-top: 14vh !important;
    min-height: 220px !important;
    padding-top: 8vw !important;
  }
  .user-info .user-action-btn {
    font-size: 1em !important;
    min-height: 46px !important;
  }
}
/* === END OF MOBILE CABINET IMPROVEMENTS === */
/* === MOBILE CABINET IMPROVEMENTS FIX === */
@media (max-width: 600px) {
  /* ...старый код для actions-grid... */

  /* Исправляем слишком большой отступ */
  #play-section {
    margin-top: 5vh !important;
    /* Остальной код оставляем как был */
  }

  /* Исправляем ширину кнопки: ограничиваем max-width */
  #play-section .big-btn {
    width: auto !important;
    max-width: 340px !important;
    min-width: 140px;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
  }

  /* Если нужно, сделайте форму по центру */
  #findMatchForm, .find-match-row-form {
    justify-content: center !important;
    align-items: center !important;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Можно убрать/уменьшить margin-top и min-height для #play-section ещё сильнее, если всё равно большой зазор */

@media (max-width: 600px) {
  /* Кнопки личного кабинета ниже */
  .user-info .actions-grid {
    margin-top: 28px !important;
  }

  /* Меньше белого пространства под Find match и в play-section */
  #play-section {
    padding-bottom: 12px !important;
  }
  #findMatchForm .big-btn,
  .find-match-row-form .big-btn {
    margin-bottom: 0 !important;
  }
}

@media (max-width: 600px) {
  /* Компактная белая рама Start match */
  #play-section {
    min-height: 0 !important;
    padding-top: 8px !important; 
    padding-bottom: 8px !important;
    margin-top: 8px !important;   /* Меньший отступ сверху */
    margin-bottom: 6px !important;
  }
  /* Уменьшаем или убираем нижний отступ у блока с кнопками */
  .user-info .actions-grid {
    margin-bottom: 6px !important; /* Было больше — делаем компактно */
    margin-top: 28px !important;   /* Если хочется опустить сами кнопки — варьируйте margin-top */
  }
}
@media (max-width: 600px) {
  #play-section {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-height: 160px !important;  /* сделайте минимально нужную высоту */
    padding-top: 0 !important;     /* уберите большой padding-top */
    padding-bottom: 8px !important;
  }
  #play-section .mobile-spacer {
    display: block !important;
    height: 40px; /* выберите высоту самостоятельно: 32px, 48px, 56px... */
    width: 100%;
  }
}
/* Для десктопа spacer можно скрыть */
@media (min-width: 601px) {
  #play-section .mobile-spacer {
    display: none !important;
    height: 0 !important;
  }
}
@media (max-width: 600px) {
  /* Крупнее кнопки Deposit, Withdraw, Support, FAQs, Logout */
  .user-info .user-action-btn {
    font-size: 1.24em !important;    /* Было ~1em или 1.13em, теперь заметно больше */
    min-height: 58px !important;
    padding: 16px 0 !important;
  }
  /* Крупнее Hello, username */
  .user-info .neon-title {
    font-size: 2.1em !important;     /* Было 2em, теперь чуть больше */
  }
  /* Крупнее баланс */
  .user-info #userBalance.neon-title {
    font-size: 1.34em !important;    /* Было 1.2em, теперь крупнее */
  }
}
@media (max-width: 600px) {
  .footer-text-size {
    font-size: 0.8em !important;
  }
}
@media (max-width: 420px) {
  .footer-text-size {
    font-size: 0.7em !important;
  }
}
/* === MOBILE: убираем все отступы между .leaderboard-section и .site-footer === */
@media (max-width: 600px) {
  .leaderboard-section {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  .leaderboard {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  .leaderboard tr:last-child td {
    padding-bottom: 0 !important;
  }
  .site-footer {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
}
@media (max-width: 600px) {
  .user-info {
    gap: 0px !important;
  }
}
@media (min-width: 601px) {
  .user-info {
    gap: 8px !important; /* Вернуть универсальный gap для всех */
  }
  .user-info .actions-grid {
    margin-top: 16px !important;  /* Самый большой отступ только перед кнопками */
  }
}
@media (max-width: 600px) {
  #userBalance {
    margin-top: 16px !important; /* сдвигает баланс вниз */
    margin-bottom: 0 !important;
  }
  .user-info {
    gap: 0px !important; /* минимизирует отступ между балансом и actions-grid (кнопками) */
  }
}
/* === MOBILE MODAL WIDTH PATCH === */
@media (max-width: 600px) {
  /* Расширяем Withdraw только для окна с почтой */
  #withdrawModal .centered-status,
  #withdrawModal div {
    max-width: 98vw !important;
    min-width: 64vw !important;
    padding-left: 3vw !important;
    padding-right: 3vw !important;
    word-break: break-word !important;
    box-sizing: border-box !important;
  }

  /* Support (Модалка поддержки) — делаем шире */
  #supportModal.user-modal {
    max-width: 95vw !important;
    min-width: 66vw !important;
    padding-left: 4vw !important;
    padding-right: 4vw !important;
  }

  /* FAQs — шире */
  #faqModal.user-modal {
    max-width: 95vw !important;
    min-width: 66vw !important;
    padding-left: 4vw !important;
    padding-right: 4vw !important;
  }
}
/* === MOBILE: Deposit USDT Modal FIX (ширина окна и кнопка back) === */
@media (max-width: 600px) {
  /* Широкие модалки для deposit step2 - ERC-20, TRC-20 */
  #depositStep2.user-modal,
  #depositStep2 {
    max-width: 96vw !important;
    min-width: 70vw !important;
    padding-left: 3vw !important;
    padding-right: 3vw !important;
    box-sizing: border-box !important;
  }
  /* Кнопка back — делаем компактнее и ниже верхнего margin */
  #depositStep2 .back-btn,
  #depositStep2 .wallet-back-btn,
  #depositStep2 button.back,
  #depositStep2 .back,
  #depositStep2 .btn-back {
    display: block !important;
    width: auto !important;
    min-width: 60px !important;
    max-width: 180px !important;
    margin: 0 auto 10px auto !important;
    font-size: 1em !important;
    padding: 7px 0 !important;
    border-radius: 7px !important;
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    background: #f0f4fa !important;
    color: #357ab8 !important;
    border: 1.5px solid #4a90e2 !important;
    box-shadow: none !important;
  }
  /* Отделяем back-кнопку от Sent — отступ у sent/next */
  #depositStep2 .wallet-sent-btn,
  #depositStep2 .wallet-next-btn,
  #depositStep2 .wallet-confirm-btn {
    margin-top: 10px !important;
  }
  /* Сделать сам блок адреса тоже шире, чтобы влез email */
  #depositStep2 .wallet-address-row {
    max-width: 92vw !important;
    min-width: 64vw !important;
    font-size: 1.03em !important;
    padding-left: 2vw;
    padding-right: 2vw;
  }
}
/* Для worst-case mini-mobile */
@media (max-width: 400px) {
  #depositStep2.user-modal, #depositStep2 {
    max-width: 99vw !important;
    min-width: 82vw !important;
    padding-left: 2vw !important;
    padding-right: 2vw !important;
  }
  #depositStep2 .wallet-address-row {
    max-width: 98vw !important;
    min-width: 78vw !important;
    font-size: 0.97em !important;
  }
}
/* === MOBILE: Явная высота кнопки Back === */
@media (max-width: 600px) {
  #depositStep2 #depositBackBtn {
    min-height: 48px !important;     /* Фикс высоты кнопки */
    /* Остальные стили для совместимости: */
    display: block !important;
    margin: 18px auto 0 auto !important;
    width: 100% !important;
    max-width: 150px !important;
    min-width: 80px !important;
    font-size: 1.13em !important;
    padding: 14px 0 !important;
    border-radius: 8px !important;
    background: #f8fafc !important;
    color: #195cb5 !important;
    border: 2px solid #357ab8 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px #4a90e233 !important;
    text-align: center !important;
    letter-spacing: 0.02em !important;
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 1002 !important;
    opacity: 1 !important;
    transition: background 0.18s, color 0.18s;
    cursor: pointer !important;
    line-height: normal !important;
    font-family: 'SF Pro Display','Segoe UI',Arial,sans-serif !important;
  }
}
@media (max-width: 400px) {
  #depositStep2 #depositBackBtn {
    min-height: 42px !important;
    max-width: 110px !important;
    font-size: 1.05em !important;
    padding: 12px 0 !important;
    margin-top: 11px !important;
  }
}
/* === END ЯВНАЯ ВЫСОТА КНОПКИ BACK === */
/* === PATCH: ONLY Play Now Auth Modal — DARK BG, GREEN FONT, GREEN GLOW + FIXED BG === */
:root {
  --modal-dark: rgba(20, 20, 30, 0.85);
  --modal-green: #2ecc40;
  --modal-green-glow: 0 0 9px #2ecc40, 0 0 18px #2ecc4044;
}

/* Затемнение всего экрана, если хотите — можете оставить полупрозрачным чёрным */
.auth-modal {
  background: rgba(0,0,0,0.3) !important;
}

.auth-modal .modal-content {
  background: var(--modal-dark) !important;
  border-color: var(--modal-green) !important;
  color: var(--modal-green) !important;
  box-shadow: 0 2px 12px #0002, var(--modal-green-glow) !important;
}

/* NEON TITLE — GREEN */
.auth-modal .neon-title {
  color: var(--modal-green) !important;
  text-shadow: none !important;
}

/* MODAL TABS */
.auth-modal #modalTabs button,
.auth-modal #modalTabs button.active {
  background: var(--modal-dark) !important;
  color: var(--modal-green) !important;
  border: 2px solid var(--modal-green) !important;
  border-bottom: 2px solid var(--modal-green) !important;
  font-weight: 700;
  box-shadow: var(--modal-green-glow) !important;
  transition: background 0.18s, color 0.18s, box-shadow 0.2s;
  border-radius: 6px 6px 0 0;
}

/* MODAL BUTTONS */
.auth-modal button,
.auth-modal input[type="submit"],
.auth-modal #signInForm button,
.auth-modal #signUpForm button {
  background: var(--modal-dark) !important;
  color: var(--modal-green) !important;
  border: 2px solid var(--modal-green) !important;
  font-weight: 700;
  box-shadow: var(--modal-green-glow) !important;
  transition: background 0.18s, color 0.18s, box-shadow 0.2s;
}

.auth-modal button:hover,
.auth-modal input[type="submit"]:hover,
.auth-modal #signInForm button:hover,
.auth-modal #signUpForm button:hover,
.auth-modal #modalTabs button:hover {
  background: #11181e !important;
  color: #43e96d !important;
  box-shadow: 0 0 18px #2ecc4088, 0 0 10px #fff !important;
}

/* Outline/secondary buttons (например, copy/back) */
.auth-modal .copy-btn,
.auth-modal .btn-back,
.auth-modal .wallet-back-btn {
  background: transparent !important;
  border-color: var(--modal-green) !important;
  color: var(--modal-green) !important;
  box-shadow: var(--modal-green-glow) !important;
}

.auth-modal .copy-btn:hover,
.auth-modal .btn-back:hover,
.auth-modal .wallet-back-btn:hover {
  background: #11181e !important;
  color: #43e96d !important;
}

/* Зеленый акцент для мелких элементов */
.auth-modal .copy-success-msg,
.auth-modal .wallet-trust-badge,
.auth-modal .brand-color {
  color: var(--modal-green) !important;
}
@media (max-width: 600px) {
  main,
  main > section,
  main > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* Снимаем сброс margin-bottom/margin-top, делаем аккуратный воздушный зазор */
  main > .leaderboard-section,
  .leaderboard-section {
    margin-top: 28px !important;
    margin-bottom: 14px !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
    box-shadow: none !important;
  }

  .leaderboard {
    padding-bottom: 0 !important;
    border-bottom: none !important;
    box-shadow: none !important;
  }

  .site-footer {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
    box-shadow: none !important;
  }

  /* Сброс line-height/height */
  .leaderboard-section,
  .leaderboard,
  .site-footer,
  main {
    line-height: 1 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
}
/* --- RPS Demo styles --- */
#botMatch {
  margin: 20px auto 22px auto;
  max-width: 520px;
  padding: 22px 30px 24px 30px;
  background: #f0f2ff;
  box-shadow: 0 4px 24px 0 rgba(46,204,64,0.12), 0 2px 8px 0 rgba(67,93,217,0.08);
  border-radius: 16px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#botPlayers {
  font-size: 1.25em;
  font-weight: 600;
  color: #357ab8;
  margin-bottom: 18px;
  text-align: center;
}

#botRpsRounds {
  width: 100%;
  margin-bottom: 12px;
}
.rps-round {
  padding: 10px 0 10px 0;
  border-bottom: 1px dashed #cad6f8;
  display: flex;
  align-items: center;
  font-size: 1.2em;
  gap: 8px;
  flex-wrap: nowrap;
  line-height: 1.4;
}
.rps-round-label {
  font-weight: 600;
  color: #357ab8;
  min-width: 80px;
  flex-shrink: 0;
  line-height: inherit;
}
.rps-round .bot1,
.rps-round .bot2 {
  white-space: nowrap;
  line-height: inherit;
}
.rps-outcome {
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: inherit;
}
.rps-win-1, .rps-win-2 {
  color: #2ecc40;
}
.rps-draw {
  color: #777;
}
#botDemoResult {
  min-height: 40px;
  text-align: center;
  margin: 12px 0 7px 0;
  font-size: 1.35em;
}
.rps-prize {
  color: #7d6dfc;
  font-size: 0.98em;
  margin-left: 8px;
}
.bot-username {
  color: #1b252d;
  font-weight: bold;
}
#playNowBtn {
  margin-top: 0;
  padding: 14px 48px;
  font-size: 1.25em;
  font-weight: 700;
  background: #2ecc40;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 12px #2ecc4088, 0 0 4px #fff;
  transition: background 0.15s, box-shadow 0.2s;
}
#playNowBtn:hover {
  background: #27ae60;
  box-shadow: 0 0 24px #2ecc40, 0 0 8px #fff;
}
@media (max-width: 600px) {
  #botMatch {
    max-width: 98vw !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 2vw !important;
    padding-right: 2vw !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    overflow-x: auto !important;
  }
  #botMatch * {
    box-sizing: border-box !important;
    word-break: break-word !important;
  }
  #botMatch table,
  #botMatch .game-board {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    overflow-x: auto !important;
  }
  #botMatch .wallet-address-row {
    min-width: 0 !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}
@media (max-width: 405px) {
  #botMatch {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
  .rps-round {
    font-size: 1.1em !important;
    gap: 4px !important;
  }
  .rps-round-label {
    min-width: 55px !important;
    font-size: 1em !important;
    flex-shrink: 1 !important;
  }
  .rps-round .bot1,
  .rps-round .bot2 {
    font-size: 1em !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 110px !important;
  }
  .rps-outcome {
    font-size: 1em !important;
    flex-shrink: 1 !important;
  }
  #botPlayers {
    font-size: 1.1em !important;
  }
  #botDemoResult {
    font-size: 1.2em !important;
  }
}
@media (min-width: 406px) and (max-width: 430px) {
  #botMatch {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
  .rps-round {
    font-size: 1.15em !important;
    gap: 5px !important;
  }
  .rps-round-label {
    min-width: 60px !important;
    font-size: 1em !important;
  }
  .rps-round .bot1,
  .rps-round .bot2 {
    font-size: 1em !important;
    max-width: 120px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  #botPlayers {
    font-size: 1.15em !important;
  }
  #botDemoResult {
    font-size: 1.25em !important;
  }
}
