/* Global Styles */
* {
  box-sizing: border-box;
}
body {
  font-family: 'Poppins', Arial, sans-serif;
  margin: 0;
  padding: 0;
  width: 100vw;
  overflow-x: hidden; /* Prevent side scrolling */
  background: linear-gradient(135deg, #074555, #00000a, #00000a);
  color: #ffffff;
  text-align: center;
  min-height: 100vh;
  position: relative;
  padding-top: 4rem;
  padding-bottom: 80px; /* Space for bottom-nav */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
a {
  color: inherit;
  text-decoration: none;
}
main {
  padding-top: 4rem;
  padding-bottom: 100px; /* Ensure space for bottom nav */
}

/* Top Navigation Bar */
#top-nav {
  display: grid;
  grid-template-columns: 44px minmax(88px, auto) minmax(0, 1fr) auto;
  align-items: center;
  justify-content: stretch;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.5rem 0.4rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  gap: 6px;
  overflow: visible;
}

#profile-button {
  background: none;
  border: none;
  color: #00ffaa;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 5px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: color 0.3s ease-in-out;
  justify-self: start;
  order: unset;
}
#points-bar {
  position: relative;
  flex-grow: 1;
  min-width: 80px;
  height: 25px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  overflow: hidden;      /* ensure fill is clipped by rounded edges */
  margin: 0 8px;
  padding: 0;            /* no internal padding, let fill reach edges */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  border: 2px solid #111;
  justify-content: center;
  white-space: nowrap;
  order: 2;
}
#points-display {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
  color: #000;
  font-style: none;
  font-size: 12px;
  white-space: nowrap;
  z-index: 2;
  pointer-events: none; /* allow clicks through if needed */
}
#points-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background-color: #00ffaa;
  /* round only left corners so tiny fills appear curved */
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  transition: width 0.5s ease;
  z-index: 1;
}
#progress-container {
  width: 100%;
  max-width: 120px;
  height: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 5px;
}
#profile-container { /* Updated from .profile-panel */
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translate(-50%, 0);
  background: rgba(0, 0, 0, 0.9);
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 90vw;
  color: #fff;
  z-index: 2000;
  display: none; /* Hidden by default */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}
#profile-container h2 {
  margin-top: 0;
}
.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: #fff;
  cursor: pointer;
}

/* Wallet Button */
#ton-connect-ui {
  display: none;
  flex-shrink: 0;
  width: 0;
  height: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
}

#ton-connect-button {
  background: none;
  border: none;
  color: #00ffaa;
  font-size: 11px;
  display: flex;
  flex-direction: row;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 5px 8px;
  min-width: 96px;
  height: 40px;
  cursor: pointer;
  transition: color 0.3s ease-in-out;
  gap: 6px;
  white-space: nowrap;
  justify-self: end;
  order: unset;
}

/* Hover effect (glow and color change) */
#ton-connect-button:hover {
  color: #00ffaa; /* Same hover effect as active nav items */
}

#wallet-popover {
  position: fixed;
  top: 56px;
  left: calc(100vw - 220px - 10px);
  width: 210px;
  background: rgba(5, 12, 22, 0.96);
  border: 1px solid rgba(0, 255, 170, 0.35);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  padding: 10px;
  z-index: 6200;
}

#wallet-picker {
  position: fixed;
  top: 56px;
  left: calc(100vw - 230px - 10px);
  width: 220px;
  background: rgba(5, 12, 22, 0.97);
  border: 1px solid rgba(0, 255, 170, 0.35);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  padding: 10px;
  z-index: 6200;
}

.tc-root,
.tc-modal,
.tc-modal-root,
[data-tc-root],
[data-tc-modal] {
  z-index: 6500 !important;
}

.wallet-picker-list {
  display: grid;
  gap: 8px;
}

.wallet-picker-btn {
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 170, 0.22);
  background: rgba(0, 255, 170, 0.08);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.wallet-picker-btn:hover {
  background: rgba(0, 255, 170, 0.16);
}

.wallet-popover-title {
  margin: 0 0 6px;
  font-size: 12px;
  color: #9eead7;
  text-align: left;
}

.wallet-popover-address {
  margin: 0 0 10px;
  font-size: 13px;
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-disconnect-btn {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 8px;
  background: linear-gradient(90deg, #ff5f6d, #ff8a5b);
  color: #fff;
}

#user-stats {
  display: grid;
  align-items: center;
  color: #aaa;
  font-style: italic;
  font-weight: bold;
  font-size: 12px;
  gap: 2px 4px;
  grid-template-columns: auto auto;
  margin: 0;
  padding: 0 4px;
  white-space: nowrap;
  flex-shrink: 0;
  order: unset;
}
.tag {
  text-align: left;
  color: #fff;
  font-weight: normal;
  margin: auto;
}

/* Change color once the real data is loaded */
#current-level.loaded,
#points-display.loaded {
  color: #00ffaa; /* Highlight color */
  font-style: normal;
}

/* Streak display style */
#streak {
  font-size: 16px;
  color: #00ffaa;
  margin-bottom: 5px;
}

#ticket-icons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 12px;
  padding: 0 4px;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  flex-shrink: 1;
  order: unset;
}

#ticket-icons span {
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

#bronze-tickets {
  color: #cd7f32;
  text-shadow: 0 0 8px rgba(205, 127, 50, 0.6);
}

#silver-tickets {
  color: #d8dee9;
  text-shadow: 0 0 8px rgba(216, 222, 233, 0.6);
}

#gold-tickets {
  color: #ffd166;
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.7);
}

#display-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0;
  position: relative;
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  z-index: 1000;
}
#display-panel > p {
  margin: 0;
  padding: 0;
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 8px;
  order: 1;
}

#settings-button {
    background: none;
    border: none;
    color: #00ffaa;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.3s ease-in-out;
    order: 3;
  }
  
#settings-button:hover {
    color: #00ffaa;
  }

#settings-button .settings-icon {
    width: 32px;
    height: 32px;
    stroke-width: 2.3;
    filter: drop-shadow(0 0 6px rgba(0, 255, 170, 0.55));
  }

/* Bottom Navigation Bar */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 0;
  z-index: 1000;
}

.nav-btn {
  text-decoration: none;
  color: #aaa; /* Inactive color */
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 14px;
  transition: color 0.3s ease-in-out;
}

/* Highlight the active tab */
.nav-btn.active {
  color: #00ffaa; /* Highlight color */
  font-weight: bold;
}
.nav-btn i {
  width: 24px;
  height: 24px;
}

.nav-btn.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

/* Main Content Area */
main {
  margin-bottom: 80px; /* Avoid content overlap with bottom nav */
}

/* Home Page Content */
#home-content {
  padding: 10px;
}
#home-content h1 {
  font-size: 28px;
  margin-bottom: 10px;
  animation: glowText 1.5s ease-in-out infinite alternate;
}
@keyframes glowText {
  from { text-shadow: 0 0 10px rgba(0, 255, 170, 0.7); }
  to { text-shadow: 0 0 20px rgba(0, 255, 170, 1); }
}
#home-content p {
  font-size: 18px;
  margin: 10px 0;
}

/* General Button Styles (uncommented and enhanced) */
button {
  padding: 10px 20px;
  margin: 8px;
  font-size: 16px;
  font-weight: bold;
  background: linear-gradient(90deg, #00ffaa, #00eaff);
  border: none;
  border-radius: 8px;
  color: #000;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(21, 223, 230, 0.5);
  transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
}
button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(33, 202, 224, 0.7);
  background: linear-gradient(90deg, #00eaff, #00ffaa); /* Reverse gradient for glow */
}
button:active {
  transform: scale(0.95);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.is-loading,
.btn-primary.is-loading,
.btn-cancel-pass.is-loading,
.btn-back-games.is-loading,
.btn-leave-game.is-loading,
.mystery-box-back-button.is-loading,
.btn-play.is-loading {
  opacity: 0.78 !important;
  pointer-events: none;
}

button.is-loading::after {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-left: 8px;
  vertical-align: -2px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: rgba(0, 0, 0, 0.9);
  animation: spin 0.8s linear infinite;
}

body.page-transitioning {
  cursor: progress;
}

body.page-transitioning::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 4990;
  pointer-events: auto;
  background: rgba(3, 9, 18, 0.45);
}

body.page-transitioning::after {
  content: "";
  position: fixed;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  margin-top: -22px;
  border-radius: 50%;
  border: 4px solid rgba(0, 255, 170, 0.25);
  border-top-color: #00ffaa;
  box-shadow: 0 0 20px rgba(0, 255, 170, 0.35);
  z-index: 4991;
  animation: spin 0.75s linear infinite;
  pointer-events: none;
}

/* Auth page */
#auth-container {
  background: rgba(0, 0, 0, 0.6);
  padding: 15px;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  height: 70%;
  max-width: 100%;
}
#telegram-login-container {
  margin: 20px 0;
  text-align: center;
}
.loader {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #00ffaa;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.hidden {
  display: none;
}
.error {
  color: #ff4d4f;
  margin-top: 12px;
  display: none;
}

