/* ==========================================================================
   HimalTrex Games — Shared Profile & Universal Top Navigation Styles
   ========================================================================== */

:root {
  --htx-gold: #f5a425;
  --htx-gold-light: #ffd166;
  --htx-crimson: #c92a42;
  --htx-turquoise: #2a9d8f;
  --htx-blue: #1e3a5f;
  --htx-dark-bg: #0d1520;
  --htx-card-bg: rgba(22, 34, 52, 0.88);
  --htx-border: rgba(245, 164, 37, 0.25);
  --htx-text: #f0f4f8;
  --htx-text-muted: #94a3b8;
  --htx-font: 'Nunito', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Universal Top Navigation Bar ── */
.htx-top-nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 54px;
  background: rgba(13, 21, 32, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--htx-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 99999;
  font-family: var(--htx-font);
  box-sizing: border-box;
}

.htx-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.htx-nav-home-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 0.94rem;
  padding: 7px 14px;
  background: linear-gradient(135deg, rgba(201, 42, 66, 0.45), rgba(245, 164, 37, 0.45));
  border: 1.5px solid rgba(245, 164, 37, 0.6);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 12px rgba(245, 164, 37, 0.2);
  transition: all 0.25s ease;
}

.htx-nav-home-btn:hover {
  background: linear-gradient(135deg, rgba(201, 42, 66, 0.7), rgba(245, 164, 37, 0.7));
  border-color: #ffd166;
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(245, 164, 37, 0.45);
}

.htx-home-icon {
  font-size: 1.1rem;
}

.htx-nav-divider {
  color: rgba(255, 255, 255, 0.3);
  font-size: 1.1rem;
}

.htx-nav-game-title {
  color: var(--htx-gold-light);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.htx-nav-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.htx-nav-link {
  color: var(--htx-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.htx-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.htx-nav-link.active {
  color: var(--htx-gold);
  background: rgba(245, 164, 37, 0.15);
  border: 1px solid rgba(245, 164, 37, 0.3);
}

.htx-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.htx-nav-site-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid rgba(46, 204, 113, 0.45);
  color: #2ecc71;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.htx-nav-site-link:hover {
  background: #2ecc71;
  color: #0b131e;
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.4);
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .htx-nav-site-link {
    display: none;
  }
}

.htx-nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(26, 40, 60, 0.85);
  border: 1px solid rgba(245, 164, 37, 0.4);
  border-radius: 8px;
  color: var(--htx-gold-light);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  padding: 0;
}

.htx-nav-icon-btn:hover {
  border-color: var(--htx-gold);
  background: rgba(35, 54, 80, 0.95);
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(245, 164, 37, 0.35);
}

.htx-rules-btn {
  position: relative;
}

.htx-rules-btn .htx-rules-icon {
  font-size: 1.15rem;
  line-height: 1;
  display: inline-block;
  transition: transform 0.2s ease;
}

.htx-rules-btn:hover .htx-rules-icon {
  transform: scale(1.15) rotate(-6deg);
}

