/* ==========================================================================
   APPLE & TELEGRAM WALLET DESIGN SYSTEM
   Стиль: iOS Human Interface Guidelines + Telegram Wallet (Dark Mode)
   Чистый OLED Black, скругления squircle, системная типографика SF Pro,
   матовое стекло (Backdrop Blur), нативные списки Grouped TableView
   ========================================================================== */

:root {
  --ios-bg: #000000;
  --ios-bg-secondary: #121214;
  --ios-card: #1c1c1e;
  --ios-card-elevated: #242426;
  --ios-card-hover: #2c2c2e;
  --ios-separator: rgba(255, 255, 255, 0.09);
  --ios-separator-light: rgba(255, 255, 255, 0.05);

  /* Apple & Telegram Wallet Accents */
  --tg-blue: #007aff;
  --tg-blue-light: #3897f0;
  --tg-blue-subtle: rgba(0, 122, 255, 0.14);
  --ios-green: #34c759;
  --ios-green-subtle: rgba(52, 199, 89, 0.14);
  --ios-amber: #ff9f0a;
  --ios-amber-subtle: rgba(255, 159, 10, 0.14);
  --ios-red: #ff453a;
  --ios-purple: #af52de;

  /* Typography Colors */
  --text-primary: #ffffff;
  --text-secondary: #8e8e93;
  --text-tertiary: #636366;
  --text-quaternary: #48484a;

  /* Fonts */
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "Fira Code", monospace;

  /* Safe Area & Metrics */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 16px);
  
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 9999px;
}

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

body {
  background-color: var(--ios-bg);
  color: var(--text-primary);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
}

#app-container {
  width: 100%;
  max-width: 440px;
  height: 100vh;
  height: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--ios-bg);
  overflow: hidden;
}

/* ==========================================================================
   TELEGRAM TOP BAR & STATUS
   ========================================================================== */
.tg-nav-bar {
  padding: calc(var(--safe-top) + 12px) 16px 12px 16px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  border-bottom: 0.5px solid var(--ios-separator);
}

.tg-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tg-avatar-squircle {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #1c1c1e;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--ios-separator);
}

.tg-avatar-squircle svg {
  width: 100%;
  height: 100%;
}

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

.tg-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tg-username {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

.tg-verified-icon {
  width: 14px;
  height: 14px;
  color: var(--tg-blue);
}

.tg-status-pill {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.tg-network-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ios-green);
}

.tg-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tg-circle-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ios-card);
  border: 0.5px solid var(--ios-separator);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.tg-circle-btn:active {
  transform: scale(0.94);
  background: var(--ios-card-hover);
}

/* ==========================================================================
   SCROLLABLE VIEWPORT CONTAINER
   ========================================================================== */
.main-view-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px calc(var(--safe-bottom) + 80px) 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-width: none;
}
.main-view-container::-webkit-scrollbar {
  display: none;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: iosFade 0.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.tab-pane.active {
  display: flex;
}

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

/* ==========================================================================
   TELEGRAM WALLET STYLE: HERO BALANCE CARD
   ========================================================================== */
.wallet-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 0 6px 0;
}

.wallet-hero-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.1px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.wallet-hero-amount {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  line-height: 1.1;
}

.wallet-hero-unit {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-secondary);
}

.wallet-hero-equiv {
  font-size: 13px;
  font-weight: 500;
  color: var(--ios-green);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Telegram Wallet Action Buttons (Send, Receive, Exchange etc.) */
.wallet-actions-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
  width: 100%;
}

.wallet-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: transparent;
  border: none;
}

.wallet-action-item:active .wallet-action-icon {
  transform: scale(0.92);
  background: var(--ios-card-hover);
}

.wallet-action-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--ios-card);
  border: 0.5px solid var(--ios-separator);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--tg-blue);
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.wallet-action-icon.primary {
  background: var(--tg-blue);
  color: #fff;
  border: none;
}

.wallet-action-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.1px;
}

/* ==========================================================================
   TELEGRAM ASSETS ROW (HORIZONTAL PILLS)
   ========================================================================== */
.assets-card {
  background: var(--ios-card);
  border-radius: var(--radius-xl);
  padding: 14px;
  border: 0.5px solid var(--ios-separator);
}

.assets-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.asset-pill {
  background: var(--ios-card-elevated);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 0.5px solid var(--ios-separator-light);
}

.asset-pill-top {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
}

.asset-pill-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-family);
  letter-spacing: -0.2px;
}