/* In-app Notifications */
#notification-host {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 72px);
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 420px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5000;
  pointer-events: none;
}

.notification {
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
  border-radius: 12px;
  padding: 11px 14px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #eafcff;
  background: linear-gradient(135deg, rgba(7, 27, 48, 0.96), rgba(7, 16, 31, 0.96));
  border: 1px solid rgba(102, 240, 255, 0.24);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(5px);
}

.notification.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.notification.success {
  border-color: rgba(0, 255, 170, 0.42);
  box-shadow: 0 8px 28px rgba(0, 255, 170, 0.14);
}

.notification.error {
  border-color: rgba(255, 93, 108, 0.44);
  box-shadow: 0 8px 28px rgba(255, 93, 108, 0.18);
}

.notification.warn {
  border-color: rgba(255, 195, 84, 0.44);
  box-shadow: 0 8px 28px rgba(255, 195, 84, 0.14);
}

/* Mining Section (Home/Dashboard) */
#mining-section {
  margin: 20px 0;
  text-align: center;
}
#mining-bar {
  width: 50%;
  max-width: 100%;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  margin: 10px auto;
  overflow: hidden;
  position: relative;
}

#mining-bar.mining-active::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    rgba(0, 255, 156, 0.03) 0%,
    rgba(0, 255, 170, 0.25) 35%,
    rgba(0, 255, 234, 0.05) 70%,
    rgba(0, 255, 156, 0.03) 100%
  );
  animation: miningTrackSweep 1.4s linear infinite;
  pointer-events: none;
}

#mining-bar.mining-active {
  box-shadow: inset 0 0 8px rgba(0, 255, 170, 0.25);
}
#mining-progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00FF9C 0%, #00FF9C 100%);
  transition: width 0.25s linear;
}
#farm-btn {
  margin-top: 10px;
} /* Inherits button styles */

/* Feature Carousel */
#feature-carousel {
  width: 100%;
  max-width: 600px;
  margin: 20px auto 12px;
  overflow: hidden;
}

#carousel-track {
  display: flex;
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  touch-action: pan-y;
}

.carousel-slide {
  flex: 0 0 calc(100% - 32px);
  margin: 0 16px;
  border-radius: 18px;
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
  min-height: 130px;
}