/* ── Tibetan Prayer Flags Garland ── */
.prayer-flags {
  display: flex !important;
  width: 100% !important;
  height: 14px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
  background: transparent !important;
  position: relative !important;
  z-index: 1000 !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.prayer-flags .flag, .flag {
  flex: 1 1 0% !important;
  width: auto !important;
  height: 100% !important;
  clip-path: polygon(0 0, 100% 0, 100% 80%, 50% 100%, 0 80%) !important;
  animation: htxFlagWave 3s ease-in-out infinite alternate !important;
}

.prayer-flags .flag.blue, .flag.blue     { background-color: #1e6fa8 !important; animation-delay: 0s !important; }
.prayer-flags .flag.white, .flag.white   { background-color: #f8fafc !important; animation-delay: 0.3s !important; }
.prayer-flags .flag.red, .flag.red       { background-color: #cd2e48 !important; animation-delay: 0.6s !important; }
.prayer-flags .flag.green, .flag.green   { background-color: #43a047 !important; animation-delay: 0.9s !important; }
.prayer-flags .flag.yellow, .flag.yellow { background-color: #f5a425 !important; animation-delay: 1.2s !important; }

@keyframes htxFlagWave {
  0%   { transform: translateY(0) skewY(0deg); }
  100% { transform: translateY(2px) skewY(3deg); }
}

@media (max-width: 960px) {
  .htx-nav-center {
    overflow-x: auto;
    white-space: nowrap;
    padding: 2px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .htx-nav-center::-webkit-scrollbar { display: none; }
}

@media (max-width: 640px) {
  .htx-top-nav {
    height: 48px;
    padding: 0 8px;
  }
  .htx-nav-home-btn span.htx-home-text {
    display: none;
  }
  .htx-nav-divider, .htx-nav-game-title {
    display: none;
  }
  .htx-badge-role {
    display: none;
  }
}

/* ── Profile Badge Widget ── */
.htx-profile-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 6px;
  background: rgba(26, 40, 60, 0.85);
  border: 1px solid rgba(245, 164, 37, 0.35);
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.htx-profile-badge:hover {
  border-color: var(--htx-gold);
  background: rgba(35, 54, 80, 0.95);
  box-shadow: 0 0 12px rgba(245, 164, 37, 0.3);
  transform: translateY(-1px);
}

.htx-badge-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle, #2d4564, #121c2a);
  border: 1.5px solid var(--htx-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.htx-badge-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.htx-badge-name {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.htx-badge-role {
  color: var(--htx-gold-light);
  font-size: 0.68rem;
  opacity: 0.85;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.htx-badge-edit {
  font-size: 0.8rem;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.htx-profile-badge:hover .htx-badge-edit {
  opacity: 1;
  transform: rotate(45deg);
}

/* ── Modal Dialog ── */
.htx-modal-container {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--htx-font);
  box-sizing: border-box;
}

.htx-modal-container.active {
  display: flex;
}

.htx-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 18, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.htx-modal-dialog {
  position: relative;
  width: 92%;
  max-width: 560px;
  max-height: 90vh;
  background: linear-gradient(165deg, #18283d 0%, #0d1624 100%);
  border: 1.5px solid rgba(245, 164, 37, 0.4);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 164, 37, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: htxModalPop 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes htxModalPop {
  0% { opacity: 0; transform: scale(0.92) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.htx-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
}

.htx-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.htx-header-icon {
  font-size: 1.8rem;
}

.htx-modal-title h3 {
  margin: 0;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.htx-modal-title p {
  margin: 2px 0 0;
  color: var(--htx-text-muted);
  font-size: 0.8rem;
}

.htx-btn-close {
  background: transparent;
  border: none;
  color: var(--htx-text-muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s ease;
}

.htx-btn-close:hover {
  color: #fff;
}

.htx-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Universal Rules Modal ── */
.htx-rules-modal-dialog {
  max-width: 680px;
  width: 94%;
}

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

.htx-rules-modal-card.htx-rules-single-col {
  max-width: 520px;
}

.htx-rules-modal-card.htx-rules-single-col .htx-rules-grid {
  grid-template-columns: 1fr;
}

.htx-rules-card {
  background: rgba(18, 30, 48, 0.75);
  border: 1px solid rgba(245, 164, 37, 0.28);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.htx-rules-card:hover {
  border-color: rgba(245, 164, 37, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.htx-rules-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--htx-gold-light);
  font-weight: 700;
  font-size: 0.95rem;
}

.htx-rules-card-text {
  color: #cfd9e8;
  font-size: 0.85rem;
  line-height: 1.45;
  margin: 0;
}

.htx-rules-card.highlight {
  border-color: rgba(245, 164, 37, 0.55);
  background: linear-gradient(135deg, rgba(245, 164, 37, 0.15) 0%, rgba(18, 30, 48, 0.85) 100%);
}

.htx-rules-card.wide {
  grid-column: 1 / -1;
}

.htx-rules-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.htx-rules-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(245, 164, 37, 0.35);
  color: #f8fafc;
  font-size: 0.78rem;
  font-weight: 700;
}

.htx-field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.htx-label {
  color: var(--htx-gold-light);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.htx-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(10, 18, 28, 0.85);
  border: 1px solid rgba(245, 164, 37, 0.3);
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.htx-input:focus {
  outline: none;
  border-color: var(--htx-gold);
  box-shadow: 0 0 10px rgba(245, 164, 37, 0.35);
}

/* Input Row & Pick Button */
.htx-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.htx-input-row .htx-input {
  flex: 1;
  min-width: 0;
}

.htx-btn-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  height: 46px;
  background: linear-gradient(135deg, rgba(245, 164, 37, 0.22), rgba(220, 100, 20, 0.25));
  border: 1px solid rgba(245, 164, 37, 0.45);
  border-radius: 10px;
  color: #ffdf9e;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  user-select: none;
  flex-shrink: 0;
}

.htx-btn-pick:hover {
  background: linear-gradient(135deg, rgba(245, 164, 37, 0.38), rgba(220, 100, 20, 0.42));
  border-color: rgba(245, 164, 37, 0.85);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 164, 37, 0.3);
}

.htx-btn-pick:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.htx-btn-pick .htx-pick-icon {
  font-size: 1.05rem;
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.htx-btn-pick:hover .htx-pick-icon {
  transform: rotate(35deg) scale(1.15);
}

@keyframes htxInputPop {
  0% {
    transform: scale(0.98);
    border-color: rgba(245, 164, 37, 0.9);
    box-shadow: 0 0 12px rgba(245, 164, 37, 0.5);
  }
  50% {
    transform: scale(1.02);
    border-color: #ffd074;
    box-shadow: 0 0 16px rgba(245, 164, 37, 0.7);
  }
  100% {
    transform: scale(1);
    border-color: rgba(245, 164, 37, 0.45);
    box-shadow: 0 0 8px rgba(245, 164, 37, 0.2);
  }
}

.htx-input.htx-input-pop {
  animation: htxInputPop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@media (max-width: 440px) {
  .htx-btn-pick {
    padding: 0 12px;
    font-size: 0.82rem;
    gap: 4px;
  }
}

/* Preview Selected Avatar */
.htx-preview-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(245, 164, 37, 0.08);
  border: 1px dashed rgba(245, 164, 37, 0.4);
  border-radius: 12px;
}

.htx-preview-icon {
  font-size: 2.2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  border: 1.5px solid var(--htx-gold);
}

.htx-preview-name {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
}

.htx-preview-desc {
  color: var(--htx-text-muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

/* Avatar Grid */
.htx-avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.htx-avatar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px;
  background: rgba(16, 26, 40, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.htx-avatar-card:hover {
  background: rgba(28, 44, 68, 0.8);
  border-color: rgba(245, 164, 37, 0.5);
  transform: translateY(-2px);
}

.htx-avatar-card.active {
  background: linear-gradient(135deg, rgba(201, 42, 66, 0.25), rgba(245, 164, 37, 0.25));
  border-color: var(--htx-gold);
  box-shadow: 0 0 14px rgba(245, 164, 37, 0.4);
}

.htx-avatar-emoji {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.htx-avatar-title {
  font-size: 0.7rem;
  color: #e2e8f0;
  text-align: center;
  line-height: 1.1;
}

.htx-avatar-card.active .htx-avatar-title {
  color: var(--htx-gold-light);
  font-weight: 700;
}

.htx-modal-footer {
  padding: 16px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: flex-end;
}

.htx-btn {
  padding: 12px 24px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.htx-btn-primary {
  background: linear-gradient(135deg, #df6a27 0%, #f5a425 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(245, 164, 37, 0.4);
}

.htx-btn-primary:hover {
  background: linear-gradient(135deg, #e97a39 0%, #ffb23f 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 164, 37, 0.6);
}

/* Responsive */
@media (max-width: 640px) {
  .htx-avatar-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .htx-top-nav .htx-nav-center {
    display: none;
  }
  .htx-nav-divider,
  .htx-nav-game-title {
    display: none;
  }
}

/* ── Stats Panel ── */
.htx-stats-panel {
  margin-top: 20px;
  border-top: 1px solid var(--htx-border);
  padding-top: 16px;
}

.htx-stats-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--htx-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.htx-total-score-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(245, 164, 37, 0.18) 0%, rgba(200, 110, 15, 0.08) 100%);
  border: 1px solid rgba(245, 164, 37, 0.45);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
}

.htx-total-score-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.htx-total-score-badge {
  font-size: 26px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(245, 164, 37, 0.5));
  flex-shrink: 0;
}

.htx-total-score-title {
  font-size: 13px;
  font-weight: 800;
  color: #ffd875;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.htx-total-score-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
  line-height: 1.3;
}

.htx-total-score-val {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 14px rgba(245, 164, 37, 0.6), 0 2px 4px rgba(0,0,0,0.5);
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.htx-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  overflow: hidden;
}

.htx-stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  transition: border-color 0.2s, background 0.2s;
  opacity: 0.55;
}

.htx-stat-card.has-score {
  background: rgba(245, 164, 37, 0.06);
  border-color: rgba(245, 164, 37, 0.3);
  opacity: 1;
}

.htx-stat-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.htx-stat-body {
  min-width: 0;
}

.htx-stat-game {
  font-size: 10px;
  color: var(--htx-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.htx-stat-score {
  font-size: 16px;
  font-weight: 800;
  color: var(--htx-text);
  line-height: 1.2;
}

.htx-stat-card.has-score .htx-stat-score {
  color: var(--htx-gold-light);
}

.htx-stat-extra {
  font-size: 10px;
  color: var(--htx-text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

/* Negative score (e.g. all-wrong victorina) */
.htx-stat-card.neg-score {
  background: rgba(201, 42, 66, 0.06);
  border-color: rgba(201, 42, 66, 0.25);
  opacity: 1;
}
.htx-stat-card.neg-score .htx-stat-score {
  color: #ff8a9a;
}

.htx-stats-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--htx-text-muted);
  font-size: 13px;
  padding: 12px;
}

/* ── Danger Button ── */
.htx-btn-danger {
  background: rgba(201, 42, 66, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(201, 42, 66, 0.4);
}

.htx-btn-danger:hover {
  background: rgba(201, 42, 66, 0.3);
  border-color: rgba(201, 42, 66, 0.6);
  transform: translateY(-1px);
}

.htx-modal-footer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .htx-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Global Language Toggle Component (Rus / Eng) ── */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(245, 164, 37, 0.35);
  border-radius: 20px;
  padding: 2px 3px;
  gap: 2px;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.25s ease;
  user-select: none;
  flex-shrink: 0;
}

.lang-toggle:hover {
  border-color: #f5a425;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 12px rgba(245, 164, 37, 0.25);
}

.lang-option {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.2;
}

.lang-option:hover {
  color: #fff;
}

.lang-option.active {
  background: linear-gradient(135deg, #f5a425 0%, #e07e10 100%);
  color: #0b131e;
  font-weight: 900;
  box-shadow: 0 0 10px rgba(245, 164, 37, 0.5);
}

/* ── Unified Animated Modal Close Cross (Red on Hover) ──────────────── */
button.htx-btn-close,
button.modal-close,
button.modal-close-btn,
button.modal-close-x,
button.close-modal-btn,
button.hw-modal-close,
button.hp-modal-close {
  transition: transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              background 0.2s ease,
              border-color 0.2s ease,
              color 0.2s ease !important;
}

button.htx-btn-close:hover,
button.modal-close:hover,
button.modal-close-btn:hover,
button.modal-close-x:hover,
button.close-modal-btn:hover,
button.hw-modal-close:hover,
button.hp-modal-close:hover {
  background: rgba(239, 68, 68, 0.28) !important;
  border-color: rgba(239, 68, 68, 0.7) !important;
  color: #fca5a5 !important;
  transform: scale(1.12) rotate(90deg) !important;
}

button.htx-btn-close:active,
button.modal-close:active,
button.modal-close-btn:active,
button.modal-close-x:active,
button.close-modal-btn:active,
button.hw-modal-close:active,
button.hp-modal-close:active {
  transform: scale(0.92) rotate(90deg) !important;
}

/* ── Universal Escape Pause Modal ───────────────────────────────────── */
.htx-pause-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 18, 0.78);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99990;
  padding: 16px;
}

.htx-pause-overlay.active {
  display: flex;
}

.htx-pause-card {
  position: relative;
  background: linear-gradient(165deg, #162336 0%, #0b1220 100%);
  border: 1.5px solid rgba(245, 164, 37, 0.45);
  border-radius: 18px;
  padding: 28px 26px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 32px rgba(245, 164, 37, 0.16);
}

.htx-pause-icon {
  font-size: 2.8rem;
  margin-bottom: 6px;
}

.htx-pause-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fde047;
  margin: 0 0 6px;
}

.htx-pause-sub {
  font-size: 0.88rem;
  color: #94a3b8;
  margin: 0 0 18px;
}

.htx-pause-resume-btn {
  width: 100%;
  padding: 11px 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #f5a425 0%, #d97706 100%);
  color: #0b1220;
  font-weight: 800;
  font-size: 0.96rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.htx-pause-resume-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(245, 164, 37, 0.4);
}
