/* ANGKA PRO - Bottom navigation + ranking page */

.bottom-action-nav {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 125;
  width: min(360px, calc(100vw - 32px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1.45fr 0.9fr;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: rgba(11, 15, 25, 0.88);
  box-shadow: 0 18px 48px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(16px);
}

.bottom-action-nav.is-hidden {
  display: none;
}

.bottom-action-btn {
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 999px;
  background: rgba(19,27,44,0.88);
  color: var(--text);
  padding: 10px 12px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  white-space: nowrap;
}

.bottom-action-btn:active {
  transform: scale(0.97);
}

.bottom-action-btn.primary {
  min-height: 48px;
  border-color: rgba(14,165,233,0.58);
  color: #dff8ff;
  background:
    radial-gradient(circle at top left, rgba(14,165,233,0.42), transparent 42%),
    linear-gradient(135deg, rgba(14,165,233,0.30), rgba(59,130,246,0.18));
  box-shadow: 0 0 22px rgba(14,165,233,0.18), inset 0 1px 0 rgba(255,255,255,0.08);
  font-size: 11px;
  letter-spacing: 1.9px;
}

.bottom-action-btn.primary::before {
  content: '↗';
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(14,165,233,0.18);
  color: var(--accent2);
  font-size: 12px;
  line-height: 1;
}

.bottom-action-btn.support {
  min-height: 42px;
  align-self: center;
  border-color: rgba(240,192,64,0.18);
  color: rgba(240,192,64,0.78);
  background: linear-gradient(135deg, rgba(240,192,64,0.08), rgba(19,27,44,0.80));
  font-size: 9px;
  letter-spacing: 1.2px;
  opacity: 0.88;
}

.ranking-page {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 185;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

.ranking-page.show {
  display: block;
}

.ranking-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  max-width: 100vw;
  animation: slideIn 0.3s ease;
}

.ranking-intro-card,
.ranking-empty {
  background: linear-gradient(135deg, rgba(19,27,44,0.98), rgba(14,165,233,0.055));
  border: 1px solid rgba(14,165,233,0.18);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: 0 14px 32px rgba(0,0,0,0.18);
}

.ranking-intro-title,
.ranking-empty-title {
  font-size: clamp(0.75rem, 3.5vw, 0.875rem);
  font-weight: 900;
  color: var(--strong);
  letter-spacing: 0.8px;
}

.ranking-intro-text,
.ranking-empty-text {
  margin-top: 0.375rem;
  font-size: clamp(0.6rem, 2.8vw, 0.6875rem);
  line-height: 1.45;
  color: var(--muted);
}

.ranking-best-chip {
  display: inline-flex;
  margin-top: 0.75rem;
  border: 1px solid rgba(240,192,64,0.26);
  background: rgba(240,192,64,0.11);
  color: var(--gold);
  border-radius: 999px;
  padding: 0.45rem 0.65rem;
  font-size: clamp(0.5rem, 2.3vw, 0.6rem);
  font-weight: 900;
  letter-spacing: 0.8px;
}

.ranking-method-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  position: sticky;
  top: calc(4.55rem + env(safe-area-inset-top));
  z-index: 18;
  background: linear-gradient(180deg, rgba(11,15,25,0.98), rgba(11,15,25,0.92));
  padding: 0.55rem;
  border: 1px solid rgba(255,255,255,0.075);
  border-radius: 999px;
  box-shadow: 0 14px 32px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.035);
  backdrop-filter: blur(16px);
}

.ranking-method-btn {
  border: 1px solid rgba(255,255,255,0.13);
  background: rgba(19,27,44,0.96);
  color: rgba(248,250,252,0.70);
  border-radius: 999px;
  padding: 0.75rem 0.35rem;
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.52rem, 2.25vw, 0.6rem);
  font-weight: 900;
  letter-spacing: 0.9px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

.ranking-method-btn.active {
  border-color: rgba(14,165,233,0.70);
  background:
    radial-gradient(circle at top left, rgba(14,165,233,0.45), transparent 42%),
    linear-gradient(135deg, rgba(14,165,233,0.32), rgba(59,130,246,0.18));
  color: #e6fbff;
  box-shadow: 0 0 20px rgba(14,165,233,0.20), inset 0 1px 0 rgba(255,255,255,0.08);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.ranking-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 0.75rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: var(--radius-lg);
  padding: 0.875rem;
  box-shadow: 0 12px 26px rgba(0,0,0,0.16);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.ranking-card:active {
  transform: scale(0.985);
  border-color: rgba(14,165,233,0.30);
  background: var(--surface2);
}

.ranking-card-rank {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(240,192,64,0.22);
  background: rgba(240,192,64,0.10);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
}

.ranking-card-main {
  min-width: 0;
}

.ranking-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.ranking-market-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--strong);
  font-size: clamp(0.7rem, 3.2vw, 0.8rem);
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.ranking-score {
  color: var(--accent2);
  font-size: clamp(0.75rem, 3.5vw, 0.875rem);
  font-weight: 900;
  white-space: nowrap;
}

.ranking-progress {
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  margin: 0.55rem 0 0.45rem;
}

.ranking-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent2), var(--gold));
}

.ranking-card-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: clamp(0.5rem, 2.25vw, 0.58rem);
  font-weight: 900;
  letter-spacing: 0.55px;
}

.ranking-status.good {
  color: #22c55e;
}

.ranking-status.bad {
  color: var(--accent3);
}

.ranking-open-hint {
  color: var(--accent2);
  border: 1px solid rgba(14,165,233,0.22);
  background: rgba(14,165,233,0.08);
  border-radius: 999px;
  padding: 0.2rem 0.42rem;
}

@media (min-width: 768px) {
  .bottom-action-nav {
    width: 360px;
  }

  .ranking-page {
    width: 430px;
    max-width: 430px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    box-shadow: 0 0 70px rgba(14,165,233,0.13), 0 0 140px rgba(0,0,0,0.35);
    border-left: 1px solid rgba(255,255,255,0.06);
    border-right: 1px solid rgba(255,255,255,0.06);
  }
}
