@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

:root {
  --bg-0:#040b19;
  --bg-1:#0a1530;
  --bg-2:#0f2249;
  --ink:#eaf3ff;
  --muted:#9eb6d8;
  --card:#0f1f3f;
  --card-soft:#122750;
  --line:rgba(118,164,226,.35);
  --cyan:#34d6ff;
  --blue:#4d7bff;
  --pink:#ff5f9d;
  --good:#19d3a1;
  --shadow:0 18px 42px rgba(0,0,0,.35);
  --scroll-track:rgba(10,20,45,.88);
  --scroll-thumb-a:#37d8ff;
  --scroll-thumb-b:#5e82ff;
  --scroll-thumb-c:#ff62a0;
  --mobile-nav-shell-z: 2147483002;
  --mobile-nav-backdrop-z: 2147483000;
  --mobile-nav-panel-z: 2147483003;
  --mobile-nav-toggle-z: 2147483004;
  --mobile-nav-header-offset: calc(env(safe-area-inset-top) + 88px);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "Tajawal", "DroidKufi-Regular", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1000px 600px at 100% 0%, rgba(77,123,255,.16), transparent 70%),
    radial-gradient(900px 600px at 0% 100%, rgba(255,95,157,.14), transparent 70%),
    linear-gradient(140deg, var(--bg-0), var(--bg-1) 58%, var(--bg-2));
}

.scene-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(500px 260px at 70% 30%, rgba(52,214,255,.16), transparent 75%),
    radial-gradient(450px 220px at 30% 72%, rgba(255,95,157,.14), transparent 75%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 120;
  isolation: isolate;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 14, 31, .82);
  /*backdrop-filter: blur(8px);*/
  backdrop-filter: unset;

}
.topbar nav a {
  color: var(--ink);
  text-decoration: none;
  margin-inline-start: 14px;
  border: 1px solid var(--line);
  background: rgba(20,40,78,.5);
  border-radius: 10px;
  padding: 8px 10px;
}
.brand-wrap { display: flex; align-items: center; gap: 10px; }
.brand-home { text-decoration: none; color: inherit; }
.brand-home:hover, .brand-home:focus-visible { opacity: .95; }
.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  box-shadow: 0 0 14px var(--cyan);
}
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(149, 189, 246, .45);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}
.season-meta { color: var(--muted); font-size: 13px; }

/* ── Fixed resource bar ── */
.resource-bar {
  width: calc(100% + 40px);
  margin: 0 -20px -12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  justify-content: flex-evenly;
  gap: 18px;
  padding: 5px 16px;
  background: rgba(8, 18, 38, .6);
  border-top: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  flex-wrap: nowrap;
      gap: 25px;
}

.resource-bar:empty { display: none; }

.resource-bar::-webkit-scrollbar { height: 3px; }
.resource-bar::-webkit-scrollbar-thumb { background: rgba(129, 176, 245, .35); border-radius: 4px; }

.rb-item {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-size: 13px;
  color: #e0ecff;
}

.rb-item img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.rb-item strong {
  color: #fff;
  font-weight: 700;
}

.rb-sep {
  color: rgba(129, 176, 245, .4);
  font-size: 16px;
  line-height: 1;
  user-select: none;
}

body[data-theme="light"] .resource-bar {
  background: rgba(241, 245, 249, .7);
  border-top-color: rgba(148, 163, 184, .3);
}

body[data-theme="light"] .rb-item { color: #334155; }
body[data-theme="light"] .rb-item strong { color: #0f172a; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-x: hidden;
}
.auth-card {
  width: min(500px, 100%);
  max-width: min(500px, calc(100vw - 24px));
  background: rgba(14,30,62,.9);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
  flex: 0 1 auto;
}
.auth-page img {
  display: block;
  max-width: min(100%, 256px);
  max-height: 256px;
  height: auto;
}
.auth-brand .brand-logo {
  width: clamp(72px, 18vw, 128px);
  height: auto;
  max-width: min(100%, 128px);
  max-height: 128px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}
.auth-card form { display:grid; gap:10px; margin-top:12px; }
.auth-card input,
.auth-card button {
  padding:12px;
  border-radius:10px;
  border:1px solid rgba(149,187,244,.35);
  font: inherit;
  color: var(--ink);
  background: rgba(9,20,43,.8);
}
.auth-card button,
.google-btn {
  background: linear-gradient(120deg, var(--blue), var(--cyan));
  color: #031327;
  border: none;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
  margin-top: 8px;
  padding: 12px;
  border-radius: 10px;
  font-weight: 700;
}
.google-btn { background: linear-gradient(120deg, #5b7cff, #9ec0ff); }
.msg { min-height:24px; font-size:14px; color:#ffd0e2; }

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 14px;
  padding: 14px;
  align-items: start;
}

.mine-wrap {
  min-height: 0;
  display: grid;
  gap: 14px;
}

.mine-summary {
  border: 1px solid rgba(123,173,255,.24);
  border-radius: 20px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(12,26,54,.58), rgba(10,22,46,.34));
  box-shadow: 0 14px 28px rgba(0,0,0,.18);
}

.mine-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, .95fr);
  gap: 12px;
  align-items: start;
}
.pilot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
}
.pilot-user {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(12,27,55,.6);
  color: var(--ink);
}
.pilot-tip { font-size: 13px; }

.tap-zone {
  position: relative;
  width: 100%;
  min-height: clamp(360px, 40vh, 500px);
  border: 1px solid rgba(123,173,255,.45);
  border-radius: 22px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(150deg, rgba(11,27,56,.86), rgba(19,39,77,.45)),
    url('/img/mine.png') center/300px no-repeat,
    radial-gradient(circle at 30% 20%, rgba(52,214,255,.28), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(255,95,157,.24), transparent 45%);
  box-shadow: 0 20px 45px rgba(0,0,0,.35), inset 0 0 0 1px rgba(140,186,255,.12);
  color: #fff;
  display: grid;
  place-items: center;
  text-align: center;
  transition: transform .18s ease, filter .2s ease;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.tap-zone::before {
  content: '';
  position: absolute;
  inset: -25% -20%;
  background: conic-gradient(from 180deg, rgba(52,214,255,.24), transparent 35%, rgba(255,95,157,.2), transparent 70%);
  animation: spin 14s linear infinite;
  z-index: -1;
}
.tap-zone::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7,15,32,.12), rgba(7,15,32,.45));
  pointer-events: none;
}
.tap-zone:active { transform: scale(.994); filter: saturate(1.05); }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.tap-core { position: relative; z-index: 2; }
.tap-core h1 { margin: 12px 0 4px; font-size: 48px; }
.tap-core small { color: #d1e7ff; font-size: 17px; }
.tap-chip {
  display: inline-block;
  border: 1px solid rgba(133,190,255,.5);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  letter-spacing: 1.5px;
  color: #aee5ff;
  background: rgba(14,37,74,.55);
}

.tap-msg {
  margin-top: 8px;
  min-height: 30px;
  color: #b8ffe4;
  font-weight: 700;
}

.panel {
  background: linear-gradient(165deg, rgba(16,34,69,.88), rgba(14,30,61,.82));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  padding-inline-end: 10px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 94px);
  overflow: auto;
}
.panel h2, .panel h3 { margin: 6px 0 10px; }

body, .panel, .stats, .charge-table-wrap {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb-b) var(--scroll-track);
}

body::-webkit-scrollbar,
.panel::-webkit-scrollbar,
.stats::-webkit-scrollbar,
.charge-table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

body::-webkit-scrollbar-track,
.panel::-webkit-scrollbar-track,
.stats::-webkit-scrollbar-track,
.charge-table-wrap::-webkit-scrollbar-track {
  background: linear-gradient(180deg, rgba(8,19,42,.95), rgba(13,29,60,.95));
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(117,166,236,.16);
}

body::-webkit-scrollbar-thumb,
.panel::-webkit-scrollbar-thumb,
.stats::-webkit-scrollbar-thumb,
.charge-table-wrap::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--scroll-thumb-a), var(--scroll-thumb-b) 56%, var(--scroll-thumb-c));
  border-radius: 999px;
  border: 2px solid rgba(7,16,34,.92);
  box-shadow: 0 0 8px rgba(71,176,255,.4);
}

body::-webkit-scrollbar-thumb:hover,
.panel::-webkit-scrollbar-thumb:hover,
.stats::-webkit-scrollbar-thumb:hover,
.charge-table-wrap::-webkit-scrollbar-thumb:hover {
  filter: brightness(1.08);
}

body::-webkit-scrollbar-corner,
.panel::-webkit-scrollbar-corner,
.stats::-webkit-scrollbar-corner,
.charge-table-wrap::-webkit-scrollbar-corner {
  background: transparent;
}

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding-inline-end: 2px;
}
.stat-card {
  border: 1px solid rgba(129,176,245,.32);
  background: rgba(15,34,69,.72);
  border-radius: 12px;
  padding: 8px;
}
.stat-head {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 8px;
}
.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: rgba(8,19,41,.86);
  border: 1px solid rgba(136,184,249,.28);
  object-fit: contain;
  padding: 4px;
}
.stat-name { font-size: 13px; color: #d7eaff; }
.stat-value { font-weight: 700; color: #fff; }
.progress {
  margin-top: 7px;
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(7,15,33,.8);
  border: 1px solid rgba(121,166,231,.2);
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--pink));
  box-shadow: 0 0 12px rgba(52,214,255,.4);
}
.progress-meta {
  margin-top: 4px;
  color: #8db1d8;
  font-size: 11px;
}

.actions {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.actions button {
  font-family: "Tajawal", "DroidKufi-Regular", sans-serif;
  font-size: medium;
  font-weight: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(122,171,239,.35);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  color: #eaf3ff;
  background: linear-gradient(120deg, rgba(13,30,58,.95), rgba(20,42,82,.95));
  transition: transform .16s ease, border-color .2s ease;
}
.actions button:hover {
  transform: translateY(-1px);
  border-color: rgba(157,203,255,.6);
}
.action-label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: start;
}
.action-owned {
  flex: 0 0 auto;
  min-width: 46px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(141, 192, 255, .34);
  background: rgba(6, 18, 40, .78);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}
.btn-icon {
  min-width: 2.5em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  filter: drop-shadow(0 0 8px rgba(99,190,255,.34));
}
.btn-icon img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}


.world-card {
  position: relative;
  z-index: 1;
  margin: 0 16px 16px;
  padding: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(16,35,69,.85), rgba(14,30,61,.82));
  border-radius: 14px;
  color: #d6ebff;
}

.leaderboard-page { overflow-x: hidden; }
.leaderboard-wrap {
  padding: 16px;
  max-width: 100%;
  overflow-x: hidden;
}
.leaderboard {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(15,33,66,.85);
}
.leaderboard th,
.leaderboard td { padding: 10px; border-bottom: 1px solid rgba(135,183,247,.22); text-align: right; }

/* FX */
.fx-ripple {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(126,212,255,.85);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  animation: ripple .62s ease-out forwards;
  pointer-events: none;
  z-index: 4;
}
@keyframes ripple {
  0% { opacity: .95; transform: translate(-50%, -50%) scale(.2); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(8.5); }
}