.slide-weekly { background: linear-gradient(135deg, #0d2a3d 0%, #1a4a1a 100%); border-color: rgba(0, 255, 170, 0.25); }
.slide-mystery { background: linear-gradient(135deg, #1a1a3e 0%, #2d1b69 100%); border-color: rgba(138, 100, 255, 0.30); }
.slide-pass { background: linear-gradient(135deg, #1f0a2e 0%, #3d1560 100%); border-color: rgba(200, 100, 255, 0.28); }
.slide-checkin { background: linear-gradient(135deg, #0a2540 0%, #003d66 100%); border-color: rgba(41, 182, 246, 0.28); }
.slide-invite { background: linear-gradient(135deg, #1a2a00 0%, #2e4a00 100%); border-color: rgba(180, 255, 0, 0.25); }

.carousel-slide::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  opacity: 0.08;
  pointer-events: none;
}

.slide-weekly::before { background: #00ffaa; }
.slide-mystery::before { background: #8a64ff; }
.slide-pass::before { background: #c864ff; }
.slide-checkin::before { background: #29b6f6; }
.slide-invite::before { background: #b4ff00; }

.carousel-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.carousel-emoji {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}

.carousel-text {
  flex: 1;
  min-width: 0;
  text-align: left;
}

[dir="rtl"] .carousel-text {
  text-align: right;
}

.carousel-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.carousel-desc {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.70);
  line-height: 1.45;
}

.carousel-cta {
  align-self: flex-start;
  padding: 7px 18px;
  border-radius: 20px;
  border: none;
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.15s ease;
  letter-spacing: 0.02em;
}

[dir="rtl"] .carousel-cta {
  align-self: flex-end;
}

.carousel-cta:active {
  transform: scale(0.95);
  opacity: 0.85;
}

.slide-weekly .carousel-cta { background: #00ffaa; color: #042c1a; }
.slide-mystery .carousel-cta { background: #8a64ff; color: #ffffff; }
.slide-pass .carousel-cta { background: #c864ff; color: #ffffff; }
.slide-checkin .carousel-cta { background: #29b6f6; color: #001a2e; }
.slide-invite .carousel-cta { background: #b4ff00; color: #1a2a00; }

#carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.25);
  padding: 0;
  cursor: pointer;
  transition: background 0.25s ease, width 0.25s ease;
}

.carousel-dot.active {
  background: #00ffaa;
  width: 18px;
  border-radius: 4px;
}

#go-to-weekly-contest {
  transition: opacity 0.22s ease, filter 0.22s ease, transform 0.2s ease;
}

#go-to-weekly-contest.weekly-drop-faded {
  opacity: 0.5;
  filter: saturate(0.65);
}

#go-to-weekly-contest.weekly-drop-ready {
  opacity: 1;
  filter: saturate(1);
}

#daily-checkin-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 20, 0.72);
  backdrop-filter: blur(3px);
  z-index: 3200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  visibility: visible;
  opacity: 1;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

#daily-checkin-modal.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.daily-checkin-card {
  width: min(92vw, 430px);
  max-height: 88vh;
  overflow-y: auto;
  text-align: left;
  background: linear-gradient(160deg, rgba(8, 20, 35, 0.96), rgba(7, 12, 23, 0.98));
  border: 1px solid rgba(0, 255, 170, 0.35);
  border-radius: 14px;
  padding: 18px 16px 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.daily-checkin-card h2 {
  margin: 0 32px 6px 0;
  font-size: 20px;
}

.daily-checkin-close {
  position: absolute;
  background: transparent;
  border: none;
  box-shadow: none;
  right: 8px;
  top: 6px;
  font-size: 28px;
  color: #b6f6e2;
  padding: 0 8px;
  margin: 0;
}

.daily-checkin-card {
  position: relative;
}

.daily-checkin-reset-time {
  margin: 0 0 6px;
  font-size: 12px;
  color: #98b8c4;
}

.daily-checkin-streak-text {
  margin: 0 0 12px;
  font-size: 14px;
  color: #e8f9ff;
  font-weight: 600;
}

.daily-checkin-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.daily-day {
  padding: 8px 4px;
  border-radius: 9px;
  border: 1px solid rgba(116, 148, 170, 0.24);
  background: rgba(24, 35, 52, 0.58);
  text-align: center;
}

.daily-day .day-num {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.daily-day .day-label {
  display: block;
  font-size: 10px;
  color: #9eb7c5;
  margin-top: 2px;
}

.daily-day.checked {
  border-color: rgba(0, 255, 170, 0.5);
  background: rgba(0, 255, 170, 0.14);
}

.daily-day.missed {
  border-color: rgba(255, 90, 90, 0.6);
  background: rgba(255, 90, 90, 0.12);
}

.daily-day.available {
  border-color: rgba(255, 200, 82, 0.72);
  background: rgba(255, 200, 82, 0.15);
  box-shadow: 0 0 10px rgba(255, 200, 82, 0.3);
}

.daily-checkin-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
  font-size: 12px;
  color: #c7d9e2;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.legend-dot.checked {
  background: #00ffaa;
}

.legend-dot.missed {
  background: #ff6f6f;
}

.legend-dot.available {
  background: #ffc95b;
}

.daily-checkin-action {
  width: 100%;
  margin: 0;
}

.checkin-success-pop {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 132px);
  transform: translate(-50%, -8px) scale(0.97);
  width: min(90vw, 420px);
  z-index: 4200;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.checkin-success-pop.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.checkin-success-card {
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(0, 255, 170, 0.42);
  background:
    radial-gradient(circle at 12% 0%, rgba(0, 255, 170, 0.18), rgba(0, 255, 170, 0) 55%),
    linear-gradient(150deg, rgba(5, 23, 42, 0.97), rgba(4, 14, 30, 0.97));
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.45),
    0 0 20px rgba(0, 255, 170, 0.16);
}

.checkin-success-title {
  font-size: 12px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #8fd4c2;
  margin-bottom: 6px;
}

.checkin-success-reward {
  font-size: 26px;
  font-weight: 800;
  color: #2fffc2;
  text-shadow: 0 0 16px rgba(47, 255, 194, 0.32);
  line-height: 1.1;
}

.checkin-success-meta {
  margin-top: 8px;
  color: #d7f6f1;
  font-size: 13px;
  font-weight: 600;
}

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

.checkin-success-pill {
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.checkin-success-pill .pill-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.3px;
  color: #9fc7c0;
}

.checkin-success-pill .pill-value {
  display: block;
  margin-top: 3px;
  font-size: 16px;
  font-weight: 800;
}

.checkin-success-pill.bronze .pill-value {
  color: #e1a66e;
  text-shadow: 0 0 10px rgba(225, 166, 110, 0.35);
}

.checkin-success-pill.xp .pill-value {
  color: #9cf7dd;
  text-shadow: 0 0 10px rgba(156, 247, 221, 0.4);
}

.checkin-success-pill.silver .pill-value {
  color: #dfe6ef;
  text-shadow: 0 0 10px rgba(223, 230, 239, 0.35);
}

.checkin-success-pill.gold .pill-value {
  color: #ffd166;
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.4);
}

#farm-btn.mining-ready {
  background: linear-gradient(90deg, #00ff00, #00ffaa);
  box-shadow: 0 0 10px #00ff00;
  animation: miningClaimGlow 1.2s ease-in-out infinite alternate;
}

@keyframes miningClaimGlow {
  from {
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.55);
  }
  to {
    box-shadow: 0 0 18px rgba(0, 255, 170, 0.95);
  }
}

@keyframes miningTrackSweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}


/* Leaderboard Styles (completed cutoff) */
#leaderboard-title {
  width: min(94vw, 640px);
  margin: 0 auto 14px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
}
.leaderboard-title-text {
  margin: 0;
  text-align: center;
}
.leaderboard-arrow {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(0, 255, 170, 0.28);
  background: linear-gradient(180deg, rgba(8, 44, 54, 0.95), rgba(4, 23, 30, 0.92));
  color: #e8fffb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}
.leaderboard-arrow:hover {
  transform: none;
  border-color: rgba(0, 255, 170, 0.5);
  background: linear-gradient(180deg, rgba(11, 51, 64, 0.97), rgba(4, 23, 30, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.leaderboard-arrow:focus-visible,
.leaderboard-arrow:active {
  transform: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.leaderboard-arrow svg {
  width: 30px;
  height: 30px;
  stroke-width: 3.1;
}
#leaderboard-container {
    width: 100%;
    max-width: 600px;
  margin: 20px auto;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.leaderboard-header, .leaderboard-row {
  display: grid;
  /* Rank, UserID, XP, Points, Streak */
  grid-template-columns: 44px minmax(0, 1.9fr) 64px 78px 68px;
  align-items: center;
  column-gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.leaderboard-header {
  font-weight: bold;
  color: #00ffaa;
}
.leaderboard-header span,
.leaderboard-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leaderboard-row {
  border-radius: 8px;
}
.leaderboard-row.current-user {
  background: linear-gradient(90deg, rgba(0, 255, 170, 0.12), rgba(0, 217, 255, 0.06));
  border: 1px solid rgba(0, 255, 170, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.leaderboard-row.detached-current-user {
  margin-top: 8px;
}
.leaderboard-row .rank,
.leaderboard-row .xp,
.leaderboard-row .points,
.leaderboard-row .streak {
  text-align: center;
}
.leaderboard-row .username {
  text-align: left;
  font-weight: 600;
}
.leaderboard-row:hover {
  background: rgba(0, 255, 170, 0.1);
}
.leaderboard-row.current-user:hover {
  background: linear-gradient(90deg, rgba(0, 255, 170, 0.16), rgba(0, 217, 255, 0.09));
}
.leaderboard-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  color: rgba(191, 244, 255, 0.55);
  letter-spacing: 6px;
  font-weight: 700;
  user-select: none;
}

/* ─── Level colour tokens ─────────────────────────────────────────────── */
:root {
  --lvl-1-accent:  #00ffaa; --lvl-1-row-bg:  rgba(0,255,170,0.07);   --lvl-1-border:  rgba(0,255,170,0.22);   --lvl-1-badge: rgba(0,255,170,0.12);
  --lvl-2-accent:  #00e5cc; --lvl-2-row-bg:  rgba(0,229,204,0.07);   --lvl-2-border:  rgba(0,229,204,0.22);   --lvl-2-badge: rgba(0,229,204,0.12);
  --lvl-3-accent:  #29b6f6; --lvl-3-row-bg:  rgba(41,182,246,0.07);  --lvl-3-border:  rgba(41,182,246,0.22);  --lvl-3-badge: rgba(41,182,246,0.14);
  --lvl-4-accent:  #7986cb; --lvl-4-row-bg:  rgba(92,107,192,0.09);  --lvl-4-border:  rgba(92,107,192,0.30);  --lvl-4-badge: rgba(92,107,192,0.18);
  --lvl-5-accent:  #9c6eff; --lvl-5-row-bg:  rgba(124,77,255,0.09);  --lvl-5-border:  rgba(124,77,255,0.32);  --lvl-5-badge: rgba(124,77,255,0.18);
  --lvl-6-accent:  #ce93d8; --lvl-6-row-bg:  rgba(171,71,188,0.10);  --lvl-6-border:  rgba(171,71,188,0.35);  --lvl-6-badge: rgba(171,71,188,0.20);
  --lvl-7-accent:  #ff8c5a; --lvl-7-row-bg:  rgba(255,107,53,0.10);  --lvl-7-border:  rgba(255,107,53,0.38);  --lvl-7-badge: rgba(255,107,53,0.20);
  --lvl-8-accent:  #ef5350; --lvl-8-row-bg:  rgba(198,40,40,0.11);   --lvl-8-border:  rgba(198,40,40,0.42);   --lvl-8-badge: rgba(198,40,40,0.22);
  --lvl-9-accent:  #ffe033; --lvl-9-row-bg:  rgba(255,214,0,0.08);   --lvl-9-border:  rgba(255,214,0,0.40);   --lvl-9-badge: rgba(255,214,0,0.18);
  --lvl-10-accent: #cfd8dc; --lvl-10-row-bg: rgba(176,190,197,0.08); --lvl-10-border: rgba(176,190,197,0.35); --lvl-10-badge: rgba(176,190,197,0.18);
}

/* ─── Data-attribute driven theming ─────────────────────────────────── */
#leaderboard-container[data-level-index="1"]  { --lvl-accent: var(--lvl-1-accent);  --lvl-row-bg: var(--lvl-1-row-bg);  --lvl-border: var(--lvl-1-border);  --lvl-badge: var(--lvl-1-badge);  }
#leaderboard-container[data-level-index="2"]  { --lvl-accent: var(--lvl-2-accent);  --lvl-row-bg: var(--lvl-2-row-bg);  --lvl-border: var(--lvl-2-border);  --lvl-badge: var(--lvl-2-badge);  }
#leaderboard-container[data-level-index="3"]  { --lvl-accent: var(--lvl-3-accent);  --lvl-row-bg: var(--lvl-3-row-bg);  --lvl-border: var(--lvl-3-border);  --lvl-badge: var(--lvl-3-badge);  }
#leaderboard-container[data-level-index="4"]  { --lvl-accent: var(--lvl-4-accent);  --lvl-row-bg: var(--lvl-4-row-bg);  --lvl-border: var(--lvl-4-border);  --lvl-badge: var(--lvl-4-badge);  }
#leaderboard-container[data-level-index="5"]  { --lvl-accent: var(--lvl-5-accent);  --lvl-row-bg: var(--lvl-5-row-bg);  --lvl-border: var(--lvl-5-border);  --lvl-badge: var(--lvl-5-badge);  }
#leaderboard-container[data-level-index="6"]  { --lvl-accent: var(--lvl-6-accent);  --lvl-row-bg: var(--lvl-6-row-bg);  --lvl-border: var(--lvl-6-border);  --lvl-badge: var(--lvl-6-badge);  }
#leaderboard-container[data-level-index="7"]  { --lvl-accent: var(--lvl-7-accent);  --lvl-row-bg: var(--lvl-7-row-bg);  --lvl-border: var(--lvl-7-border);  --lvl-badge: var(--lvl-7-badge);  }
#leaderboard-container[data-level-index="8"]  { --lvl-accent: var(--lvl-8-accent);  --lvl-row-bg: var(--lvl-8-row-bg);  --lvl-border: var(--lvl-8-border);  --lvl-badge: var(--lvl-8-badge);  }
#leaderboard-container[data-level-index="9"]  { --lvl-accent: var(--lvl-9-accent);  --lvl-row-bg: var(--lvl-9-row-bg);  --lvl-border: var(--lvl-9-border);  --lvl-badge: var(--lvl-9-badge);  }
#leaderboard-container[data-level-index="10"] { --lvl-accent: var(--lvl-10-accent); --lvl-row-bg: var(--lvl-10-row-bg); --lvl-border: var(--lvl-10-border); --lvl-badge: var(--lvl-10-badge); }

#leaderboard-container {
  --lvl-accent: var(--lvl-1-accent);
  --lvl-row-bg: var(--lvl-1-row-bg);
  --lvl-border: var(--lvl-1-border);
  --lvl-badge:  var(--lvl-1-badge);
}

.leaderboard-title-text {
  color: var(--lvl-accent);
  transition: color 0.25s ease;
}

.leaderboard-arrow {
  border-color: color-mix(in srgb, var(--lvl-accent) 28%, transparent);
  color: var(--lvl-accent);
  transition: border-color 0.25s ease, color 0.25s ease;
}
.leaderboard-arrow:hover {
  border-color: color-mix(in srgb, var(--lvl-accent) 55%, transparent);
}

.leaderboard-header {
  color: var(--lvl-accent);
  transition: color 0.25s ease;
}

.leaderboard-row:nth-child(-n+3) .rank {
  color: var(--lvl-accent);
  font-weight: 700;
}

.leaderboard-row.current-user {
  background: var(--lvl-row-bg);
  border: 1px solid var(--lvl-border);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
  transition: background 0.25s ease, border-color 0.25s ease;
}
.leaderboard-row.current-user:hover {
  background: var(--lvl-row-bg);
  filter: brightness(1.25);
}

#current-level.level-badge-themed {
  color: var(--lvl-accent);
  transition: color 0.25s ease;
}
.referral-board-container {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
  width: 100%;
  overflow: hidden;
}

.referral-header,
.referral-row {
  display: grid;
  grid-template-columns: 48px minmax(96px, 1fr) minmax(24px, 0.55fr) 88px;
  align-items: center;
  column-gap: 0;
  width: 100%;
  min-height: 42px;
  padding: 10px 0;
  box-sizing: border-box;
}

.referral-header {
  font-weight: bold;
  color: #00ffaa;
  border-bottom: 2px solid rgba(0, 255, 170, 0.2);
  font-size: 0.9rem;
}

.referral-header span,
.referral-row span {
  display: flex;
  align-items: center;
  min-width: 0;
}

.referral-header span:nth-child(1),
.referral-row .rank {
  justify-content: center;
  text-align: center;
  font-weight: 600;
  padding: 0 6px;
}

.referral-header span:nth-child(2),
.referral-row .username {
  grid-column: 2;
  justify-content: center;
  text-align: center;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 8px;
}

.referral-header span:nth-child(3),
.referral-row .referrals {
  grid-column: 4;
  justify-content: center;
  text-align: center;
  font-weight: 600;
  padding: 0 6px;
}

.referral-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.95rem;
  color: #dff6f2;
}

.referral-row:hover {
  background: rgba(0, 255, 170, 0.08);
}

.referral-board-container .leaderboard-list {
  display: flex;
  flex-direction: column;
}

.referral-board-container .leaderboard-divider {
  width: 100%;
  box-sizing: border-box;
}

/* Invite Page Tasks Appearance Fixes */
#invite-content {
  width: min(94vw, 640px);
  margin: 0 auto;
}

.invite-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 170, 0.24);
  background: linear-gradient(160deg, rgba(7, 25, 42, 0.82), rgba(5, 17, 32, 0.85));
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

#invite-link {
  min-width: 0;
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 170, 0.25);
  background: rgba(9, 21, 36, 0.9);
  color: #dff6f2;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  outline: none;
}

#copy-invite-btn {
  height: 42px;
  margin: 0;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
  white-space: nowrap;
}

.invite-tasks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0;
}
.invite-task {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px auto;
  column-gap: 10px;
  row-gap: 0;
  align-items: center;
  background: rgba(0, 0, 0, 0.46);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 170, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  text-align: left;
}
.invite-task p {
  grid-column: 1;
  grid-row: 1;
  font-size: 16px;
  margin: 0;
  font-weight: 600;
  color: #ebf7ff;
}
.progress {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: 30px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin: 0;
  border: 1px solid rgba(0, 255, 170, 0.28);
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00ffaa, #00d9ff);
  width: 0%; /* Dynamic via JS */
  transition: width 0.5s ease;
}
.progress-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  color: rgba(240, 252, 255, 0.95);
  font-weight: 700;
  letter-spacing: 0.2px;
}
.check-button {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  background: #00ffaa; /* Glow green when ready */
  color: #000;
  padding: 7px 14px;
  margin: 0;
  min-width: 76px;
  height: 34px;
  border-radius: 6px;
  transition: background 0.3s, transform 0.2s;
}
.check-button:hover {
  background: #00eaff;
  transform: scale(1.05);
}

/* Referral Leaderboard Styling */
.referral-leaderboard {
  width: min(94vw, 640px);
  margin: 18px auto 0;
  padding: 0;
}

.referral-leaderboard h2 {
  font-size: 1.3rem;
  margin: 0 0 12px 0;
  color: #ebf7ff;
  font-weight: 700;
}

/* Tasks Page Appearance Fixes */
.task-tabs {
  display: flex;
  justify-content: space-around;
  margin: 10px 0;
}
.task-tab {
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #aaa;
  cursor: pointer;
  transition: color 0.3s, background 0.3s;
}
.task-tab.active {
  color: #00ffaa;
  background: rgba(0, 255, 170, 0.2);
  box-shadow: 0 0 10px rgba(0, 255, 170, 0.5);
}
.task-section {
  display: none;
}
.task-section.active {
  display: block;
}
.task-group {
  margin: 20px 0;
  padding: 15px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
}
.task-group-title {
  font-size: 20px;
  margin-bottom: 10px;
}
.task-group-hint {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 15px;
}
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* Assume injected tasks have .task-item class */
.task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  border-radius: 8px;
  transition: background 0.3s;
}
.task-item:hover {
  background: rgba(255, 255, 255, 0.2);
}
.task-item button { /* Go/Check/Claim */
  background: #00ffaa;
  color: #000;
  padding: 6px 12px;
  border-radius: 6px;
}
.task-item button.done {
  background: #aaa;
  cursor: not-allowed;
}

.verify-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: #8fd4c2;
}

.verify-spinner {
  animation: spin 2s linear infinite;
  display: inline-block;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.verify-countdown {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.task-button.claim-btn {
  background: linear-gradient(90deg, #00ffaa, #00eaff);
  color: #0a1a2a;
  font-weight: 700;
  animation: claimPulse 1.4s ease-in-out infinite alternate;
}

@keyframes claimPulse {
  from { box-shadow: 0 0 6px rgba(0, 255, 170, 0.4); }
  to { box-shadow: 0 0 16px rgba(0, 255, 170, 0.85); }
}

/* Marketplace Tabs & Elements */
#marketplace-tabs {
  display: flex;
  justify-content: space-around;
  margin: 10px 0;
}
.market-tab {
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #aaa;
  cursor: pointer;
  transition: color 0.3s, background 0.3s;
}
.market-tab.active {
  color: #00ffaa;
  background: rgba(0, 255, 170, 0.2);
  box-shadow: 0 0 10px rgba(0, 255, 170, 0.5);
}
.market-section {
  display: none;
}
.market-section.active {
  display: block;
}
.exchange-container {
  width: min(94vw, 640px);
  margin: 0 auto;
  padding: 14px 12px 16px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(6, 24, 40, 0.75), rgba(4, 14, 28, 0.7));
  border: 1px solid rgba(0, 255, 170, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 12px 28px rgba(0, 0, 0, 0.32);
}
.ticket-selector {
  margin-bottom: 10px;
}
#exchange-type {
  width: min(320px, 100%);
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 170, 0.4);
  background: rgba(8, 20, 34, 0.95);
  color: #dff8f1;
  font-weight: 700;
  font-size: 14px;
  padding: 0 36px 0 12px;
  outline: none;
  box-shadow: 0 0 10px rgba(0, 255, 170, 0.18);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #66e8cb 50%),
    linear-gradient(135deg, #66e8cb 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 15px,
    calc(100% - 12px) 15px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
#exchange-type option {
  color: #e9fbff;
  background: #0a1a2b;
}
.ticket-options {
  margin-top: 12px;
}
.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.amount-option {
  min-height: 52px;
  padding: 10px;
  margin: 0;
  border: 1px solid rgba(0, 255, 170, 0.22);
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(20, 35, 56, 0.95), rgba(8, 18, 35, 0.95));
  color: #e9fbff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 255, 170, 0.12);
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.amount-option:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 255, 170, 0.6);
  box-shadow: 0 0 14px rgba(0, 255, 170, 0.3);
}
.amount-option.selected {
  border-color: rgba(0, 255, 170, 0.9);
  background: linear-gradient(150deg, rgba(0, 255, 170, 0.2), rgba(7, 25, 42, 0.96));
  box-shadow: 0 0 18px rgba(0, 255, 170, 0.36);
}
.amount-option:disabled {
  opacity: 0.45;
  color: #7e9ca8;
  border-color: rgba(130, 150, 165, 0.2);
  background: linear-gradient(150deg, rgba(14, 20, 30, 0.94), rgba(8, 14, 24, 0.96));
  box-shadow: none;
  cursor: not-allowed;
}
.exchange-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 10px;
  font-weight: 700;
  color: #cfe9f1;
}
#from-ticket,
#to-ticket {
  min-width: 110px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 170, 0.24);
  background: rgba(10, 24, 40, 0.86);
}
#trade-button {
  width: min(280px, 100%);
  margin-top: 2px;
  color: #00221a;
}
#trade-button:disabled {
  background: linear-gradient(150deg, rgba(70, 80, 90, 0.5), rgba(44, 52, 60, 0.6));
  color: rgba(208, 220, 228, 0.7);
  box-shadow: none;
}

