/* ═══════════════════════════════════════ */
/* VoicyOK — Telegram UI Components       */
/* ═══════════════════════════════════════ */

:root {
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 20px;
  --spacing-xl: 24px;
  --spacing-2xl: 32px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-xs: 12px;
  --font-sm: 14px;
  --font-md: 16px;
  --font-lg: 18px;
  --font-xl: 20px;
  --font-2xl: 24px;
}

/* ═══════════════════════════════════════ */
/* TELEGRAM THEME TOKENS                  */
/* ═══════════════════════════════════════ */
body {
  --tg-bg: var(--tg-theme-bg-color, #efeff4);
  --tg-text: var(--tg-theme-text-color, #000000);
  --tg-hint: var(--tg-theme-hint-color, #8e8e93);
  --tg-link: var(--tg-theme-link-color, #007aff);
  --tg-accent: var(--tg-theme-button-color, #007aff);
  --tg-accent-text: var(--tg-theme-button-text-color, #ffffff);
  --tg-secondary-bg: var(--tg-theme-secondary-bg-color, #ffffff);
  --tg-section-bg: var(--tg-theme-section-bg-color, #ffffff);
  --tg-header-bg: var(--tg-theme-header-bg-color, var(--tg-bg));
  --tg-border: var(--tg-theme-section-separator-color, #c6c6c8);
  --tg-destructive: #ff3b30;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--tg-bg);
  color: var(--tg-text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ═══════════════════════════════════════ */
/* SPLASH SCREEN                           */
/* ═══════════════════════════════════════ */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-content { text-align: center; color: #fff; }
.splash-logo {
  position: relative; width: 120px; height: 80px;
  margin: 0 auto var(--spacing-xl);
}
.splash-circle {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.splash-mic { width: 24px; height: 24px; color: #fff; }
.splash-wave { width: 120px; height: 80px; color: rgba(255,255,255,.6); }
.splash-bar { animation: waveAnim 1.2s ease-in-out infinite; transform-origin: center; }
.bar-1 { animation-delay: 0s; } .bar-2 { animation-delay: .1s; }
.bar-3 { animation-delay: .2s; } .bar-4 { animation-delay: .3s; }
.bar-5 { animation-delay: .4s; } .bar-6 { animation-delay: .5s; }
.bar-7 { animation-delay: .6s; } .bar-8 { animation-delay: .7s; }
@keyframes waveAnim {
  0%,100% { transform: scaleY(1); opacity: .6; }
  50% { transform: scaleY(1.3); opacity: 1; }
}
.splash-title { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 4px; }
.splash-subtitle { font-size: 14px; opacity: .7; letter-spacing: 1px; text-transform: uppercase; }

/* ═══════════════════════════════════════ */
/* HEADER                                  */
/* ═══════════════════════════════════════ */
.header {
  position: sticky; top: 0; z-index: 500;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px;
  background: var(--tg-header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  min-height: 48px;
}
.header-left { display: flex; align-items: center; gap: 8px; flex: 1; }
.header-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.app-title {
  font-size: var(--font-lg); font-weight: 700;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.app-logo-icon { width: 22px; height: 22px; flex-shrink: 0; }

/* Header buttons — круглые 36x36 */
.header-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: transparent;
  color: var(--tg-hint); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.header-btn:hover { background: rgba(128,128,128,.1); }
.header-btn:active { transform: scale(.92); }
.header-btn.hidden { display: none; }

/* ═══════════════════════════════════════ */
/* BOTTOM NAV                              */
/* ═══════════════════════════════════════ */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around; align-items: stretch;
  background: var(--tg-secondary-bg);
  border-top: .5px solid var(--tg-border);
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px));
  z-index: 1000;
}
.bottom-nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; padding: 6px 4px;
  background: none; border: none; cursor: pointer;
  color: var(--tg-hint); transition: color .15s;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-btn.active { color: var(--tg-accent); }
.bottom-nav-icon { width: 24px; height: 24px; }
.bottom-nav-label { font-size: 10px; font-weight: 500; line-height: 1.2; }

/* ═══════════════════════════════════════ */
/* TABS NAV                                */
/* ═══════════════════════════════════════ */
.tabs-nav { margin-bottom: 0; }
.tabs-nav.hidden { display: none !important; }
.tabs-container {
  display: flex; overflow-x: auto;
  scrollbar-width: none; gap: 0;
  border-bottom: .5px solid var(--tg-border);
}
.tabs-container::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0; padding: 12px 16px;
  background: none; border: none; border-bottom: 2px solid transparent;
  font-size: var(--font-sm); color: var(--tg-hint);
  cursor: pointer; white-space: nowrap;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.tab-btn.active { color: var(--tg-accent); border-bottom-color: var(--tg-accent); font-weight: 600; }

/* ═══════════════════════════════════════ */
/* TG COMPONENTS                           */
/* ═══════════════════════════════════════ */

/* Section — группировка с заголовком */
.tg-section {
  margin: 16px 0;
}
.tg-section-title {
  padding: 0 16px 8px;
  font-size: var(--font-xs); font-weight: 500;
  color: var(--tg-hint); text-transform: uppercase;
  letter-spacing: .3px;
}

/* List — список Cell'ов */
.tg-list {
  background: var(--tg-section-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 0 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* Cell — строка с иконкой, заголовком, подписью и правым элементом */
.tg-cell {
  display: flex; align-items: center;
  gap: 12px; padding: 12px 16px;
  min-height: 48px;
  border-bottom: .5px solid var(--tg-border);
  cursor: pointer;
  transition: background .12s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.tg-cell:last-child { border-bottom: none; }
.tg-cell:hover { background: rgba(128,128,128,.04); }
.tg-cell:active { background: rgba(128,128,128,.08); }
.tg-cell-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
  background: var(--tg-secondary-bg);
}
.tg-cell-body { flex: 1; min-width: 0; }
.tg-cell-title { font-size: var(--font-md); font-weight: 500; color: var(--tg-text); }
.tg-cell-subtitle { font-size: var(--font-xs); color: var(--tg-hint); margin-top: 2px; }
.tg-cell-right {
  font-size: var(--font-xs); color: var(--tg-hint);
  text-align: right; flex-shrink: 0;
}
.tg-cell-arrow {
  color: var(--tg-hint); opacity: .5;
  margin-left: 4px; flex-shrink: 0;
}

/* Grid категорий — адаптивная сетка */
.tg-grid-strip {
  display: grid;
  gap: 10px;
  padding: 0 16px;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}

.tg-grid-strip .tg-cell {
  flex-direction: column; text-align: center;
  padding: 16px 8px; gap: 6px;
  min-height: auto; border: none;
  border-radius: var(--radius-md);
  background: var(--tg-section-bg);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  display: flex;
}
.tg-grid-strip .tg-cell:active { transform: scale(.96); }
.tg-grid-strip .tg-cell-icon {
  width: 44px; height: 44px; border-radius: 12px;
  font-size: 26px; margin: 0 auto;
}
.tg-grid-strip .tg-cell-title {
  font-size: var(--font-xs); font-weight: 500;
  line-height: 1.2; word-break: break-word;
}
.tg-grid-strip .tg-cell-subtitle { display: none; }
.tg-grid-strip .tg-cell-right { display: none; }
.tg-grid-strip .tg-cell-arrow { display: none; }

/* Grid для мемов (popup / similar) */
.tg-grid {
  display: grid;
  gap: 10px;
  padding: 0 16px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.tg-grid .tg-cell {
  flex-direction: column; text-align: center;
  padding: 16px 8px; gap: 6px;
  min-height: 100px; border: none;
  border-radius: var(--radius-md);
  background: var(--tg-section-bg);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  display: flex;
}
.tg-grid .tg-cell:active { transform: scale(.96); }
.tg-grid .tg-cell-icon {
  width: 40px; height: 40px; border-radius: 10px;
  font-size: 24px; margin: 0 auto;
}
.tg-grid .tg-cell-title { font-size: var(--font-sm); }
.tg-grid .tg-cell-subtitle { display: none; }
.tg-grid .tg-cell-right { display: none; }
.tg-grid .tg-cell-arrow { display: none; }

/* Button */
.tg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 14px 20px;
  border: none; border-radius: var(--radius-md);
  font-size: var(--font-md); font-weight: 600;
  cursor: pointer; min-height: 52px;
  transition: opacity .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.tg-btn:active { transform: scale(.97); }
.tg-btn:disabled { opacity: .4; cursor: not-allowed; }
.tg-btn-primary { background: var(--tg-accent); color: var(--tg-accent-text); }
.tg-btn-secondary { background: var(--tg-secondary-bg); color: var(--tg-text); border: .5px solid var(--tg-border); }
.tg-btn-destructive { background: var(--tg-destructive); color: #fff; }
.tg-btn-block { width: 100%; }

/* Input */
.tg-input-wrapper {
  background: var(--tg-section-bg);
  border-radius: var(--radius-md);
  padding: 0 16px;
  display: flex; align-items: center; gap: 10px;
  min-height: 52px;
  margin: 0 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.tg-input {
  flex: 1; border: none; outline: none;
  background: transparent;
  font-size: var(--font-md); color: var(--tg-text);
  font-family: inherit; line-height: 1.4;
}
.tg-input::placeholder { color: var(--tg-hint); }

/* Toggle */
.tg-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; min-height: 48px;
  gap: 12px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tg-toggle-label { flex: 1; font-size: var(--font-md); color: var(--tg-text); }
.tg-toggle input { display: none; }
.tg-toggle-track {
  width: 50px; height: 30px; flex-shrink: 0;
  background: #e5e5ea; border-radius: 15px;
  position: relative; transition: background .2s;
}
.tg-toggle-track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}
.tg-toggle input:checked + .tg-toggle-track { background: var(--tg-accent); }
.tg-toggle input:checked + .tg-toggle-track::after { transform: translateX(20px); }

/* Radio list */
.tg-radio {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; min-height: 48px;
  cursor: pointer; transition: background .12s;
  border-bottom: .5px solid var(--tg-border);
  -webkit-tap-highlight-color: transparent;
}
.tg-radio:last-child { border-bottom: none; }
.tg-radio:active { background: rgba(128,128,128,.06); }
.tg-radio input { display: none; }
.tg-radio-dot {
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 50%; border: 2px solid var(--tg-hint);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s;
}
.tg-radio input:checked + .tg-radio-dot { border-color: var(--tg-accent); }
.tg-radio input:checked + .tg-radio-dot::after {
  content: ''; width: 12px; height: 12px;
  border-radius: 50%; background: var(--tg-accent);
}
.tg-radio-body { flex: 1; min-width: 0; }
.tg-radio-title { font-size: var(--font-md); color: var(--tg-text); }
.tg-radio-sub { font-size: var(--font-xs); color: var(--tg-hint); margin-top: 1px; }

/* Badge / статус */
.tg-badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 10px; font-size: 11px; font-weight: 600;
}
.tg-badge-pending { background: rgba(255,193,7,.15); color: #ff9500; }
.tg-badge-approved { background: rgba(52,199,89,.12); color: #34c759; }
.tg-badge-rejected { background: rgba(255,59,48,.12); color: #ff3b30; }

/* ═══════════════════════════════════════ */
/* PLAYER                                  */
/* ═══════════════════════════════════════ */
.player-content { padding: 0 16px; }
.meme-audio-player {
  background: var(--tg-section-bg); border-radius: var(--radius-md);
  padding: 24px; text-align: center; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.audio-visualizer {
  display: flex; justify-content: center; align-items: flex-end;
  height: 60px; gap: 4px; margin-bottom: 16px;
}
.audio-visualizer .visualizer-bar {
  width: 6px; border-radius: 3px;
  background: linear-gradient(to top, var(--tg-accent), #5d9cec);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: .3; } 50% { opacity: .8; }
}
.audio-player-main { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.play-btn-large {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--tg-accent); color: var(--tg-accent-text);
  border: none; font-size: 28px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s;
  box-shadow: 0 4px 12px rgba(0,122,255,.3);
}
.play-btn-large:active { transform: scale(.94); }
.audio-timer { font-size: var(--font-sm); font-weight: 500; color: var(--tg-hint); }
.audio-progress { margin-top: 8px; }
#progress-slider {
  width: 100%; height: 4px;
  -webkit-appearance: none; appearance: none;
  background: var(--tg-border); border-radius: 2px; outline: none;
}
#progress-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px;
  border-radius: 50%; background: var(--tg-accent); cursor: pointer;
  border: 3px solid var(--tg-section-bg);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.meme-info { text-align: center; margin-bottom: 16px; }
#audio-title { font-size: var(--font-xl); font-weight: 700; margin-bottom: 4px; }
.meme-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; font-size: var(--font-xs); color: var(--tg-hint); }
.meme-meta .meta-item { display: inline-flex; align-items: center; gap: 4px; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }

/* ═══════════════════════════════════════ */
/* PLAYER BUTTONS REUSING TG-BTN          */
/* ═══════════════════════════════════════ */
.action-grid .tg-btn { width: 100%; }

/* ═══════════════════════════════════════ */
/* PROFILE                                 */
/* ═══════════════════════════════════════ */
.profile-container { text-align: center; padding: 16px; }
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  margin: 0 auto 16px; overflow: hidden;
  background: var(--tg-secondary-bg);
  display: flex; align-items: center; justify-content: center;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: var(--font-xl); font-weight: 700; margin-bottom: 16px; }
.profile-credits {
  background: linear-gradient(135deg, var(--tg-accent), #5d9cec);
  border-radius: var(--radius-md); padding: 16px;
  margin-bottom: 16px; color: var(--tg-accent-text);
  display: flex; align-items: center; justify-content: space-between;
}
.credits-card { display: flex; align-items: center; gap: 12px; }
.credits-icon { font-size: 28px; }
.credits-value { font-size: 22px; font-weight: 800; }
.credits-label { font-size: var(--font-xs); opacity: .8; }
.credits-buy-btn {
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3);
  color: inherit; padding: 8px 16px; border-radius: var(--radius-md);
  font-size: var(--font-sm); font-weight: 600; cursor: pointer;
  backdrop-filter: blur(4px);
}
.profile-stats { display: flex; justify-content: center; gap: 24px; margin-bottom: 24px; }
.profile-stat { text-align: center; }
.profile-stat-value { display: block; font-size: 22px; font-weight: 700; color: var(--tg-accent); }
.profile-stat-label { font-size: var(--font-xs); color: var(--tg-hint); text-transform: uppercase; }
.profile-actions { display: flex; flex-direction: column; gap: 10px; max-width: 280px; margin: 0 auto; }

/* ═══════════════════════════════════════ */
/* MODAL / OVERLAY                         */
/* ═══════════════════════════════════════ */
.modal {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.5);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px;
}
.modal.hidden { display: none; }
.modal-content {
  background: var(--tg-section-bg); border-radius: var(--radius-md);
  width: 100%; max-width: 500px; max-height: 80vh;
  overflow-y: auto; box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px; border-bottom: .5px solid var(--tg-border);
}
.modal-header h2 { font-size: var(--font-lg); font-weight: 600; margin: 0; }
.modal-close-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: rgba(128,128,128,.1);
  color: var(--tg-hint); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-body { padding: 16px; font-size: var(--font-sm); color: var(--tg-hint); line-height: 1.5; }
.modal-body ol { padding-left: 20px; margin-bottom: 12px; }
.modal-body li { margin-bottom: 8px; }
.modal-footer { padding: 16px; border-top: .5px solid var(--tg-border); }

/* Upload modal (stays as-is) */
.upload-modal {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.5);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px;
}
.upload-modal-content {
  background: var(--tg-section-bg); border-radius: var(--radius-md);
  width: 100%; max-width: 500px; max-height: 85vh; overflow-y: auto;
  padding: 24px;
}
.upload-modal h3 { font-size: var(--font-lg); font-weight: 600; margin-bottom: 16px; text-align: center; }
.file-select-area {
  background: var(--tg-secondary-bg); border: 2px dashed var(--tg-border);
  border-radius: var(--radius-md); padding: 24px; text-align: center;
  cursor: pointer; margin-bottom: 12px; color: var(--tg-hint); transition: border-color .15s;
}
.file-select-area:hover { border-color: var(--tg-accent); }
#filename-display { font-size: var(--font-xs); color: var(--tg-accent); margin-top: 8px; }
#audio-title-input {
  width: 100%; padding: 12px; border: .5px solid var(--tg-border);
  border-radius: var(--radius-sm); background: var(--tg-secondary-bg);
  color: var(--tg-text); font-size: var(--font-md); outline: none; margin-bottom: 12px;
}
#audio-title-input:focus { border-color: var(--tg-accent); }
.legal-notice {
  background: var(--tg-secondary-bg); border-radius: var(--radius-sm);
  padding: 12px; margin-bottom: 12px; border-left: 3px solid #ff9500;
  font-size: var(--font-xs); color: var(--tg-hint);
}
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: var(--font-sm); cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--tg-accent); }

/* ═══════════════════════════════════════ */
/* NOTIFICATION                            */
/* ═══════════════════════════════════════ */
.notification {
  position: fixed; bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--tg-section-bg); color: var(--tg-text);
  padding: 12px 20px; border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  z-index: 9999; transition: transform .25s ease;
  font-size: var(--font-sm); text-align: center;
  max-width: 90%;
}
.notification.show { transform: translateX(-50%) translateY(0); }
.notification.error { border-left: 3px solid var(--tg-destructive); }

/* ═══════════════════════════════════════ */
/* UTILITIES                               */
/* ═══════════════════════════════════════ */
.hidden { display: none !important; }
.empty-state { text-align: center; padding: 40px 16px; color: var(--tg-hint); }
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .5; }
.empty-state h3 { font-size: var(--font-lg); color: var(--tg-text); margin-bottom: 8px; }
.loading { text-align: center; padding: 24px; color: var(--tg-hint); font-size: var(--font-sm); }

/* ═══════════════════════════════════════ */
/* SIMILAR MEMES — HORIZONTAL SCROLL      */
/* ═══════════════════════════════════════ */
.similar-memes-container {
  display: flex; overflow-x: auto; gap: 10px;
  padding-bottom: 8px; scrollbar-width: thin;
}
.similar-memes-container::-webkit-scrollbar { height: 4px; }
.similar-memes-container::-webkit-scrollbar-thumb { background: var(--tg-border); border-radius: 2px; }
.similar-meme-card {
  flex: 0 0 100px; text-align: center;
  background: var(--tg-section-bg); border-radius: var(--radius-sm);
  padding: 12px 8px; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: transform .12s;
}
.similar-meme-card:active { transform: scale(.96); }
.similar-meme-emoji { font-size: 28px; margin-bottom: 6px; }
.similar-meme-name { font-size: var(--font-xs); color: var(--tg-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ═══════════════════════════════════════ */
/* ADMIN                                   */
/* ═══════════════════════════════════════ */
.admin-pending-card {
  background: var(--tg-section-bg); border-radius: var(--radius-sm);
  padding: 16px; margin-bottom: 10px; border-left: 3px solid #ff9500;
}
.admin-pending-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.admin-pending-title { font-weight: 600; }
.admin-pending-actions { display: flex; gap: 8px; }

/* ═══════════════════════════════════════ */
/* MEME PLAY BUTTON IN GRID               */
/* ═══════════════════════════════════════ */
.meme-play-btn {
  margin-top: 6px; padding: 6px 14px;
  border: none; border-radius: var(--radius-sm);
  background: var(--tg-accent); color: var(--tg-accent-text);
  font-size: 14px; cursor: pointer;
  transition: opacity .12s;
}
.meme-play-btn:active { opacity: .7; }

/* ═══════════════════════════════════════ */
/* ADMIN MOVE/DELETE BUTTONS              */
/* ═══════════════════════════════════════ */
.meme-move-btn, .meme-delete-btn {
  margin-top: 4px; padding: 4px 10px;
  border: none; border-radius: var(--radius-sm);
  font-size: 16px; cursor: pointer;
  background: var(--tg-secondary-bg); color: var(--tg-hint);
  transition: background .12s;
}
.meme-move-btn:active, .meme-delete-btn:active { background: rgba(128,128,128,.1); }

/* ═══════════════════════════════════════ */
/* ADMIN — PLAY PENDING BTN              */
/* ═══════════════════════════════════════ */
.play-pending-btn {
  padding: 8px 16px; border: none; border-radius: var(--radius-sm);
  background: var(--tg-accent); color: var(--tg-accent-text);
  font-size: var(--font-sm); font-weight: 600; cursor: pointer;
  margin-top: 8px;
}
.play-pending-btn:active { opacity: .8; }

/* ═══════════════════════════════════════ */
/* LOADING SPINNER                        */
/* ═══════════════════════════════════════ */
.loading-spinner { font-size: 20px; display: inline-block; }

/* ═══════════════════════════════════════ */
/* DEBUG INFO                             */
/* ═══════════════════════════════════════ */
.debug-info {
  margin-top: 16px; padding: 12px;
  background: var(--tg-secondary-bg); border-radius: var(--radius-sm);
  font-family: monospace; font-size: 11px;
  color: var(--tg-hint); white-space: pre-wrap;
  word-break: break-all;
}

/* ═══════════════════════════════════════ */
/* TAB BADGES (header right)              */
/* ═══════════════════════════════════════ */
.tab-badges { display: flex; align-items: center; gap: 4px; }
.badge-item { font-size: 16px; }

/* ═══════════════════════════════════════ */
/* ADMIN — AUDIO TAG BADGE IN CELL       */
/* ═══════════════════════════════════════ */
.tg-badge-pending { background: rgba(255,193,7,.15); color: #ff9500; }
.tg-badge-approved { background: rgba(52,199,89,.12); color: #34c759; }
.tg-badge-rejected { background: rgba(255,59,48,.12); color: #ff3b30; }

/* ═══════════════════════════════════════ */
/* Theme toggle icon swap                 */
/* ═══════════════════════════════════════ */
.theme-icon-sun, .theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: block; }

/* ═══════════════════════════════════════ */
/* Audio element (hidden)                 */
/* ═══════════════════════════════════════ */
.audio-debug {
  position: fixed; left: -9999px; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}

/* ═══════════════════════════════════════ */
/* RESPONSIVE                               */
/* ═══════════════════════════════════════ */
@media (max-width: 400px) {
  .tg-grid-strip { grid-template-columns: repeat(2, 1fr); }
  .tg-grid { grid-template-columns: repeat(2, 1fr); }
  .action-grid { grid-template-columns: 1fr; }
}

@media (min-width: 540px) {
  .tg-grid-strip { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .tg-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
