html:has(.tm-page),
body:has(.tm-page) {
  height: 100%;
  overflow: hidden;
}

body:has(.tm-page) .app-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.app-main:has(.tm-page) {
  padding: 0;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #020302;
}

body:has(.tm-page) .tabbar {
  display: none !important;
}

.tm-page {
  --c-accent: #b6f53a;
  --c-accent-2: #7ec922;
  --c-sub: #8f9688;
  --c-muted: #5f655c;
  --c-card: rgba(14, 18, 12, 0.72);
  --c-border: rgba(182, 245, 58, 0.14);
  --tm-topbar-height: 52px;
  position: relative;
  isolation: isolate;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  padding-top: calc(var(--tm-topbar-height) + var(--safe-top));
  box-sizing: border-box;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(126, 201, 34, 0.16), transparent 55%),
    linear-gradient(180deg, #050805 0%, #020302 48%, #000 100%);
  color: #f4f7ef;
  font-feature-settings: "tnum" 1;
}

.tm-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.tm-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: tm-float 9s ease-in-out infinite;
}

.tm-orb-a {
  width: 220px;
  height: 220px;
  top: 8%;
  right: -60px;
  background: radial-gradient(circle, rgba(182, 245, 58, 0.35), transparent 68%);
}

.tm-orb-b {
  width: 260px;
  height: 260px;
  bottom: 12%;
  left: -90px;
  background: radial-gradient(circle, rgba(90, 160, 30, 0.28), transparent 70%);
  animation-delay: -3.5s;
}

.tm-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(182, 245, 58, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(182, 245, 58, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 75%);
  opacity: 0.7;
}

.tm-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 120px;
  top: -120px;
  background: linear-gradient(180deg, transparent, rgba(182, 245, 58, 0.06), transparent);
  animation: tm-scan 7.5s linear infinite;
}

@keyframes tm-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(18px) scale(1.06); }
}

@keyframes tm-scan {
  0% { transform: translateY(0); }
  100% { transform: translateY(120vh); }
}

@keyframes tm-pulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.08); }
}

@keyframes tm-reveal {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.tm-reveal {
  animation: tm-reveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--d, 0) * 70ms);
}

.tm-topbar,
.tm-body {
  position: relative;
  z-index: 1;
}

.tm-topbar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--tm-topbar-height) + var(--safe-top));
  padding: var(--safe-top) 14px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  background: linear-gradient(180deg, rgba(2, 3, 2, 0.92), rgba(2, 3, 2, 0.72) 70%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-sizing: border-box;
}

.tm-back {
  position: absolute;
  left: 10px;
  top: calc(var(--safe-top) + (var(--tm-topbar-height) - 36px) / 2);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #eef7dc;
  border: 1px solid rgba(182, 245, 58, 0.16);
  background: rgba(182, 245, 58, 0.06);
}

.tm-back:active {
  background: rgba(182, 245, 58, 0.14);
  color: var(--c-accent);
}

.tm-title {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.04em;
}

.tm-title-chip {
  position: absolute;
  right: 14px;
  top: calc(var(--safe-top) + (var(--tm-topbar-height) - 22px) / 2);
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--c-accent);
  border: 1px solid rgba(182, 245, 58, 0.28);
  background: rgba(182, 245, 58, 0.08);
  box-shadow: 0 0 16px rgba(182, 245, 58, 0.12);
}

.tm-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 16px calc(28px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.tm-stats-card,
.tm-card,
.tm-zone-card {
  position: relative;
  background:
    linear-gradient(145deg, rgba(182, 245, 58, 0.07), transparent 42%),
    var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}

.tm-stats-card {
  display: flex;
  align-items: stretch;
  padding: 22px 10px 20px;
}

.tm-stats-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(182, 245, 58, 0.08) 48%, transparent 66%);
  transform: translateX(-120%);
  animation: tm-sheen 5.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes tm-sheen {
  0%, 55%, 100% { transform: translateX(-120%); }
  70% { transform: translateX(120%); }
}

.tm-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.tm-stat-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #070907;
  border: 1px solid rgba(182, 245, 58, 0.22);
  box-shadow: 0 0 0 3px rgba(182, 245, 58, 0.05), 0 0 18px rgba(182, 245, 58, 0.18);
}

.tm-stat-icon {
  width: 54px;
  height: 54px;
  object-fit: cover;
}