/* ==========================================================================
   APPLE SEGMENTED CONTROL / HORIZONTAL PILLS
   ========================================================================== */
.ios-segmented-control {
  background: transparent;
  border-radius: 0;
  padding: 4px 0 8px 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ios-segmented-control::-webkit-scrollbar {
  display: none;
}

.ios-segment {
  flex: 0 0 auto !important; /* ПРЕДОТВРАЩАЕТ НАЛОЖЕНИЕ ДРУГ НА ДРУГА */
  padding: 8px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  border: 0.5px solid var(--ios-separator);
  background: var(--ios-card);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ios-segment:active {
  transform: scale(0.96);
}

.ios-segment.active {
  background: #ffffff;
  color: #000000;
  font-weight: 600;
  border-color: #ffffff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   GARDEN PLOTS: APPLE WIDGET STYLE SQUIRCLES
   ========================================================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-caption {
  font-size: 12px;
  color: var(--tg-blue);
  font-weight: 500;
  cursor: pointer;
}

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

.plot-tile {
  background: var(--ios-card);
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--ios-separator);
  aspect-ratio: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.2s ease;
  overflow: hidden;
}

.plot-tile:active {
  transform: scale(0.95);
  background: var(--ios-card-hover);
}

.plot-tile.empty {
  border: 0.5px dashed rgba(255, 255, 255, 0.14);
  background: rgba(28, 28, 30, 0.5);
}

.plot-tile.ready {
  border-color: rgba(255, 159, 10, 0.5);
  background: linear-gradient(180deg, #22201b 0%, #1c1a16 100%);
  box-shadow: 0 4px 18px rgba(255, 159, 10, 0.15);
}

.plot-badge-idx {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.plot-icon {
  font-size: 32px;
  margin-top: 6px;
  line-height: 1;
  transition: transform 0.25s ease;
}

.plot-tile.ready .plot-icon {
  transform: scale(1.1);
  animation: subtleBounce 2s infinite ease-in-out;
}

@keyframes subtleBounce {
  0%, 100% { transform: scale(1.1) translateY(0); }
  50% { transform: scale(1.1) translateY(-3px); }
}

.plot-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.plot-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.plot-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 3px;
}

.plot-progress-fill {
  height: 100%;
  background: var(--ios-green);
  border-radius: 2px;
  transition: width 0.3s linear;
}

.plot-time {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
}

.plot-status-ready {
  font-size: 10px;
  font-weight: 700;
  color: var(--ios-amber);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ==========================================================================
   QUOTE BANNER (COACHMARK STYLE)
   ========================================================================== */
.ios-coachmark {
  background: var(--ios-card);
  border-radius: var(--radius-xl);
  border: 0.5px solid var(--ios-separator);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.coachmark-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #242426;
  border: 0.5px solid var(--ios-separator);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coachmark-avatar svg {
  width: 100%;
  height: 100%;
}

.coachmark-content {
  flex: 1;
}

.coachmark-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.coachmark-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* ==========================================================================
   APPLE GROUPED LIST / CELL VIEW (PROKID, GRULAB, QUESTS)
   ========================================================================== */
.ios-group {
  background: var(--ios-card);
  border-radius: var(--radius-xl);
  border: 0.5px solid var(--ios-separator);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ios-cell {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 0.5px solid var(--ios-separator);
  transition: background 0.15s ease;
}

.ios-cell:last-child {
  border-bottom: none;
}

.ios-cell-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.ios-cell-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--ios-card-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.ios-cell-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ios-cell-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.ios-cell-sub {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* Apple & Telegram Buttons */
.ios-btn-primary, .btn-primary {
  background: var(--tg-blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.25);
}

.ios-btn-primary:active, .btn-primary:active {
  opacity: 0.85;
  transform: scale(0.97);
}

.ios-btn-primary:disabled, .btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.ios-btn-secondary, .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 0.5px solid var(--ios-separator);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}

.ios-btn-secondary:active, .btn-secondary:active {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(0.97);
}

.ios-btn-secondary:disabled, .btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   APPLE DYNAMIC ISLAND TOAST (NOTIFICATION CAPSULE)
   ========================================================================== */
.ios-toast {
  position: fixed;
  top: calc(var(--safe-top) + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-70px);
  background: rgba(30, 30, 32, 0.95);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65);
  z-index: 9999;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.19, 1, 0.22, 1);
  max-width: 90%;
  pointer-events: none;
}

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

.ios-toast-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.ios-toast-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ios-toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.ios-toast-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ==========================================================================
   PROKID (CYBER MINER) APPLE HARDWARE CARD
   ========================================================================== */
.prokid-speed-hero {
  background: linear-gradient(180deg, #191c22 0%, #13151a 100%);
  border-radius: var(--radius-xl);
  border: 0.5px solid var(--ios-separator);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.prokid-stat-box {
  background: var(--ios-card);
  border-radius: var(--radius-md);
  padding: 10px;
  border: 0.5px solid var(--ios-separator-light);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

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

.prokid-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--tg-blue-light);
  letter-spacing: -0.3px;
}

.prokid-canvas-box {
  width: 100%;
  height: 120px;
  background: #0d0e12;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--ios-separator-light);
  overflow: hidden;
}

#prokidCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   DEFENSE ARENA (COMBAT)
   ========================================================================== */
.defense-card {
  background: var(--ios-card);
  border-radius: var(--radius-xl);
  border: 0.5px solid var(--ios-separator);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.defense-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.defense-life-track {
  width: 100px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.defense-life-fill {
  height: 100%;
  background: var(--ios-red);
  width: 100%;
  transition: width 0.2s ease;
}

.defense-canvas-box {
  width: 100%;
  height: 200px;
  background: #111411;
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--ios-separator-light);
  overflow: hidden;
  position: relative;
  cursor: crosshair;
}

#battleCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.defense-skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.defense-skill-pill {
  background: var(--ios-card-elevated);
  border: 0.5px solid var(--ios-separator);
  border-radius: var(--radius-md);
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.defense-skill-pill:active {
  transform: scale(0.94);
  background: var(--ios-card-hover);
}

.defense-skill-icon {
  font-size: 18px;
}

.defense-skill-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.defense-skill-cost {
  font-size: 9px;
  color: var(--text-secondary);
}

/* ==========================================================================
   DAILY 7-DAY CALENDAR & MISSIONS
   ========================================================================== */
.daily-week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.daily-day-cell {
  background: var(--ios-card-elevated);
  border-radius: var(--radius-sm);
  padding: 8px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: 0.5px solid var(--ios-separator-light);
  text-align: center;
}

.daily-day-cell.current {
  border-color: var(--tg-blue);
  background: var(--tg-blue-subtle);
}

.daily-day-cell.claimed {
  opacity: 0.45;
  filter: grayscale(0.5);
}

.daily-day-num {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-secondary);
}

.daily-day-icon {
  font-size: 16px;
}

.daily-day-val {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   WHEEL OF FORTUNE
   ========================================================================== */
.wheel-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.wheel-frame {
  width: 200px;
  height: 200px;
  position: relative;
}

#wheelCanvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--ios-separator);
}

.wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 16px solid var(--ios-amber);
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

/* ==========================================================================
   TELEGRAM NATIVE BOTTOM TAB BAR
   ========================================================================== */
.tg-bottom-tabbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--safe-bottom) + 54px);
  padding: 6px 12px var(--safe-bottom) 12px;
  background: rgba(18, 18, 20, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-top: 0.5px solid var(--ios-separator);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 60;
}

.tg-tab-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease, transform 0.1s ease;
  position: relative;
}

.tg-tab-item:active {
  transform: scale(0.92);
}

.tg-tab-item.active {
  color: var(--tg-blue);
}

.tg-tab-icon {
  font-size: 20px;
  line-height: 1;
}

.tg-tab-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: -0.1px;
}

.tg-badge-dot {
  position: absolute;
  top: 4px;
  right: 18px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ios-red);
}

/* ==========================================================================
   APPLE BOTTOM SHEET (MODAL)
   ========================================================================== */
.ios-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.ios-sheet-backdrop.active {
  display: flex;
}

.ios-bottom-sheet {
  background: #1c1c1e;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  padding: 12px 18px calc(var(--safe-bottom) + 20px) 18px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  animation: slideUpSheet 0.28s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
  border-top: 0.5px solid var(--ios-separator);
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-grabber {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
  align-self: center;
  margin-bottom: 2px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.sheet-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
}

/* Floating numbers & particles */
.floating-harvest {
  position: absolute;
  pointer-events: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--ios-green);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  animation: floatUpIos 0.85s ease forwards;
  z-index: 100;
}

@keyframes floatUpIos {
  0% { opacity: 1; transform: translateY(0) scale(0.9); }
  50% { transform: translateY(-20px) scale(1.05); }
  100% { opacity: 0; transform: translateY(-38px) scale(0.9); }
}