.mystery-box-panel {
  margin: 14px auto;
  max-width: 640px;
  background: rgba(7, 23, 34, 0.5);
  border: 1px solid rgba(0, 255, 170, 0.25);
  border-radius: 12px;
  padding: 14px;
}

.mystery-box-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.round-badge {
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #00ffaa;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  text-transform: uppercase;
  grid-column: 1 / -1;
}

.box-card {
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
  border: 1px solid rgba(158, 185, 206, 0.28);
  background: rgba(16, 30, 44, 0.8);
}

.box-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.box-state {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: #9bb3c2;
}

.box-card.next {
  border-color: rgba(0, 255, 170, 0.75);
  box-shadow: 0 0 10px rgba(0, 255, 170, 0.24);
}

.box-card.ready,
.box-card.opened {
  border-color: rgba(255, 214, 114, 0.75);
}

.box-card.claimed {
  border-color: rgba(83, 216, 133, 0.8);
  background: rgba(18, 48, 34, 0.75);
}

.box-card.locked {
  opacity: 0.6;
}

.box-card.bronze .box-title {
  color: #d3a670;
}

.box-card.silver .box-title {
  color: #c5d1dc;
}

.box-card.gold .box-title {
  color: #e8cf74;
}

#mystery-box-info p {
  margin: 6px 0;
  color: #d8ecf5;
  font-size: 13px;
}