.tm-stat-label {
  font-size: 12px;
  color: var(--c-sub);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.tm-stat-value {
  font-size: 32px;
  font-weight: 750;
  color: var(--c-accent);
  line-height: 1;
  text-shadow: 0 0 18px rgba(182, 245, 58, 0.35);
}

.tm-stat-divider {
  width: 1px;
  margin: 6px 0;
  background: linear-gradient(180deg, transparent, rgba(182, 245, 58, 0.35), transparent);
  align-self: stretch;
  flex-shrink: 0;
}

.tm-mid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  align-items: stretch;
}

.tm-card {
  padding: 14px 12px 12px;
  min-height: 210px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.tm-card-glow {
  position: absolute;
  width: 120px;
  height: 120px;
  right: -30px;
  bottom: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(182, 245, 58, 0.22), transparent 70%);
  pointer-events: none;
}

.tm-card-glow-level {
  left: 50%;
  right: auto;
  top: 42px;
  bottom: auto;
  transform: translateX(-50%);
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(182, 245, 58, 0.2), transparent 68%);
  animation: tm-pulse 3.2s ease-in-out infinite;
}

.tm-card-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #f2f6ea;
  flex-shrink: 0;
}

.tm-card-head-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(182, 245, 58, 0.1);
  border: 1px solid rgba(182, 245, 58, 0.18);
}

.tm-card-head-icon img,
.tm-card-head img {
  width: 13px;
  height: 13px;
  object-fit: contain;
}

.tm-card-perf-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 0 4px;
}

.tm-card-sub {
  font-size: 11px;
  color: var(--c-sub);
  line-height: 1.3;
}

.tm-card-value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 780;
  color: var(--c-accent);
  line-height: 1.05;
  word-break: break-all;
  text-shadow: 0 0 20px rgba(182, 245, 58, 0.28);
}

.tm-card-unit {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(182, 245, 58, 0.65);
  font-weight: 600;
}

.tm-parent-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(182, 245, 58, 0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tm-parent-label {
  font-size: 11px;
  color: var(--c-sub);
  line-height: 1.3;
}

.tm-parent-addr {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  font-size: 12px;
  line-height: 1.35;
  color: #c8d0bc;
  word-break: break-all;
}

.tm-parent-addr.has-address {
  color: #eef3e4;
  cursor: pointer;
}

.tm-parent-addr.has-address:active {
  color: var(--c-accent);
}

.tm-card-level {
  align-items: stretch;
}

.tm-level-badge {
  position: relative;
  margin: 6px auto 2px;
  width: 102px;
  height: 102px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tm-level-ring {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px dashed rgba(182, 245, 58, 0.28);
  animation: tm-spin 12s linear infinite;
}

@keyframes tm-spin {
  to { transform: rotate(360deg); }
}

.tm-level-badge-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(182, 245, 58, 0.42));
}

.tm-level-badge-text {
  position: relative;
  z-index: 1;
  margin-top: -10px;
  font-size: 15px;
  font-weight: 780;
  color: #d8ff6a;
  letter-spacing: 0.03em;
  text-shadow: 0 0 12px rgba(182, 245, 58, 0.7);
  line-height: 1;
}

.tm-level-name {
  text-align: center;
  font-size: 12px;
  color: #d5ddc8;
  margin-top: 2px;
}

.tm-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.tm-progress {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  border: 1px solid rgba(182, 245, 58, 0.12);
}

.tm-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5f9a18, #b6f53a 55%, #e7ff9a);
  box-shadow: 0 0 12px rgba(182, 245, 58, 0.45);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.tm-progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: tm-bar-shine 2.2s ease-in-out infinite;
}

@keyframes tm-bar-shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.tm-progress-pct {
  flex-shrink: 0;
  min-width: 34px;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-accent);
  text-align: right;
}

.tm-upgrade {
  margin-top: 8px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--c-muted);
  text-align: center;
}

