* { box-sizing: border-box; margin: 0; padding: 0; }

/* Navigation Links - no underline */
.nav a, .nav-btn {
  text-decoration: none;
}

/* Smooth page load */
body {
  opacity: 0;
  animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #22c55e;
  --warning: #f59e0b;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
}

/* Dark Theme */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.4);
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  border-color: var(--primary);
}

/* Copy Animation */
@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-30px); }
}

.copy-indicator {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  pointer-events: none;
  animation: floatUp 0.8s ease forwards;
}

/* Random Emoji Button */
.random-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.random-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.random-btn:active {
  transform: scale(0.95);
}

/* Random Feature */
.random-feature {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border-radius: 20px;
  padding: 25px;
  text-align: center;
  border: 2px dashed var(--primary);
}

[data-theme="dark"] .random-feature {
  background: linear-gradient(135deg, #1e3a5f, #1e293b);
}

.random-btn-large {
  padding: 16px 32px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.random-btn-large:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

.random-icon {
  font-size: 24px;
  animation: shake 2s ease-in-out infinite;
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

.random-result {
  margin-top: 25px;
}

.random-emoji-display {
  font-size: 80px;
  display: block;
  margin-bottom: 15px;
}

@keyframes popIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.random-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.random-actions .btn {
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.random-actions .btn-primary {
  background: var(--primary);
  color: white;
  border: none;
}

.random-actions .btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

[data-theme="dark"] .random-actions .btn-secondary {
  background: var(--bg-secondary);
}

.random-actions .btn:hover {
  transform: scale(1.05);
}

/* Trending Section */
.trending-section {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #fbbf24;
}

[data-theme="dark"] .trending-section {
  background: linear-gradient(135deg, #78350f, #92400e);
  border-color: #b45309;
}

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

.trending-title {
  font-size: 18px;
  font-weight: 700;
  color: #78350f;
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="dark"] .trending-title {
  color: #fef3c7;
}

.trending-emojis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trending-emoji {
  font-size: 28px;
  padding: 10px;
  background: rgba(255,255,255,0.7);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

[data-theme="dark"] .trending-emoji {
  background: rgba(0,0,0,0.3);
}

.trending-emoji:hover {
  transform: scale(1.2);
  background: white;
}

.trending-emoji .trend-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 10px;
  background: #ef4444;
  color: white;
  padding: 2px 5px;
  border-radius: 8px;
}

/* Seasonal Collection */
.seasonal-section {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  border: 2px dashed var(--border);
}

.seasonal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.seasonal-tab {
  padding: 8px 16px;
  border: none;
  background: var(--bg);
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.seasonal-tab:hover {
  background: var(--primary-light);
  color: white;
}

.seasonal-tab.active {
  background: var(--primary);
  color: white;
}

.seasonal-emojis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seasonal-emoji {
  font-size: 26px;
  padding: 8px;
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.seasonal-emoji:hover {
  transform: scale(1.15);
  background: var(--primary-light);
}

/* Export/Import Buttons */
.export-import-section {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.export-btn, .import-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.export-btn:hover {
  background: #dbeafe;
  border-color: #3b82f6;
}

.import-btn:hover {
  background: #dcfce7;
  border-color: #22c55e;
}

/* Keyboard Shortcut Hints */
@media (max-width: 768px) {
  .theme-toggle {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

html {
  overflow-x: hidden;
}

/* Global touch improvements */
button, .clickable {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Header */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.logo-icon { 
  width: 50px; 
  height: 50px; 
  object-fit: contain;
}

h1 {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Navigation */
.nav {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 15px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.nav-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 25px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.nav-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-btn:active {
  transform: scale(0.95);
}

.nav-btn.active {
  background: var(--primary);
  color: white;
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* How It Works Block */
.how-it-works {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.how-step {
  text-align: center;
}

.how-step-icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.how-step-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 5px;
}

.how-step-desc {
  font-size: 13px;
  opacity: 0.9;
}

.how-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.7;
}

.how-close:hover { opacity: 1; }

.how-it-works-wrapper {
  position: relative;
}

/* Search */
.search-box {
  position: relative;
  margin-bottom: 20px;
}

.search-input {
  width: 100%;
  padding: 15px 20px 15px 50px;
  border: 2px solid var(--border);
  border-radius: 15px;
  font-size: 16px;
  background: var(--bg-card);
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--text-muted);
}

/* Tabs Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Categories */
.categories {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.cat-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cat-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cat-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Favorites Button Special */
.cat-btn.favorites-btn {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-color: #f59e0b;
  color: white;
}

.cat-btn.favorites-btn:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.cat-btn.favorites-btn.active {
  background: linear-gradient(135deg, #d97706, #b45309);
}

/* Emoji Grid */
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 6px;
  background: var(--bg-card);
  padding: 20px;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

/* Usage Tips - Wrapper для grid с sidebar */
.emoji-grid-wrapper {
  display: block;
  position: relative;
}

/* Usage Tips - Sidebar (PC) - привязан к левому краю emoji-grid */
.usage-tips-sidebar {
  display: none;
  position: absolute;
  right: calc(100% + 12px);
  top: 0;
  width: 150px;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  z-index: 50;
}

.tips-header {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

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

.tip-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tip-row .tip-icon {
  font-size: 14px;
}

.tip-row .tip-text {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.tip-row .tip-value {
  font-size: 12px;
  font-weight: 600;
}

.tip-value.tip-copy {
  color: #3b82f6;
}

.tip-value.tip-combo {
  color: #3b82f6;
}

.tip-value.tip-fav {
  color: #fbbf24;
}

/* Usage Tips - Mobile (сверху) */
.usage-tips-mobile {
  display: none;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.tips-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.tip-item {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.tip-action {
  color: var(--text-muted);
  font-weight: 500;
}

.tip-result {
  font-weight: 600;
}

.tip-result.tip-copy {
  color: #3b82f6;
}

.tip-result.tip-fav {
  color: #fbbf24;
}

.tip-divider {
  color: var(--text-muted);
  opacity: 0.5;
}

/* PC: показываем sidebar только если достаточно места слева */
@media (min-width: 1400px) {
  .usage-tips-sidebar {
    display: block;
  }
  
  .usage-tips-mobile {
    display: none !important;
  }
}

/* Средние экраны: показываем мобильную версию */
@media (min-width: 769px) and (max-width: 1399px) {
  .usage-tips-sidebar {
    display: none !important;
  }
  
  .usage-tips-mobile {
    display: block;
  }
}

/* Mobile/Tablet: показываем верхнюю панель */
@media (max-width: 768px) {
  .usage-tips-sidebar {
    display: none !important;
  }
  
  .usage-tips-mobile {
    display: block;
  }
}

/* Кастомный скроллбар - на МОБИЛЬНЫХ показываем кастомный JS скроллбар */
@media (max-width: 1024px) {
  #scrollWrapper {
    display: flex !important;
    flex-direction: row !important;
    max-height: 50vh !important;
  }
  #myScrollbar {
    display: block !important;
    width: 10px !important;
    min-width: 10px !important;
    background: var(--border) !important;
    border-radius: 5px !important;
    margin-right: 6px !important;
  }
  #myThumb {
    background: var(--primary) !important;
    border-radius: 5px !important;
  }
  #emojiGrid {
    max-height: 50vh !important;
    overflow-y: scroll !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  #emojiGrid::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
  }
}

/* Кастомный скроллбар - на ПК используем нативный CSS скроллбар */
@media (min-width: 1025px) {
  #scrollWrapper {
    display: flex !important;
    flex-direction: row-reverse !important;
    max-height: 65vh !important;
  }
  #myScrollbar {
    display: none !important; /* Скрываем кастомный JS скроллбар на PC */
  }
  #emojiGrid {
    max-height: 65vh !important;
    overflow-y: scroll !important;
    /* Firefox - auto для нормальной ширины */
    scrollbar-width: auto !important;
    scrollbar-color: var(--primary) var(--border) !important;
  }
  #emojiGrid::-webkit-scrollbar {
    display: block !important;
    width: 18px !important;
  }
  #emojiGrid::-webkit-scrollbar-track {
    background: var(--border) !important;
    border-radius: 9px !important;
  }
  #emojiGrid::-webkit-scrollbar-thumb {
    background: var(--primary) !important;
    border-radius: 9px !important;
    border: none !important;
  }
  #emojiGrid::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light) !important;
  }
  #emojiGrid::-webkit-scrollbar-thumb:active {
    background: #2563eb !important;
  }
}

/* Рекламный блок между контентом и футером */
.ad-container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
  text-align: center;
}

.ad-block {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 20px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* Скрыть заглушку когда есть реальная реклама */
.ad-block.has-ad {
  border: none;
  padding: 0;
  background: transparent;
}

.emoji-item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.15s;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.emoji-item:hover {
  background: var(--bg);
  transform: scale(1.15);
  z-index: 5;
}

.emoji-item:active {
  transform: scale(0.95);
  background: var(--primary-light);
}

/* Favorite Star */
.emoji-item .fav-star {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 10px;
  opacity: 0;
  transition: all 0.2s;
  cursor: pointer;
  padding: 3px;
  z-index: 10;
}

.emoji-item:hover .fav-star {
  opacity: 0.5;
}

.emoji-item .fav-star:hover {
  opacity: 1;
  transform: scale(1.3);
}

.emoji-item.is-favorite .fav-star {
  opacity: 1;
}

/* Combinator */
.combinator {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.combinator-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.combo-hint {
  background: linear-gradient(135deg, #f5a623 0%, #f57c00 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.combinator-output {
  min-height: 50px;
  padding: 15px;
  background: var(--bg);
  border-radius: 12px;
  font-size: 26px;
  word-break: break-all;
  line-height: 1.5;
  border: 2px dashed var(--border);
}

.combinator-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

/* Kaomoji Section */
.kaomoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.kaomoji-item {
  padding: 15px;
  background: var(--bg-card);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  font-size: 18px;
  transition: all 0.2s;
  border: 1px solid var(--border);
}

.kaomoji-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.kaomoji-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Invisible Characters */
.invisible-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.invisible-item {
  padding: 20px;
  background: var(--bg-card);
  border-radius: 15px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.invisible-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.invisible-name {
  font-weight: 600;
  margin-bottom: 5px;
}

.invisible-code {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
  background: var(--bg);
  padding: 4px 8px;
  border-radius: 5px;
  display: inline-block;
}

.invisible-preview {
  margin-top: 10px;
  padding: 10px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Packs Section */
.packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
}

.pack-item {
  padding: 20px;
  background: var(--bg-card);
  border-radius: 15px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.pack-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.pack-name {
  font-weight: 600;
  margin-bottom: 10px;
}

.pack-preview {
  font-size: 24px;
  letter-spacing: 2px;
}

/* Meanings Styles */
.meanings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
}

.meaning-item {
  padding: 20px;
  background: var(--bg-card);
  border-radius: 15px;
  border: 1px solid var(--border);
  transition: all 0.2s;
  cursor: pointer;
}

.meaning-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.meaning-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 12px;
}

.meaning-emoji {
  font-size: 42px;
  line-height: 1;
}

.meaning-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}

.meaning-desc {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.meaning-tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meaning-tag {
  background: var(--bg);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
}

/* User Combo Styles - Compact */
.user-combo-item {
  position: relative;
  padding: 12px !important;
}

.user-combo-item .pack-name {
  font-size: 13px;
  margin-bottom: 6px;
}

.user-combo-item .pack-preview {
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.2s;
  font-size: 18px;
  letter-spacing: 1px;
}

.user-combo-item .pack-preview:hover {
  background: var(--bg);
}

.user-combo-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.user-combo-btn {
  flex: 1;
  padding: 5px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.user-combo-btn:hover {
  border-color: var(--primary);
}

.user-combo-btn.delete-btn:hover {
  background: #fee2e2;
  border-color: #ef4444;
}

.user-combo-btn.copy-btn:hover {
  background: #dbeafe;
  border-color: #3b82f6;
}

.user-combo-btn.load-btn:hover {
  background: #dcfce7;
  border-color: #22c55e;
}

/* Section Titles */
.section-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text);
}

/* Symbol Categories */
.symbol-category {
  margin-bottom: 30px;
}

.symbol-category h3 {
  font-size: 16px;
  margin-bottom: 15px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 15px 25px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.toast-success {
  background: var(--success);
}

.toast-warning {
  background: var(--warning);
}

/* Save Combo Notification */
.save-notification {
  position: fixed;
  top: 20px;
  right: -400px;
  width: 320px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(245, 158, 11, 0.3);
  z-index: 1001;
  transition: right 0.4s ease;
}

.save-notification.show {
  right: 20px;
}

.save-notification-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.save-notification-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.save-notification-text {
  font-size: 14px;
  opacity: 0.95;
}

.save-notification-actions {
  display: flex;
  gap: 10px;
  margin-top: 5px;
}

.save-notification-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.save-notification-btn.primary {
  background: white;
  color: #d97706;
}

.save-notification-btn.primary:hover {
  background: #fef3c7;
}

.save-notification-btn.secondary {
  background: rgba(255,255,255,0.2);
  color: white;
}

.save-notification-btn.secondary:hover {
  background: rgba(255,255,255,0.3);
}

.save-notification-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.save-notification-close:hover {
  opacity: 1;
}

.save-notification-dismiss {
  font-size: 11px;
  opacity: 0.7;
  cursor: pointer;
  text-align: center;
  margin-top: 8px;
}

.save-notification-dismiss:hover {
  opacity: 1;
  text-decoration: underline;
}

/* User Combos Section with scroll */
.user-combos-container {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 5px;
  margin-bottom: 15px;
}

.user-combos-container .packs-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.user-combos-container .empty-state {
  padding: 20px;
  font-size: 13px;
}

.user-combos-container .empty-state .empty-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.user-combos-container::-webkit-scrollbar {
  width: 6px;
}

.user-combos-container::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 3px;
}

.user-combos-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.user-combos-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Stats */
.stats {
  text-align: center;
  padding: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Footer */
.footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
}

/* Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text);
}

.modal-preview {
  background: var(--bg);
  padding: 15px 20px;
  border-radius: 12px;
  font-size: 28px;
  text-align: center;
  margin-bottom: 15px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: break-all;
}

.modal-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 20px;
  transition: border-color 0.2s;
}

.modal-input:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 25px;
  color: var(--text);
}

.modal-section {
  margin-bottom: 20px;
}

.modal-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.modal-section p {
  color: var(--text-muted);
  line-height: 1.6;
}

.modal-section ul {
  margin: 10px 0;
  padding-left: 25px;
  color: var(--text-muted);
}

.modal-section li {
  margin-bottom: 5px;
}

.modal-section a {
  color: var(--primary);
  text-decoration: none;
}

.modal-section a:hover {
  text-decoration: underline;
}

.modal-updated {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

/* Hint Box */
.hint-box {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fbbf24;
  border-radius: 12px;
  padding: 15px 20px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #92400e;
}

.hint-box b {
  color: #78350f;
}

/* Responsive */
@media (max-width: 768px) {
  .logo { font-size: 20px; }
  
  /* На мобилках звезда - только индикатор, клик не работает */
  .emoji-item .fav-star {
    pointer-events: none;
  }
  
  /* Показываем подсказку на мобилках */
  .mobile-hint {
    display: block !important;
  }
  
  .emoji-grid { 
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)) !important; 
    gap: 4px !important; 
    padding: 12px !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  
  .emoji-grid::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
  }
  
  .emoji-item { 
    font-size: 22px; 
  }
  .container { padding: 10px; }
  .how-it-works { padding: 15px; display: none; }
  .how-step-icon { font-size: 24px; }
  .how-step-title { font-size: 13px; }
  .how-step-desc { font-size: 11px; }
  
  /* Navigation - все табы видны, wrap */
  .nav {
    justify-content: center;
    flex-wrap: wrap;
    padding: 6px 8px;
    gap: 4px;
  }
  .nav-btn { 
    padding: 5px 8px;
    font-size: 10px;
    gap: 2px;
    border-radius: 12px;
    min-height: auto;
    min-width: auto;
  }
  
  /* Header */
  .header { padding: 10px 15px; }
  .logo-icon { width: 36px; height: 36px; }
  h1 { font-size: 12px; margin-top: 3px; }
  
  /* Combinator - компактный */
  .combinator {
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 10px;
  }
  .combinator-label {
    font-size: 10px;
    margin-bottom: 4px;
    flex-wrap: wrap;
    gap: 4px;
  }
  .combinator-label span:last-child {
    font-size: 9px !important;
    padding: 3px 8px !important;
  }
  .combinator-output {
    min-height: 32px;
    padding: 6px 8px;
    font-size: 18px;
    border-radius: 8px;
    line-height: 1.3;
  }
  .combinator-actions {
    margin-top: 6px;
    gap: 4px;
    flex-wrap: wrap;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .combinator-actions .btn {
    padding: 5px 8px;
    font-size: 11px;
    border-radius: 6px;
    justify-content: center;
  }
  
  /* Random Feature */
  .random-feature { padding: 15px 10px; }
  .random-btn-large {
    padding: 12px 20px;
    font-size: 14px;
  }
  .random-emoji-display { font-size: 50px; }
  .random-actions { gap: 6px; }
  .random-actions .btn { 
    padding: 8px 14px; 
    font-size: 13px;
  }
  
  /* Trending */
  .trending-section { padding: 12px; margin-bottom: 12px; }
  .trending-title { font-size: 14px; }
  .trending-emojis { gap: 6px; }
  .trending-emoji { 
    font-size: 22px; 
    padding: 6px;
    min-width: 38px;
  }
  
  /* Seasonal */
  .seasonal-section { padding: 12px; margin-bottom: 12px; }
  .seasonal-tabs { gap: 4px; margin-bottom: 10px; }
  .seasonal-tab {
    padding: 6px 10px;
    font-size: 11px;
  }
  .seasonal-emojis { gap: 4px; }
  .seasonal-emoji { font-size: 20px; padding: 6px; }
  
  /* Combo Builder */
  .combo-builder { padding: 12px; }
  .combo-preview { 
    font-size: 24px; 
    min-height: 40px;
    padding: 10px;
  }
  .combo-actions { 
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .combo-actions button { 
    flex: 1 1 45%;
    min-width: 0;
    padding: 8px;
    font-size: 12px;
  }
  
  /* Export/Import */
  .export-import-section {
    margin-top: 10px;
    padding-top: 10px;
  }
  .export-btn, .import-btn {
    padding: 8px;
    font-size: 12px;
  }
  
  /* Categories - компактнее */
  .categories {
    gap: 4px;
    margin-bottom: 10px;
  }
  .cat-btn {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 15px;
  }
  
  /* Search */
  .search-box { margin-bottom: 10px; }
  .search-input {
    padding: 10px 12px 10px 36px;
    font-size: 14px;
    border-radius: 10px;
  }
  .search-icon {
    left: 12px;
    font-size: 16px;
  }
  
  /* Stats */
  .stats { padding: 6px; font-size: 11px; }
  
  /* Meaning Cards - компактно с прокруткой */
  .meanings-grid { 
    gap: 8px; 
    grid-template-columns: 1fr;
    max-height: 55vh;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 12px;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  .meanings-grid::-webkit-scrollbar { 
    display: none !important;
    width: 0 !important;
  }
  .meaning-item { padding: 10px; border-radius: 10px; }
  .meaning-header { gap: 10px; margin-bottom: 8px; }
  .meaning-emoji { font-size: 28px; }
  .meaning-title { font-size: 13px; }
  .meaning-desc { font-size: 11px; line-height: 1.4; }
  .meaning-tags { gap: 4px; margin-top: 8px; }
  .meaning-tag { padding: 2px 6px; font-size: 9px; }
  
  /* Kaomoji - компактно с прокруткой */
  .kaomoji-grid { 
    gap: 6px; 
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    max-height: 55vh;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 12px;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  .kaomoji-grid::-webkit-scrollbar { 
    display: none !important;
    width: 0 !important;
  }
  .kaomoji-item {
    padding: 6px 8px;
    font-size: 12px;
    border-radius: 8px;
  }
  .kaomoji-label { font-size: 9px; margin-top: 3px; }
  
  /* Invisible - компактно с прокруткой */
  .invisible-grid { 
    gap: 8px; 
    grid-template-columns: 1fr;
    max-height: 55vh;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 12px;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  .invisible-grid::-webkit-scrollbar { 
    display: none !important;
    width: 0 !important;
  }
  .invisible-item { padding: 10px; border-radius: 10px; }
  .invisible-name { font-size: 12px; margin-bottom: 4px; }
  .invisible-code { font-size: 10px; padding: 3px 6px; }
  .invisible-preview { font-size: 10px; padding: 6px; margin-top: 6px; border-radius: 6px; }
  
  /* Packs/Combos - компактно с прокруткой */
  .packs-grid { 
    gap: 8px; 
    grid-template-columns: 1fr 1fr;
    max-height: 55vh;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 12px;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  .packs-grid::-webkit-scrollbar { 
    display: none !important;
    width: 0 !important;
  }
  .pack-item { padding: 10px; border-radius: 10px; }
  .pack-name { font-size: 11px; margin-bottom: 5px; }
  .pack-preview { font-size: 16px; letter-spacing: 1px; }
  
  /* Trending section - компактно */
  .trending-section {
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 10px;
  }
  .trending-emojis {
    max-height: 30vh;
    overflow-y: auto;
    padding: 5px;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  .trending-emojis::-webkit-scrollbar { 
    display: none !important;
    width: 0 !important;
  }
  
  /* Seasonal section - компактно */
  .seasonal-section {
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 10px;
  }
  .seasonal-emojis {
    max-height: 25vh;
    overflow-y: auto;
    padding: 5px;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  .seasonal-emojis::-webkit-scrollbar { 
    display: none !important;
    width: 0 !important;
  }
  
  /* Symbols tab - использует emoji-grid, уже оптимизирован */
  .symbol-category .emoji-grid {
    max-height: 40vh;
  }
  
  /* My Combos */
  .my-combo-item { padding: 10px; }
  .my-combo-text { font-size: 16px; }
  .my-combo-name { font-size: 12px; }
  
  /* Section titles */
  .section-title { font-size: 16px; margin-bottom: 10px; }
  .section-subtitle { font-size: 12px; }
  
  /* Symbol categories */
  .symbol-category { margin-bottom: 20px; }
  .symbol-category h3 { font-size: 14px; margin-bottom: 10px; }
  
  /* Toast */
  .toast {
    left: 50%;
    right: auto;
    bottom: 15px;
    transform: translateX(-50%) translateY(100px);
    max-width: calc(100% - 30px);
    font-size: 12px;
    padding: 10px 16px;
  }
  
  .toast.show {
    transform: translateX(-50%) translateY(0);
  }
}

/* Save notification mobile */
@media (max-width: 768px) {
  .save-notification {
    width: calc(100% - 40px);
    right: -100%;
    top: auto;
    bottom: 20px;
  }
  
  .save-notification.show {
    right: 20px;
  }
  
  /* Compact user combos on mobile */
  .user-combos-container {
    max-height: 150px;
  }
  
  .user-combos-container .packs-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }
  
  .user-combo-item {
    padding: 8px !important;
  }
  
  .user-combo-item .pack-name {
    font-size: 11px;
    margin-bottom: 4px;
  }
  
  .user-combo-item .pack-preview {
    font-size: 14px;
    letter-spacing: 0;
  }
  
  .user-combo-actions {
    gap: 4px;
    margin-top: 6px;
    padding-top: 6px;
  }
  
  .user-combo-btn {
    padding: 4px;
    font-size: 10px;
  }
  
  /* Usage Tips Mobile */
  .usage-tips-mobile {
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: 10px;
  }
  
  .tips-row {
    font-size: 11px;
    gap: 6px;
  }
  
  .tip-item {
    gap: 3px;
  }
}

/* Extra small devices */
@media (max-width: 375px) {
  .nav { padding: 6px 8px; gap: 3px; }
  .nav-btn { padding: 5px 8px; font-size: 10px; }
  .emoji-grid { 
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)) !important; 
    padding: 10px !important;
  }
  .emoji-item { 
    font-size: 20px;
  }
  .combinator { padding: 8px; }
  .combinator-output { font-size: 18px; min-height: 32px; padding: 6px 8px; }
  .combinator-actions .btn { padding: 5px 10px; font-size: 11px; }
  .random-emoji-display { font-size: 40px; }
  .trending-emoji { font-size: 20px; min-width: 34px; padding: 5px; }
  .cat-btn { padding: 5px 8px; font-size: 10px; }
  
  /* Usage Tips - compact */
  .usage-tips-mobile {
    padding: 8px 10px;
  }
  
  .tips-row {
    font-size: 10px;
    flex-direction: column;
    gap: 4px;
  }
  
  .tip-divider {
    display: none;
  }
}