.fx-particle {
  position: absolute;
  width: 24px;
  height: 24px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
  animation: fly .72s cubic-bezier(.16,.84,.44,1) forwards;
}
@keyframes fly {
  0% {
    opacity: .98;
    transform: translate(-50%, -50%) scale(.85);
    filter: drop-shadow(0 0 0 rgba(255,255,255,.2));
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.24) rotate(var(--rot));
    filter: drop-shadow(0 0 10px rgba(147,210,255,.45));
  }
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .panel { max-height: none; overflow: visible; padding-inline-end: 14px; }
  .tap-zone { min-height: 52vh; }
  .tap-core h1 { font-size: 36px; }
}
@media (max-width: 620px) {
  body {
    direction: ltr !important;
  }

  html[lang="ar"] body div,
  html[lang="ar"] body section,
  html[lang="ar"] body article,
  html[lang="ar"] body main,
  html[lang="ar"] body header,
  html[lang="ar"] body nav,
  html[lang="ar"] body table,
  html[lang="ar"] body form,
  html[lang="ar"] body input,
  html[lang="ar"] body select,
  html[lang="ar"] body textarea,
  html[lang="ar"] body button {
    direction: rtl !important;
  }

  html[lang="en"] body div,
  html[lang="en"] body section,
  html[lang="en"] body article,
  html[lang="en"] body main,
  html[lang="en"] body header,
  html[lang="en"] body nav,
  html[lang="en"] body table,
  html[lang="en"] body form,
  html[lang="en"] body input,
  html[lang="en"] body select,
  html[lang="en"] body textarea,
  html[lang="en"] body button {
    direction: ltr !important;
  }

  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .brand-logo { width: 36px; height: 36px; border-radius: 10px; }
  .pilot { flex-direction: column; align-items: flex-start; }
  .tap-zone { min-height: 46vh; }
  .tap-core small { font-size: 14px; }
}
/* Charge page */
.charge-theme {
  background:
    radial-gradient(900px 420px at 90% -10%, rgba(23,113,255,.24), transparent 65%),
    radial-gradient(800px 380px at 0% 100%, rgba(17,233,200,.1), transparent 60%),
    linear-gradient(180deg, #020617 0%, #020b22 45%, #01081f 100%);
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(145,198,255,.32);
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
}

.charge-wrap {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.charge-hero,
.charge-section {
  border: 1px solid rgba(79,120,196,.4);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(8,20,47,.9), rgba(6,16,38,.86));
  box-shadow: 0 16px 35px rgba(0,0,0,.35);
}

.charge-hero {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 112px;
}

.history-pill {
  border: 1px solid rgba(73,138,255,.35);
  background: linear-gradient(120deg, rgba(23,43,86,.95), rgba(27,57,114,.9));
  color: #d5e7ff;
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 13px;
}

.balance-box {
  text-align: right;
  display: grid;
  gap: 3px;
}
.balance-box span { color: #90a9cd; font-size: 13px; }
.balance-box strong {
  color: #ffd635;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  letter-spacing: .4px;
}
.balance-box small { color: #8ba5cf; font-size: 14px; }

.wallet-overview {
  display: grid;
  gap: 10px;
}

.wallet-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.wallet-mini-card {
  border: 1px solid rgba(102,150,226,.38);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(13,30,62,.9), rgba(8,20,43,.9));
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 8px;
}

.wallet-mini-card img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.wallet-mini-card span {
  color: #8ea8cf;
  font-size: 12px;
}

.wallet-mini-card strong {
  color: #e9f3ff;
  font-size: 16px;
  letter-spacing: .2px;
}

.charge-section {
  padding: 18px;
}
.charge-section h1,
.charge-section h2,
.charge-section h3 {
  margin: 0;
}

.charge-sub {
  margin-top: 8px;
  color: #8fa8ce;
  font-size: 14px;
}

.package-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.package-card {
  position: relative;
  border: 1px solid rgba(83,120,188,.38);
  border-radius: 14px;
  background: linear-gradient(170deg, rgba(12,26,57,.95), rgba(9,20,43,.95));
  color: #dceaff;
  padding: 16px 12px;
  min-height: 144px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.package-card:hover {
  border-color: rgba(127,171,247,.65);
  transform: translateY(-2px);
}
.package-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.package-card.active {
  border-color: #ff2f77;
  box-shadow: 0 0 0 1px rgba(255,47,119,.35), 0 14px 30px rgba(0,0,0,.35);
}

.popular-chip {
  position: absolute;
  top: -10px;
  background: linear-gradient(120deg, #ff2f77, #ff4f7c);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 10px;
  border: 1px solid rgba(255,144,171,.55);
}

.coin-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.coin-icon {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 999px;
  display: block;
  filter: drop-shadow(0 0 8px rgba(255, 198, 68, .35));
}
.package-card b {
  font-size: clamp(27px, 3vw, 42px);
  line-height: 1;
  color: #f0f5ff;
}
.coin-label {
  color: #8ea8cf;
  font-size: 14px;
}
.price-row {
  color: #00f6ee;
  font-weight: 800;
  font-size: 27px;
  letter-spacing: .2px;
}

.method-row {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.method-tile {
  border: 0;
  border-radius: 18px;
  min-height: 98px;
  padding: 14px 18px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 12px 30px rgba(0,0,0,.3);
  transition: transform .2s ease, filter .2s ease;
}
.method-tile strong {
  display: block;
  font-size: 35px;
  line-height: 1.02;
}
.method-tile small {
  display: block;
  margin-top: 6px;
  color: rgba(255,255,255,.88);
  font-size: 13px;
}
.method-tile:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.method-paypal {
  background: linear-gradient(105deg, #1f4e9a, #248ad4);
}
.method-stripe {
  background: linear-gradient(105deg, #5b4dff, #6d45ff 60%, #7343f5);
}

.paypal-note {
  margin-top: 14px;
  border: 1px solid rgba(82,121,189,.38);
  border-radius: 14px;
  padding: 14px;
  background: rgba(6,16,37,.72);
}
.paypal-note p {
  margin: 8px 0 0;
  color: #9bb3d7;
}

.paypal-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.paypal-form label {
  font-size: 12px;
  color: #9db6dd;
}
.paypal-form input {
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  border: 1px solid rgba(88,134,208,.35);
  background: rgba(6,17,38,.92);
  color: #ebf3ff;
}

.pay-btn {
  margin-top: 2px;
  border: 0;
  border-radius: 11px;
  padding: 11px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  color: #03263c;
  background: linear-gradient(120deg, #3cf7eb, #1de4d6);
}

.msg {
  margin-top: 10px;
  min-height: 22px;
}

.charge-table-wrap {
  margin-top: 12px;
  max-height: 52vh;
  overflow: auto;
}

.charge-table {
  background: rgba(8,18,39,.9);
}
.charge-table th,
.charge-table td {
  font-size: 13px;
}
.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(120,170,238,.35);
  font-size: 12px;
}
.status-paid {
  color: #92ffd5;
  border-color: rgba(82,231,178,.5);
  background: rgba(17,78,59,.35);
}
.status-pending {
  color: #ffe39a;
  border-color: rgba(252,204,101,.45);
  background: rgba(80,57,14,.35);
}
.status-failed {
  color: #ffb6c8;
  border-color: rgba(240,104,146,.45);
  background: rgba(84,19,41,.35);
}

@media (max-width: 1180px) {
  .package-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 840px) {
  .package-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .method-row {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .charge-wrap {
    padding: 12px;
  }
  .charge-hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .wallet-mini-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }
  .package-row {
    grid-template-columns: 1fr;
  }
}
.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  z-index: 999;
}
.top-nav a {
  margin-inline-start: 0;
  z-index: 999;
}
.lang-toggle {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 1px solid rgba(123, 169, 240, .45);
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  background-color: rgba(9, 22, 45, .56);
  background-image:
    linear-gradient(140deg, rgba(10, 22, 45, .34), rgba(14, 31, 64, .18)),
    url('/img/btn/btn1.png');
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow: 0 0 0 1px rgba(126, 211, 255, .18);
  padding: 3px;
}
.lang-toggle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.lang-toggle:hover {
  filter: brightness(1.05);
}

.auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.auth-nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 240px;
  flex-wrap: wrap;
}

.pkg-label {
  color: #b9cff1;
  font-size: 12px;
}

[dir="ltr"] .leaderboard th,
[dir="ltr"] .leaderboard td,
[dir="ltr"] .charge-table th,
[dir="ltr"] .charge-table td {
  text-align: left;
}

[dir="ltr"] .balance-box {
  text-align: left;
}

[dir="ltr"] .wallet-mini-card {
  grid-template-columns: 30px 1fr auto;
}

@media (max-width: 620px) {
  .auth-page {
    padding: 12px;
    align-items: start;
  }
  .auth-card {
    width: min(100%, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    padding: 18px 14px;
  }
  .auth-head {
    justify-content: center;
  }
  .auth-brand,
  .auth-nav-links {
    width: 100%;
  }
  .auth-nav-links {
    justify-content: center;
  }
  .auth-head > .lang-toggle {
    margin-inline: auto;
  }
  .top-nav {
    width: 100%;
      z-index: 999;
  }
.lang-toggle {
    margin-inline-start: 0;
  }
}





/* Game UI refresh: large visual controls, notes popup, theme toggle */
body[data-theme="light"] {
  --bg-0:#ffffff;
  --bg-1:#fbfdff;
  --bg-2:#f5f9ff;
  --ink:#0f1f3a;
  --muted:#4a6288;
  --card:#ffffff;
  --card-soft:#f6f9fd;
  --line:rgba(76,120,190,.28);
  --cyan:#0891b2;
  --blue:#1d4ed8;
  --pink:#db2777;
  --good:#059669;
  --shadow:0 12px 32px rgba(15,40,90,.1);
  --scroll-track:rgba(228,236,248,.95);
  --scroll-thumb-a:#0ea5e9;
  --scroll-thumb-b:#3b82f6;
  --scroll-thumb-c:#e11d48;
}

body[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, .94);
}

body[data-theme="light"] .scene-glow {
  background:
    radial-gradient(520px 300px at 72% 18%, rgba(59,130,246,.12), transparent 72%),
    radial-gradient(480px 260px at 18% 82%, rgba(236,72,153,.1), transparent 70%),
    radial-gradient(400px 200px at 50% 50%, rgba(14,165,233,.06), transparent 65%);
}

.top-nav a,
.notes-open {
  border: 1px solid var(--line);
  border-radius: 14px;
  background-color: rgba(20, 39, 76, .92);
  background-image:
    linear-gradient(140deg, rgba(10, 22, 45, .30), rgba(13, 29, 60, .14));
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  color: var(--ink);
  text-decoration: none;
  min-height: 50px;
  padding: 10px 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .15s ease, border-color .2s ease, filter .2s ease;
}

body[data-theme="light"] .top-nav a,
body[data-theme="light"] .notes-open {
  background-color: rgba(255, 255, 255, .94);
  background-image:
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(241,248,255,.88));
  box-shadow: 0 2px 12px rgba(15, 40, 90, .06);
}

.top-nav a:hover,
.notes-open:hover {
  transform: translateY(-1px);
  border-color: rgba(157,203,255,.65);
  filter: brightness(1.05);
}

/* Icon-only theme switch (pill + sun/moon thumb) */
.theme-switch {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  vertical-align: middle;
  -webkit-tap-highlight-color: transparent;
}

.theme-switch-track {
  display: inline-block;
  position: relative;
  width: 52px;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #0f172a, #1e293b);
  border: 1px solid rgba(148, 163, 184, .35);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .45);
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}

body[data-theme="light"] .theme-switch .theme-switch-track {
  background: linear-gradient(180deg, #e2e8f0, #f1f5f9);
  border-color: rgba(100, 116, 139, .35);
  box-shadow: inset 0 1px 4px rgba(255, 255, 255, .85), 0 1px 3px rgba(15, 23, 42, .08);
}

.theme-switch-thumb {
  position: absolute;
  top: 50%;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  inset-inline-start: 3px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #f87171, #b91c1c);
  box-shadow:
    0 2px 8px rgba(185, 28, 28, .45),
    inset 0 1px 0 rgba(255, 255, 255, .35);
  transition:
    inset-inline-start .28s cubic-bezier(.4, 0, .2, 1),
    background .25s ease,
    box-shadow .25s ease;
}

body[data-theme="light"] .theme-switch .theme-switch-thumb {
  inset-inline-start: calc(100% - 27px);
  background: linear-gradient(145deg, #f472b6, #db2777);
  box-shadow:
    0 2px 10px rgba(219, 39, 119, .4),
    inset 0 1px 0 rgba(255, 255, 255, .4);
}

.theme-switch-icon {
  position: absolute;
  color: #fde047;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, .35));
  transition: opacity .22s ease, transform .22s ease;
}

.theme-switch-icon--sun {
  opacity: 0;
  transform: scale(.85);
}

.theme-switch-icon--moon {
  opacity: 1;
  transform: scale(1);
}

body[data-theme="light"] .theme-switch .theme-switch-icon--sun {
  opacity: 1;
  transform: scale(1);
}

body[data-theme="light"] .theme-switch .theme-switch-icon--moon {
  opacity: 0;
  transform: scale(.75);
}

.theme-switch:hover .theme-switch-track {
  border-color: rgba(56, 189, 248, .45);
}

.theme-switch:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 999px;
}

.theme-switch:active .theme-switch-thumb {
  filter: brightness(.95);
}

.mine-wrap {
  display: grid;
  gap: 12px;
}

.stats-wrap {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(16,35,69,.85), rgba(13,29,60,.82));
  box-shadow: var(--shadow);
  padding: 12px;
}

body[data-theme="light"] .stats-wrap {
  background: linear-gradient(160deg, rgba(255,255,255,.98), rgba(248,252,255,.94));
  border-color: rgba(76, 120, 190, .22);
  box-shadow: var(--shadow);
}

body[data-theme="light"] .mine-summary {
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(241,248,255,.88));
  border-color: rgba(76, 120, 190, .22);
  box-shadow: 0 12px 28px rgba(15, 40, 90, .08);
}

body[data-theme="light"] .pilot-user {
  background: rgba(255, 255, 255, .9);
  border-color: var(--line);
}

body[data-theme="light"] .tap-zone {
  border-color: rgba(59, 130, 246, .35);
  background:
    linear-gradient(150deg, rgba(255,255,255,.92), rgba(239,246,255,.78)),
    url('/img/mine.png') center/300px no-repeat,
    radial-gradient(circle at 30% 20%, rgba(56, 189, 248, .2), transparent 48%),
    radial-gradient(circle at 80% 80%, rgba(244, 114, 182, .16), transparent 48%);
  box-shadow: 0 16px 40px rgba(15, 40, 90, .12), inset 0 0 0 1px rgba(255, 255, 255, .6);
  color: var(--ink);
}

body[data-theme="light"] .tap-zone::after {
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(241,248,255,.35));
}

body[data-theme="light"] .tap-core small {
  color: var(--muted);
}

body[data-theme="light"] .tap-chip {
  color: #0369a1;
  background: rgba(224, 242, 254, .85);
  border-color: rgba(14, 165, 233, .35);
}

body[data-theme="light"] .tap-msg {
  color: #047857;
}

body[data-theme="light"] .quick-inventory {
  border-color: rgba(244, 114, 182, .35);
  background: linear-gradient(135deg, rgba(224, 242, 254, .9), rgba(236, 253, 245, .75));
}

body[data-theme="light"] .quick-title {
  color: #9d174d;
}

body[data-theme="light"] .quick-item {
  background: rgba(255, 255, 255, .88);
  border-color: rgba(251, 207, 232, .5);
}

body[data-theme="light"] .quick-item strong {
  color: var(--ink);
}

body[data-theme="light"] .quick-item span {
  color: #a21caf;
}

body[data-theme="light"] .quick-hint {
  background: rgba(254, 252, 232, .95);
  border-color: rgba(250, 204, 21, .35);
  color: #854d0e;
}

body[data-theme="light"] .drop-rates {
  border-color: rgba(234, 179, 8, .45);
  background: linear-gradient(120deg, rgba(254, 243, 199, .65), rgba(254, 249, 231, .9));
}

body[data-theme="light"] .drop-rate-item {
  background: rgba(255, 255, 255, .9);
  border-color: rgba(250, 204, 21, .3);
}

body[data-theme="light"] .notes-backdrop {
  background: rgba(15, 23, 42, .35);
}

body[data-theme="light"] .side-actions-panel > .panel-section {
  --section-bg-a: #ffffff;
  --section-bg-b: #ffffff;
  --section-border: rgba(148, 163, 184, .35);
  --section-btn-a: #ffffff;
  --section-btn-b: #ffffff;
  --section-btn-border: rgba(148, 163, 184, .32);
  --section-btn-shadow: rgba(15, 23, 42, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 12px 28px rgba(15, 40, 90, .08);
}

body[data-theme="light"] .side-actions-panel > .panel-section .actions button {
  box-shadow: 0 8px 18px var(--section-btn-shadow), inset 0 1px 0 rgba(255, 255, 255, .85);
}

body[data-theme="light"] .side-actions-panel > .panel-section .actions button::before {
  opacity: .12;
  mix-blend-mode: multiply;
}

body[data-theme="light"] .side-actions-panel > .panel-section .action-owned {
  background: rgba(241, 245, 249, .95);
  color: var(--ink);
}

body[data-theme="light"] .side-actions-panel > .panel-section .btn-icon {
  background: rgba(255, 255, 255, .95);
  border-color: rgba(148, 163, 184, .35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

body[data-theme="light"] .side-actions-panel > .panel-section.panel-section--conversions {
  --section-bg-a: #ffffff;
  --section-bg-b: #ffffff;
  --section-border: rgba(14, 165, 233, .28);
  --section-btn-a: #ffffff;
  --section-btn-b: #ffffff;
}

body[data-theme="light"] .side-actions-panel > .panel-section.panel-section--upgrades {
  --section-bg-a: #ffffff;
  --section-bg-b: #ffffff;
  --section-border: rgba(99, 102, 241, .22);
  --section-btn-a: #ffffff;
  --section-btn-b: #ffffff;
}

body[data-theme="light"] .auto-miner-panel {
  border-color: rgba(148, 163, 184, .35);
  background: linear-gradient(160deg, rgba(255, 255, 255, .98), rgba(248, 250, 252, .94));
  box-shadow: 0 14px 32px rgba(15, 40, 90, .1);
}

body[data-theme="light"] .auto-miner-copy strong {
  color: var(--ink);
}

body[data-theme="light"] .auto-miner-copy span {
  color: var(--muted);
}

body[data-theme="light"] .auto-miner-stat {
  background: rgba(255, 255, 255, .9);
  border-color: rgba(148, 163, 184, .28);
}

body[data-theme="light"] .auto-miner-stat span {
  color: var(--muted);
}

body[data-theme="light"] .auto-miner-stat strong {
  color: var(--ink);
}

body[data-theme="light"] .auto-miner-select select {
  background: rgba(255, 255, 255, .98);
  border-color: rgba(148, 163, 184, .4);
  color: var(--ink);
}

body.charge-theme[data-theme="light"] {
  background:
    radial-gradient(900px 420px at 90% -10%, rgba(59, 130, 246, .14), transparent 65%),
    radial-gradient(800px 380px at 0% 100%, rgba(16, 185, 129, .1), transparent 60%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 50%, #e8eef7 100%);
}

body.charge-theme[data-theme="light"] .charge-hero,
body.charge-theme[data-theme="light"] .charge-section {
  background: linear-gradient(165deg, rgba(255, 255, 255, .99), rgba(248, 250, 252, .96));
  border-color: rgba(148, 163, 184, .32);
  box-shadow: 0 12px 30px rgba(15, 40, 90, .08);
}

body.charge-theme[data-theme="light"] .history-pill {
  background: linear-gradient(120deg, rgba(239, 246, 255, .98), rgba(224, 242, 254, .92));
  border-color: rgba(59, 130, 246, .28);
  color: var(--ink);
}

body[data-theme="light"] .profile-shell {
  background: linear-gradient(165deg, rgba(255, 255, 255, .98), rgba(248, 252, 255, .94));
  border-color: rgba(148, 163, 184, .3);
  box-shadow: 0 18px 40px rgba(15, 40, 90, .1);
}

body[data-theme="light"] .profile-kicker {
  background: rgba(239, 246, 255, .92);
  border-color: rgba(96, 165, 250, .34);
  color: #0f4c81;
}

body[data-theme="light"] .profile-meta-strip span {
  background: rgba(255, 255, 255, .96);
  border-color: rgba(148, 163, 184, .35);
  color: #29466f;
}

body[data-theme="light"] .profile-summary {
  background: linear-gradient(165deg, rgba(255, 255, 255, .96), rgba(243, 248, 255, .92));
  border-color: rgba(148, 163, 184, .32);
  box-shadow: 0 16px 32px rgba(15, 40, 90, .08);
}

body[data-theme="light"] .profile-summary strong,
body[data-theme="light"] .profile-field span {
  color: #16365f;
}

body[data-theme="light"] .profile-summary span,
body[data-theme="light"] .profile-avatar-field small {
  color: #5b769b;
}

body[data-theme="light"] .profile-field input {
  background: rgba(255, 255, 255, .95);
  border-color: rgba(148, 163, 184, .35);
  color: var(--ink);
}

body[data-theme="light"] .profile-field input[readonly] {
  background: rgba(241, 245, 249, .94);
  color: #536b8c;
}

body[data-theme="light"] .profile-file-row {
  background: rgba(248, 250, 252, .95);
  border-color: rgba(148, 163, 184, .35);
}

body[data-theme="light"] .guide-section,
body[data-theme="light"] .guide-hero,
body[data-theme="light"] .guide-tip {
  background: linear-gradient(165deg, rgba(255, 255, 255, .97), rgba(248, 250, 252, .94));
  border-color: rgba(148, 163, 184, .28);
}

body[data-theme="light"] .guide-rules article,
body[data-theme="light"] .guide-card,
body[data-theme="light"] .guide-chain-row,
body[data-theme="light"] .stat-card,
body[data-theme="light"] .world-card {
  background: #ffffff;
  border-color: rgba(148, 163, 184, .28);
  box-shadow: 0 10px 24px rgba(15, 40, 90, .06);
}

body[data-theme="light"] .guide-chain,
body[data-theme="light"] .guide-data-table th,
body[data-theme="light"] .guide-data-table tbody tr,
body[data-theme="light"] .guide-data-table tbody tr:nth-child(even) {
  background: #ffffff;
}

body[data-theme="light"] .guide-data-table,
body[data-theme="light"] .guide-chain {
  border-color: rgba(148, 163, 184, .28);
  box-shadow: 0 12px 28px rgba(15, 40, 90, .08);
}

body[data-theme="light"] .guide-chain li,
body[data-theme="light"] .chain-num,
body[data-theme="light"] .guide-data-table th {
  color: var(--ink);
}

body[data-theme="light"] .leaderboard-wrap {
  border-color: rgba(148, 163, 184, .25);
}

body[data-theme="light"] .leaderboard-page .leaderboard-wide tbody tr:nth-child(odd),
body[data-theme="light"] .leaderboard-page .leaderboard-wide.has-stripes tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, .72);
}

body[data-theme="light"] .leaderboard-page .leaderboard-wide tbody tr:nth-child(even),
body[data-theme="light"] .leaderboard-page .leaderboard-wide.has-stripes tbody tr:nth-child(even) {
  background: rgba(241, 245, 249, .85);
}

body[data-theme="light"] .leaderboard-page .leaderboard-wide tbody tr.rank-1 {
  background: linear-gradient(90deg, rgba(254, 243, 199, .55), rgba(255, 255, 255, .75));
}

body[data-theme="light"] .leaderboard-page .leaderboard-wide tbody tr.rank-2 {
  background: linear-gradient(90deg, rgba(226, 232, 240, .7), rgba(255, 255, 255, .8));
}

body[data-theme="light"] .leaderboard-page .leaderboard-wide tbody tr.rank-3 {
  background: linear-gradient(90deg, rgba(255, 237, 213, .5), rgba(255, 255, 255, .78));
}

.stats-wrap h2 {
  margin: 0 0 10px;
}

.stats {
  max-height: 34vh;
  overflow: auto;
  gap: 8px;
}

.panel {
  max-height: none;
}

.panel h3 {
  margin-top: 2px;
}

.actions button {
  min-height: 60px;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 100;
  justify-content: flex-start;
}

.btn-icon {
  min-width: 2.1em;
  width: 3.1em;
  height: 3.1em;
  border-radius: 2.1em;
  border-radius: 12px;
  border: 1px solid rgba(141,192,255,.4);
  background: rgba(7,22,49,.5);
  font-size: 18px;
}
.btn-icon img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}


body[data-theme="light"] .btn-icon {
  background: rgba(237,246,255,.9);
}
body[data-theme="light"] .action-owned {
  background: rgba(241, 247, 255, .95);
  color: #17345d;
}
.btn-icon img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}


.world-card {
  margin: 0;
}

.mine-meta {
  display: flex;
  justify-content: flex-end;
}

.notes-open {
  cursor: pointer;
  font: inherit;
  padding-inline: 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── Tutorial Suggestion Modal ────────────────────────── */
.tut-suggest-modal {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tut-suggest-modal[hidden] { display: none; }

.tut-suggest-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 22, .75);
  backdrop-filter: blur(6px);
}

.tut-suggest-panel {
  position: relative;
  margin: auto;
  width: min(440px, calc(100vw - 32px));
  max-height: min(85vh, 640px);
  /*overflow-y: auto;*/
  border-radius: 20px;
  border: 1px solid rgba(123,173,255,.25);
  background: linear-gradient(165deg, rgba(15,31,62,.98), rgba(10,25,55,.98));
  box-shadow: 0 24px 64px rgba(0,0,0,.55), 0 0 0 1px rgba(123,173,255,.08);
  padding: 0 24px 28px;
  text-align: center;
  animation: tutSuggestIn .35s ease-out;
}
@keyframes tutSuggestIn {
  from { opacity: 0; transform: translateY(24px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

body[data-theme="light"] .tut-suggest-panel {
  background: linear-gradient(165deg, rgba(250,253,255,.99), rgba(238,246,255,.98));
  border-color: rgba(100,160,240,.25);
}

.tut-suggest-img-wrap {
  margin: -70px auto 12px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(123,173,255,.30);
  background: rgba(10,20,45,.5);
}
.tut-suggest-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tut-suggest-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--ink);
}

.tut-suggest-desc {
  font-size: .92rem;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 22px;
  text-align: start;
}

.tut-suggest-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tut-suggest-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font: 700 1rem/1.3 'Tajawal', sans-serif;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  text-decoration: none;
}
.tut-suggest-btn:hover { transform: translateY(-1px); }
.tut-suggest-btn:active { transform: translateY(0); }

.tut-suggest-btn--go {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37,99,235,.35);
}
.tut-suggest-btn--go:hover {
  box-shadow: 0 6px 22px rgba(37,99,235,.5);
}

