/* MemeVault — "Pad Deck" redesign
   Design concept: the page reads like a hardware sampler / drum machine.
   Sound cards behave like physical pads (chunky offset shadow, press-down
   on click). Ink-on-paper palette instead of the usual pink/purple SaaS
   look. Condensed display type for headings, mono type for all numeric
   readouts (play counts, likes) to feel like a device readout.
*/

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  color-scheme: light;
  --background: #F7F4EC;
  --paper: #FFFDF8;
  --ink: #17140F;
  --ink-soft: #55503f;
  --card: #FFFFFF;
  --card-foreground: var(--ink);
  --primary: #FFC61E;        /* pad yellow */
  --primary-ink: #17140F;    /* text on yellow stays ink, not white */
  --accent: #FF4E6A;         /* record-light red/pink for likes+alerts */
  --accent-foreground: #ffffff;
  --secondary: #EFEAD9;
  --secondary-foreground: var(--ink);
  --muted: #EFEAD9;
  --muted-foreground: #837c67;
  --border: #E4DEC9;
  --ring: #17140F;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-2xl: 26px;
  --sidebar: var(--paper);
  --sidebar-foreground: var(--ink);
  --sidebar-accent: var(--secondary);
  --sidebar-accent-foreground: var(--ink);
  --sidebar-border: var(--border);
  --font-display: 'Space Grotesk', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
  --primary-text: #17140F;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--background);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(23,20,15,0.06) 1px, transparent 0);
  background-size: 22px 22px;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Layout ---------- */

.app-shell { display: flex; height: 100dvh; overflow: hidden; }
.main-col { display: flex; min-width: 0; flex: 1 1 auto; flex-direction: column; }

/* ---------- Sidebar ---------- */

.sidebar {
  display: flex;
  height: 100%;
  width: 17rem;
  flex-shrink: 0;
  flex-direction: column;
  border-right: 2px solid var(--ink);
  background: var(--sidebar);
}
.sidebar-brand {
  display: flex;
  align-items: baseline;
  gap: 0.1rem;
  padding: 1.5rem 1.25rem 1.1rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  border-bottom: 2px solid var(--ink);
  text-transform: uppercase;
}
.sidebar-brand .muted-tail { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500; color: var(--muted-foreground); text-transform: none; margin-left: 0.25rem; }
.sidebar-nav { flex: 1 1 auto; overflow-y: auto; padding: 1rem 0.75rem; }
.sidebar-link {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  border: 2px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  transition: transform .12s ease, background-color .12s, border-color .12s, color .12s;
  text-align: left;
}
.sidebar-link:hover { background: var(--secondary); color: var(--ink); transform: translateX(2px); }
.sidebar-link.active { background: var(--primary); border-color: var(--ink); color: var(--primary-ink); font-weight: 600; }
.sidebar-link .emoji { font-size: 1.05rem; }
.sidebar-link .label { flex: 1 1 auto; text-align: left; }
.sidebar-count {
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  background: var(--secondary);
  color: var(--muted-foreground);
}
.sidebar-link.active .sidebar-count { background: rgba(23,20,15,0.12); color: var(--ink); }
.sidebar-footer { border-top: 2px solid var(--ink); padding: 0.9rem 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.btn-block {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 2px solid var(--ink);
}
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 3px 3px 0 var(--ink); }
.btn-primary:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn-primary:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.btn-secondary { background: var(--paper); color: var(--sidebar-foreground); justify-content: flex-start; font-weight: 500; }
.btn-secondary:hover { background: var(--secondary); }

/* ---------- Mobile category chips ---------- */

.mobile-chips {
  display: none;
  gap: 0.5rem;
  overflow-x: auto;
  border-bottom: 2px solid var(--ink);
  padding: 1.5rem 1rem;
  background: var(--paper);
}
.chip {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  white-space: nowrap;
}
.chip.active { background: var(--primary); }

/* ---------- Top bar ---------- */

.top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
  padding: 0.85rem 1.25rem;
}
.search-wrap { position: relative; min-width: 0; flex: 1 1 auto; }
.search-wrap svg { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
.search-input {
  height: 2.85rem;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 0 1rem 0 2.6rem;
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: var(--card-foreground);
  outline: none;
}
.search-input:focus { box-shadow: 3px 3px 0 var(--primary); }
.icon-btn {
  display: flex;
  height: 2.85rem;
  width: 2.85rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--card-foreground);
}
.icon-btn:hover { background: var(--accent); color: var(--accent-foreground); }
.volume-wrap { display: flex; align-items: center; gap: 0.5rem; border-radius: var(--radius-sm); border: 2px solid var(--ink); background: var(--paper); padding: 0 0.75rem; }
.volume-wrap button { display: flex; height: 2.85rem; align-items: center; border: none; background: none; color: var(--card-foreground); }
.volume-wrap button:hover { color: var(--accent); }
.volume-wrap input[type="range"] { width: 6rem; accent-color: var(--ink); }
.btn-upload {
  display: flex;
  height: 2.85rem;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--ink);
  background: var(--primary);
  color: var(--primary-ink);
  padding: 0 1.1rem;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-upload:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn-upload:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }

