/* IceMarket Mini App Stylesheet - High Fidelity Modern UI */

:root {
  --bg-primary: #111216;
  --bg-card: #181920;
  --bg-card-elevated: #21222b;
  --accent-purple: #7952f5;
  --accent-purple-glow: rgba(121, 82, 245, 0.35);
  --accent-blue: #3a8bfd;
  --accent-cyan: #00d2ff;
  --accent-gold: #ffaa00;
  --accent-green: #10c375;
  --accent-red: #ff3b30;
  --text-primary: #ffffff;
  --text-secondary: #9092a0;
  --text-muted: #606272;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  user-select: none;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100svh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  background-color: var(--bg-primary);
}

/* ==========================================================================
   Top Header Bar
   ========================================================================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-wrapper {
  position: relative;
  width: 42px;
  height: 42px;
}

.user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-card-elevated);
  border: 1.5px solid var(--border-subtle);
}

.vip-diamond-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 13px;
  line-height: 1;
  background: #1e1b2e;
  border-radius: 50%;
  padding: 2px;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-handle {
  font-size: 11px;
  color: var(--text-muted);
}

/* Balance Display */
.balance-display {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.balance-title {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.balance-value-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gem-icon {
  font-size: 15px;
}

.balance-number {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #fff;
}

/* Deposit Button */
.btn-deposit {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #7c57f7, #693cf3);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--accent-purple-glow);
  transition: transform 0.15s ease;
}

.btn-deposit:active {
  transform: scale(0.96);
}

.deposit-icon {
  font-size: 14px;
}

/* ==========================================================================
   Content Scroll & Views
   ========================================================================== */
.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 85px 16px;
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

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

/* ==========================================================================
   Live Drops Activity Strip
   ========================================================================== */
.live-strip-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.live-label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 1.8s infinite;
}

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

.live-text {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.live-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}

.live-scroll::-webkit-scrollbar {
  display: none;
}

.live-badge {
  flex: 0 0 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 20px;
  border: 1px solid var(--border-subtle);
  transition: transform 0.2s;
}

.live-badge:active {
  transform: scale(0.92);
}

.badge-cyan { background: linear-gradient(135deg, #00b4db, #0083b0); }
.badge-yellow { background: linear-gradient(135deg, #ffe259, #ffa751); }
.badge-purple { background: linear-gradient(135deg, #a18cd1, #fbc2eb); color: #333; font-weight: 800; font-size: 13px; }
.badge-orange { background: linear-gradient(135deg, #f12711, #f5af19); }
.badge-green { background: linear-gradient(135deg, #11998e, #38ef7d); }
.badge-pink { background: linear-gradient(135deg, #ff758c, #ff7eb3); }
.badge-blue { background: linear-gradient(135deg, #2193b0, #6dd5ed); }

/* ==========================================================================
   Featured Cards
   ========================================================================== */
.featured-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.card-tag {
  position: absolute;
  top: 12px;
  left: 16px;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.5px;
}

.tag-hot { color: #f53803; }
.tag-new { color: #ff9900; }

.card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
}

.card-titles .card-title-main {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 4px;
}

/* Card 1: ROCKET */
.card-rocket {
  background: linear-gradient(135deg, #3080ea 0%, #1752b0 100%);
}

.rocket-art-container {
  position: relative;
  display: flex;
  align-items: center;
}

.rocket-graphic {
  font-size: 54px;
  transform: rotate(-15deg);
}

.floating-pill {
  position: absolute;
  background: rgba(46, 213, 115, 0.9);
  color: #0d381e;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.pill-1 { top: -14px; right: 28px; }
.pill-2 { bottom: -6px; left: -18px; }
.pill-3 { top: 12px; right: -12px; }

/* Card 2: PVP HUB */
.card-pvp {
  background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
}

.pvp-duel-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.duel-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
}

.vs-badge {
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 6px rgba(0,0,0,0.5);
}

/* Card 3: PLAY HUB */
.card-play {
  background: linear-gradient(135deg, #6c2cf5 0%, #3a0ca3 100%);
}

.play-sub-cards {
  display: flex;
  gap: 8px;
}

.mini-hub-box {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  gap: 3px;
}

.hub-icon {
  font-size: 18px;
}

/* ==========================================================================
   Marketplace Listings Section
   ========================================================================== */
.marketplace-section {
  margin-top: 24px;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-heading {
  font-size: 16px;
  font-weight: 800;
}

.badge-count {
  font-size: 11px;
  color: var(--text-muted);
}

.category-chips-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.chip-filter {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chip-filter.active {
  background: var(--text-primary);
  color: #000;
  font-weight: 700;
}

/* Items Grid */
.items-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s;
}

.item-card:active {
  transform: scale(0.98);
}

.item-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.item-badge-icon {
  font-size: 28px;
}

.item-mint-tag {
  font-size: 10px;
  color: var(--accent-cyan);
  font-weight: 700;
  background: rgba(0, 210, 255, 0.12);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.item-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.item-price {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

.btn-buy-item {
  background: var(--accent-purple);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================================================
   Backpack, Invite, Leaderboard & Earn Tabs
   ========================================================================== */
.tab-header-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  margin-bottom: 16px;
  border: 1px solid var(--border-subtle);
}

.tab-header-card h2 {
  font-size: 18px;
  margin-bottom: 6px;
}

.tab-header-card p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.btn-primary-action {
  background: var(--accent-purple);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--accent-purple-glow);
}

/* Invite Tab */
.invite-banner-card {
  background: linear-gradient(135deg, #1f1d36, #2d2b55);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 16px;
  border: 1px solid var(--border-subtle);
}

.banner-emoji {
  font-size: 40px;
  display: block;
  margin-bottom: 8px;
}

.referral-box {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
}

.referral-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.referral-input-group {
  display: flex;
  gap: 8px;
}

.referral-input-group input {
  flex: 1;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 8px 12px;
  font-size: 12px;
}

.btn-copy {
  background: var(--accent-purple);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.stats-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-box {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.stat-number {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  display: block;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Leaderboard */
.podium-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.podium-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  width: 95px;
}

.podium-col.rank-1 {
  background: linear-gradient(180deg, #2a2544, #1b1929);
  border: 1px solid rgba(255, 215, 0, 0.4);
  padding-top: 20px;
  transform: translateY(-10px);
}

.crown-icon { font-size: 18px; margin-bottom: 4px; }
.podium-avatar { font-size: 28px; }
.podium-name { font-size: 12px; font-weight: 700; margin-top: 6px; }
.podium-score { font-size: 10px; color: var(--accent-cyan); font-weight: 800; }

.leaderboard-table {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.leaderboard-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

/* Earn Tab */
.earn-daily-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #1b263b, #0d1b2a);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}

.daily-title { font-size: 14px; font-weight: 800; display: block; }
.daily-streak { font-size: 11px; color: var(--accent-gold); }

.btn-claim {
  background: var(--accent-green);
  color: #000;
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}

.tasks-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.task-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.task-title { font-size: 13px; font-weight: 600; display: block; }
.task-reward { font-size: 11px; color: var(--accent-cyan); }
.btn-task-action {
  background: var(--bg-card-elevated);
  color: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
}

/* ==========================================================================
   Bottom Navigation Bar ("dow bar")
   ========================================================================== */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  height: 68px;
  background: rgba(18, 18, 24, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
  z-index: 100;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-muted);
  width: 64px;
  padding: 4px 0;
  transition: color 0.15s ease;
}

.nav-tab-btn.active {
  color: #fff;
}

.nav-icon-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.nav-icon {
  font-size: 20px;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
}

/* Center Highlighted Home Pill */
.nav-tab-btn.active .home-pill {
  background: #5b40c2;
  border-radius: var(--radius-md);
  padding: 6px 16px;
  position: relative;
}

.nav-indicator-bar {
  position: absolute;
  top: -6px;
  width: 20px;
  height: 3px;
  background: #8b6ff9;
  border-radius: var(--radius-pill);
}

.badge-notify {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--accent-red);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: var(--radius-pill);
  min-width: 16px;
  text-align: center;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 200;
  padding: 20px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 360px;
  padding: 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

.modal-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.modal-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-option-btn {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.modal-option-btn:active {
  background: var(--accent-purple);
}

/* Form inputs */
.form-group {
  margin-bottom: 12px;
}

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
}

.form-group input, .form-group select {
  width: 100%;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 10px 12px;
  font-size: 13px;
}

.btn-submit-item {
  width: 100%;
  background: var(--accent-purple);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 8px;
}

/* Telegram Mobile Exclusive Guard Screen */
.telegram-guard-overlay {
  position: fixed;
  inset: 0;
  background: #0c0d12;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.guard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  max-width: 380px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.guard-icon {
  font-size: 56px;
  margin-bottom: 16px;
  animation: floatIcon 2s ease-in-out infinite;
}

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

.guard-card h2 {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.4;
}

.guard-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.guard-steps {
  background: var(--bg-card-elevated);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
  font-size: 12px;
  color: #c9ccd6;
  margin-bottom: 24px;
}

.btn-guard-action {
  display: block;
  background: linear-gradient(135deg, #7c57f7, #693cf3);
  color: #fff;
  text-decoration: none;
  padding: 14px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 18px var(--accent-purple-glow);
}