.tut-suggest-btn--skip {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.tut-suggest-btn--skip:hover {
  background: rgba(123,173,255,.08);
}
/* ── /Tutorial Suggestion Modal ───────────────────────── */

.notes-modal {
  position: fixed;
  inset: 0;
  z-index: 15;
}

.notes-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 22, .68);
  backdrop-filter: blur(4px);
}

.notes-panel {
  position: relative;
  width: min(520px, calc(100vw - 24px));
  max-height: min(70vh, 620px);
  overflow: auto;
  margin: 10vh auto 0;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(15,31,62,.98), rgba(10,25,55,.98));
  box-shadow: 0 24px 56px rgba(0,0,0,.45);
  padding: 12px;
}

body[data-theme="light"] .notes-panel {
  background: linear-gradient(165deg, rgba(250,253,255,.99), rgba(238,246,255,.98));
}

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

.notes-close {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  min-width: 36px;
  min-height: 36px;
  cursor: pointer;
  font: inherit;
}

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

.note-item {
  border: 1px solid rgba(123,173,255,.35);
  border-radius: 12px;
  padding: 10px;
  background: rgba(13,29,58,.75);
}

body[data-theme="light"] .note-item {
  background: rgba(245,250,255,.96);
}

.note-time {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}

.note-item.success {
  border-color: rgba(34,211,153,.45);
}