#mystery-box-launcher {
  margin-top: 10px;
}

.mystery-box-back-button {
  margin-top: 6px;
  background: linear-gradient(90deg, #27465d, #1b3247);
  color: #d9f4ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

#open-market-mystery-box-button.buy-ready {
  background: linear-gradient(90deg, #00ffaa, #00eaff);
  color: #00221a;
}

#open-market-mystery-box-button.open-ready {
  background: linear-gradient(90deg, #ffd166, #ff9f43);
  color: #2a1500;
  box-shadow: 0 0 0 rgba(255, 191, 94, 0.2), 0 0 16px rgba(255, 191, 94, 0.45);
  animation: openBoxPulse 1.1s ease-in-out infinite alternate;
}

#open-market-mystery-box-button.open-ready:hover {
  background: linear-gradient(90deg, #ffe08a, #ffb25e);
}

@keyframes openBoxPulse {
  from {
    box-shadow: 0 0 8px rgba(255, 191, 94, 0.35), 0 0 14px rgba(255, 191, 94, 0.25);
    transform: translateY(0);
  }
  to {
    box-shadow: 0 0 16px rgba(255, 191, 94, 0.7), 0 0 24px rgba(255, 191, 94, 0.45);
    transform: translateY(-1px);
  }
}

/* Weekly Drop */
#weekly-drop-content {
  width: min(100% - 24px, 440px);
  margin: 12px auto 96px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

#wd-hero {
  padding: 18px 16px;
  border: 1px solid rgba(0, 255, 170, 0.22);
  border-radius: 16px;
  background:
    radial-gradient(circle at top left, rgba(0, 255, 170, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(8, 33, 45, 0.96), rgba(4, 15, 28, 0.96));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28), inset 0 0 18px rgba(0, 255, 170, 0.06);
}

#wd-eyebrow,
.wd-section-label {
  margin: 0 0 8px;
  color: rgba(0, 255, 170, 0.72);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#wd-title {
  margin: 0;
  color: #f7fffb;
  font-size: 27px;
  line-height: 1.1;
  letter-spacing: 0;
}

#wd-week-label {
  margin: 8px 0 14px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 700;
}

#wd-countdown,
#wd-confirmed-countdown {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 6px;
}

.wd-cd-cell {
  min-width: 0;
  padding: 9px 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  text-align: center;
}

.wd-cd-num {
  display: block;
  color: #00ffaa;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.wd-cd-unit {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.wd-cd-sep {
  color: rgba(0, 255, 170, 0.52);
  font-weight: 900;
}

#wd-entry-cost {
  margin: 13px 0 0;
  color: #ffd866;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

#wd-checklist,
#wd-confirmed,
#wd-winners {
  padding: 13px 12px;
  border: 1px solid rgba(0, 255, 170, 0.12);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
}

.wd-check-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.wd-check-row:first-of-type {
  border-top: none;
}

.wd-check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.wd-check-ok .wd-check-icon {
  background: rgba(0, 255, 170, 0.16);
  color: #00ffaa;
}

.wd-check-no .wd-check-icon {
  background: rgba(255, 209, 102, 0.14);
  color: #ffd166;
}

.wd-check-label {
  min-width: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 700;
}

.wd-check-val {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.wd-check-ok .wd-check-val {
  color: #00ffaa;
}

#eligibility-status {
  display: block;
  margin: 0;
  padding: 0 4px;
  color: #ffd866;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

#enter-contest-button {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.42);
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 15px;
  font-weight: 900;
  cursor: not-allowed;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

#enter-contest-button.wd-enter-ready {
  background: linear-gradient(90deg, #00ffaa, #00eaff);
  color: #032219;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 255, 170, 0.26);
}

#enter-contest-button.wd-enter-ready:hover {
  transform: translateY(-1px);
}

#enter-contest-button:disabled {
  opacity: 0.82;
}

#wd-participants {
  margin: -4px 0 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

#wd-confirmed {
  border-color: rgba(0, 255, 170, 0.2);
  text-align: center;
}

#wd-confirmed-icon {
  margin-bottom: 6px;
  font-size: 34px;
}

#wd-confirmed-title {
  margin: 0;
  color: #00ffaa;
  font-size: 19px;
  font-weight: 900;
}

#wd-confirmed-sub {
  margin: 6px 0 14px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
  line-height: 1.45;
}

.wd-invite-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  border: 1px solid rgba(0, 255, 170, 0.28);
  border-radius: 10px;
  color: #00ffaa;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.wd-invite-btn:hover {
  background: rgba(0, 255, 170, 0.08);
}

.wd-rules-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  padding: 0 2px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.52);
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.wd-rules-toggle i {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.wd-rules-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.wd-rules-body {
  margin-top: -8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  line-height: 1.7;
}

.wd-rules-body ul {
  margin: 0;
  padding-left: 16px;
}

.wd-rules-body li {
  margin-bottom: 4px;
}

#wd-winners {
  border-color: rgba(255, 216, 102, 0.14);
}

