/* =========================================================
   HOME — mine board, workers, stats, leaderboard
   ========================================================= */

.mine-board {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--glass-grad);
  border: 1px solid rgba(255, 199, 90, 0.18);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.mine-board::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 240px;
  height: 240px;
  background: radial-gradient(
    circle,
    rgba(255, 199, 90, 0.18),
    transparent 65%
  );
  pointer-events: none;
}

@media (min-width: 500px) {
  .mine-board {
    flex-direction: row;
    align-items: stretch;
  }
}

/* ---------------- left mine tile ---------------- */

.mine-left {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius-md);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.015)
  );
  border: 1px solid var(--stroke);
}

.mine-title {
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-2);
  margin-bottom: 8px;
}

.mine-image-container {
  position: relative;
  width: 100%;
  max-width: 104px;
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  padding: 8px;
  margin-bottom: 10px;
  background: radial-gradient(
      circle at 50% 30%,
      rgba(255, 199, 90, 0.2),
      transparent 65%
    ),
    rgba(8, 12, 21, 0.75);
  border: 1px solid rgba(255, 199, 90, 0.22);
  box-shadow: inset 0 0 24px rgba(255, 199, 90, 0.08),
    0 18px 34px -22px rgba(240, 165, 0, 0.9);
}

.mine-image-container::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 22px;
  border: 1px dashed rgba(255, 199, 90, 0.18);
  pointer-events: none;
}

.mine-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55));
}

.mine-animated {
  animation: pulse-mine 2.6s ease-in-out infinite alternate;
}

@keyframes pulse-mine {
  0% {
    transform: scale(1) translateY(0);
  }
  100% {
    transform: scale(1.05) translateY(-2px);
  }
}

.mine-capacity {
  width: 100%;
  position: relative;
  margin-top: auto;
  padding-top: 6px;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.55);
}

.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--gold-grad);
  box-shadow: 0 0 12px rgba(255, 199, 90, 0.65);
  transition: width 0.45s ease;
}

.capacity-text {
  display: block;
  margin-top: 5px;
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

/* ---------------- worker grid ---------------- */

.mine-center {
  flex: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 7px;
}

.worker-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding: 6px 3px;
  min-height: 68px;
  border-radius: 13px;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.055),
    rgba(255, 255, 255, 0.015)
  );
  border: 1px solid var(--stroke);
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.2s ease,
    box-shadow 0.25s ease;
}

.worker-slot.active-worker {
  background: linear-gradient(
    160deg,
    rgba(255, 199, 90, 0.16),
    rgba(255, 199, 90, 0.03)
  );
  border-color: rgba(255, 199, 90, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 199, 90, 0.12),
    0 10px 24px -14px rgba(240, 165, 0, 0.8);
}

.worker-slot.active-worker::after {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 229, 166, 0.8),
    transparent
  );
}