.note-item.error {
  border-color: rgba(244,114,182,.45);
}

.notes-list > .note-item.error:first-child {
  background: linear-gradient(145deg, rgba(92,20,58,.45), rgba(29,20,58,.38));
  border-color: rgba(255,129,191,.8);
  box-shadow: 0 0 0 1px rgba(255,129,191,.28), 0 8px 20px rgba(0,0,0,.28);
}

body[data-theme="light"] .notes-list > .note-item.error:first-child {
  background: linear-gradient(145deg, rgba(255,224,236,.92), rgba(255,241,247,.96));
  border-color: rgba(224,70,135,.62);
  box-shadow: 0 0 0 1px rgba(224,70,135,.2), 0 8px 18px rgba(91,24,58,.12);
}

@media (max-width: 980px) {
  .stats {
    max-height: 44vh;
  }
}




.auth-guide-link,
.auth-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid rgba(123,169,240,.45);
  background: rgba(9,22,45,.56);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
}
.auth-guide-link:hover,
.auth-home-link:hover {
  filter: brightness(1.06);
}

.guide-wrap {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 14px;
  min-width: 0;
}
.guide-hero,
.guide-section,
.guide-tip {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(15,34,69,.82), rgba(10,25,55,.84));
  box-shadow: var(--shadow);
  padding: 16px;
}
.guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}
.guide-hero-copy {
  min-width: 0;
}
.guide-hero-video-wrap {
  width: min(100%, 320px);
  max-width: 100%;
  justify-self: start;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(129,176,245,.32);
  background: rgba(7,17,36,.82);
  aspect-ratio: 16 / 9;
  box-shadow: 0 14px 28px rgba(0,0,0,.22);
}
.guide-hero-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #020916;
}
.guide-hero h1 {
  margin: 0 0 8px;
}
.guide-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}
.guide-section h2 {
  margin: 0 0 12px;
}
.guide-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.guide-rules article {
  border: 1px solid rgba(129,176,245,.32);
  border-radius: 12px;
  padding: 12px;
  background: rgba(11,27,56,.68);
}
.guide-rules h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.guide-rules p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.guide-card {
  border: 1px solid rgba(129,176,245,.32);
  border-radius: 12px;
  padding: 12px;
  background: rgba(11,27,56,.68);
  text-align: center;
}
.guide-card img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.guide-card h3 {
  margin: 6px 0 4px;
}
.guide-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.guide-grid.upgrades {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.guide-tip {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  color: var(--ink);
}
.guide-tip span {
  color: var(--muted);
}

.guide-chain {
  border: 1px solid rgba(88, 213, 255, .45);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(8,36,78,.88), rgba(10,25,55,.9));
  box-shadow: var(--shadow);
  padding: 16px;
}
.guide-chain h2 {
  margin: 0 0 10px;
}
.guide-chain ol {
  margin: 0;
  padding-inline-start: 22px;
  display: grid;
  gap: 8px;
}
.guide-chain li {
  font-weight: 700;
  color: #d9ecff;
  line-height: 1.7;
}
@media (max-width: 900px) {
  .guide-rules {
    grid-template-columns: 1fr;
  }
  .guide-grid,
  .guide-grid.upgrades {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .guide-grid,
  .guide-grid.upgrades {
    grid-template-columns: 1fr;
  }
}

.guide-chain-rows {
  display: grid;
  gap: 10px;
}
.guide-chain-row {
  border: 1px solid rgba(129,176,245,.32);
  border-radius: 12px;
  background: rgba(11,27,56,.68);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.guide-chain-row img {
  width: 35px;
  height: 35px;
  object-fit: contain;
}
.chain-num {
  font-weight: 800;
  color: #e8f4ff;
  min-width: 1.5em;
  text-align: center;
}
.chain-op {
  color: #9cc8ff;
  font-weight: 800;
}

/* ── Raid Guide Section ── */
.guide-raid-section {
  border-color: rgba(255, 170, 50, .45);
  background: linear-gradient(160deg, rgba(30,20,8,.88), rgba(15,25,55,.84));
}
.guide-raid-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.guide-raid-chest-icon {
  font-size: 48px;
  line-height: 1;
  flex-shrink: 0;
}
.guide-raid-intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 15px;
}
.guide-raid-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.guide-raid-card {
  border: 1px solid rgba(255, 170, 50, .3);
  border-radius: 12px;
  padding: 12px;
  background: rgba(20,14,4,.55);
}
.guide-raid-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.guide-raid-card p {
  margin: 0 0 6px;
  color: var(--muted);
  line-height: 1.7;
}
.guide-raid-cycle-hint {
  font-size: 13px;
  color: #f0c060;
  margin-top: 6px;
  opacity: .85;
}
.guide-raid-table-title {
  margin: 0 0 4px;
  font-size: 17px;
}
.guide-raid-what-desc {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.7;
}
.guide-raid-table td.raid-rare {
  color: #ff6b8a;
  font-weight: 700;
}
.guide-raid-table td.raid-uncommon {
  color: #f0c060;
  font-weight: 700;
}
.guide-raid-table td.raid-common {
  color: #6be080;
  font-weight: 700;
}
.guide-raid-table .mix img {
  width: 28px;
  height: 28px;
}
.guide-raid-note {
  margin: 10px 0 4px;
  font-size: 13px;
  color: #b0c4de;
  line-height: 1.7;
}
.guide-raid-tip-line {
  margin: 4px 0 0;
  font-size: 14px;
  color: #f0c060;
  font-weight: 700;
}
@media (max-width: 900px) {
  .guide-raid-cards {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .guide-raid-hero {
    flex-direction: column;
    text-align: center;
  }
  .guide-raid-chest-icon {
    font-size: 40px;
  }
}

body[data-theme="light"] .guide-raid-section {
  background: linear-gradient(165deg, rgba(255, 248, 235, .97), rgba(248, 250, 252, .94));
  border-color: rgba(200, 140, 40, .35);
}
body[data-theme="light"] .guide-raid-card {
  background: #ffffff;
  border-color: rgba(200, 140, 40, .25);
  box-shadow: 0 10px 24px rgba(15, 40, 90, .06);
}
body[data-theme="light"] .guide-raid-cycle-hint {
  color: #a07020;
}
body[data-theme="light"] .guide-raid-note {
  color: #555;
}
body[data-theme="light"] .guide-raid-tip-line {
  color: #a07020;
}
body[data-theme="light"] .guide-raid-table td.raid-rare {
  color: #d32f5a;
}
body[data-theme="light"] .guide-raid-table td.raid-uncommon {
  color: #b8860b;
}
body[data-theme="light"] .guide-raid-table td.raid-common {
  color: #2e8540;
}

.guide-table-wrap {
  overflow: hidden;
}
.guide-data-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid rgba(129,176,245,.32);
  border-radius: 12px;
  overflow: hidden;
}
.guide-data-table th,
.guide-data-table td {
  border-bottom: 1px solid rgba(129,176,245,.2);
  padding: 10px;
  text-align: center;
}
.guide-data-table th {
  background: rgba(6,20,44,.72);
  font-size: 14px;
}
.guide-data-table tbody tr:nth-child(even) {
  background: rgba(8,23,50,.45);
}
.guide-data-table tbody tr:last-child td {
  border-bottom: 0;
}
.mix {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}
.mix img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
@media (max-width: 560px) {
  .guide-data-table th,
  .guide-data-table td {
    padding: 8px 6px;
    font-size: 13px;
  }
  .guide-chain-row {
    justify-content: flex-start;
  }
}

/* ===== Guide Tactical Sections ===== */
.guide-tactical-section {
  background: linear-gradient(165deg, rgba(6, 20, 44, .95), rgba(12, 30, 60, .9));
  border: 1px solid rgba(88, 166, 255, .2);
  border-radius: 16px;
  padding: 28px 24px;
}
.guide-tactical-intro {
  font-size: 15px;
  color: #8b949e;
  margin-bottom: 20px;
  line-height: 1.7;
}
.guide-subtabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.guide-subtab {
  padding: 10px 18px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(88, 166, 255, .15);
  border-radius: 8px;
  color: #8b949e;
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s ease;
}
.guide-subtab:hover {
  background: rgba(88, 166, 255, .1);
  color: #c9d1d9;
}
.guide-subtab.active {
  background: rgba(88, 166, 255, .15);
  border-color: #58a6ff;
  color: #58a6ff;
}
.guide-subpanel {
  display: none;
}
.guide-subpanel.active {
  display: block;
}
.guide-subpanel h3 {
  color: #e3b341;
  margin-bottom: 12px;
}
.guide-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(227, 179, 65, .08);
  border-radius: 8px;
  color: #c9d1d9;
  font-size: 14px;
}
.guide-model-b-desc {
  font-size: 15px;
  color: #8b949e;
  margin-bottom: 16px;
  line-height: 1.7;
}
.guide-model-b-desc strong {
  color: #58a6ff;
}
.guide-model-b-formula {
  margin-top: 14px;
  padding: 12px 16px;
  background: rgba(88, 166, 255, .08);
  border: 1px solid rgba(88, 166, 255, .15);
  border-radius: 8px;
  color: #c9d1d9;
  font-size: 14px;
}
.guide-model-b-formula strong {
  color: #e3b341;
}
.guide-raid-flow {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.guide-flow-step {
  flex: 1;
  min-width: 140px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(88, 166, 255, .12);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.guide-flow-step .flow-num {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  border-radius: 50%;
  background: rgba(88, 166, 255, .2);
  color: #58a6ff;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}
.guide-flow-step p {
  font-size: 13px;
  color: #c9d1d9;
  margin: 0;
}
.guide-auto-features {
  margin-top: 16px;
  padding: 14px;
  background: rgba(255,255,255,.03);
  border-radius: 10px;
}
.guide-auto-features h4 {
  color: #e3b341;
  margin-bottom: 8px;
  font-size: 15px;
}
.guide-auto-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.guide-auto-features li {
  padding: 6px 0;
  font-size: 14px;
  color: #c9d1d9;
}
body[data-theme="light"] .guide-tactical-section {
  background: linear-gradient(165deg, rgba(240, 245, 255, .97), rgba(248, 250, 252, .94));
  border-color: rgba(88, 166, 255, .25);
}
body[data-theme="light"] .guide-subtab {
  background: rgba(0,0,0,.04);
  color: #555;
  border-color: rgba(0,0,0,.1);
}
body[data-theme="light"] .guide-subtab.active {
  background: rgba(88, 166, 255, .12);
  color: #0969da;
  border-color: #0969da;
}
body[data-theme="light"] .guide-tactical-intro { color: #555; }
body[data-theme="light"] .guide-note { background: rgba(227, 179, 65, .1); color: #333; }
body[data-theme="light"] .guide-model-b-desc { color: #555; }
body[data-theme="light"] .guide-model-b-formula { background: rgba(88, 166, 255, .06); border-color: rgba(88, 166, 255, .2); color: #333; }
body[data-theme="light"] .guide-flow-step { background: #fff; border-color: rgba(0,0,0,.08); }
body[data-theme="light"] .guide-flow-step p { color: #333; }
body[data-theme="light"] .guide-auto-features { background: rgba(0,0,0,.02); }
body[data-theme="light"] .guide-auto-features li { color: #333; }
body[data-theme="light"] .guide-subpanel h3 { color: #b8860b; }

/* Mining interaction additions */
.top-nav-toggle {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(15, 36, 76, .8);
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.quick-inventory {
  border: 1px solid rgba(255, 130, 150, .55);
  background: linear-gradient(135deg, rgba(12, 143, 186, 0.56), rgba(24, 122, 24, 0.3));
  border-radius: 14px;
  padding: 8px;
}

.quick-title {
  font-size: 12px;
  color: #ffd3dc;
  margin-bottom: 6px;
}

.quick-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.quick-item {
  border: 1px solid rgba(255, 149, 171, .32);
  border-radius: 10px;
  padding: 7px 8px;
  display: grid;
  justify-items: center;
  gap: 2px;
  background: rgba(26, 7, 24, .28);
}

.quick-item img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.quick-item strong {
  color: #fff;
  line-height: 1;
}

.quick-item span {
  color: #ffd5dd;
  font-size: 12px;
}


.quick-hint {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 141, .28);
  background: rgba(17, 26, 52, .34);
  color: #fff1bf;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.drop-rates {
  border: 1px solid rgba(255, 225, 130, .6);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(88, 62, 12, .34), rgba(145, 103, 18, .18));
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.drop-rate-item {
  border: 1px solid rgba(255, 228, 154, .34);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: center;
  background: rgba(43, 30, 8, .24);
}

.drop-rate-item img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.drop-rate-item strong {
  display: block;
  color: #ffe6aa;
  line-height: 1.2;
}

.drop-rate-item span {
  color: #ffeec7;
  font-size: 12px;
  line-height: 1.2;
}

.pickaxe-tool {
  position: absolute;
  bottom: 14px;
  inset-inline-end: 22px;
  width: clamp(88px, 14vw, 150px);
  height: auto;
  pointer-events: none;
  transform-origin: 26% 95%;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .35));
  z-index: 3;
  will-change: transform;
}

.pickaxe-tool.swing {
  animation: pickaxeSwing .2s ease-out;
}

@keyframes pickaxeSwing {
  0% { transform: rotate(6deg); }
  32% { transform: rotate(-20deg); }
  72% { transform: rotate(12deg); }
  100% { transform: rotate(6deg); }
}

@media (max-width: 760px) {
  .drop-rates {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: stretch;
  }

  .topbar .brand-wrap {
    display: flex;
    align-items: center;
  }

  .top-nav-toggle {
    display: inline-flex;
    margin-top: 6px;
  }

  .topbar.top-nav-collapsed .top-nav {
    display: none;
  }

  .top-nav {
    width: 100%;
  }

  .quick-items {
    grid-template-columns: 1fr;
  }

  .pickaxe-tool {
    width: clamp(72px, 18vw, 102px);
    bottom: 8px;
    inset-inline-end: 8px;
  }
}

/* Layout refinement: notes + rates row */
.mine-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.mine-meta .notes-open {
  white-space: nowrap;
  align-self: start;
}

.mine-meta .drop-rates {
  width: 100%;
  margin: 0;
}

.quick-items {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Reward celebration effects */
.fx-reward {
  position: absolute;
  width: 34px;
  height: 34px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 5;
  animation: rewardBurst .95s cubic-bezier(.16,.84,.44,1) forwards;
}

@keyframes rewardBurst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(.78);
    filter: drop-shadow(0 0 0 rgba(255,255,255,.2));
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.35) rotate(var(--rot));
    filter: drop-shadow(0 0 16px rgba(255, 231, 146, .72));
  }
}

.reward-popup {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity .18s ease;
}

.reward-popup.show {
  opacity: 1;
}

.reward-popup-card {
  min-width: min(420px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  border: 1px solid rgba(255, 224, 138, .82);
  border-radius: 18px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(140deg, rgba(38, 20, 55, .92), rgba(9, 28, 59, .94));
  box-shadow: 0 24px 50px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 209, 117, .22);
  transform: translateY(14px) scale(.96);
  transition: transform .2s ease;
}

.reward-popup.show .reward-popup-card {
  transform: translateY(0) scale(1);
}

.reward-popup-card img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(255, 228, 131, .44));
}

.reward-popup-card strong {
  font-size: clamp(22px, 2.2vw, 31px);
  color: #fff3ca;
  line-height: 1.2;
  text-wrap: balance;
}


.hint-toast {
  position: fixed;
  inset: 0;
  z-index: 34;
  pointer-events: none;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity .2s ease;
}

.hint-toast.show {
  opacity: 1;
}

.hint-toast-card {
  min-width: min(420px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(117, 208, 255, .38);
  background: linear-gradient(145deg, rgba(8, 24, 52, .96), rgba(15, 42, 77, .94));
  box-shadow: 0 18px 34px rgba(0, 0, 0, .34);
  text-align: center;
}

.hint-toast-card strong {
  color: #e8f7ff;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 700;
}

@media (max-width: 980px) {
  .mine-meta {
    grid-template-columns: 1fr;
  }

  .mine-meta .notes-open {
    justify-self: start;
  }

  .mine-meta .drop-rates {
    grid-template-columns: 1fr;
  }

  .quick-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .reward-popup-card {
    padding: 14px;
    gap: 10px;
  }

  .reward-popup-card img {
    width: 56px;
    height: 56px;
  }

  .reward-popup-card strong {
    font-size: 19px;
  }

  .quick-items {
    grid-template-columns: 1fr;
  }
}

/* Leaderboard horizontal scroll */
.leaderboard-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15,33,66,.55);
}

.leaderboard-wide {
  min-width: 1650px;
  border: 0;
  border-radius: 0;
  margin: 0;
}

.leaderboard-wide th,
.leaderboard-wide td {
  white-space: nowrap;
  min-width: 96px;
}

.leaderboard-wide th[data-sort-key] {
  position: relative;
  cursor: pointer;
  user-select: none;
  padding-inline-end: 28px;
}

.leaderboard-wide th[data-sort-key]::after {
  content: "";
  position: absolute;
  inset-inline-end: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: rgba(186, 213, 255, 0.6);
  opacity: 0;
}

.leaderboard-wide th[data-sort-key]:hover {
  background: rgba(56, 189, 248, 0.08);
}

.leaderboard-wide th[data-sort-key]:focus-visible {
  outline: 2px solid rgba(126, 211, 255, 0.55);
  outline-offset: -2px;
}

.leaderboard-wide th.is-sort-asc::after {
  content: "\25B2";
  color: #7fe4ff;
  opacity: 1;
}

.leaderboard-wide th.is-sort-desc::after {
  content: "\25BC";
  color: #7fe4ff;
  opacity: 1;
}

.leaderboard-wide th:nth-child(2),
.leaderboard-wide td:nth-child(2) {
  min-width: 62px;
  width: 62px;
  text-align: center;
}

.leaderboard-wide th:nth-child(3),
.leaderboard-wide td:nth-child(3) {
  min-width: 220px;
}

/* Leaderboard Safari iPhone fixes */
.leaderboard-page .leaderboard-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  max-width: 100%;
}

.leaderboard-page .leaderboard-wide {
  min-width: 1850px;
}



/* Leaderboard style: plus/minus toggle + stripes + top3 highlights */
.leaderboard-page .top-nav-toggle {
  font-size: 20px;
  font-weight: 800;
  min-width: 56px;
  min-height: 56px;
  line-height: 1;
  border-radius: 14px;
}

.leaderboard-page .leaderboard-wide tbody tr:nth-child(odd) {
  background: rgba(18, 42, 84, .52);
}

.leaderboard-page .leaderboard-wide tbody tr:nth-child(even) {
  background: rgba(12, 33, 70, .42);
}

.leaderboard-page .leaderboard-wide tbody tr.rank-1 {
  background: linear-gradient(120deg, rgba(162, 119, 21, .38), rgba(74, 53, 11, .22));
}

.leaderboard-page .leaderboard-wide tbody tr.rank-2 {
  background: linear-gradient(120deg, rgba(140, 152, 176, .32), rgba(72, 84, 111, .2));
}

.leaderboard-page .leaderboard-wide tbody tr.rank-3 {
  background: linear-gradient(120deg, rgba(141, 93, 56, .32), rgba(78, 53, 34, .2));
}

@media (max-width: 620px) {
  .leaderboard-page .top-nav-toggle {
    font-size: 20px;
    min-width: 52px;
    min-height: 52px;
  }
}

/* Leaderboard rank colors refresh + conditional stripe + pagination */
.leaderboard-page .leaderboard-wide.has-stripes tbody tr:nth-child(odd) {
  background: rgba(20, 43, 86, .48);
}

.leaderboard-page .leaderboard-wide.has-stripes tbody tr:nth-child(even) {
  background: rgba(11, 31, 66, .36);
}

.leaderboard-page .leaderboard-wide tbody tr.rank-1 {
  background: linear-gradient(115deg, rgba(241, 196, 15, .34), rgba(120, 89, 5, .26));
}

.leaderboard-page .leaderboard-wide tbody tr.rank-2 {
  background: linear-gradient(115deg, rgba(187, 198, 214, .34), rgba(95, 109, 128, .24));
}

.leaderboard-page .leaderboard-wide tbody tr.rank-3 {
  background: linear-gradient(115deg, rgba(205, 127, 50, .34), rgba(122, 72, 32, .24));
}

.leaderboard-pager {
  margin-top: 10px;
  display: none;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.pager-btn {
  border: 1px solid rgba(126, 177, 250, .46);
  border-radius: 10px;
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  background: rgba(12, 30, 61, .9);
  color: #eaf3ff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.pager-btn.active {
  border-color: rgba(255, 228, 131, .72);
  background: linear-gradient(120deg, rgba(51, 90, 162, .95), rgba(43, 66, 123, .95));
  color: #fff7d3;
}

.pager-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}


.top-nav a.is-active {
  background: linear-gradient(120deg, rgba(77,123,255,.95), rgba(52,214,255,.9));
  color: #041224;
  border-color: transparent;
}

.pilot-user-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.leader-player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.leader-level-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  line-height: 1.2;
  padding-block: 4px;
}

.leader-level-num {
  font-size: 17px;
  font-weight: 800;
  color: #ffe47d;
}

.leader-level-xp {
  font-size: 10px;
  color: #8fb0da;
  white-space: nowrap;
}

.leader-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 40px;
  border: 1px solid rgba(150,196,255,.35);
  background: rgba(8,18,39,.88);
  box-shadow: 0 8px 20px rgba(0,0,0,.28);
}

.leader-player-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.leader-player-name,
.leader-player-username {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-player-name {
  color: #eef6ff;
  font-weight: 700;
}

.leader-player-username {
  color: #8fb0da;
  font-size: 12px;
  direction: ltr;
}

.profile-wrap {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px;
}

.profile-shell {
  border: 1px solid rgba(116,165,235,.34);
  border-radius: 24px;
  padding: 20px;
  background: linear-gradient(165deg, rgba(13,29,59,.92), rgba(9,21,44,.9));
  box-shadow: 0 22px 48px rgba(0,0,0,.34);
}

.profile-shell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.profile-copy h1 {
  margin: 10px 0 8px;
  font-size: clamp(28px, 3.1vw, 40px);
}

.profile-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.profile-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(122,179,255,.42);
  background: rgba(19,41,81,.62);
  color: #b8e5ff;
  padding: 6px 12px;
  font-size: 12px;
  letter-spacing: .3px;
}

.profile-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.profile-meta-strip span {
  border: 1px solid rgba(118,166,233,.3);
  border-radius: 999px;
  background: rgba(10,24,49,.72);
  padding: 8px 12px;
  color: #dcecff;
  font-size: 13px;
}

.profile-summary {
  min-width: 250px;
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(121,171,242,.32);
  background: rgba(10,23,47,.68);
}

.profile-avatar-xl {
  width: min(100%, 156px);
  max-width: 156px;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(152,204,255,.44);
  background: rgba(8,18,39,.92);
  box-shadow: 0 18px 36px rgba(0,0,0,.34);
}

.profile-summary strong {
  font-size: 24px;
  color: #f3f8ff;
}

.profile-summary span {
  color: #93b4dc;
  font-size: 14px;
}

.profile-form {
  margin-top: 12px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.profile-field {
  display: grid;
  gap: 8px;
}

.profile-field-wide {
  grid-column: 1 / -1;
}

.profile-field span {
  color: #d9ebff;
  font-size: 14px;
  font-weight: 700;
}

.profile-field input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(126,177,246,.28);
  background: rgba(16,33,66,.86);
  color: var(--ink);
  font: inherit;
  padding: 13px 14px;
}

.profile-field input[readonly] {
  color: #aac2e1;
  background: rgba(12,24,48,.78);
}

.profile-avatar-field small {
  color: #91abd1;
  line-height: 1.6;
}

.profile-file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border: 1px dashed rgba(123,174,246,.26);
  border-radius: 16px;
  padding: 14px;
  background: rgba(10,22,45,.58);
}