#wd-winners .wd-section-label {
  color: rgba(255, 216, 102, 0.72);
}

.wd-winner-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
}

.wd-winner-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 216, 102, 0.14);
  color: #ffe066;
  font-size: 10px;
  font-weight: 900;
}

.wd-winner-name {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
}

.wd-winners-pending {
  margin: 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 12px;
  font-style: italic;
}

.wd-winners-message {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.46);
  font-size: 11px;
  line-height: 1.45;
}
/* Settings Panel (from index.html) */
#settings-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 300px;
  z-index: 2000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}
.settings-content {
  text-align: left;
}
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.setting-guide-text {
  min-width: 0;
}
.setting-guide-label {
  display: block;
  color: #fff;
}
.setting-guide-sub {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
}
.setting-guide-btn {
  background: rgba(0, 255, 170, 0.1);
  border: 1px solid rgba(0, 255, 170, 0.25);
  border-radius: 8px;
  padding: 7px 9px;
  color: #00ffaa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.setting-guide-btn:hover {
  background: rgba(0, 255, 170, 0.2);
  border-color: rgba(0, 255, 170, 0.45);
}
.setting-guide-btn svg {
  width: 16px;
  height: 16px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #00ffaa;
}
input:checked + .slider:before {
  transform: translateX(20px);
}
.close-settings {
  position: absolute;
  top: 10px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: #fff;
  cursor: pointer;
}

/* Responsive Media Queries */
@media (max-width: 600px) {
  #top-nav {
    grid-template-columns: 42px minmax(70px, auto) minmax(0, 1fr) auto;
    gap: 4px;
  }
  #user-stats {
    grid-template-columns: 1fr 1fr;
    font-size: 10px;
  }
  #ticket-icons span {
    font-size: 12px;
  }
  #ton-connect-button {
    min-width: 84px;
    font-size: 10px;
    padding: 5px 6px;
  }
  button {
    font-size: 14px;
    padding: 8px 16px;
  }
  .invite-task, .task-item {
    font-size: 14px;
  }
  .invite-box {
    grid-template-columns: 1fr;
  }
  #copy-invite-btn {
    width: 100%;
    justify-content: center;
  }
  .invite-task {
    grid-template-columns: minmax(0, 1fr) 94px auto;
    column-gap: 8px;
    padding: 9px 10px;
  }
  .invite-task p {
    font-size: 15px;
  }
  .progress {
    height: 28px;
  }
  .progress-label {
    font-size: 13px;
  }
  .check-button {
    min-width: 70px;
    height: 32px;
    padding: 6px 12px;
    font-size: 13px;
  }
  #mining-bar {
    width: 80%;
  }
  .leaderboard-header, .leaderboard-row {
    grid-template-columns: 32px minmax(0, 1.7fr) 52px 64px 56px;
    column-gap: 6px;
    padding: 7px 8px;
    font-size: 12px;
  }
  #leaderboard-title {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 8px;
  }
  .leaderboard-arrow {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  .leaderboard-arrow svg {
    width: 26px;
    height: 26px;
    stroke-width: 3.1;
  }
}

@media (max-width: 420px) {
  .exchange-container {
    width: min(96vw, 640px);
    padding: 12px 10px 14px;
  }
  #exchange-type {
    height: 36px;
    font-size: 13px;
    padding: 0 34px 0 10px;
    background-position:
      calc(100% - 17px) 14px,
      calc(100% - 11px) 14px;
  }
  .amount-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .amount-option {
    min-height: 46px;
    padding: 8px 6px;
    font-size: 13px;
  }
  .exchange-preview {
    gap: 7px;
    margin-top: 12px;
    font-size: 12px;
    flex-wrap: wrap;
  }
  #from-ticket,
  #to-ticket {
    min-width: 92px;
    padding: 7px 8px;
    font-size: 12px;
  }
  #trade-button {
    width: 100%;
    font-size: 14px;
  }
}

@media (max-width: 360px) {
  .amount-option {
    font-size: 12px;
  }
}

/* ============ GAMES GRID STYLES ============ */

#games-section {
  padding: 20px 10px;
}

#games-container {
  width: 100%;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  padding: 10px 0;
}

.game-card {
  position: relative;
  background: linear-gradient(135deg, rgba(0, 30, 50, 0.9), rgba(0, 15, 25, 0.95));
  border: 1px solid rgba(0, 255, 170, 0.2);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.game-card:hover,
.game-card.hovered {
  border-color: rgba(0, 255, 170, 0.6);
  box-shadow: 0 0 20px rgba(0, 255, 170, 0.4), 0 8px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-4px);
}

.game-card-inner {
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.game-icon {
  font-size: 40px;
  line-height: 1;
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.game-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #00ffaa;
  text-shadow: 0 0 10px rgba(0, 255, 170, 0.3);
}

.game-description {
  margin: 0;
  font-size: 12px;
  color: #b3d9cc;
  line-height: 1.4;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-play {
  margin: 0 !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  background: linear-gradient(90deg, #00ffaa, #00eaff) !important;
  border: none !important;
  border-radius: 8px !important;
  color: #000 !important;
  font-weight: 700 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 255, 170, 0.2) !important;
  transition: all 0.3s ease !important;
}

.btn-play:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 4px 12px rgba(0, 255, 170, 0.4) !important;
  background: linear-gradient(90deg, #00eaff, #00ffaa) !important;
}

.btn-play .arrow {
  transition: transform 0.3s ease;
}

.game-card:hover .btn-play .arrow {
  transform: translateX(3px);
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .game-card-inner {
    padding: 12px 10px;
  }

  .game-icon {
    font-size: 32px;
  }

  .game-name {
    font-size: 14px;
  }

  .game-description {
    font-size: 11px;
  }
}

/* ============ FLIP CARDS GAME STYLES ============ */

.flipcards-ui {
  width: 100%;
  padding: 10px;
  position: relative;
}

.flipcards-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 52px);
  z-index: 22;
  padding: 8px 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(4, 18, 28, 0.96), rgba(4, 18, 28, 0.84));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  margin-bottom: 16px;
  gap: 12px;
}

.flipcards-timer {
  font-size: 24px;
  font-weight: 700;
  color: #00ffaa;
  text-shadow: 0 0 10px rgba(0, 255, 170, 0.5);
  min-width: 70px;
  text-align: center;
  transition: all 0.3s ease;
}

.flipcards-timer.warning {
  color: #ff9500;
  text-shadow: 0 0 15px rgba(255, 149, 0, 0.6);
  animation: pulse 0.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.flipcards-header h2 {
  flex-grow: 1;
  margin: 0;
  font-size: 18px;
  color: #00ffaa;
}

.btn-abandon {
  background: linear-gradient(90deg, #ff5f6d, #ff8a5b) !important;
  box-shadow: 0 2px 8px rgba(255, 95, 109, 0.2) !important;
  padding: 6px 10px !important;
  font-size: 13px !important;
  margin: 0 !important;
}

.btn-abandon:hover {
  box-shadow: 0 4px 12px rgba(255, 95, 109, 0.4) !important;
}

.flipcards-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 10px;
  margin: 20px 0;
  padding: 0;
  perspective: 1000px;
  position: relative;
  z-index: 1;
}

@media (max-width: 480px) {
  .flipcards-board {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

.flipcard {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  cursor: pointer;
  perspective: 1000px;
}

.flipcard.flipped .flipcard-inner,
.flipcard.matched .flipcard-inner {
  transform: rotateY(180deg);
}

.flipcard.matched {
  pointer-events: none;
}

.flipcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flipcard-front,
.flipcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  border-radius: 8px;
  border: 2px solid;
}

.flipcard-front {
  background: linear-gradient(135deg, rgba(0, 100, 150, 0.8), rgba(0, 50, 100, 0.9));
  border-color: rgba(0, 255, 170, 0.3);
  color: #00ffaa;
  z-index: 2;
}

.flipcard-front:hover {
  background: linear-gradient(135deg, rgba(0, 120, 170, 0.9), rgba(0, 70, 120, 0.95));
  box-shadow: inset 0 0 15px rgba(0, 255, 170, 0.2);
}

.flipcard-back {
  background: linear-gradient(135deg, rgba(0, 200, 100, 0.9), rgba(0, 150, 70, 0.95));
  border-color: rgba(0, 255, 170, 0.6);
  transform: rotateY(180deg);
  box-shadow: 0 0 15px rgba(0, 255, 170, 0.3);
}

.flipcard.matched .flipcard-back {
  box-shadow: 0 0 25px rgba(0, 255, 170, 0.6);
  animation: matchGlow 0.5s ease-out;
}

@keyframes matchGlow {
  0% {
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.3);
    transform: rotateY(180deg) scale(1);
  }
  50% {
    box-shadow: 0 0 30px rgba(0, 255, 170, 0.8);
    transform: rotateY(180deg) scale(1.05);
  }
  100% {
    box-shadow: 0 0 25px rgba(0, 255, 170, 0.6);
    transform: rotateY(180deg) scale(1);
  }
}

.flipcards-instructions {
  text-align: center;
  color: #b3d9cc;
  font-size: 13px;
  margin-top: 16px;
}

.difficulty-selector {
  text-align: center;
  padding: 20px;
}

.difficulty-selector h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: #00ffaa;
}