.tm-zone-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tm-zone-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 80px;
  padding: 16px 14px;
  box-sizing: border-box;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tm-zone-big {
  border-color: rgba(182, 245, 58, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(182, 245, 58, 0.04),
    0 12px 30px rgba(0, 0, 0, 0.35);
}

.tm-zone-link:active {
  transform: scale(0.985);
  border-color: rgba(182, 245, 58, 0.35);
  background: rgba(20, 28, 14, 0.88);
}

.tm-zone-icon-box,
.tm-zone-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(8, 12, 6, 0.9);
  border: 1px solid rgba(182, 245, 58, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(182, 245, 58, 0.12);
}

.tm-zone-icon-wrap {
  border-radius: 50%;
}

.tm-zone-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.tm-zone-icon-wrap .tm-zone-icon {
  width: 44px;
  height: 44px;
  object-fit: cover;
}

.tm-zone-main {
  flex: 1;
  min-width: 0;
}

.tm-zone-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tm-zone-label,
.tm-zone-title {
  font-size: 13px;
  color: #eef3e4;
  line-height: 1.2;
}

.tm-zone-title {
  font-weight: 650;
}

.tm-zone-tag {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #0b1204;
  background: linear-gradient(90deg, #9fe02a, #d4ff63);
  box-shadow: 0 0 10px rgba(182, 245, 58, 0.35);
}

.tm-zone-tag-muted {
  color: rgba(182, 245, 58, 0.85);
  background: rgba(182, 245, 58, 0.1);
  border: 1px solid rgba(182, 245, 58, 0.2);
  box-shadow: none;
}

.tm-zone-value {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 750;
  color: var(--c-accent);
  text-shadow: 0 0 14px rgba(182, 245, 58, 0.25);
}

.tm-zone-value em {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(182, 245, 58, 0.7);
  margin-left: 2px;
}

.tm-zone-desc {
  margin-top: 5px;
  font-size: 11px;
  color: var(--c-sub);
  line-height: 1.35;
}

.tm-zone-go {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-accent);
  background: rgba(182, 245, 58, 0.08);
  border: 1px solid rgba(182, 245, 58, 0.18);
  flex-shrink: 0;
}

.tm-zone-arrow {
  width: 14px;
  height: 14px;
}

.tm-invite-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  font-size: 13px;
  color: var(--c-sub);
  margin-bottom: 12px;
  backdrop-filter: blur(12px);
}

.tm-invite-summary strong {
  color: var(--c-accent);
  font-size: 18px;
  text-shadow: 0 0 12px rgba(182, 245, 58, 0.3);
}

.tm-invite-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tm-invite-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  backdrop-filter: blur(12px);
}

.tm-invite-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tm-invite-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #0a0a0a;
  border: 1px solid rgba(182, 245, 58, 0.2);
}

.tm-invite-main {
  flex: 1;
  min-width: 0;
}

.tm-invite-addr {
  font-size: 13px;
  color: #f2f2f2;
  font-family: ui-monospace, Consolas, Monaco, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tm-invite-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--c-sub);
}

.tm-invite-team {
  flex-shrink: 0;
  min-width: 56px;
  text-align: center;
}

.tm-invite-team-num {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-accent);
  line-height: 1.2;
}

.tm-invite-team-label {
  margin-top: 2px;
  font-size: 10px;
  color: var(--c-sub);
  white-space: nowrap;
}

.tm-invite-tag {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--c-accent);
  background: rgba(182, 245, 58, 0.12);
  border: 1px solid rgba(182, 245, 58, 0.18);
}

.tm-invite-perf {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(182, 245, 58, 0.1);
}

.tm-invite-perf-item {
  min-width: 0;
  padding: 8px 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(182, 245, 58, 0.08);
  text-align: center;
}

.tm-invite-perf-label {
  display: block;
  font-size: 10px;
  color: var(--c-sub);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tm-invite-perf-val {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 650;
  color: var(--c-accent);
  line-height: 1.2;
  word-break: break-all;
}

.tm-empty {
  padding: 48px 12px;
  text-align: center;
  color: var(--c-sub);
  font-size: 13px;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  transform: translateX(-50%) translateY(12px);
  max-width: min(86vw, 360px);
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(10, 14, 8, 0.94);
  border: 1px solid rgba(182, 245, 58, 0.22);
  color: #f2f2f2;
  font-size: 13px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
  text-align: center;
  box-shadow: 0 0 24px rgba(182, 245, 58, 0.12);
}

.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .tm-orb,
  .tm-scan,
  .tm-reveal,
  .tm-stats-card::before,
  .tm-level-ring,
  .tm-progress-bar::after,
  .tm-card-glow-level {
    animation: none !important;
  }
}