.profile-avatar-preview {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(152,204,255,.38);
  background: rgba(8,18,39,.92);
}

.profile-file-row input[type="file"] {
  flex: 1 1 280px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(126,177,246,.22);
  background: rgba(14,28,58,.9);
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.profile-save {
  min-width: 200px;
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  color: #031327;
  background: linear-gradient(120deg, var(--blue), var(--cyan));
  box-shadow: 0 16px 30px rgba(77,123,255,.28);
}

.profile-save:hover {
  filter: brightness(1.04);
}

@media (max-width: 900px) {
  .profile-shell-head {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-summary {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .leader-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .profile-wrap {
    padding: 12px;
  }

  .profile-shell {
    padding: 16px 14px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-actions {
    justify-content: stretch;
  }

  .profile-save {
    width: 100%;
    min-width: 0;
  }
}


.top-nav .top-user-link,
.top-nav .top-user-menu {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.top-user-menu {
  position: relative;
  z-index: calc(var(--top-nav-z, 50) + 2);
}

.top-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(9, 22, 45, 0.35);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: inherit;
  box-shadow: 0 0 0 1px rgba(126, 211, 255, 0.12);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.top-user-trigger:hover,
.top-user-menu.is-open .top-user-trigger {
  border-color: rgba(130, 190, 255, 0.45);
  background: rgba(12, 28, 56, 0.55);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
}

.top-user-chevron {
  width: 0;
  height: 0;
  border-inline-start: 5px solid transparent;
  border-inline-end: 5px solid transparent;
  border-top: 6px solid rgba(180, 210, 255, 0.75);
  flex: 0 0 auto;
  opacity: 0.85;
}

.top-user-menu.is-open .top-user-chevron {
  transform: rotate(180deg);
}

.top-user-dropdown {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  min-width: min(220px, 92vw);
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(130, 190, 255, 0.35);
  background: linear-gradient(165deg, rgba(11, 24, 48, 0.97), rgba(8, 18, 38, 0.98));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(56, 189, 248, 0.12);
  backdrop-filter: blur(12px);
  z-index: 55;
  width: max-content;
  display: grid;
  gap: 5px;
}

.top-user-dropdown[hidden] {
  display: none !important;
}

.top-user-dropdown-item {
  display: block;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(130, 190, 255, 0.22);
  background: rgba(17, 36, 72, 0.82);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  color: #e8f2ff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

@media (min-width: 901px) {
  .top-user-dropdown-item {
    width: 90%;
  }
}

.top-user-dropdown-item:hover {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(130, 190, 255, 0.35);
  transform: translateY(-1px);
}

.top-user-dropdown-item--danger {
  color: #fecaca;
}

.top-user-dropdown-item--danger:hover {
  background: rgba(248, 113, 113, 0.12);
}

.top-nav .top-user-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  text-decoration: none;
}

.topbar-mobile-quick {
  display: none;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
  min-width: 0;
}

.topbar-mobile-quick .top-user-link,
.topbar-mobile-quick .top-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  text-decoration: none;
  max-width: min(52vw, 250px);
}

.topbar-mobile-quick .top-user-menu {
  max-width: min(52vw, 250px);
}

.topbar-mobile-quick .top-user-dropdown {
  right: 0;
  left: auto;
  transform: translateX(-14px);
}

.topbar-mobile-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(123,169,240,.45);
  background: rgba(9,22,45,.56);
  box-shadow: 0 0 0 1px rgba(126,211,255,.18);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.top-user-avatar {
  width: 52px;
  height: 52px;
  max-width: 52px;
  max-height: 52px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 52px;
  border: 1px solid rgba(152,204,255,.42);
  background: rgba(8,18,39,.92);
  box-shadow: 0 10px 20px rgba(0,0,0,.24);
}

.top-user-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.top-user-name {
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-user-flag,
.leader-flag,
.country-picker-flag,
.country-option-flag,
.profile-country-badge img {
  width: 32px;
   
  padding: 1px;
  border-radius: 3px;
  object-fit: cover;
  box-sizing: border-box;
  border: 1px solid rgba(152,204,255,.42);
  background: rgba(8,18,39,.92);
  box-shadow: 0 4px 10px rgba(0,0,0,.18);
  flex: 0 0 22px;
}

.leader-player-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.leader-flag-cell {
  text-align: center;
}

.leader-flag-cell .leader-flag,
.leader-flag-placeholder {
  display: inline-block;
  vertical-align: middle;
}

.leader-flag-placeholder {
  width: 22px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(152,204,255,.18);
  background: rgba(8,18,39,.3);
}

.profile-avatar-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.profile-avatar-stack {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.profile-avatar-edit {
  position: absolute;
  inset-inline-end: 6px;
  bottom: 6px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(10,24,48,.92);
  background: linear-gradient(120deg, var(--blue), var(--cyan));
  color: #031327;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0,0,0,.28);
}

.profile-country-badge,
.profile-roblox-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(120,171,242,.3);
  background: rgba(10,24,49,.72);
  color: #dcecff;
}

.profile-avatar-note {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border: 1px dashed rgba(123,174,246,.26);
  border-radius: 16px;
  padding: 14px;
  background: rgba(10,22,45,.58);
}

.profile-avatar-copy {
  display: grid;
  gap: 6px;
  flex: 1 1 260px;
}

.profile-avatar-copy strong {
  color: #eef6ff;
}

.profile-avatar-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.profile-avatar-picker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(126,177,246,.34);
  background: linear-gradient(140deg, rgba(26,49,90,.95), rgba(17,35,72,.95));
  color: #eef6ff;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.profile-avatar-picker-btn:hover {
  filter: brightness(1.06);
}

.profile-avatar-file-name {
  min-width: 0;
  flex: 1 1 180px;
  color: #9eb6d8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-picker {
  position: relative;
}

.country-picker-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 12px;
  border: 1px solid rgba(126,177,246,.28);
  background: rgba(16,33,66,.86);
  color: var(--ink);
  font: inherit;
  padding: 13px 14px;
  cursor: pointer;
}

.country-picker-current {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.country-picker-current span[data-country-label] {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-picker-caret {
  color: #98b8e2;
  font-size: 12px;
}

.country-picker-menu {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 8px);
  z-index: 15;
  border: 1px solid rgba(120,171,242,.34);
  border-radius: 16px;
  background: linear-gradient(165deg, #0d1d3b, #09152c);
  box-shadow: 0 22px 44px rgba(0,0,0,.34);
  padding: 12px;
}

.country-picker-search {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(126,177,246,.22);
  background: rgba(14,28,58,.9);
  color: var(--ink);
  font: inherit;
  padding: 11px 12px;
  margin-bottom: 10px;
}

.country-picker-list {
  max-height: 300px;
  overflow: auto;
  display: grid;
  gap: 6px;
}

.country-option {
  width: 100%;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid rgba(126,177,246,.16);
  background: rgba(13,28,56,.76);
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
  cursor: pointer;
  text-align: start;
}

.country-option:hover,
.country-option.is-selected {
  border-color: rgba(77,123,255,.6);
  background: rgba(22,41,82,.92);
}

.country-option-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-option-iso {
  color: #8eb1dc;
  font-size: 12px;
  direction: ltr;
}

.country-picker-empty {
  padding: 10px 12px;
  text-align: center;
  color: #8eb1dc;
}

.country-picker.is-open .country-picker-trigger {
  border-color: rgba(77,123,255,.65);
}

.country-picker-flag.is-hidden {
  display: none;
}

@media (max-width: 900px) {
  .top-nav .top-user-link,
  .top-nav .top-user-menu,
  .top-nav .top-user-trigger {
    width: 100%;
    justify-content: center;
  }

  .top-nav .top-user-menu {
    justify-content: stretch;
  }

  .top-nav .top-user-trigger {
    justify-content: center;
  }
}

@media (max-width: 620px) {
  .top-user-name {
    max-width: 84px;
  }

  .profile-avatar-note {
    align-items: flex-start;
  }

  .country-picker-menu {
    position: static;
    margin-top: 8px;
  }
}


.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: #dff2ff;
  transition: .24s ease;
  content: '';
}

.nav-toggle-icon {
  position: relative;
}

.nav-toggle-icon::before {
  position: absolute;
  top: -7px;
  left: 0;
}

.nav-toggle-icon::after {
  position: absolute;
  top: 7px;
  left: 0;
}

.top-nav-toggle.is-open .nav-toggle-icon {
  background: transparent;
}

.top-nav-toggle.is-open .nav-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.top-nav-toggle.is-open .nav-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}


body.nav-drawer-open {
  overflow: hidden;
}
body.nav-drawer-open::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: var(--mobile-nav-backdrop-z);
  background: rgba(3, 10, 24, .34);
  pointer-events: none;
}
body.nav-drawer-open main,
body.nav-drawer-open .scene-glow {
  filter: blur(4px);
  -webkit-filter: blur(4px);
  pointer-events: none;
  user-select: none;
}
@media (max-width: 620px) {
  .topbar {
    position: sticky;
    top: 0px;
    z-index: var(--mobile-nav-shell-z);
    isolation: auto;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    overflow: visible;

    width: 100%;

  }
  .topbar > .resource-bar {
    order: 3;
    width: calc(100% + 40px);
    margin: -4px -20px -12px;
    gap: 14px;
    padding: 5px 12px;
  }
  .topbar.is-open {
    z-index: var(--mobile-nav-shell-z);
    background: transparent;
    backdrop-filter: none;
    border-bottom-color: transparent;
  }
  .topbar .brand-wrap {
    display: none;
  }
  .topbar-mobile-quick {
    display: flex;
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100vw - 86px);
    justify-content: flex-start;
    position: relative;
    z-index: calc(var(--mobile-nav-shell-z) + 1);
    overflow: visible;
  }
  .topbar-mobile-quick .top-user-link,
  .topbar-mobile-quick .top-user-trigger,
  .topbar-mobile-quick .top-user-meta {
    min-width: 0;
    overflow: hidden;
  }
  .topbar-mobile-quick .top-user-link,
  .topbar-mobile-quick .top-user-menu {
    width: auto;
    max-width: calc(100vw - 148px);
  }
  .topbar-mobile-quick .top-user-menu {
    overflow: visible;
  }
  .topbar.is-open .topbar-mobile-quick {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .top-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin-top: 0;
    border-radius: 14px;
    border: 1px solid rgba(123,169,240,.45);
    background: rgba(9,22,45,.56);
    box-shadow: 0 0 0 1px rgba(126,211,255,.18);
    flex: 0 0 54px;
    order: 2;
    position: relative;
    z-index: var(--mobile-nav-toggle-z);
  }
  .topbar-mobile-quick .lang-toggle {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
  }
  .topbar-mobile-quick .top-user-name {
    max-width: 130px;
    color: #9cecff;
  }
  .topbar .top-nav {
    position: fixed;
    top: var(--mobile-nav-header-offset);
    bottom: 0;
    z-index: var(--mobile-nav-panel-z);
    width: min(84vw, 320px);
    padding: 12px 16px max(24px, env(safe-area-inset-bottom) + 16px) 16px;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: max-content;
    align-content: start;
    justify-items: stretch;
    gap: 1px;
    overflow-y: auto;
    overflow-x: hidden;
    background: black;
    box-shadow: 0 22px 48px rgba(0,0,0,.38);
    transition: transform .28s ease;
  }
  body[data-theme="light"] .topbar .top-nav {
    background: azure;
  }
  html[lang="ar"] .topbar .top-nav {
    left: 0;
    right: auto;
    transform: translate3d(-108%, 0, 0);
    border-inline-end: 1px solid var(--line);
  }
  html[lang="en"] .topbar .top-nav {
    right: 0;
    left: auto;
    transform: translate3d(108%, 0, 0);
    border-inline-start: 1px solid var(--line);
  }
  html[lang="ar"] .topbar.is-open .top-nav,
  html[lang="en"] .topbar.is-open .top-nav {
    transform: translate3d(0, 0, 0);
  }
  .topbar .top-nav > * {
    min-width: 0;
  }
  .topbar .top-nav a,
  .topbar .top-nav .top-user-link,
  .topbar .top-nav .top-user-menu,
  .topbar .top-nav .top-user-trigger,
  .topbar .top-nav .lang-toggle,
  .topbar .top-nav .theme-switch {
    width: 100%;
    
    margin: 8px auto 0;
    justify-content: center;
    align-self: center;
  }
  .topbar .top-nav .top-user-name {
    max-width: none;
  }
  .topbar .top-nav .nav-mobile-hide {
    display: none;
  }
  .topbar.top-nav-collapsed .top-nav {
    display: grid !important;
  }
  .leaderboard-page .topbar,
  .guide-page .topbar,
  .profile-wrap .topbar,
  .charge-wrap .topbar {
    flex-direction: row;
  }
  .leaderboard-page .topbar-mobile-quick {
    max-width: calc(100vw - 86px);
  }
  .leaderboard-page,
  .leaderboard-wrap,
  .leaderboard-page main {
    max-width: 100%;
    overflow-x: hidden;
  }
  .leaderboard-page .leaderboard-scroll {
    max-width: 100%;
    overflow-x: auto;
  }
  .guide-hero {
    grid-template-columns: 1fr;
  }
  .guide-hero-video-wrap {
    width: 100%;
    justify-self: stretch;
  }
}

.pilot-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
}