.worker-name {
  font-size: 8px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worker-slot.active-worker .worker-name {
  color: var(--gold-1);
}

.worker-avatar {
  width: 100%;
  height: 34px;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0.28;
  filter: grayscale(1);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.worker-slot.active-worker .worker-avatar {
  opacity: 1;
  filter: none;
  animation: workerFloat 3.2s ease-in-out infinite;
}

.worker-avatar img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@keyframes workerFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

.worker-level {
  width: fit-content;
  padding: 1px 7px;
  border-radius: 99px;
  font-family: var(--font-num);
  font-size: 8px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.worker-slot.active-worker .worker-level {
  color: #10141f;
  background: var(--gold-grad);
  border-color: transparent;
}

/* ---------------- stat cards ---------------- */

.stats-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stats-row {
  display: flex;
  gap: 9px;
}

.stat-card {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 12px 6px 11px;
  border-radius: var(--radius-md);
  background: var(--glass-grad);
  border: 1px solid var(--stroke);
  box-shadow: 0 14px 30px -24px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 199, 90, 0.65),
    transparent
  );
}

.stat-icon {
  font-size: 15px;
  color: var(--gold-2);
  margin-bottom: 2px;
  filter: drop-shadow(0 0 8px rgba(255, 199, 90, 0.35));
}

.stat-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.stat-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-val {
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.stat-val i {
  font-size: 9px;
  color: var(--gold-2);
}

/* ---------------- collect panel ---------------- */

.collect-card {
  position: relative;
  padding: 18px 16px 16px;
  border-radius: var(--radius-lg);
  text-align: center;
  background: linear-gradient(
    165deg,
    rgba(255, 199, 90, 0.13) 0%,
    rgba(17, 24, 40, 0.96) 46%,
    rgba(10, 15, 26, 0.98) 100%
  );
  border: 1px solid rgba(255, 199, 90, 0.35);
  box-shadow: var(--shadow-lg), 0 0 40px -22px rgba(240, 165, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.collect-card::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -20%;
  width: 70%;
  height: 220%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.07),
    transparent
  );
  transform: rotate(18deg);
  animation: collectSheen 5.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes collectSheen {
  0%,
  60% {
    transform: translateX(-120%) rotate(18deg);
  }
  85%,
  100% {
    transform: translateX(320%) rotate(18deg);
  }
}

.current-gold-big {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
  font-family: var(--font-num);
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  text-shadow: 0 0 26px rgba(255, 199, 90, 0.35);
}

.current-gold-big .usd-icon {
  margin-bottom: 2px;
}

.btn-collect-board {
  position: relative;
  z-index: 1;
  padding: 12px 0;
  border: none;
  border-radius: 15px;
  background: var(--gold-grad);
  color: #10141f;
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 0 14px 28px -12px rgba(240, 165, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 0 rgba(160, 100, 0, 0.35);
}

.btn-collect-board:hover {
  filter: brightness(1.06);
  color: #10141f;
}

.btn-collect-board:active {
  transform: translateY(2px) scale(0.99);
  box-shadow: 0 6px 16px -10px rgba(240, 165, 0, 0.9);
}

/* ---------------- STON.fi trade ---------------- */

.btn-stonfi-trade {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px 12px;
  border-radius: 15px;
  text-decoration: none;
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan-1);
  background: linear-gradient(
    160deg,
    rgba(70, 216, 255, 0.12),
    rgba(10, 16, 28, 0.9)
  );
  border: 1px solid rgba(70, 216, 255, 0.35);
  box-shadow: 0 16px 34px -22px rgba(70, 216, 255, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}

.btn-stonfi-trade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 20% 0%,
    rgba(139, 243, 255, 0.18),
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
}

.btn-stonfi-trade:hover {
  color: #eafcff;
  border-color: rgba(139, 243, 255, 0.65);
  box-shadow: 0 18px 40px -20px rgba(70, 216, 255, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn-stonfi-trade:hover::after {
  opacity: 1;
}

.btn-stonfi-trade:active {
  transform: scale(0.98);
}

/* ---------------- leaderboard ---------------- */

.leaderboard-container {
  position: relative;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--glass-grad);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.leaderboard-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 199, 90, 0.55),
    transparent
  );
}

.leaderboard-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
}

.leaderboard-title i {
  filter: drop-shadow(0 0 10px rgba(255, 199, 90, 0.5));
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.leader-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 13px;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.015)
  );
  border: 1px solid var(--stroke);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.leader-item:hover {
  background: rgba(255, 255, 255, 0.075);
}

.leader-item.top-1 {
  background: linear-gradient(
    120deg,
    rgba(255, 199, 90, 0.16),
    rgba(255, 199, 90, 0.03)
  );
  border-color: rgba(255, 199, 90, 0.4);
  box-shadow: 0 0 26px -14px rgba(255, 199, 90, 0.9);
}

.leader-item.top-2 {
  background: linear-gradient(
    120deg,
    rgba(214, 224, 241, 0.13),
    rgba(214, 224, 241, 0.02)
  );
  border-color: rgba(214, 224, 241, 0.28);
}

.leader-item.top-3 {
  background: linear-gradient(
    120deg,
    rgba(228, 150, 90, 0.14),
    rgba(228, 150, 90, 0.02)
  );
  border-color: rgba(228, 150, 90, 0.3);
}

.leader-item.my-rank {
  background: linear-gradient(
    120deg,
    rgba(70, 216, 255, 0.14),
    rgba(70, 216, 255, 0.02)
  );
  border-color: rgba(70, 216, 255, 0.45);
  box-shadow: 0 0 26px -14px rgba(70, 216, 255, 0.95);
}