/* ---------- Main content ---------- */

main.content { flex: 1 1 auto; overflow-y: auto; padding: 2rem 1.5rem; }
.content-head { margin-bottom: 1.5rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem; }
.content-head h1 { margin: 0; font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; letter-spacing: -0.01em; text-transform: uppercase; }
.content-head p { margin: 0.35rem 0 0; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted-foreground); }

.grid {
  display: grid;
  /*grid-template-columns: repeat(1, minmax(0, 1fr));*/
  gap: 1.1rem;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid.sounds { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .grid.sounds { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid.gifs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  padding: 5rem 1rem;
  text-align: center;
  background: var(--paper);
}
.empty-state .emoji { font-size: 2.25rem; }
.empty-state p { margin-top: 0.75rem; font-size: 0.875rem; color: var(--muted-foreground); }

/* ---------- Sound card ("pad") ---------- */

.sound-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 2px solid var(--ink);
  background: var(--card);
  padding: 1.1rem;
  text-align: left;
  width: 100%;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .1s ease, box-shadow .1s ease;
}
.sound-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.sound-card:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.sound-card:focus-visible { outline: none; box-shadow: 6px 6px 0 var(--accent); }
.sound-card.active { background: var(--primary); transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.sound-card-top { display: flex; align-items: flex-start; gap: 0.75rem; }
.sound-icon {
  display: flex;
  height: 2.9rem;
  width: 2.9rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 2px solid var(--ink);
  background: var(--secondary);
  font-size: 1.3rem;
}
.sound-card.active .sound-icon { background: var(--paper); }

.sound-info { min-width: 0; flex: 1 1 auto; }
.sound-info h3 { margin: 0; font-family: var(--font-display); font-size: 0.92rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sound-info .cat { margin-top: 0.3rem; display: flex; align-items: center; gap: 0.35rem; font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-soft); }

.play-badge {
  display: flex;
  height: 2.1rem;
  width: 2.1rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}
.sound-card:hover .play-badge { background: var(--accent); color: var(--accent-foreground); border-color: var(--ink); }
.sound-card.active .play-badge { background: var(--ink); color: var(--primary); }

.sound-card-bottom { margin-top: 1.1rem; display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; gap: 0.4rem; }
.plays-count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted-foreground); }
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  padding: 0.35rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  flex: 0 0 auto;
  white-space: nowrap;
}
.download-btn:hover { background: var(--ink); color: var(--primary); }

.like-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  padding: 0.35rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  /*flex: 1 1 auto;*/
  min-width: 0;
}
.like-btn:hover { border-color: var(--accent); }
.like-btn.liked { background: var(--accent); color: var(--accent-foreground); border-color: var(--ink); }

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  width: 2.1rem;
  height: 2.1rem;
  font-size: 0.85rem;
  flex: 0 0 auto;
}
.share-btn:hover { background: var(--primary); }

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--primary);
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
  border: 2px solid var(--primary);
}
.toast.show { opacity: 1; }

.pad-audio { display: none; }

.scroll-sentinel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 2rem 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted-foreground);
}
.loader-spin {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border);
  border-top-color: var(--ink);
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}

/* ---------- GIF gallery (pad-deck) ---------- */