.pilot-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 36px;
  border: 1px solid rgba(152,204,255,.42);
  background: rgba(8,18,39,.92);
  box-shadow: 0 8px 18px rgba(0,0,0,.24);
}

.pilot-user-name {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inline-currency-icon {
  width: 29px;
  height: 29px;
  object-fit: contain;
  display: inline-block;
  vertical-align: -9px;
  margin-inline: 4px;
  filter: drop-shadow(0 0 6px rgba(255, 224, 140, .28));
}

.game-guide-panels {
  padding: 0 16px 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.game-guide-panel {
  margin: 0;
}

.game-guide-panel .guide-data-table {
  margin: 0;
}

@media (max-width: 980px) {
  .game-guide-panels {
    grid-template-columns: 1fr;
  }
}
.auto-miner-panel {
  position: relative;
  top: auto;
  inset-inline-end: auto;
  z-index: 1;
  width: 100%;
  min-height: 100%;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(132, 186, 255, .36);
  background: linear-gradient(160deg, rgba(13, 27, 56, .92), rgba(26, 34, 70, .88));
  box-shadow: 0 18px 36px rgba(0, 0, 0, .28);
  backdrop-filter: blur(10px);
  text-align: start;
  cursor: default;
}

.auto-miner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auto-miner-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.auto-miner-copy strong {
  font-size: 18px;
  color: #f5fbff;
}

.auto-miner-copy span {
  font-size: 13px;
  color: #a9caef;
}

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

.auto-miner-stat {
  border: 1px solid rgba(137, 188, 255, .22);
  border-radius: 14px;
  padding: 8px 10px;
  background: rgba(8, 18, 40, .46);
  display: grid;
  gap: 4px;
  min-width: 0;
}

.auto-miner-stat span {
  font-size: 12px;
  color: #8ebae5;
}

.auto-miner-stat strong {
  font-size: 18px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auto-miner-select select {
  width: 100%;
  border: 1px solid rgba(133, 190, 255, .34);
  border-radius: 10px;
  background: rgba(5, 15, 34, .92);
  color: #eef7ff;
  padding: 8px 10px;
  font: inherit;
  outline: none;
}

.auto-miner-select select:disabled {
  opacity: .7;
  cursor: not-allowed;
}

.auto-miner-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 42px;
  direction: ltr;
  cursor: pointer;
}

.auto-miner-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.auto-miner-slider {
  position: relative;
  display: block;
  width: 74px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  transition: background .22s ease;
}

.auto-miner-slider::after {
  content: '';
  position: absolute;
  top: 4px;
  inset-inline-start: 4px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(0,0,0,.24);
  transition: transform .22s ease;
}

.auto-miner-switch input:checked + .auto-miner-slider {
  background: linear-gradient(120deg, rgba(77,123,255,.95), rgba(52,214,255,.9));
}

.auto-miner-switch input:checked + .auto-miner-slider::after {
  transform: translateX(32px);
}

.auto-miner-switch input:disabled + .auto-miner-slider {
  opacity: .5;
}

.pickaxe-tool.auto-mining {
  animation: pickaxeAutoSwing var(--auto-swing-duration, 20s) ease-in-out infinite;
}

@keyframes pickaxeAutoSwing {
  0% { transform: rotate(6deg); }
  18% { transform: rotate(5deg); }
  44% { transform: rotate(-18deg); }
  62% { transform: rotate(13deg); }
  78% { transform: rotate(4deg); }
  100% { transform: rotate(6deg); }
}



@media (max-width: 1100px) {
  .mine-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .auto-miner-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auto-miner-panel.auto-miner-mobile-collapsed .auto-miner-grid {
    display: none;
  }
}

@media (max-width: 1200px) {
  .tap-zone {
    min-height: clamp(340px, 38vh, 440px);
  }
}

@media (max-width: 620px) {
  .mine-summary {
    padding: 10px;
  }

  .side-actions-panel {
    position: static;
    max-height: none;
  }

  .tap-zone {
    min-height: clamp(300px, 34vh, 380px);
  }
}


.side-actions-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  max-height: calc(100vh - 108px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: auto;
  scrollbar-gutter: stable;
  padding-inline-end: 8px;
  position: sticky;
  top: 14px;
  font-family: 'Tajawal', 'DroidKufi-Regular', sans-serif;
}

/* ── Side-panel tabs ── */
.side-tabs {
  display: flex;
  gap: 6px;
  font-family: 'Tajawal', 'DroidKufi-Regular', sans-serif;
  position: sticky;
  top: 0;
  z-index: 10;
  padding-block: 4px;
  background: var(--bg-0, #040b19);
}

.side-tab {
  flex: 1;
  padding: 10px 4px;
  border: none;
  border-radius: 14px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  color: #fff;
  transition: filter .2s, box-shadow .2s;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
  font-family: 'Tajawal', 'DroidKufi-Regular', sans-serif;
}

.side-tab:hover { filter: brightness(1.15); }

.side-tab--convert {
  background: linear-gradient(135deg, #d32f2f, #b71c1c);
  box-shadow: 0 4px 12px rgba(211, 47, 47, .35);
}
.side-tab--upgrade {
  background: linear-gradient(135deg, #388e3c, #1b5e20);
  box-shadow: 0 4px 12px rgba(56, 142, 60, .35);
}
.side-tab--trade {
  background: linear-gradient(135deg, #f9a825, #f57f17);
  box-shadow: 0 4px 12px rgba(249, 168, 37, .35);
}

.side-tab.is-active {
  outline: 2px solid #fff;
  outline-offset: -2px;
  filter: brightness(1.2);
}

.side-actions-panel > .panel-section {
  display: none;
}

.side-actions-panel > .panel-section.is-active-section {
  display: block;
}

.side-actions-panel > .panel-section {
  --section-bg-a: rgba(16, 34, 69, .72);
  --section-bg-b: rgba(12, 28, 58, .62);
  --section-border: rgba(126, 176, 245, .28);
  --section-btn-a: rgba(17, 37, 71, .94);
  --section-btn-b: rgba(24, 48, 92, .92);
  --section-btn-border: rgba(149, 197, 255, .24);
  --section-btn-shadow: rgba(0, 0, 0, .28);
  margin: 0;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--section-border);
  background: linear-gradient(180deg, var(--section-bg-a), var(--section-bg-b));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 16px 32px rgba(0,0,0,.18);
}

.side-actions-panel > .panel-section h3 {
  margin: 2px 4px 10px;
}

.side-actions-panel > .panel-section .actions {
  margin: 0;
  gap: 10px;
}

.side-actions-panel > .panel-section .actions button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 64px;
  border-radius: 16px;
  padding: 12px 14px;
  border-color: var(--section-btn-border);
  background: linear-gradient(145deg, var(--section-btn-a), var(--section-btn-b));
  box-shadow: 0 10px 22px var(--section-btn-shadow), inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .16s ease, border-color .2s ease, box-shadow .2s ease, filter .2s ease;
  font-family: 'Tajawal', 'DroidKufi-Regular', sans-serif;
}

.side-actions-panel > .panel-section .actions button::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--panel-btn-art, url('/img/btn/btn2.png'));
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  opacity: var(--panel-btn-opacity, .18);
  mix-blend-mode: screen;
}

.side-actions-panel > .panel-section .actions button > * {
  position: relative;
  z-index: 1;
}

.side-actions-panel > .panel-section .actions button:hover,
.side-actions-panel > .panel-section .actions button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(191, 223, 255, .56);
  box-shadow: 0 14px 28px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.07);
  filter: brightness(1.05);
}