.rank-badge {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.top-1 .rank-badge {
  color: #10141f !important;
  background: var(--gold-grad) !important;
  border-color: transparent;
  box-shadow: 0 0 14px rgba(255, 199, 90, 0.7);
}

.top-2 .rank-badge {
  color: #10141f !important;
  background: linear-gradient(135deg, #f4f8ff, #b9c6da) !important;
  border-color: transparent;
}

.top-3 .rank-badge {
  color: #241207 !important;
  background: linear-gradient(135deg, #f0b183, #c97a3f) !important;
  border-color: transparent;
}

.my-rank .rank-badge {
  color: #04141a !important;
  background: var(--cyan-grad) !important;
  border-color: transparent;
  box-shadow: 0 0 14px rgba(70, 216, 255, 0.7);
}

.leader-avatar {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  font-size: 14px;
  background: rgba(8, 12, 21, 0.8);
  border: 1px solid var(--stroke);
}

.leader-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.leader-name {
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-score {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 600;
}

.leader-score i {
  color: var(--gold-2);
  font-size: 9px;
}

/* ---------------- misc ---------------- */

.my-user:hover {
  color: var(--gold-1);
}


/* العربية: إلغاء التباعد بين الحروف حتى لا تتقطع الكلمات */
html[lang="ar"] .btn-collect-board,
html[lang="ar"] .mine-title,
html[lang="ar"] .stat-title {
  letter-spacing: normal;
  text-transform: none;
}

/* ---------------- إعلان المكافأة اليومي ---------------- */
.reward-ad-heading {
  margin-bottom: 8px;
  color: var(--gold-1);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.reward-ad-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 199, 90, 0.38);
  border-radius: 20px;
  background:
    radial-gradient(130% 190% at 100% 0%, rgba(255, 199, 90, 0.26) 0%, transparent 58%),
    linear-gradient(135deg, #241a08 0%, #33230a 48%, #151108 100%);
  box-shadow:
    0 14px 34px -16px rgba(240, 165, 0, 0.55),
    inset 0 1px 0 rgba(255, 230, 166, 0.24);
  color: var(--text);
  text-align: start;
  direction: rtl;
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.reward-ad-card::before {
  content: "";
  position: absolute;
  top: -30%;
  bottom: -30%;
  width: 42%;
  inset-inline-start: -55%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 230, 166, 0.24) 50%,
    transparent 100%
  );
  transform: rotate(18deg);
  animation: rewardAdShine 4.5s ease-in-out infinite;
  pointer-events: none;
}

.reward-ad-card > * {
  position: relative;
  z-index: 1;
}

.reward-ad-card:hover {
  box-shadow:
    0 18px 40px -16px rgba(240, 165, 0, 0.68),
    inset 0 1px 0 rgba(255, 230, 166, 0.3);
}

.reward-ad-card:active {
  transform: scale(0.985);
}

.reward-ad-card.is-locked {
  filter: saturate(0.62);
}

.reward-ad-card.is-locked .reward-ad-icon {
  animation: none;
}

.reward-ad-icon {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-grad);
  color: #2a1a00;
  font-size: 19px;
  box-shadow:
    0 8px 20px -6px rgba(240, 165, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  animation: rewardAdPulse 2.4s ease-in-out infinite;
}

.reward-ad-icon i {
  transform: translateX(1px);
}

.reward-ad-badge {
  position: absolute;
  top: -5px;
  inset-inline-start: -5px;
  padding: 1px 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 199, 90, 0.5);
  background: #0b0d12;
  color: var(--gold-2);
  font-family: var(--font-num);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.4px;
  line-height: 1.4;
}

.reward-ad-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.reward-ad-title {
  color: var(--gold-1);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.reward-ad-title b {
  color: #ffffff;
  font-family: var(--font-num);
}

.reward-ad-sub {
  color: rgba(255, 230, 166, 0.72);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
}

.reward-ad-pill {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--gold-grad);
  color: #2a1a00;
  font-size: 9.5px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 12px -4px rgba(240, 165, 0, 0.6);
}

.reward-ad-card.is-locked .reward-ad-pill {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  box-shadow: none;
}

@keyframes rewardAdShine {
  0% {
    transform: translateX(-160%) rotate(18deg);
  }
  55%,
  100% {
    transform: translateX(320%) rotate(18deg);
  }
}

@keyframes rewardAdPulse {
  0%,
  100% {
    box-shadow:
      0 8px 20px -6px rgba(240, 165, 0, 0.72),
      inset 0 1px 0 rgba(255, 255, 255, 0.55);
  }
  50% {
    box-shadow:
      0 10px 26px -6px rgba(240, 165, 0, 0.95),
      0 0 0 6px rgba(255, 199, 90, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.55);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reward-ad-card::before,
  .reward-ad-icon {
    animation: none;
  }
}