.grid.gifpad {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}
@media (min-width: 640px) { .grid.gifpad { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid.gifpad { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .grid.gifpad { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.gif-pad-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 2px solid var(--ink);
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .1s ease, box-shadow .1s ease;
}
.gif-pad-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.gif-pad-card:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.gif-pad-card:focus-visible { outline: none; box-shadow: 6px 6px 0 var(--accent); }

.gif-pad-media { position: relative; aspect-ratio: 1 / 1; overflow: hidden; border-bottom: 2px solid var(--ink); background: var(--secondary); }
.gif-pad-media img { width: 100%; height: 100%; object-fit: cover; }

.gif-pad-bottom { padding: 0.85rem; display: flex; flex-direction: column; gap: 0.6rem; }
.gif-pad-bottom h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gif-pad-actions { display: flex; align-items: center; justify-content: flex-start; flex-wrap: nowrap; gap: 0.4rem; }

/* ---------- GIF detail page ---------- */

.detail-gif-wrap {
  margin: 1.5rem 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--secondary);
}
.detail-gif-img { width: 100%; display: block; max-height: 480px; object-fit: contain; background: var(--secondary); }

@media (max-width: 480px) {
  .grid.gifpad { grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 0.75rem; }
  .detail-gif-img { max-height: 320px; }
}

/* ---------- Sound detail page ---------- */

.detail-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}
.detail-header-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.detail-main { max-width: 760px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }

.detail-card {
  border: 2px solid var(--ink);
  border-radius: var(--radius-xl);
  background: var(--card);
  padding: 2rem;
  box-shadow: 5px 5px 0 var(--ink);
  text-align: center;
}
.detail-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--secondary);
  padding: 0.35rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.detail-title {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.detail-player {
  margin: 1.75rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}
.detail-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--primary);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}
.detail-play-btn svg { width: 1.4rem; height: 1.4rem; }
.detail-play-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.detail-play-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted-foreground);
}
.detail-meta span { display: inline-flex; align-items: center; gap: 0.3rem; }

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.25rem;
}
.btn-primary-lg, .btn-secondary-lg {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--ink);
  padding: 0.7rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 700;
}
.btn-primary-lg { background: var(--primary); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.btn-primary-lg:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn-primary-lg:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.btn-secondary-lg { background: var(--paper); color: var(--ink); }
.btn-secondary-lg:hover { background: var(--secondary); }
.btn-secondary-lg.liked { background: var(--accent); color: var(--accent-foreground); }

.related-section { margin-top: 3rem; }
.related-heading {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}
.related-section .grid.sounds { 
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
    
}
@media (min-width: 640px) { 
    .related-section .grid.sounds { 
        grid-template-columns: repeat(3, minmax(0, 1fr)); 
        
    } 
    
}

/* ---------- Mobile responsiveness pass ---------- */

@media (max-width: 480px) {
  .detail-card { padding: 1.5rem 1.1rem; box-shadow: 4px 4px 0 var(--ink); }
  .detail-play-btn { width: 3.8rem; height: 3.8rem; }
  .detail-actions { flex-direction: column; width: 85%; }
  .btn-primary-lg, .btn-secondary-lg { width: 100%; justify-content: center; }
  .related-section .grid.sounds { 
      grid-template-columns: 1fr; 
      
  }
  .sound-card { padding: 0.9rem; width: 70%}
  .content-head h1 { font-size: 1.4rem; }
  .top-bar { padding: 0.7rem 1rem; }
  .volume-wrap { display: none; }
}

.bars { display: flex; align-items: flex-end; gap: 3px; }
.bars span { width: 3px; border-radius: 999px; background: var(--ink); animation: bounce 0.6s ease-in-out infinite; }
.bars span:nth-child(1) { height: 0.75rem; }
.bars span:nth-child(2) { height: 1rem; animation-delay: .15s; }
.bars span:nth-child(3) { height: 0.6rem; animation-delay: .3s; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */

.page-footer { margin-top: 3rem; border-top: 2px solid var(--ink); padding-top: 1.5rem; text-align: center; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted-foreground); }

/* ---------- GIF gallery ---------- */

.gif-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}
.gif-header-inner { margin: 0 auto; display: flex; max-width: 72rem; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 1.1rem 1.25rem; }
.back-link { display: flex; align-items: center; gap: 0.4rem; border-radius: 999px; border: 2px solid var(--ink); background: var(--secondary); color: var(--ink); padding: 0.5rem 0.85rem; font-size: 0.82rem; font-weight: 600; }
.back-link:hover { background: var(--primary); }
.gif-brand { display: flex; align-items: center; gap: 0.1rem; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; text-transform: uppercase; }
.gif-search { position: relative; margin-left: auto; width: 100%; max-width: 16rem; }
.gif-search svg { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
.gif-search input {
  width: 100%;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  font-size: 0.85rem;
  color: var(--foreground);
  outline: none;
}
.gif-search input:focus { box-shadow: 3px 3px 0 var(--primary); }

.gif-main { margin: 0 auto; max-width: 72rem; padding: 2rem 1.25rem; }
.gif-chips { margin-bottom: 1.75rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.gif-chip { border-radius: 999px; padding: 0.4rem 0.95rem; font-size: 0.82rem; font-weight: 600; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); }
.gif-chip:hover { background: var(--secondary); }
.gif-chip.active { background: var(--primary); }

.gif-card { overflow: hidden; border-radius: var(--radius-lg); border: 2px solid var(--ink); background: var(--card); box-shadow: 4px 4px 0 var(--ink); transition: transform .1s ease, box-shadow .1s ease; }
.gif-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.gif-media { position: relative; aspect-ratio: 1 / 1; overflow: hidden; border-bottom: 2px solid var(--ink); }
.gif-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gif-card:hover .gif-media img { transform: scale(1.05); }
.gif-download {
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
  display: flex;
  height: 2.3rem;
  width: 2.3rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  opacity: 0;
  transition: opacity .2s, background-color .15s, color .15s;
}
.gif-card:hover .gif-download { opacity: 1; }
.gif-download:hover { background: var(--primary); }
.gif-caption { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.85rem 1rem; }
.gif-caption h2 { margin: 0; font-family: var(--font-display); font-size: 0.88rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gif-views { flex-shrink: 0; display: flex; align-items: center; gap: 0.25rem; font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted-foreground); }

.hidden { display: none !important; }

/* ---------- Icon sizing utilities ---------- */
svg.size-4 { width: 1rem; height: 1rem; flex-shrink: 0; }
svg.size-3-5 { width: 0.875rem; height: 0.875rem; flex-shrink: 0; }

@media (min-width: 768px) {
  .sidebar-wrap { display: block; }
  .mobile-chips { display: none; }
}
@media (max-width: 767px) {
  .sidebar-wrap { display: none; }
  .mobile-chips { display: flex; }
}