.side-actions-panel > .panel-section .actions button:active {
  transform: translateY(0);
}

.side-actions-panel > .panel-section .action-label {
  font-weight: 600;
  line-height: 1.35;
}

.side-actions-panel > .panel-section .actions button.is-insufficient .action-label {
  color: #afafaf;
}

.side-actions-panel > .panel-section .action-owned {
  background: rgba(7, 18, 38, .72);
}

.side-actions-panel > .panel-section .btn-icon {
  width: 3.25em;
  height: 3.25em;
  min-width: 3.25em;
  border-radius: 14px;
  border: 1px solid rgba(170, 209, 255, .28);
  background: rgba(7, 20, 42, .4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.side-actions-panel > .panel-section .btn-icon img {
  width: 44px;
  height: 44px;
}

.side-actions-panel > .panel-section.panel-section--conversions {
  --section-bg-a: rgba(12, 73, 96, .34);
  --section-bg-b: rgba(10, 41, 74, .52);
  --section-border: rgba(84, 206, 228, .26);
  --section-btn-a: rgba(10, 52, 73, .96);
  --section-btn-b: rgba(19, 46, 93, .92);
}

.side-actions-panel > .panel-section.panel-section--upgrades {
  --section-bg-a: rgba(59, 76, 148, .22);
  --section-bg-b: rgba(17, 32, 76, .54);
  --section-border: rgba(161, 172, 255, .24);
  --section-btn-a: rgba(27, 41, 88, .96);
  --section-btn-b: rgba(23, 36, 75, .92);
}


.side-actions-panel > .panel-section.panel-section--conversions .actions button {
  --panel-btn-art: url('/img/btn/btn2.png');
  --panel-btn-opacity: .15;
}

.side-actions-panel > .panel-section.panel-section--upgrades .actions button {
  --panel-btn-art: url('/img/btn/btn2.png');
  --panel-btn-opacity: .16;
}

.side-actions-panel > .panel-section.panel-section--trade .actions button {
  --panel-btn-art: url('/img/btn/btn1.png');
  --panel-btn-opacity: .11;
}

.side-actions-panel > .panel-section.panel-section--trade {
  --section-bg-a: rgba(104, 72, 22, .20);
  --section-bg-b: rgba(25, 38, 73, .58);
  --section-border: rgba(233, 196, 113, .22);
  --section-btn-a: rgba(62, 46, 28, .86);
  --section-btn-b: rgba(24, 44, 82, .94);
}


.guide-value-banner {
  padding: 0 16px 16px;
}

.guide-value-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(227, 191, 106, .32);
  background: linear-gradient(135deg, rgba(247, 244, 237, .98), rgba(255, 255, 255, .92));
  color: #08172f;
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
}

.guide-value-asset {
  width: 88px;
  height: 88px;
  object-fit: contain;
  flex: 0 0 88px;
}

.guide-value-copy {
  flex: 1 1 auto;
  text-align: center;
}

.guide-value-copy strong {
  display: block;
  font-size: clamp(22px, 2.8vw, 34px);
  line-height: 1.2;
  color: #0e223f;
}

.guide-value-icons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.guide-value-icons img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

body[data-theme="dark"] .guide-value-card {
  background: linear-gradient(135deg, rgba(31, 37, 58, .96), rgba(19, 26, 46, .94));
  color: #f7f0d6;
}

body[data-theme="dark"] .guide-value-copy strong {
  color: #fff1bc;
}

@media (max-width: 720px) {
  .guide-value-card {
    flex-direction: column;
    text-align: center;
  }

  .guide-value-icons {
    justify-content: center;
  }
}



.trade-inline-hint--button {
  pointer-events: auto;
}

.trade-inline-hint--button .action-owned {
  min-width: 46px;
}

.trade-inline-hint__label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
  font-weight: 700;
  color: #fff0b6;
}