.difficulty-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  padding: 10px 0;
}

.difficulty-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 12px !important;
  background: linear-gradient(135deg, rgba(0, 50, 100, 0.9), rgba(0, 30, 60, 0.95)) !important;
  border: 2px solid rgba(0, 255, 170, 0.2) !important;
  border-radius: 10px !important;
  color: #b3d9cc !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
  cursor: pointer;
}

.difficulty-btn:hover {
  border-color: rgba(0, 255, 170, 0.6) !important;
  background: linear-gradient(135deg, rgba(0, 80, 120, 0.95), rgba(0, 50, 80, 0.98)) !important;
  box-shadow: 0 0 15px rgba(0, 255, 170, 0.3) !important;
  transform: translateY(-2px) !important;
}

.difficulty-btn .icon {
  font-size: 28px;
  line-height: 1;
}

.reward-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 20, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: 16px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.reward-content {
  background: linear-gradient(160deg, rgba(8, 30, 50, 0.98), rgba(5, 15, 30, 0.99));
  border: 1px solid rgba(0, 255, 170, 0.4);
  border-radius: 16px;
  padding: 24px 20px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 255, 170, 0.15);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.reward-content h2 {
  margin: 0 0 16px;
  font-size: 28px;
  color: #00ffaa;
  text-shadow: 0 0 15px rgba(0, 255, 170, 0.4);
}

.reward-content p {
  color: #b3d9cc;
  margin: 8px 0;
}

.onboarding-modal {
  position: fixed;
  inset: 0;
  z-index: 5050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 8, 20, 0.86);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.24s ease-out;
}

.onboarding-modal.closing {
  animation: fadeOut 0.18s ease forwards;
}

.onboarding-card {
  position: relative;
  width: min(100%, 380px);
  padding: 22px 18px 18px;
  border: 1px solid rgba(0, 255, 170, 0.34);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 234, 255, 0.16), transparent 42%),
    linear-gradient(160deg, rgba(8, 30, 50, 0.98), rgba(5, 15, 30, 0.99));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.52), 0 0 38px rgba(0, 255, 170, 0.14);
  text-align: center;
  animation: slideUp 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.onboarding-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: #d7f6f1;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.onboarding-progress {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-bottom: 18px;
}

.onboarding-progress span {
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.onboarding-progress span.active {
  background: linear-gradient(90deg, #00ffaa, #00eaff);
  box-shadow: 0 0 12px rgba(0, 255, 170, 0.35);
}

.onboarding-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 255, 170, 0.24);
  background: rgba(0, 255, 170, 0.08);
  font-size: 40px;
}

.onboarding-card h2 {
  margin: 0 0 10px;
  color: #00ffaa;
  font-size: 24px;
  line-height: 1.2;
}

.onboarding-card p {
  min-height: 64px;
  margin: 0 0 20px;
  color: #b3d9cc;
  font-size: 15px;
  line-height: 1.45;
}

.onboarding-next {
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, #00ffaa, #00eaff);
  color: #001113;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 255, 170, 0.22);
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.game-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.stat {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 170, 0.15);
}

.stat-label {
  display: block;
  font-size: 12px;
  color: #9eb7c5;
  margin-bottom: 6px;
}

.stat-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #00ffaa;
}

.rewards-earned {
  margin: 16px 0;
  background: rgba(0, 255, 170, 0.08);
  border: 1px solid rgba(0, 255, 170, 0.2);
  border-radius: 10px;
  padding: 12px;
}

.rewards-earned h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: #00ffaa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.reward-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: #d7f6f1;
}

.reward-amount {
  font-weight: 700;
  color: #00ffaa;
  text-shadow: 0 0 8px rgba(0, 255, 170, 0.3);
}

.new-stats {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 8px;
  margin: 12px 0;
  font-size: 13px;
  color: #b3d9cc;
}

.new-stats p {
  margin: 6px 0;
}

.btn-primary {
  width: 100%;
  margin: 0 !important;
  padding: 12px 16px !important;
  font-size: 15px !important;
  background: linear-gradient(90deg, #00ffaa, #00eaff) !important;
  color: #000 !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  transition: all 0.3s ease !important;
}

.btn-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 255, 170, 0.3) !important;
}

/* ============ DAILY PASS PURCHASE SCREEN ============ */

.pass-purchase-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 20px;
}

.pass-card {
  background: linear-gradient(160deg, rgba(8, 30, 50, 0.98), rgba(5, 15, 30, 0.99));
  border: 2px solid rgba(0, 255, 170, 0.5);
  border-radius: 20px;
  padding: 32px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 50px rgba(0, 255, 170, 0.2);
  animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pass-icon {
  font-size: 64px;
  margin-bottom: 16px;
  display: block;
  animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.pass-card h2 {
  margin: 0 0 12px;
  font-size: 32px;
  color: #00ffaa;
  text-shadow: 0 0 20px rgba(0, 255, 170, 0.5);
}

.pass-description {
  color: #9eb7c5;
  font-size: 14px;
  margin: 0 0 24px;
  line-height: 1.5;
}

.pass-features {
  background: rgba(0, 255, 170, 0.08);
  border: 1px solid rgba(0, 255, 170, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin: 24px 0;
  display: grid;
  gap: 12px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #d7f6f1;
}

.feature-icon {
  font-size: 20px;
  display: block;
}

.pass-price {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 255, 170, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0;
}

.price-label {
  display: block;
  font-size: 12px;
  color: #9eb7c5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.price-amount {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: #00ffaa;
  text-shadow: 0 0 15px rgba(0, 255, 170, 0.4);
}

.btn-purchase-pass {
  width: 100%;
  padding: 14px 16px;
  font-size: 15px;
  background: linear-gradient(90deg, #00ffaa, #00eaff);
  color: #000;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin: 12px 0;
  box-shadow: 0 4px 16px rgba(0, 255, 170, 0.3);
}

.btn-purchase-pass:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 255, 170, 0.4);
}

.btn-purchase-pass:active {
  transform: translateY(-1px);
}

.btn-back-games {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  background: rgba(4, 19, 31, 0.96);
  color: #c8fff0;
  border: 1px solid rgba(0, 255, 170, 0.38);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 255, 170, 0.08), 0 6px 16px rgba(0, 0, 0, 0.26);
}

.btn-back-games:hover {
  background: rgba(0, 255, 170, 0.12);
  border-color: rgba(0, 255, 170, 0.7);
  color: #f2fffb;
}

.btn-leave-game {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  color: #130605;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0;
}

.arcade-subtitle {
  color: #b3d9cc;
  margin: 10px 10px 18px;
  text-align: center;
}

.arcade-shell {
  margin: 0 auto 24px;
  max-width: 520px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(0, 255, 170, 0.22);
  background:
    radial-gradient(circle at top left, rgba(0, 255, 170, 0.08), transparent 42%),
    linear-gradient(160deg, rgba(8, 30, 50, 0.98), rgba(5, 15, 30, 0.99));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
}

.arcade-header {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.arcade-header-sticky {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 52px);
  z-index: 20;
  padding: 4px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(4, 18, 28, 0.96), rgba(4, 18, 28, 0.82));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.arcade-chip {
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 170, 0.18);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.arcade-chip span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8eb1bb;
  margin-bottom: 6px;
}

.arcade-chip strong {
  font-size: 18px;
  color: #f0fff8;
}

.game-outcome {
  text-align: center;
}

.game-outcome h3 {
  margin: 0 0 8px;
  color: #00ffaa;
  font-size: 28px;
}

.game-outcome p {
  color: #b3d9cc;
  margin: 0 0 18px;
}