.trade-inline-hint__text,
.trade-inline-hint__Worker {
  display: inline-block;
}

.trade-inline-hint__Worker {
  color: #f8e8b4;
}

.trade-inline-hint--button .inline-currency-icon {
  width: 26px;
  height: 26px;
  vertical-align: middle;
  margin-inline: 2px;
}

@media (max-width: 720px) {
  .trade-inline-hint__label {
    font-size: 14px;
  }

  .trade-inline-hint--button .inline-currency-icon {
    width: 22px;
    height: 22px;
  }
}

/* ===== Guide Sidebar Layout ===== */
.guide-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

[id^="gs-"] {
  scroll-margin-top: 80px;
}

.guide-sidebar {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  width: 240px;
  min-width: 240px;
  background: linear-gradient(180deg, rgba(8,18,40,.96), rgba(5,12,30,.98));
  border-inline-end: 1px solid rgba(129,176,245,.15);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow: hidden;
  transition: width .3s ease, min-width .3s ease;
}

.guide-sidebar-toggle {
  display: none;
}

.guide-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 18px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(129,176,245,.25) transparent;
}

.guide-sidebar-nav::-webkit-scrollbar { width: 4px; }
.guide-sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.guide-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(129,176,245,.25); border-radius: 4px; }

.guide-sidebar-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(129,176,245,.55);
  margin: 0 0 14px 6px;
  font-weight: 600;
}

.guide-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted, rgba(255,255,255,.6));
  text-decoration: none;
  transition: background .2s, color .2s, transform .15s;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-sidebar-link:hover {
  background: rgba(129,176,245,.08);
  color: var(--text, #fff);
  transform: translateX(3px);
}

[dir="rtl"] .guide-sidebar-link:hover {
  transform: translateX(-3px);
}

.guide-sidebar-link.active {
  background: rgba(129,176,245,.12);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gs-active-color, #3b82f6);
}

[dir="rtl"] .guide-sidebar-link.active {
  box-shadow: inset -3px 0 0 var(--gs-active-color, #3b82f6);
}

.gs-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Light theme */
body[data-theme="light"] .guide-sidebar {
  background: linear-gradient(180deg, rgba(245,248,255,.98), rgba(235,240,252,.98));
  border-inline-end-color: rgba(0,0,0,.1);
}
body[data-theme="light"] .guide-sidebar-title {
  color: rgba(0,0,0,.4);
}
body[data-theme="light"] .guide-sidebar-link {
  color: rgba(0,0,0,.55);
}
body[data-theme="light"] .guide-sidebar-link:hover {
  background: rgba(0,0,0,.05);
  color: #111;
}
body[data-theme="light"] .guide-sidebar-link.active {
  background: rgba(59,130,246,.1);
  color: #111;
}

/* Mobile: sidebar as overlay toggle */
@media (max-width: 900px) {
  .guide-layout {
    display: block;
  }

  .guide-sidebar {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    height: 100vh;
    width: 260px;
    min-width: 0;
    transform: translateX(-110%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    z-index: 9999;
    border-inline-end: 1px solid rgba(129,176,245,.2);
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
    padding-top: 60px;
  }

  [dir="rtl"] .guide-sidebar {
    transform: translateX(110%);
  }

  .guide-sidebar.open {
    transform: translateX(0);
  }

  .guide-sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    position: fixed;
    bottom: 20px;
    inset-inline-end: 20px;
    z-index: 10000;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(59,130,246,.4);
    transition: transform .2s, box-shadow .2s;
    font-family: 'Tajawal', 'DroidKufi-Regular', sans-serif;

  }

  .guide-sidebar-toggle:active {
    transform: scale(.95);
  }

  .guide-sidebar-toggle-icon {
    font-size: 18px;
  }

  .guide-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
  }

  .guide-sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }

  .guide-wrap {
    max-width: 100%;
  }
}