.pass-target-game {
  border: 1px solid rgba(0, 255, 170, 0.18);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 12px;
  margin: 18px 0 0;
  color: #e8fff5;
}

.pass-target-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8eb1bb;
  margin-bottom: 6px;
}

.arcade-pass-banner {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 255, 170, 0.22);
  background: linear-gradient(180deg, rgba(8, 44, 54, 0.94), rgba(5, 22, 30, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  text-align: center;
}

.arcade-pass-banner-head {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #f0fff8;
  font-size: 15px;
  font-weight: 700;
}

.arcade-pass-banner-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #2cf5a1;
  box-shadow: 0 0 14px rgba(44, 245, 161, 0.65);
}

.arcade-pass-banner-copy {
  display: block;
  margin-top: 6px;
  color: #9fc2b9;
  font-size: 12px;
}

.arcade-entry-back {
  display: block;
  width: auto;
  min-width: 190px;
  max-width: 240px;
  margin: 16px auto 0;
  padding: 10px 18px;
}

.slidingtiles-board {
  --grid-size: 4;
  display: grid;
  grid-template-columns: repeat(var(--grid-size), minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at top left, rgba(0, 234, 255, 0.16), transparent 38%);
  border: 1px solid rgba(0, 234, 255, 0.18);
}

.slidingtile {
  aspect-ratio: 1;
  border: 0;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(0, 255, 170, 0.92), rgba(0, 174, 255, 0.86)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent);
  color: #02161a;
  font-weight: 800;
  font-size: clamp(18px, 4vw, 28px);
  letter-spacing: 0.03em;
  box-shadow: 0 14px 24px rgba(0, 140, 120, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.slidingtile:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(0, 190, 160, 0.28);
}

.slidingtile-empty {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.18);
}

.blocktower-shell {
  max-width: 560px;
}

.blocktower-game-shell {
  padding: 14px;
  padding-top: 18px;
}

.blocktower-topbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 52px);
  z-index: 20;
  padding: 4px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(4, 18, 28, 0.96), rgba(4, 18, 28, 0.82));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.blocktower-mini-stat {
  border-radius: 12px;
  padding: 10px 8px;
  border: 1px solid rgba(0, 255, 170, 0.14);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.blocktower-mini-stat span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #8ea8b2;
  margin-bottom: 4px;
}

.blocktower-mini-stat strong {
  display: block;
  font-size: 20px;
  color: #f4fff9;
}

.blocktower-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 190px);
  gap: 10px;
  align-items: start;
}

.blocktower-helper-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 196, 89, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 214, 112, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.02);
}

.blocktower-helper-strip.is-revealing {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.blocktower-helper-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.blocktower-helper-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.blocktower-helper-copy strong {
  color: #fff4cf;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.blocktower-helper-copy span {
  color: #cfe1db;
  font-size: 12px;
  line-height: 1.35;
}

.blocktower-helper-actions {
  display: grid;
  justify-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.blocktower-helper-meta {
  color: #f6d58e;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.blocktower-helper-btn {
  width: min(100%, 260px);
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffd166, #ffae3d);
  color: #261400;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.22);
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.blocktower-helper-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.24);
}

.blocktower-helper-btn.is-disabled,
.blocktower-helper-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.blocktower-helper-strip.is-attention {
  border-color: rgba(255, 209, 102, 0.6);
  box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.18), 0 0 22px rgba(255, 174, 61, 0.18);
}

.blocktower-helper-btn.is-attention {
  animation: blocktowerHelpJump 0.95s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 14px 28px rgba(255, 174, 61, 0.34), 0 0 20px rgba(255, 209, 102, 0.22);
}

.blocktower-helper-preview {
  width: min(88px, 100%);
  justify-self: end;
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 209, 102, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.blocktower-helper-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.blocktower-helper-preview-head strong {
  color: #fff4cf;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.blocktower-helper-preview-head span {
  color: #f7d07a;
  font-size: 10px;
  font-weight: 700;
}

.blocktower-helper-preview-stack {
  height: 184px;
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
}

.blocktower-helper-preview-block {
  flex: 1 1 0;
  min-height: 8px;
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.08) 26%, rgba(0, 0, 0, 0.12) 100%),
    var(--tower-color, #00ffaa);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.blocktower-panel {
  border-radius: 16px;
  border: 1px solid rgba(0, 255, 170, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.14));
  padding: 12px;
}

.blocktower-panel.is-disabled {
  opacity: 0.7;
}

.blocktower-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.blocktower-panel-head h3 {
  margin: 0;
  color: #ecfff6;
  font-size: 14px;
}

.blocktower-panel-head span {
  font-size: 10px;
  color: #8ea8b2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.blocktower-stack-lane {
  min-height: 310px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(0, 0, 0, 0.16)),
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.06), transparent 48%);
  padding: 12px 10px 10px;
}

.blocktower-stack {
  min-height: 286px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  gap: 8px;
}

.tower-block,
.blocktower-brick {
  position: relative;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.08) 26%, rgba(0, 0, 0, 0.1) 100%),
    var(--tower-color, #00ffaa);
  color: rgba(7, 14, 18, 0.9);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -4px 0 rgba(0, 0, 0, 0.12),
    0 10px 18px rgba(0, 0, 0, 0.18);
}

.tower-block::before,
.blocktower-brick::before {
  content: '';
  position: absolute;
  inset: 4px 5px auto;
  height: 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.tower-block.is-top {
  cursor: pointer;
}

.tower-block.is-top:hover {
  transform: translateY(-1px);
}

.tower-block.is-wrong,
.blocktower-brick.is-wrong {
  animation: towerShake 0.36s linear;
}

.tower-block-preview {
  animation: towerDrop 0.5s cubic-bezier(0.2, 0.9, 0.2, 1);
}

@keyframes towerDrop {
  from {
    opacity: 0;
    transform: translateY(-26px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tower-block-placeholder {
  min-height: 56px;
  background: rgba(255, 255, 255, 0.04);
  color: #89a8b2;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.tower-block-placeholder::before {
  display: none;
}

.blocktower-tray-grid {
  display: grid;
  gap: 10px;
}

.blocktower-tray-brick {
  width: 100%;
  min-height: 56px;
  text-align: left;
  justify-content: space-between;
  padding-inline: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.blocktower-tray-brick:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -4px 0 rgba(0, 0, 0, 0.12),
    0 14px 22px rgba(0, 0, 0, 0.22);
}

.blocktower-tray-brick.is-empty,
.blocktower-tray-brick:disabled {
  opacity: 0.35;
  filter: grayscale(0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.brick-label,
.brick-count {
  position: relative;
  z-index: 1;
}

.brick-label {
  font-size: 15px;
}

.brick-count {
  font-size: 12px;
}

.blocktower-footer-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(0, 255, 170, 0.1);
  display: grid;
  gap: 3px;
  color: #c7e6df;
  font-size: 12px;
}

.blocktower-footer-note strong {
  color: #f1fff9;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@keyframes towerShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

@keyframes blocktowerHelpJump {
  0%, 100% { transform: translateY(0) scale(1); }
  16% { transform: translateY(-7px) scale(1.02); }
  32% { transform: translateY(2px) scale(0.99); }
  48% { transform: translateY(-5px) scale(1.015); }
  64% { transform: translateY(0) scale(1); }
  78% { transform: translateX(-4px); }
  90% { transform: translateX(4px); }
}

@media (max-width: 520px) {
  .blocktower-topbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .blocktower-helper-strip.is-revealing {
    grid-template-columns: minmax(0, 1fr) 72px;
    align-items: start;
  }

  .blocktower-helper-actions {
    justify-items: center;
  }

  .blocktower-helper-main {
    gap: 8px;
  }

  .blocktower-helper-btn {
    min-width: 0;
    width: min(100%, 240px);
  }

  .blocktower-helper-preview {
    width: 72px;
    padding: 7px;
  }

  .blocktower-helper-preview-stack {
    height: 150px;
    gap: 3px;
  }

  .blocktower-stage {
    grid-template-columns: minmax(0, 1fr) 148px;
    gap: 8px;
  }

  .blocktower-stack-lane {
    min-height: 260px;
  }

  .blocktower-stack {
    min-height: 236px;
  }

  .tower-block,
  .blocktower-brick {
    min-height: 38px;
    padding: 8px 10px;
  }

  .brick-label {
    font-size: 13px;
  }

  .brick-count {
    font-size: 11px;
  }
}


